Glutton Parachain (#2294)

* Glutton Parachain

* implement collator stuff

* add glutton

* implement missing api calls

* small changes

* use shell-runtime as starting point

* update docs

* Glutton chain configurations

* successfully build

* add local chain config

* chain spec

* update Cargo.lock

* Update parachains/runtimes/glutton/glutton-kusama/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update parachains/runtimes/glutton/glutton-kusama/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update parachains/runtimes/glutton/glutton-kusama/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update parachains/runtimes/glutton/glutton-kusama/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* explicit indices

* update para_id

* irrelevant docs

* update glutton.json

* para_id as cli argument

* expect

* merge

* update

* fixes

* xcm-builder/runtime-benchmarks added

* benchmarks enabled

* add glutton to bench scripts + nitpick

* remove local bootnode

* ".git/.scripts/commands/fmt/fmt.sh"

* make clippy happy

* fix clippy

* fix chain_spec

* fix chain_spec 2

* fix chain_spec 3

* ".git/.scripts/commands/bench/bench.sh" pallet glutton-kusama-dev-1300 glutton pallet_glutton

* Update polkadot-parachain/src/chain_spec/glutton.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

* Update parachains/runtimes/glutton/glutton-kusama/src/lib.rs

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>

---------

Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Co-authored-by: NachoPal <ignacio.palacios.santos@gmail.com>
Co-authored-by: command-bot <>
This commit is contained in:
Sergej Sakac
2023-05-17 11:49:18 +02:00
committed by GitHub
parent 17b2e1b300
commit 0bc3d2c0ce
16 changed files with 1048 additions and 2 deletions
@@ -0,0 +1,90 @@
// Copyright Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
use crate::chain_spec::Extensions;
use cumulus_primitives_core::ParaId;
use sc_service::ChainType;
/// Specialized `ChainSpec` for the Glutton parachain runtime.
pub type GluttonChainSpec =
sc_service::GenericChainSpec<glutton_runtime::GenesisConfig, Extensions>;
pub fn glutton_development_config(para_id: ParaId) -> GluttonChainSpec {
GluttonChainSpec::from_genesis(
// Name
"Glutton Development",
// ID
"glutton_dev",
ChainType::Local,
move || glutton_genesis(para_id),
Vec::new(),
None,
None,
None,
None,
Extensions { relay_chain: "kusama-dev".into(), para_id: para_id.into() },
)
}
pub fn glutton_local_config(para_id: ParaId) -> GluttonChainSpec {
GluttonChainSpec::from_genesis(
// Name
"Glutton Local",
// ID
"glutton_local",
ChainType::Local,
move || glutton_genesis(para_id),
Vec::new(),
None,
None,
None,
None,
Extensions { relay_chain: "kusama-local".into(), para_id: para_id.into() },
)
}
pub fn glutton_config(para_id: ParaId) -> GluttonChainSpec {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("ss58Format".into(), 2.into());
GluttonChainSpec::from_genesis(
// Name
format!("Glutton {}", para_id).as_str(),
// ID
format!("glutton_kusama_{}", para_id).as_str(),
ChainType::Live,
move || glutton_genesis(para_id),
Vec::new(),
None,
// Protocol ID
Some(format!("glutton_kusama_{}", para_id).as_str()),
None,
Some(properties),
Extensions { relay_chain: "kusama".into(), para_id: para_id.into() },
)
}
fn glutton_genesis(parachain_id: ParaId) -> glutton_runtime::GenesisConfig {
glutton_runtime::GenesisConfig {
system: glutton_runtime::SystemConfig {
code: glutton_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
.to_vec(),
},
parachain_info: glutton_runtime::ParachainInfoConfig { parachain_id },
parachain_system: Default::default(),
}
}
@@ -23,6 +23,7 @@ use sp_runtime::traits::{IdentifyAccount, Verify};
pub mod bridge_hubs;
pub mod collectives;
pub mod contracts;
pub mod glutton;
pub mod penpal;
pub mod rococo_parachain;
pub mod seedling;