Skip to content

Commit

Permalink
feat: add working demo
Browse files Browse the repository at this point in the history
  • Loading branch information
th7nder committed Nov 29, 2024
1 parent bf61dfb commit 06b993c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion examples/rpc_publish.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
set -e

if [ "$#" -ne 1 ]; then
echo "$0: input file required"
Expand Down Expand Up @@ -58,7 +59,7 @@ DEAL_JSON=$(
)
SIGNED_DEAL_JSON="$(RUST_LOG=error target/release/polka-storage-provider-client sign-deal --sr25519-key "$CLIENT" "$DEAL_JSON")"

(RUST_LOG=debug target/release/polka-storage-provider-server --sr25519-key "$PROVIDER" --seal-proof "2KiB" --post-proof "2KiB" --porep-parameters 2KiB.porep.params) &
(RUST_LOG=debug target/release/polka-storage-provider-server --sr25519-key "$PROVIDER" --seal-proof "2KiB" --post-proof "2KiB" --porep-parameters 2KiB.porep.params --post-parameters 2KiB.post.params) &
sleep 5 # gives time for the server to start

DEAL_CID="$(RUST_LOG=error target/release/polka-storage-provider-client propose-deal "$DEAL_JSON")"
Expand Down
6 changes: 5 additions & 1 deletion storage-provider/server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mod storage;
use std::{env::temp_dir, net::SocketAddr, path::PathBuf, sync::Arc, time::Duration};

use clap::Parser;
use pipeline::types::PipelineMessage;
use pipeline::types::{PipelineMessage, SubmitWindowedPoStMessage};
use polka_storage_proofs::{
porep::{self, PoRepParameters},
post::{self, PoStParameters},
Expand Down Expand Up @@ -419,6 +419,10 @@ impl ServerConfiguration {

let (pipeline_tx, pipeline_rx) = tokio::sync::mpsc::unbounded_channel::<PipelineMessage>();

pipeline_tx.send(PipelineMessage::SubmitWindowedPoStMessage(SubmitWindowedPoStMessage {
deadline_index: 0
})).expect("it to work...");

let storage_state = StorageServerState {
car_piece_storage_dir: car_piece_storage_dir.clone(),
deal_db: deal_database.clone(),
Expand Down
4 changes: 2 additions & 2 deletions storage-provider/server/src/pipeline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ use storagext::{
types::{
market::DealProposal,
storage_provider::{PoStProof, ProveCommitSector, SectorPreCommitInfo, SubmitWindowedPoStParams},
}, IntoBoundedByteVec, RandomnessClientExt, StorageProviderClientExt, SystemClientExt
}, RandomnessClientExt, StorageProviderClientExt, SystemClientExt
};
use subxt::{
ext::{codec::Encode, sp_core::ConstU32},
ext::codec::Encode,
tx::Signer,
};
use tokio::{
Expand Down

0 comments on commit 06b993c

Please sign in to comment.