Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/darwinia-network/darwinia
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
hackfisher committed Sep 2, 2019
2 parents 3431dc8 + 6e70937 commit cd4d244
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ members = [
exclude = ["node/runtime/wasm"]

[package]
authors = ['Parity Technologies <[email protected]>']
authors = ['Darwinia Network <[email protected]>']
build = 'build.rs'
edition = '2018'
name = 'darwinia-poc2'
version = '0.2.2'
name = 'darwinia-crayfish'
version = '0.3.0'

25 changes: 14 additions & 11 deletions node/cli/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
}
Expand Down Expand Up @@ -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 {
Expand All @@ -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::<Vec<_>>(),
Expand All @@ -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(),
}),
Expand Down Expand Up @@ -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)]
Expand Down
6 changes: 3 additions & 3 deletions node/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand All @@ -158,7 +158,7 @@ pub fn run<I, T, E>(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);
Expand Down
13 changes: 7 additions & 6 deletions node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit cd4d244

Please sign in to comment.