Commit 5ef5fb66 authored by Cecile Tonglet's avatar Cecile Tonglet
Browse files

More fixes

parent a2dbe42f
Pipeline #85003 failed with stage
in 5 minutes and 53 seconds
......@@ -67,10 +67,12 @@ use polkadot_cli::{
service::{self, Roles}
};
pub use polkadot_cli::service::Configuration;
pub use polkadot_cli::Cli;
pub use polkadot_validation::SignedStatement;
pub use polkadot_primitives::parachain::CollatorId;
pub use sc_network::PeerId;
pub use service::RuntimeApiCollection;
pub use sc_cli::SubstrateCli;
const COLLATION_TIMEOUT: Duration = Duration::from_secs(30);
......
......@@ -27,10 +27,10 @@ use primitives::{
parachain::{HeadData, BlockData, Id as ParaId, LocalValidationData},
};
use collator::{
InvalidHead, ParachainContext, Network, BuildParachainContext, load_spec, Configuration,
InvalidHead, ParachainContext, Network, BuildParachainContext, Cli, SubstrateCli,
};
use parking_lot::Mutex;
use futures::future::{Ready, ok, err};
use futures::future::{Ready, ok, err, TryFutureExt};
const GENESIS: AdderHead = AdderHead {
number: 0,
......@@ -110,7 +110,7 @@ impl BuildParachainContext for AdderContext {
}
}
fn main() {
fn main() -> Result<(), Box<dyn std::error::Error>> {
let key = Arc::new(Pair::from_seed(&[1; 32]));
let id: ParaId = 100.into();
......@@ -132,17 +132,16 @@ fn main() {
_network: None,
};
let mut config = Configuration::default();
config.chain_spec = Some(load_spec("dev", false).unwrap());
let res = collator::run_collator(
context,
id,
key,
config,
);
if let Err(e) = res {
println!("{}", e);
}
let cli = Cli::from_iter(&["-dev"]);
let runner = cli.create_runtime(&cli.run.base)?;
runner.async_run(|config| {
collator::start_collator(
context,
id,
key,
config,
).map_err(|e| e.into())
})?;
Ok(())
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment