diff --git a/Cargo.lock b/Cargo.lock index aa05afe0fa..63e0d5cd74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5298,59 +5298,6 @@ dependencies = [ "xcm", ] -[[package]] -name = "parachain-collator" -version = "2.0.0" -dependencies = [ - "cumulus-client-cli", - "cumulus-client-collator", - "cumulus-client-consensus-relay-chain", - "cumulus-client-network", - "cumulus-client-service", - "cumulus-primitives-core", - "derive_more 0.15.0", - "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "frame-benchmarking-cli", - "hex-literal 0.2.1", - "jsonrpc-core", - "log", - "pallet-transaction-payment-rpc", - "parachain-runtime", - "parity-scale-codec", - "polkadot-cli", - "polkadot-parachain", - "polkadot-primitives", - "polkadot-service", - "polkadot-test-service", - "sc-basic-authorship", - "sc-chain-spec", - "sc-cli", - "sc-client-api", - "sc-consensus", - "sc-executor", - "sc-keystore", - "sc-rpc", - "sc-rpc-api", - "sc-service", - "sc-telemetry", - "sc-tracing", - "sc-transaction-pool", - "serde", - "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-block-builder", - "sp-blockchain", - "sp-consensus", - "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "sp-timestamp", - "sp-transaction-pool", - "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", - "structopt", - "substrate-build-script-utils", - "substrate-frame-rpc-system", -] - [[package]] name = "parachain-info" version = "0.1.0" @@ -5796,6 +5743,59 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pint" +version = "2.0.0" +dependencies = [ + "cumulus-client-cli", + "cumulus-client-collator", + "cumulus-client-consensus-relay-chain", + "cumulus-client-network", + "cumulus-client-service", + "cumulus-primitives-core", + "derive_more 0.15.0", + "frame-benchmarking 3.1.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "frame-benchmarking-cli", + "hex-literal 0.2.1", + "jsonrpc-core", + "log", + "pallet-transaction-payment-rpc", + "parachain-runtime", + "parity-scale-codec", + "polkadot-cli", + "polkadot-parachain", + "polkadot-primitives", + "polkadot-service", + "polkadot-test-service", + "sc-basic-authorship", + "sc-chain-spec", + "sc-cli", + "sc-client-api", + "sc-consensus", + "sc-executor", + "sc-keystore", + "sc-rpc", + "sc-rpc-api", + "sc-service", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "serde", + "sp-api 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-core 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-inherents 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-runtime 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "sp-timestamp", + "sp-transaction-pool", + "sp-trie 3.0.0 (git+https://github.com/paritytech/substrate.git?branch=rococo-v1)", + "structopt", + "substrate-build-script-utils", + "substrate-frame-rpc-system", +] + [[package]] name = "pkg-config" version = "0.3.19" diff --git a/README.md b/README.md index a9f58faac0..7d37a42f8c 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,13 @@ cargo build --release --features real-overseer ./target/release/polkadot --chain ./rococo_local.json -d cumulus_relay0 --validator --alice --port 50556 ``` +* [polkadot-launch](https://github.com/paritytech/polkadot-launch) can be run by dropping the proper polkadot binary in the `./bin` folder and + * Run globally + * `polkadot-launch config.json` + * Run locally, navigate into polkadot-launch, + * ``` yarn ``` + * ``` yarn start ``` + Substrate Parachain Template: ``` # this command assumes the chain spec is in a directory named polkadot that is a sibling of the working directory diff --git a/config.json b/config.json new file mode 100644 index 0000000000..b69b2e0f6f --- /dev/null +++ b/config.json @@ -0,0 +1,61 @@ +{ + "relaychain": { + "bin": "./bin/polkadot", + "chain": "rococo-local", + "nodes": [ + { + "name": "alice", + "wsPort": 9944, + "port": 30444 + }, + { + "name": "bob", + "wsPort": 9955, + "port": 30555 + }, + { + "name": "charlie", + "wsPort": 9966, + "port": 30666 + } + ] + }, + "parachains": [ + { + "bin": "./target/release/pint", + "chain": "pint-dev", + "id": "1", + "wsPort": 9988, + "port": 31200, + "balance": "1000000000000000000000", + "flags": [ + "--", + "--execution=wasm" + ] + }, + { + "bin": "./target/release/pint", + "chain": "pint-dev", + "id": "300", + "wsPort": 9999, + "port": 31300, + "balance": "1000000000000000000000", + "flags": [ + "--", + "--execution=wasm" + ] + } + ], + "simpleParachains": [ + ], + "hrmpChannels": [ + { + "sender": 1, + "recipient": 300, + "maxCapacity": 8, + "maxMessageSize": 512 + } + ], + "types": {}, + "finalization": false +} diff --git a/node/Cargo.toml b/node/Cargo.toml index 27f80aae69..530f8277cb 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -201,9 +201,6 @@ branch = 'rococo-v1' git = "https://github.com/paritytech/polkadot" branch = 'rococo-v1' -[[bin]] -name = 'parachain-collator' - [package] authors = ['Anonymous'] build = 'build.rs' @@ -211,7 +208,7 @@ description = 'A new Cumulus FRAME-based Substrate node, ready for hacking.' edition = '2018' homepage = 'https://substrate.dev' license = 'LGPL-3.0-only' -name = 'parachain-collator' +name = 'pint' repository = 'https://github.com/substrate-developer-hub/substrate-parachain-template' version = '2.0.0' [package.metadata.docs.rs] diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 4517061204..b05c32f933 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -46,15 +46,15 @@ where AccountPublic::from(get_from_seed::(seed)).into_account() } -pub fn development_config(id: ParaId) -> ChainSpec { +pub fn pint_development_config(id: ParaId) -> ChainSpec { ChainSpec::from_genesis( // Name - "Development", + "PINT Development", // ID - "dev", + "pint_dev", ChainType::Local, move || { - testnet_genesis( + pint_testnet_genesis( get_account_id_from_seed::("Alice"), vec![ get_account_id_from_seed::("Alice"), @@ -76,7 +76,7 @@ pub fn development_config(id: ParaId) -> ChainSpec { ) } -pub fn local_testnet_config(id: ParaId) -> ChainSpec { +pub fn pint_local_config(id: ParaId) -> ChainSpec { ChainSpec::from_genesis( // Name "Local Testnet", @@ -84,7 +84,7 @@ pub fn local_testnet_config(id: ParaId) -> ChainSpec { "local_testnet", ChainType::Local, move || { - testnet_genesis( + pint_testnet_genesis( get_account_id_from_seed::("Alice"), vec![ get_account_id_from_seed::("Alice"), @@ -114,7 +114,7 @@ pub fn local_testnet_config(id: ParaId) -> ChainSpec { ) } -fn testnet_genesis( +fn pint_testnet_genesis( root_key: AccountId, endowed_accounts: Vec, id: ParaId, diff --git a/node/src/cli.rs b/node/src/cli.rs index 973fc2c849..c3654a8b14 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -47,8 +47,8 @@ pub struct ExportGenesisStateCommand { /// Id of the parachain this state is for. /// - /// Default: 100 - #[structopt(long, conflicts_with = "chain")] + /// Default: 200 + #[structopt(long)] pub parachain_id: Option, /// Write output in binary. Default is to write in hex. @@ -56,7 +56,7 @@ pub struct ExportGenesisStateCommand { pub raw: bool, /// The name of the chain for that the genesis state should be exported. - #[structopt(long, conflicts_with = "parachain-id")] + #[structopt(long)] pub chain: Option, } diff --git a/node/src/command.rs b/node/src/command.rs index 61b58efd55..0a16eb8017 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -30,8 +30,8 @@ fn load_spec( para_id: ParaId, ) -> std::result::Result, String> { Ok(match id { - "dev" => Box::new(chain_spec::development_config(para_id)), - "" | "local" => Box::new(chain_spec::local_testnet_config(para_id)), + "pint-dev" => Box::new(chain_spec::pint_development_config(para_id)), + "pint-local" => Box::new(chain_spec::pint_local_config(para_id)), path => Box::new(chain_spec::ChainSpec::from_json_file( std::path::PathBuf::from(path), )?), @@ -40,7 +40,7 @@ fn load_spec( impl SubstrateCli for Cli { fn impl_name() -> String { - "Parachain Collator Template".into() + "PINT Collator".into() } fn impl_version() -> String { @@ -49,7 +49,7 @@ impl SubstrateCli for Cli { fn description() -> String { format!( - "Parachain Collator Template\n\nThe command-line arguments provided first will be \ + "PINT Collator\n\nThe command-line arguments provided first will be \ passed to the parachain node, while the arguments provided after -- will be passed \ to the relaychain node.\n\n\ {} [parachain-args] -- [relaychain-args]", @@ -62,7 +62,7 @@ impl SubstrateCli for Cli { } fn support_url() -> String { - "https://github.com/substrate-developer-hub/substrate-parachain-template/issues/new".into() + "https://github.com/ChainSafe/PINT/issues/new".into() } fn copyright_start_year() -> i32 { @@ -80,7 +80,7 @@ impl SubstrateCli for Cli { impl SubstrateCli for RelayChainCli { fn impl_name() -> String { - "Parachain Collator Template".into() + "PINT Collator".into() } fn impl_version() -> String { @@ -88,7 +88,7 @@ impl SubstrateCli for RelayChainCli { } fn description() -> String { - "Parachain Collator Template\n\nThe command-line arguments provided first will be \ + "PINT Collator\n\nThe command-line arguments provided first will be \ passed to the parachain node, while the arguments provided after -- will be passed \ to the relaychain node.\n\n\ rococo-collator [parachain-args] -- [relaychain-args]" @@ -100,7 +100,7 @@ impl SubstrateCli for RelayChainCli { } fn support_url() -> String { - "https://github.com/substrate-developer-hub/substrate-parachain-template/issues/new".into() + "https://github.com/ChainSafe/PINT/issues/new".into() } fn copyright_start_year() -> i32 {