Skip to content

Commit

Permalink
wip, example to drive exec
Browse files Browse the repository at this point in the history
  • Loading branch information
pepoviola committed Sep 19, 2023
1 parent a7c7da1 commit b430982
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
3 changes: 3 additions & 0 deletions crates/examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ edition = "2021"
[dependencies]
configuration = { path = "../configuration" }
orchestrator = { path = "../orchestrator" }
provider = { path = "../provider" }
support = { path = "../support" }
tokio = { workspace = true }
22 changes: 18 additions & 4 deletions crates/examples/examples/small_network_with_default.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
use configuration::NetworkConfigBuilder;
use orchestrator::Orchestrator;
use provider::NativeProvider;
use support::fs::local::LocalFileSystem;

fn main() {

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>>{
let config = NetworkConfigBuilder::new()
.with_relaychain(|r| {
r.with_chain("rococo-local")
.with_default_command("polkadot")
.with_node(|node| node.with_name("alice"))
.with_node(|node| node.with_name("name"))
.with_node(|node| node.with_name("bob"))
})
.build();
.build().unwrap();

println!("{:?}", &config);

let fs = LocalFileSystem;
let provider = NativeProvider::new(fs.clone());
let orchestrator = Orchestrator::new(fs, provider);
orchestrator.spawn(config).await?;
while true {

println!("{:?}", config.unwrap());
}
Ok(())
}

0 comments on commit b430982

Please sign in to comment.