Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request paritytech#200 from subspace/farmer-improvements
Browse files Browse the repository at this point in the history
Farmer improvements
  • Loading branch information
nazar-pc authored Dec 15, 2021
2 parents 3dbf360 + 3283a4a commit be195ab
Show file tree
Hide file tree
Showing 13 changed files with 591 additions and 575 deletions.
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/subspace-farmer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ async-trait = "0.1.51"
clap = { version = "3.0.0-beta.5", features = ["color", "derive"] }
dirs = "4.0.0"
env_logger = "0.9.0"
event-listener-primitives = "2.0.1"
futures = "0.3.13"
hex = "0.4.3"
hex-buffer-serde = "0.3.0"
Expand All @@ -28,6 +29,7 @@ jsonrpsee = { version = "0.4.1", features = ["client", "macros", "server"] }
log = "0.4.14"
lru = "0.6.6"
parity-scale-codec = "2.3.0"
parking_lot = "0.11.2"
rayon = "1.5.1"
schnorrkel = "0.9.1"
serde = { version = "1.0.130", features = ["derive"] }
Expand Down
14 changes: 12 additions & 2 deletions crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,20 @@ pub(crate) async fn farm(
// TODO: This doesn't account for the fact that node can
// have a completely different history to what farmer expects
info!("Opening plot");
let plot = Plot::open_or_create(&base_directory).await?;
let plot_fut = tokio::task::spawn_blocking({
let base_directory = base_directory.clone();

move || Plot::open_or_create(&base_directory)
});
let plot = plot_fut.await.unwrap()?;

info!("Opening commitments");
let commitments = Commitments::new(base_directory.join("commitments").into()).await?;
let commitments_fut = tokio::task::spawn_blocking({
let path = base_directory.join("commitments");

move || Commitments::new(path)
});
let commitments = commitments_fut.await.unwrap()?;

info!("Opening object mapping");
let object_mappings = tokio::task::spawn_blocking({
Expand Down
Loading

0 comments on commit be195ab

Please sign in to comment.