diff --git a/Cargo.lock b/Cargo.lock index 9eb102625..127534f56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -599,8 +599,8 @@ dependencies = [ ] [[package]] -name = "darwinia-poc2" -version = "0.2.2" +name = "darwinia-crayfish" +version = "0.3.0" dependencies = [ "ctrlc 3.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "fork-tree 2.0.0 (git+https://github.com/paritytech/substrate.git)", diff --git a/Cargo.toml b/Cargo.toml index a86c3b046..77582ea40 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,9 +66,9 @@ members = [ exclude = ["node/runtime/wasm"] [package] -authors = ['Parity Technologies '] +authors = ['Darwinia Network '] build = 'build.rs' edition = '2018' -name = 'darwinia-poc2' -version = '0.2.2' +name = 'darwinia-crayfish' +version = '0.3.0' diff --git a/node/cli/src/chain_spec.rs b/node/cli/src/chain_spec.rs index 02c540a07..14e8dc087 100644 --- a/node/cli/src/chain_spec.rs +++ b/node/cli/src/chain_spec.rs @@ -305,8 +305,11 @@ fn crayfish_config_genesis() -> GenesisConfig { get_authority_keys_from_seed("Alice"), get_authority_keys_from_seed("Bob"), ], - get_account_id_from_seed("Alice"), - None, + hex!["5225c14bd888f6f623d4c6fb283b3b6bbb76560151f6dbf3476dc2b60c24c476"].unchecked_into(), + Some(vec![ + // tony + hex!["12d5e8af67fc5c08ed231619d9210ecad2c665ff5d72e5948e56e82a0553f86b"].unchecked_into() + ]), false, ) } @@ -336,7 +339,7 @@ pub fn crayfish_testnet_genesis( ] }); - const ENDOWMENT: Balance = 10_000_000 * COIN; + const ENDOWMENT: Balance = 100_000_000 * COIN; const STASH: Balance = 100 * COIN; GenesisConfig { @@ -348,16 +351,16 @@ pub fn crayfish_testnet_genesis( ids: endowed_accounts.clone(), }), balances: Some(BalancesConfig { - balances: endowed_accounts.iter().map(|k| (k.clone(), ENDOWMENT)).collect(), - vesting: vec![], - }), - kton: Some(KtonConfig { balances: endowed_accounts.iter().cloned() - .map(|k| (k, ENDOWMENT)) + .map(|k| (k, 18 * ENDOWMENT)) .chain(initial_authorities.iter().map(|x| (x.0.clone(), ENDOWMENT))) .collect(), vesting: vec![], }), + kton: Some(KtonConfig { + balances: vec![], + vesting: vec![], + }), session: Some(SessionConfig { validators: initial_authorities.iter().map(|x| x.1.clone()).collect(), keys: initial_authorities.iter().map(|x| (x.1.clone(), SessionKeys(x.2.clone(), x.2.clone()))).collect::>(), @@ -367,10 +370,10 @@ pub fn crayfish_testnet_genesis( // TODO: ready for hacking current_era_total_reward: 80_000_000 * COIN / 63720, minimum_validator_count: 1, - validator_count: 3, + validator_count: 30, offline_slash: Perbill::from_parts(1_000_000), session_reward: Perbill::from_percent(90), - offline_slash_grace: 2, + offline_slash_grace: 4, stakers: initial_authorities.iter().map(|x| (x.0.clone(), x.1.clone(), STASH, StakerStatus::Validator)).collect(), invulnerables: initial_authorities.iter().map(|x| x.1.clone()).collect(), }), @@ -428,7 +431,7 @@ pub fn local_testnet_config() -> ChainSpec { /// c￿rayfish testnet config (multivalidator Alice + Bob) pub fn crayfish_testnet_config() -> ChainSpec { - ChainSpec::from_genesis("Crayfish Testnet", "crayfish_testnet", crayfish_config_genesis, vec![], None, None, None, token_properties()) + ChainSpec::from_genesis("Crayfish Testnet", "crayfish_testnet", crayfish_config_genesis, vec![], None, Some("DAR"), None, token_properties()) } #[cfg(test)] diff --git a/node/cli/src/lib.rs b/node/cli/src/lib.rs index c0d2a36f1..bf03e8876 100644 --- a/node/cli/src/lib.rs +++ b/node/cli/src/lib.rs @@ -132,9 +132,9 @@ impl ChainSpec { match s { "dev" => Some(ChainSpec::Development), "local" => Some(ChainSpec::LocalTestnet), - "" | "fir" | "flaming-fir" => Some(ChainSpec::FlamingFir), + "" | "crayfish" => Some(ChainSpec::CrayfishTestnet), + "flaming-fir" => Some(ChainSpec::FlamingFir), "staging" => Some(ChainSpec::StagingTestnet), - "crayfish" => Some(ChainSpec::CrayfishTestnet), _ => None, } } @@ -158,7 +158,7 @@ pub fn run(args: I, exit: E, version: cli::VersionInfo) -> error::Resul |exit, _cli_args, _custom_args, config| { info!("{}", version.name); info!(" version {}", config.full_version()); - info!(" by Parity Technologies, 2017-2019"); + info!(" by Darwinia Network, 2017-2019"); info!("Chain specification: {}", config.chain_spec.name()); info!("Node name: {}", config.name); info!("Roles: {:?}", config.roles); diff --git a/node/runtime/src/lib.rs b/node/runtime/src/lib.rs index b8142a9f8..6c928bc9d 100644 --- a/node/runtime/src/lib.rs +++ b/node/runtime/src/lib.rs @@ -182,11 +182,11 @@ impl timestamp::Trait for Runtime { } parameter_types! { - pub const ExistentialDeposit: Balance = 1 * NANO; - pub const TransferFee: Balance = 1 * NANO; - pub const CreationFee: Balance = 1 * NANO; - pub const TransactionBaseFee: Balance = 1 * NANO; - pub const TransactionByteFee: Balance = 1 * NANO; + pub const ExistentialDeposit: Balance = 1 * MICRO; + pub const TransferFee: Balance = 1 * MILLI; + pub const CreationFee: Balance = 1 * MILLI; + pub const TransactionBaseFee: Balance = 1 * MILLI; + pub const TransactionByteFee: Balance = 1 * MICRO; } type SessionHandlers = (Grandpa, Aura); @@ -228,7 +228,8 @@ impl session::Trait for Runtime { parameter_types! { pub const SessionsPerEra: session::SessionIndex = 5; - pub const BondingDuration: staking::EraIndex = 2; + // about 14 days + pub const BondingDuration: staking::EraIndex = 4032; // 365 days * 24 hours * 60 miutes / 5 minutes pub const ErasPerEpoch: staking::ErasNums = 63720; }