Skip to content

Commit

Permalink
clean up chain specs (#97)
Browse files Browse the repository at this point in the history
* clean up chainspecs (similar to the cleanup in integritee-network/parachain#78)
* prepare for rococo to become permanent test-parachain
* tested teleport downwards and upwards successfully with https://github.com/encointer/encointer-parachain/tree/master/docs/downward-upward-native-token-tx and a rococo-local-with-launch setup
  • Loading branch information
brenzi authored Mar 14, 2022
1 parent ff85f3c commit d5c60fe
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 294 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ jobs:
strategy:
fail-fast: false
matrix:
chain: [launch]
chain: [encointer]
config: [rococo, westend, kusama]
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

4 changes: 2 additions & 2 deletions polkadot-launch/launch-rococo-local-with-launch.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"relaychain": {
"bin": "../../bin/polkadot-v0.9.16-rc9",
"bin": "../../../bin/polkadot-0.9.17",
"chain": "rococo-local",
"nodes": [
{
Expand All @@ -23,7 +23,7 @@
"parachains": [
{
"bin": "../target/release/encointer-collator",
"chain": "launch-rococo-local",
"chain": "launch-rococo-local-dev",
"balance": "1000000000000000000000",
"nodes": [
{
Expand Down
2 changes: 1 addition & 1 deletion polkadot-parachains/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "encointer-collator"
# align major.minor revision with the runtimes. bump patch revision ad lib. make this the github release tag
version = "0.6.8"
version = "0.6.9"
authors = ["Encointer <[email protected]>"]
build = "build.rs"
edition = "2021"
Expand Down
28 changes: 7 additions & 21 deletions polkadot-parachains/res/encointer-kusama.json

Large diffs are not rendered by default.

25 changes: 4 additions & 21 deletions polkadot-parachains/res/encointer-rococo.json

Large diffs are not rendered by default.

23 changes: 3 additions & 20 deletions polkadot-parachains/res/encointer-westend.json

Large diffs are not rendered by default.

61 changes: 0 additions & 61 deletions polkadot-parachains/res/launch-kusama.json

This file was deleted.

58 changes: 0 additions & 58 deletions polkadot-parachains/res/launch-rococo.json

This file was deleted.

61 changes: 0 additions & 61 deletions polkadot-parachains/res/launch-westend.json

This file was deleted.

21 changes: 3 additions & 18 deletions polkadot-parachains/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,30 +263,15 @@ fn launch_genesis(

/// hard-coded launch-runtime config for rococo
pub fn launch_rococo() -> Result<LaunchChainSpec, String> {
LaunchChainSpec::from_json_bytes(&include_bytes!("../res/launch-rococo.json")[..])
LaunchChainSpec::from_json_bytes(&include_bytes!("../res/encointer-rococo.json")[..])
}

/// hard-coded launch-runtime config for kusama
pub fn launch_kusama() -> Result<LaunchChainSpec, String> {
LaunchChainSpec::from_json_bytes(&include_bytes!("../res/launch-kusama.json")[..])
LaunchChainSpec::from_json_bytes(&include_bytes!("../res/encointer-kusama.json")[..])
}

/// hard-coded launch-runtime config for westend
pub fn launch_westend() -> Result<LaunchChainSpec, String> {
LaunchChainSpec::from_json_bytes(&include_bytes!("../res/launch-westend.json")[..])
}

/// hard-coded encointer-runtime config for rococo
pub fn encointer_rococo() -> Result<EncointerChainSpec, String> {
EncointerChainSpec::from_json_bytes(&include_bytes!("../res/encointer-rococo.json")[..])
}

/// hard-coded encointer-runtime config for kusama
pub fn encointer_kusama() -> Result<EncointerChainSpec, String> {
EncointerChainSpec::from_json_bytes(&include_bytes!("../res/encointer-kusama.json")[..])
}

/// hard-coded encointer-runtime config for westend
pub fn encointer_westend() -> Result<EncointerChainSpec, String> {
EncointerChainSpec::from_json_bytes(&include_bytes!("../res/encointer-westend.json")[..])
LaunchChainSpec::from_json_bytes(&include_bytes!("../res/encointer-westend.json")[..])
}
77 changes: 48 additions & 29 deletions polkadot-parachains/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,35 +59,54 @@ fn load_spec(
id: &str,
) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
Ok(match id {
"encointer-rococo" => Box::new(chain_spec::encointer_rococo()?),
"encointer-rococo-fresh" => Box::new(chain_spec::encointer_spec(1003.into(), GenesisKeys::Encointer, RelayChain::Rococo)),
"encointer-rococo-local" => Box::new(chain_spec::encointer_spec(1003.into(), GenesisKeys::WellKnown, RelayChain::RococoLocal)),

"encointer-westend" => Box::new(chain_spec::encointer_westend()?),
"encointer-westend-fresh" => Box::new(chain_spec::encointer_spec(1001.into(), GenesisKeys::Encointer, RelayChain::Westend)),
"encointer-westend-local" => Box::new(chain_spec::encointer_spec(1001.into(), GenesisKeys::WellKnown, RelayChain::WestendLocal)),

"encointer-kusama" => Box::new(chain_spec::encointer_kusama()?),
"encointer-kusama-fresh" => Box::new(chain_spec::encointer_spec(1001.into(), GenesisKeys::Encointer, RelayChain::Kusama)),
"encointer-kusama-local" => Box::new(chain_spec::encointer_spec(1001.into(), GenesisKeys::WellKnown, RelayChain::KusamaLocal)),

"launch-rococo" => Box::new(chain_spec::launch_rococo()?),
"launch-rococo-fresh" => Box::new(chain_spec::launch_spec(1003.into(), GenesisKeys::Encointer, RelayChain::Rococo)),
"launch-rococo-local" => Box::new(chain_spec::launch_spec(1003.into(), GenesisKeys::WellKnown, RelayChain::RococoLocal)),

"launch-westend" => Box::new(chain_spec::launch_westend()?),
"launch-westend-fresh" => Box::new(chain_spec::launch_spec(1001.into(), GenesisKeys::Encointer, RelayChain::Westend)),
"launch-westend-local" => Box::new(chain_spec::launch_spec(1001.into(), GenesisKeys::EncointerWithCouncilEndowed, RelayChain::WestendLocal)),
"launch-westend-local-dev" => Box::new(chain_spec::launch_spec(1001.into(), GenesisKeys::WellKnown, RelayChain::WestendLocal)),

"launch-kusama" => Box::new(chain_spec::launch_kusama()?),
"launch-kusama-fresh" => Box::new(chain_spec::launch_spec(1001.into(), GenesisKeys::Encointer, RelayChain::Kusama)),
"launch-kusama-local" => Box::new(chain_spec::launch_spec(1001.into(), GenesisKeys::EncointerWithCouncilEndowed, RelayChain::KusamaLocal)),
"launch-kusama-local-dev" => Box::new(chain_spec::launch_spec(1001.into(), GenesisKeys::WellKnown, RelayChain::KusamaLocal)),


"sybil-dummy-rococo" => Box::new(chain_spec::sybil_dummy_spec(1863.into(), RelayChain::Rococo)),
"sybil-dummy-rococo-local" => Box::new(chain_spec::sybil_dummy_spec(1863.into(), RelayChain::RococoLocal)),
// live configs (hard coded genesis state. genesis will always be shell for a live system)
"encointer-rococo" => Box::new(chain_spec::launch_rococo()?),
"encointer-westend" => Box::new(chain_spec::launch_westend()?),
"encointer-kusama" => Box::new(chain_spec::launch_kusama()?),

// live config initialize
"encointer-rococo-fresh" => Box::new(chain_spec::launch_spec(
1003.into(), GenesisKeys::Encointer, RelayChain::Rococo)),
"encointer-westend-fresh" => Box::new(chain_spec::launch_spec(
1001.into(), GenesisKeys::Encointer, RelayChain::Westend)),
"encointer-kusama-fresh" => Box::new(chain_spec::launch_spec(
1001.into(), GenesisKeys::Encointer, RelayChain::Kusama)),

// on-the-spot specs
"encointer-rococo-local" => Box::new(chain_spec::encointer_spec(
1003.into(), GenesisKeys::EncointerWithCouncilEndowed, RelayChain::RococoLocal)),
"encointer-rococo-local-dev" => Box::new(chain_spec::encointer_spec(
1003.into(), GenesisKeys::WellKnown, RelayChain::RococoLocal)),

"encointer-westend-local" => Box::new(chain_spec::encointer_spec(
1001.into(), GenesisKeys::EncointerWithCouncilEndowed, RelayChain::WestendLocal)),
"encointer-westend-local-dev" => Box::new(chain_spec::encointer_spec(
1001.into(), GenesisKeys::WellKnown, RelayChain::WestendLocal)),

"encointer-kusama-local" => Box::new(chain_spec::encointer_spec(
1001.into(), GenesisKeys::EncointerWithCouncilEndowed, RelayChain::KusamaLocal)),
"encointer-kusama-local-dev" => Box::new(chain_spec::encointer_spec(
1001.into(), GenesisKeys::WellKnown, RelayChain::KusamaLocal)),

"launch-rococo-local" => Box::new(chain_spec::launch_spec(
1003.into(), GenesisKeys::EncointerWithCouncilEndowed, RelayChain::RococoLocal)),
"launch-rococo-local-dev" => Box::new(chain_spec::launch_spec(
1003.into(), GenesisKeys::WellKnown, RelayChain::RococoLocal)),

"launch-westend-local" => Box::new(chain_spec::launch_spec(
1001.into(), GenesisKeys::EncointerWithCouncilEndowed, RelayChain::WestendLocal)),
"launch-westend-local-dev" => Box::new(chain_spec::launch_spec(
1001.into(), GenesisKeys::WellKnown, RelayChain::WestendLocal)),

"launch-kusama-local" => Box::new(chain_spec::launch_spec(
1001.into(), GenesisKeys::EncointerWithCouncilEndowed, RelayChain::KusamaLocal)),
"launch-kusama-local-dev" => Box::new(chain_spec::launch_spec(
1001.into(), GenesisKeys::WellKnown, RelayChain::KusamaLocal)),

"sybil-dummy-rococo" => Box::new(chain_spec::sybil_dummy_spec(
1863.into(), RelayChain::Rococo)),
"sybil-dummy-rococo-local" => Box::new(chain_spec::sybil_dummy_spec(
1863.into(), RelayChain::RococoLocal)),

"" => return Err("No chain-spec specified".into()),
path => {
Expand Down

0 comments on commit d5c60fe

Please sign in to comment.