Skip to content

Commit

Permalink
Add zeitgeist chainspec (#392)
Browse files Browse the repository at this point in the history
* Add zeitgeist chainspec

* Change default collator balance, endowed sudo key and spec files

* Add CollatorDeposit to endowed staking balance in battery station

* Add working mainnet chainspec

* Add working zeitgeist standalone chainspec

* Cargo fmt
  • Loading branch information
sea212 authored Dec 1, 2021
1 parent 27eb7c4 commit bb71c95
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 6 deletions.
73 changes: 73 additions & 0 deletions node/res/zeitgeist.json

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions node/res/zeitgeist_parachain.json

Large diffs are not rendered by default.

17 changes: 11 additions & 6 deletions node/src/chain_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,21 @@ use zeitgeist_runtime::SS58Prefix;
use {
sp_runtime::{Perbill, Percent},
zeitgeist_primitives::constants::{ztg, DefaultBlocksPerRound, MILLISECS_PER_BLOCK},
zeitgeist_runtime::{CollatorDeposit, MinCollatorStake},
};

cfg_if::cfg_if! {
if #[cfg(feature = "parachain")] {
// Testnet
const DEFAULT_STAKING_AMOUNT_TESTNET: u128 = 2_000 * BASE;
const DEFAULT_COLLATOR_BALANCE_TESTNET: Option<u128> =
DEFAULT_STAKING_AMOUNT_TESTNET.checked_add(CollatorDeposit::get());
const DEFAULT_INITIAL_CROWDLOAN_FUNDS_TESTNET: u128 = 100 * BASE;

// Mainnet
const DEFAULT_STAKING_AMOUNT_MAINNET: u128 = 64 * BASE;
const DEFAULT_STAKING_AMOUNT_MAINNET: u128 = MinCollatorStake::get();
const DEFAULT_COLLATOR_BALANCE_MAINNET: Option<u128> =
DEFAULT_STAKING_AMOUNT_MAINNET.checked_add(CollatorDeposit::get());
const DEFAULT_INITIAL_CROWDLOAN_FUNDS_MAINNET: u128 = 0;

// Common
Expand Down Expand Up @@ -248,7 +253,7 @@ fn endowed_accounts_staging_testnet() -> Vec<EndowedAccountWithBalance> {
#[cfg(feature = "parachain")]
EndowedAccountWithBalance(
hex!["302f6d7467ae2d7e3b9b962bfc3b9d929da9fae5f1e8c977a031ddf721b0790d"].into(),
DEFAULT_STAKING_AMOUNT_TESTNET,
DEFAULT_COLLATOR_BALANCE_TESTNET.unwrap(),
),
]
}
Expand All @@ -265,23 +270,23 @@ fn endowed_accounts_staging_mainnet() -> Vec<EndowedAccountWithBalance> {
#[cfg(feature = "parachain")]
EndowedAccountWithBalance(
hex!["524e9aac979cbb9ecdb7acd1635755c3b15696321a3345ca77f0ab0ae23f675a"].into(),
DEFAULT_STAKING_AMOUNT_MAINNET,
DEFAULT_COLLATOR_BALANCE_MAINNET.unwrap(),
),
// dDy7WSPy4pvWBKsUta8MdWxduWFTpJtv9zgBiVGtqWmMh6bi6
#[cfg(feature = "parachain")]
EndowedAccountWithBalance(
hex!["04163722a7f1f900c1ec502383d4959360e374c8808e13d47b3e553d761a6329"].into(),
DEFAULT_STAKING_AMOUNT_MAINNET,
DEFAULT_COLLATOR_BALANCE_MAINNET.unwrap(),
),
// dE36Y98QpX8hEkLANntbtUvt7figSPGxSrDxU4sscuX989CTJ
#[cfg(feature = "parachain")]
EndowedAccountWithBalance(
hex!["b449a256f73e59602eb742071a07e4d94aaae91e6872f28e161f34982a0bfc0d"].into(),
DEFAULT_STAKING_AMOUNT_MAINNET,
DEFAULT_COLLATOR_BALANCE_MAINNET.unwrap(),
),
// dE2nxuZc5e7xBbU1cGikmtVGws9niNPUayigoDdyqB7hzHQ6X
EndowedAccountWithBalance(
hex!["a6e29646e15a7440a1a422a5bd985ba67494ea0ba1b44fed4b864b8ccf72db00"].into(),
hex!["203ef582312dae988433920791ce584daeca819a76d000175dc6d7d1a0fb1413"].into(),
DEFAULT_SUDO_BALANCE_MAINNET,
),
]
Expand Down
6 changes: 6 additions & 0 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ pub fn load_spec(
#[cfg(feature = "parachain")]
parachain_id,
)?),
"zeitgeist" => Box::new(crate::chain_spec::ChainSpec::from_json_bytes(
#[cfg(feature = "parachain")]
&include_bytes!("../res/zeitgeist_parachain.json")[..],
#[cfg(not(feature = "parachain"))]
&include_bytes!("../res/zeitgeist.json")[..],
)?),
"zeitgeist_staging" => Box::new(crate::chain_spec::zeitgeist_staging_config(
#[cfg(feature = "parachain")]
parachain_id,
Expand Down

0 comments on commit bb71c95

Please sign in to comment.