Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #197

Merged
merged 29 commits into from
Dec 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
db10609
update: format
AurevoirXavier Dec 25, 2019
664186b
add: `fn` for getter function, follow https://github.com/paritytech/s…
AurevoirXavier Dec 25, 2019
adbc812
update: chain spec
AurevoirXavier Dec 25, 2019
5cb919c
update: boot configuration
AurevoirXavier Dec 25, 2019
5acf990
remove: useless conf
AurevoirXavier Dec 25, 2019
47961b2
update: testnet configuration
AurevoirXavier Dec 25, 2019
19766d9
update: types
AurevoirXavier Dec 25, 2019
d110129
update: chain spec
AurevoirXavier Dec 25, 2019
bfc874a
update: chain spec
AurevoirXavier Dec 25, 2019
e99d6bc
update: icefrog configuration
AurevoirXavier Dec 25, 2019
2f13f60
update: initial authorities set to 2
AurevoirXavier Dec 25, 2019
1f825e6
update: icefrog boot configuration
AurevoirXavier Dec 25, 2019
e4f477f
Merge remote-tracking branch 'origin/develop'
AurevoirXavier Dec 25, 2019
eb39a50
update: chain spec
AurevoirXavier Dec 25, 2019
3364735
update: boot configuration example
AurevoirXavier Dec 25, 2019
1840b43
update: version
AurevoirXavier Dec 25, 2019
ba90451
update: chain spec
AurevoirXavier Dec 25, 2019
6869c49
update: inflation
AurevoirXavier Dec 26, 2019
677c147
update: runtime
AurevoirXavier Dec 26, 2019
5eacdb1
fix: #188
AurevoirXavier Dec 26, 2019
073b53c
update: cargo update
AurevoirXavier Dec 26, 2019
bbfd60a
update: mock test
AurevoirXavier Dec 26, 2019
3e65ad5
udpate: icefrog boot configuration example
AurevoirXavier Dec 26, 2019
cfe28e1
update: chain spec
AurevoirXavier Dec 26, 2019
2ed062f
update: testnet boot configuration
AurevoirXavier Dec 26, 2019
fc0fc71
update: switch to production env
AurevoirXavier Dec 26, 2019
49d499b
Merge remote-tracking branch 'upstream/develop' into develop
AurevoirXavier Dec 26, 2019
3239373
update: types
AurevoirXavier Dec 26, 2019
cc5a5e7
add: IKTON
AurevoirXavier Dec 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

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

21 changes: 0 additions & 21 deletions boot-conf/example.json

This file was deleted.

17 changes: 17 additions & 0 deletions boot-conf/icefrog/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"base-path": "/tmp/icefrog",
"bootnodes": [
"/ip4/Node 1 IP Here/tcp/Node 1 PORT Here/p2p/Node 1 ID Here",
"/ip4/Node 2 IP Here/tcp/Node 2 PORT Here/p2p/Node 2 ID Here"
],

"name": "Example",
"validator": true,

"rpc-external": true,
"rpc-port": 23332,
"ws-external": true,
"ws-port": 23333,
"rpc-cors": "all",
"port": 23334
}
6 changes: 4 additions & 2 deletions boot-conf/testnet/alice.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"base-path": "/tmp/darwinia-testnet/alice",
"base-path": "/tmp/testnet/alice",
"rpc-external": true,
"rpc-port": 23332,
"ws-external": true,
"ws-port": 23333,
"rpc-cors": "all"
"rpc-cors": "all",
"port": 23334
}
9 changes: 9 additions & 0 deletions boot-conf/testnet/bob.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"base-path": "/tmp/testnet/bob",
"rpc-external": true,
"rpc-port": 23335,
"ws-external": true,
"ws-port": 23336,
"rpc-cors": "all",
"port": 23337
}
112 changes: 0 additions & 112 deletions node/cli/res/darwinia.json

This file was deleted.

137 changes: 79 additions & 58 deletions node/cli/res/icefrog.json

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions node/cli/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ pub fn darwinia_genesis(
staking: Some(StakingConfig {
current_era: 0,
validator_count: 7,
minimum_validator_count: 1,
minimum_validator_count: 2,
stakers: initial_authorities
.iter()
.map(|x| (x.0.clone(), x.1.clone(), STASH, StakerStatus::Validator))
Expand Down Expand Up @@ -368,9 +368,13 @@ pub fn icefrog_testnet_config() -> ChainSpec {
Some("DAR"),
{
let mut properties = Properties::new();

properties.insert("ss58Format".into(), 42.into());

properties.insert("tokenDecimals".into(), 9.into());
properties.insert("tokenSymbol".into(), "RING".into());
properties.insert("tokenSymbol".into(), "IRING".into());
properties.insert("ktonTokenDecimals".into(), 9.into());
properties.insert("ktonTokenSymbol".into(), "IKTON".into());

Some(properties)
},
Expand Down
13 changes: 7 additions & 6 deletions node/runtime/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ pub mod time {
/// <https://research.web3.foundation/en/latest/polkadot/BABE/Babe/#6-practical-results>

// Develop
pub const MILLISECS_PER_BLOCK: Moment = 1000;
// pub const MILLISECS_PER_BLOCK: Moment = 1000;
// Production
// pub const MILLISECS_PER_BLOCK: Moment = 3000;
pub const MILLISECS_PER_BLOCK: Moment = 3000;
pub const SECS_PER_BLOCK: Moment = MILLISECS_PER_BLOCK / 1000;

pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK;
Expand All @@ -60,9 +60,10 @@ pub mod time {
pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4);

// Develop
pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 10;
// pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 10;
// pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = MINUTES;
// Production
// pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 10 * MINUTES;
pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 10 * MINUTES;
pub const EPOCH_DURATION_IN_SLOTS: u64 = {
const SLOT_FILL_RATE: f64 = MILLISECS_PER_BLOCK as f64 / SLOT_DURATION as f64;

Expand All @@ -76,9 +77,9 @@ pub mod time {

pub const SESSION_DURATION: BlockNumber = EPOCH_DURATION_IN_SLOTS as _;
// Develop
pub const SESSION_PER_ERA: sr_staking_primitives::SessionIndex = 3;
// pub const SESSION_PER_ERA: sr_staking_primitives::SessionIndex = 3;
// Production
// pub const SESSION_PER_ERA: sr_staking_primitives::SessionIndex = 5;
pub const SESSION_PER_ERA: sr_staking_primitives::SessionIndex = 5;
}

// CRITICAL NOTE: The system module maintains two constants: a _maximum_ block weight and a _ratio_
Expand Down
66 changes: 33 additions & 33 deletions node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("node"),
impl_name: create_runtime_str!("darwinia-node"),
authoring_version: 3,
spec_version: 81,
impl_version: 81,
spec_version: 83,
impl_version: 83,
apis: RUNTIME_API_VERSIONS,
};

Expand Down Expand Up @@ -148,16 +148,16 @@ impl indices::Trait for Runtime {

parameter_types! {
// Develop
pub const TransactionBaseFee: Balance = MICRO;
pub const TransactionByteFee: Balance = MICRO;
// pub const TransactionBaseFee: Balance = MICRO;
// pub const TransactionByteFee: Balance = MICRO;
// setting this to zero will disable the weight fee.
pub const WeightFeeCoefficient: Balance = MICRO;
// pub const WeightFeeCoefficient: Balance = MICRO;

// Production
// pub const TransactionBaseFee: Balance = 1 * MICRO;
// pub const TransactionByteFee: Balance = 10 * MICRO;
// // setting this to zero will disable the weight fee.
// pub const WeightFeeCoefficient: Balance = 1 * MICRO;
pub const TransactionBaseFee: Balance = 1 * MICRO;
pub const TransactionByteFee: Balance = 10 * MICRO;
// setting this to zero will disable the weight fee.
pub const WeightFeeCoefficient: Balance = 50 * NANO;

// for a sane configuration, this should always be less than `AvailableBlockRatio`.
pub const TargetBlockFullness: Perbill = Perbill::from_percent(25);
Expand Down Expand Up @@ -226,26 +226,26 @@ impl session::historical::Trait for Runtime {

parameter_types! {
// Develop
pub const ContractTransferFee: Balance = MICRO;
pub const ContractCreationFee: Balance = MICRO;
pub const ContractTransactionBaseFee: Balance = MICRO;
pub const ContractTransactionByteFee: Balance = MICRO;
pub const ContractFee: Balance = MICRO;
pub const TombstoneDeposit: Balance = MICRO;
pub const RentByteFee: Balance = MICRO;
pub const RentDepositOffset: Balance = MICRO;
pub const SurchargeReward: Balance = MICRO;
// pub const ContractTransferFee: Balance = MICRO;
// pub const ContractCreationFee: Balance = MICRO;
// pub const ContractTransactionBaseFee: Balance = MICRO;
// pub const ContractTransactionByteFee: Balance = MICRO;
// pub const ContractFee: Balance = MICRO;
// pub const TombstoneDeposit: Balance = MICRO;
// pub const RentByteFee: Balance = MICRO;
// pub const RentDepositOffset: Balance = MICRO;
// pub const SurchargeReward: Balance = MICRO;

// Production
// pub const ContractTransferFee: Balance = 1 * MICRO;
// pub const ContractCreationFee: Balance = 1 * MICRO;
// pub const ContractTransactionBaseFee: Balance = 1 * MICRO;
// pub const ContractTransactionByteFee: Balance = 10 * MICRO;
// pub const ContractFee: Balance = 1 * MICRO;
// pub const TombstoneDeposit: Balance = 1 * COIN;
// pub const RentByteFee: Balance = 1 * COIN;
// pub const RentDepositOffset: Balance = 1000 * COIN;
// pub const SurchargeReward: Balance = 150 * COIN;
pub const ContractTransferFee: Balance = 1 * MICRO;
pub const ContractCreationFee: Balance = 1 * MICRO;
pub const ContractTransactionBaseFee: Balance = 1 * MICRO;
pub const ContractTransactionByteFee: Balance = 10 * MICRO;
pub const ContractFee: Balance = 1 * MICRO;
pub const TombstoneDeposit: Balance = 1 * COIN;
pub const RentByteFee: Balance = 1 * COIN;
pub const RentDepositOffset: Balance = 1000 * COIN;
pub const SurchargeReward: Balance = 150 * COIN;
}
impl contracts::Trait for Runtime {
type Currency = Balances;
Expand Down Expand Up @@ -370,12 +370,12 @@ parameter_types! {
pub const BondingDuration: Moment = 1_209_600_000;
pub const BondingDurationInEra: staking::EraIndex = 4032;
// decimal 9
pub const HardCap: Balance = 1_000_000_000 * COIN;
// date in Los Angeles*: 11/19/2019, 2:33:20 AM
// date in Berlin* :11/19/2019, 5:33:20 PM
// date in Beijing*: 11/19/2019, 4:33:20 PM
// date in New York* :11/19/2019, 4:33:20 AM
pub const GenesisTime: Moment = 1_574_156_000_000;
pub const HardCap: Balance = 10_000_000_000 * COIN;
// Date in Los Angeles*: 12/25/2019, 10:58:29 PM
// Date in Berlin* :12/26/2019, 1:58:29 PM
// Date in Beijing*: 12/26/2019, 12:58:29 PM
// Date in New York* :12/26/2019, 12:58:29 AM
pub const GenesisTime: Moment = 1_577_339_909_000;
}
impl staking::Trait for Runtime {
type Time = Timestamp;
Expand Down
14 changes: 6 additions & 8 deletions srml/eth-backing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@ sr-eth-primitives = { path = "../../core/sr-eth-primitives", default-features =
hex-literal = "0.2.1"
rustc-hex = "2.0"

balances = { package = "darwinia-balances", path = '../balances' }
kton = { package = "darwinia-kton", path = "../kton" }
staking = { package = "darwinia-staking", path = "../staking" }

authorship = { package = "srml-authorship", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop"}
session = { package = "srml-session",git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop"}
sr-staking-primitives = { git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop"}
phragmen = { package = "substrate-phragmen", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop"}
rlp = { package = "rlp", git = "https://github.com/darwinia-network/parity-common.git" }
runtime-io = { package = "sr-io", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
rlp = { package = "rlp", git = "https://github.com/darwinia-network/parity-common.git"}
session = { package = "srml-session",git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop"}
sr-staking-primitives = { git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop"}

kton = { package = "darwinia-kton", path = "../kton" }
ring = { package = "darwinia-balances", path = '../balances' }
staking = { package = "darwinia-staking", path = "../staking" }

[features]
default = ["std"]
Expand Down
Loading