mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 08:11:03 +00:00
Update CLI (#53)
* Initial commit Forked at:4a3ffe07e7Parent branch: master * Update substrate: more CLI improvement * Update substrate and polkadot to cecton-cumulus-branch * WIP Forked at:4a3ffe07e7Parent branch: master * Update Cargo.lock * WIP Forked at:4a3ffe07e7Parent branch: master * WIP Forked at:4a3ffe07e7Parent branch: master * Update Cargo.lock * WIP Forked at:4a3ffe07e7Parent branch: master * WIP Forked at:4a3ffe07e7Parent branch: master * Test running node and interrupts * WIP Forked at:4a3ffe07e7Parent branch: master * Update Cargo.lock * Update test/parachain/tests/running_the_node_and_interrupt.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
+17
-17
@@ -6,20 +6,20 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
# Substrate dependencies
|
||||
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
|
||||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
|
||||
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
|
||||
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
|
||||
sp-api = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
|
||||
sc-client = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
|
||||
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
|
||||
sc-service = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
|
||||
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
|
||||
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" }
|
||||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" }
|
||||
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" }
|
||||
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" }
|
||||
sp-api = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" }
|
||||
sc-client = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" }
|
||||
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" }
|
||||
sc-service = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" }
|
||||
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" }
|
||||
|
||||
# Polkadot dependencies
|
||||
polkadot-collator = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch" }
|
||||
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch" }
|
||||
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch" }
|
||||
polkadot-collator = { git = "https://github.com/paritytech/polkadot", branch = "cecton-cumulus-branch" }
|
||||
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "cecton-cumulus-branch" }
|
||||
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "cecton-cumulus-branch" }
|
||||
|
||||
# Cumulus dependencies
|
||||
cumulus-consensus = { path = "../consensus" }
|
||||
@@ -37,13 +37,13 @@ test-runtime = { package = "cumulus-test-runtime", path = "../test/runtime" }
|
||||
test-client = { package = "cumulus-test-client", path = "../test/client" }
|
||||
|
||||
# Substrate dependencies
|
||||
substrate-test-client = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
|
||||
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
|
||||
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
|
||||
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "cumulus-branch" }
|
||||
substrate-test-client = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" }
|
||||
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" }
|
||||
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" }
|
||||
sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "cecton-cumulus-branch" }
|
||||
|
||||
# Polkadot dependencies
|
||||
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "cumulus-branch" }
|
||||
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "cecton-cumulus-branch" }
|
||||
|
||||
# Other dependencies
|
||||
env_logger = "0.7.1"
|
||||
|
||||
@@ -24,7 +24,6 @@ use sp_consensus::{
|
||||
};
|
||||
use sp_inherents::InherentDataProviders;
|
||||
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
|
||||
use sc_cli;
|
||||
|
||||
use polkadot_collator::{
|
||||
BuildParachainContext, InvalidHead, Network as CollatorNetwork, ParachainContext,
|
||||
@@ -32,7 +31,7 @@ use polkadot_collator::{
|
||||
};
|
||||
use polkadot_primitives::{
|
||||
parachain::{
|
||||
self, BlockData, CollatorPair, Id as ParaId, Message, OutgoingMessages,
|
||||
self, BlockData, Id as ParaId, Message, OutgoingMessages,
|
||||
Status as ParachainStatus,
|
||||
},
|
||||
Block as PBlock, Hash as PHash,
|
||||
@@ -256,14 +255,14 @@ where
|
||||
}
|
||||
|
||||
/// Implements `BuildParachainContext` to build a collator instance.
|
||||
struct CollatorBuilder<Block, SP> {
|
||||
pub struct CollatorBuilder<Block, SP> {
|
||||
setup_parachain: SP,
|
||||
_marker: PhantomData<Block>,
|
||||
}
|
||||
|
||||
impl<Block, SP> CollatorBuilder<Block, SP> {
|
||||
/// Create a new instance of self.
|
||||
fn new(setup_parachain: SP) -> Self {
|
||||
pub fn new(setup_parachain: SP) -> Self {
|
||||
Self {
|
||||
setup_parachain,
|
||||
_marker: PhantomData,
|
||||
@@ -345,23 +344,6 @@ pub trait SetupParachain<Block: BlockT>: Send {
|
||||
SP: Spawn + Clone + Send + Sync + 'static;
|
||||
}
|
||||
|
||||
/// Run a collator with the given proposer factory.
|
||||
pub fn run_collator<Block, SP>(
|
||||
setup_parachain: SP,
|
||||
para_id: ParaId,
|
||||
key: Arc<CollatorPair>,
|
||||
configuration: polkadot_collator::Configuration,
|
||||
) -> Result<(), sc_cli::error::Error>
|
||||
where
|
||||
Block: BlockT,
|
||||
SP: SetupParachain<Block> + Send + 'static,
|
||||
<<SP as SetupParachain<Block>>::ProposerFactory as Environment<Block>>::Proposer: Send,
|
||||
{
|
||||
let builder = CollatorBuilder::new(setup_parachain);
|
||||
let exit = future::pending(); // TODO to delete
|
||||
polkadot_collator::run_collator(builder, para_id, exit, key, configuration)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user