Skip to content

Commit 7bd2378

Browse files
committed
refactored chain
1 parent 542ad5e commit 7bd2378

13 files changed

Lines changed: 300 additions & 324 deletions

File tree

Cargo.lock

Lines changed: 210 additions & 210 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# Substrate Node Template
1+
# Argo chain

node/Cargo.toml

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
2-
name = "node-template"
3-
version = "4.0.0-dev"
2+
name = "argochain"
3+
version = "1.0.0"
44
description = "Client node"
5-
authors = ["5ireChain"]
5+
authors = ["argochain"]
66
edition = "2021"
77
publish = false
88
build = "build.rs"
@@ -108,7 +108,7 @@ node-executor = { version = "3.0.0-dev", git = "https://github.com/paritytech/su
108108

109109

110110
# Local Dependencies
111-
node-template-runtime = { version = "4.0.0-dev", path = "../runtime" }
111+
argochain-runtime = { version = "1.0.0", path = "../runtime" }
112112
node-primitives = { version = "2.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", default-features = false }
113113

114114
# CLI-specific dependencies
@@ -157,26 +157,10 @@ cli = [
157157
]
158158
# Dependencies that are only required if runtime benchmarking should be build.
159159
runtime-benchmarks = [
160-
"node-template-runtime/runtime-benchmarks",
160+
"argochain-runtime/runtime-benchmarks",
161161
"frame-benchmarking/runtime-benchmarks",
162162
"frame-benchmarking-cli/runtime-benchmarks",
163163
]
164164
# Enable features that allow the runtime to be tried and debugged. Name might be subject to change
165165
# in the near future.
166-
try-runtime = ["node-template-runtime/try-runtime", "try-runtime-cli/try-runtime"]
167-
168-
169-
170-
171-
#[build-dependencies]
172-
#clap = { version = "4.2.5", optional = true }
173-
#clap_complete = { version = "4.0.2", optional = true }
174-
#node-inspect = { version = "0.9.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
175-
#frame-benchmarking-cli = { version = "4.0.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
176-
#substrate-build-script-utils = { version = "3.0.0", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
177-
#substrate-frame-cli = { version = "4.0.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
178-
#try-runtime-cli = { version = "0.10.0-dev", optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
179-
#sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0", optional = true }
180-
#pallet-balances = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
181-
#sc-storage-monitor = { version = "0.1.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
182-
#substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
166+
try-runtime = ["argochain-runtime/try-runtime", "try-runtime-cli/try-runtime"]

node/src/benchmarking.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
2323
use crate::service::{create_extrinsic, FullClient};
2424

25-
use node_template_runtime::{BalancesCall, SystemCall};
25+
use argochain_runtime::{BalancesCall, SystemCall};
2626
use node_primitives::{AccountId, Balance};
2727
use sc_cli::Result;
2828
use sp_inherents::{InherentData, InherentDataProvider};

node/src/chain_spec.rs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
//! Substrate chain configurations.
2020
2121
use grandpa_primitives::AuthorityId as GrandpaId;
22-
use node_template_runtime::{
22+
use argochain_runtime::{
2323
constants::currency::*, wasm_binary_unwrap, BabeConfig, BalancesConfig, Block, CouncilConfig,
2424
DemocracyConfig, ElectionsConfig, ImOnlineConfig, IndicesConfig, MaxNominations,
2525
NominationPoolsConfig, SessionConfig, SessionKeys, SocietyConfig, StakerStatus, StakingConfig,
@@ -38,7 +38,7 @@ use sp_runtime::{
3838
Perbill,
3939
};
4040

41-
pub use node_template_runtime::RuntimeGenesisConfig;
41+
pub use argochain_runtime::RuntimeGenesisConfig;
4242
pub use node_primitives::{AccountId, Balance, Signature};
4343

4444
type AccountPublic = <Signature as Verify>::Signer;
@@ -78,14 +78,6 @@ fn session_keys(
7878

7979
fn staging_testnet_config_genesis() -> RuntimeGenesisConfig {
8080
#[rustfmt::skip]
81-
// stash, controller, session-key
82-
// generated with secret:
83-
// for i in 1 2 3 4 ; do for j in stash controller; do subkey inspect "$secret"/fir/$j/$i; done; done
84-
//
85-
// and
86-
//
87-
// for i in 1 2 3 4 ; do for j in session; do subkey --ed25519 inspect "$secret"//fir//$j//$i; done; done
88-
8981
let initial_authorities: Vec<(
9082
AccountId,
9183
AccountId,
@@ -290,7 +282,7 @@ pub fn testnet_genesis(
290282

291283
let num_endowed_accounts = endowed_accounts.len();
292284

293-
const ENDOWMENT: Balance = 10_000_000 * DOLLARS;
285+
const ENDOWMENT: Balance = 30_000_000 * ARGO;
294286
const STASH: Balance = ENDOWMENT / 1000;
295287

296288
RuntimeGenesisConfig {
@@ -339,7 +331,7 @@ pub fn testnet_genesis(
339331
},
340332
sudo: SudoConfig { key: Some(root_key) },
341333
babe: BabeConfig {
342-
epoch_config: Some(node_template_runtime::BABE_GENESIS_EPOCH_CONFIG),
334+
epoch_config: Some(argochain_runtime::BABE_GENESIS_EPOCH_CONFIG),
343335
..Default::default()
344336
},
345337
im_online: ImOnlineConfig { keys: vec![] },
@@ -360,8 +352,8 @@ pub fn testnet_genesis(
360352
alliance: Default::default(),
361353
alliance_motion: Default::default(),
362354
nomination_pools: NominationPoolsConfig {
363-
min_create_bond: 10 * DOLLARS,
364-
min_join_bond: 1 * DOLLARS,
355+
min_create_bond: 10 * ARGO,
356+
min_join_bond: 1 * ARGO,
365357
..Default::default()
366358
},
367359
glutton: Default::default(),
@@ -405,8 +397,8 @@ fn local_testnet_genesis() -> RuntimeGenesisConfig {
405397
/// Local testnet config (multivalidator Alice + Bob)
406398
pub fn local_testnet_config() -> ChainSpec {
407399
ChainSpec::from_genesis(
408-
"Local Testnet",
409-
"local_testnet",
400+
"ArgoChain Testnet",
401+
"argochain_testnet",
410402
ChainType::Local,
411403
local_testnet_genesis,
412404
vec![],

node/src/command.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ use crate::{
2323
cli::{Cli, Subcommand},
2424
};
2525
use frame_benchmarking_cli::*;
26-
use node_template_runtime::{ExistentialDeposit, RuntimeApi};
27-
use node_executor::ExecutorDispatch;
26+
use argochain_runtime::ExistentialDeposit;
2827
use node_primitives::Block;
2928
use sc_cli::{Result, SubstrateCli};
3029
use sc_service::PartialComponents;
@@ -34,7 +33,7 @@ use std::sync::Arc;
3433

3534
#[cfg(feature = "try-runtime")]
3635
use {
37-
node_template_runtime::constants::time::SLOT_DURATION,
36+
argochain_runtime::constants::time::SLOT_DURATION,
3837
try_runtime_cli::block_building_info::substrate_info,
3938
};
4039

node/src/rpc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
//! be placed here or imported from corresponding FRAME RPC definitions.
3030
3131
#![warn(missing_docs)]
32-
#![warn(unused_crate_dependencies)]
32+
// #![warn(unused_crate_dependencies)]
3333

3434
use std::sync::Arc;
3535

node/src/service.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use codec::Encode;
2727
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
2828
use frame_system_rpc_runtime_api::AccountNonceApi;
2929
use futures::prelude::*;
30-
use node_template_runtime::RuntimeApi;
30+
use argochain_runtime::RuntimeApi;
3131
use node_executor::ExecutorDispatch;
3232
use node_primitives::Block;
3333
use sc_client_api::{Backend, BlockBackend};
@@ -76,43 +76,43 @@ pub fn fetch_nonce(client: &FullClient, account: sp_core::sr25519::Pair) -> u32
7676
pub fn create_extrinsic(
7777
client: &FullClient,
7878
sender: sp_core::sr25519::Pair,
79-
function: impl Into<node_template_runtime::RuntimeCall>,
79+
function: impl Into<argochain_runtime::RuntimeCall>,
8080
nonce: Option<u32>,
81-
) -> node_template_runtime::UncheckedExtrinsic {
81+
) -> argochain_runtime::UncheckedExtrinsic {
8282
let function = function.into();
8383
let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed");
8484
let best_hash = client.chain_info().best_hash;
8585
let best_block = client.chain_info().best_number;
8686
let nonce = nonce.unwrap_or_else(|| fetch_nonce(client, sender.clone()));
8787

88-
let period = node_template_runtime::BlockHashCount::get()
88+
let period = argochain_runtime::BlockHashCount::get()
8989
.checked_next_power_of_two()
9090
.map(|c| c / 2)
9191
.unwrap_or(2) as u64;
9292
let tip = 0;
93-
let extra: node_template_runtime::SignedExtra = (
94-
frame_system::CheckNonZeroSender::<node_template_runtime::Runtime>::new(),
95-
frame_system::CheckSpecVersion::<node_template_runtime::Runtime>::new(),
96-
frame_system::CheckTxVersion::<node_template_runtime::Runtime>::new(),
97-
frame_system::CheckGenesis::<node_template_runtime::Runtime>::new(),
98-
frame_system::CheckEra::<node_template_runtime::Runtime>::from(generic::Era::mortal(
93+
let extra: argochain_runtime::SignedExtra = (
94+
frame_system::CheckNonZeroSender::<argochain_runtime::Runtime>::new(),
95+
frame_system::CheckSpecVersion::<argochain_runtime::Runtime>::new(),
96+
frame_system::CheckTxVersion::<argochain_runtime::Runtime>::new(),
97+
frame_system::CheckGenesis::<argochain_runtime::Runtime>::new(),
98+
frame_system::CheckEra::<argochain_runtime::Runtime>::from(generic::Era::mortal(
9999
period,
100100
best_block.saturated_into(),
101101
)),
102-
frame_system::CheckNonce::<node_template_runtime::Runtime>::from(nonce),
103-
frame_system::CheckWeight::<node_template_runtime::Runtime>::new(),
104-
pallet_asset_conversion_tx_payment::ChargeAssetTxPayment::<node_template_runtime::Runtime>::from(
102+
frame_system::CheckNonce::<argochain_runtime::Runtime>::from(nonce),
103+
frame_system::CheckWeight::<argochain_runtime::Runtime>::new(),
104+
pallet_asset_conversion_tx_payment::ChargeAssetTxPayment::<argochain_runtime::Runtime>::from(
105105
tip, None,
106106
),
107107
);
108108

109-
let raw_payload = node_template_runtime::SignedPayload::from_raw(
109+
let raw_payload = argochain_runtime::SignedPayload::from_raw(
110110
function.clone(),
111111
extra.clone(),
112112
(
113113
(),
114-
node_template_runtime::VERSION.spec_version,
115-
node_template_runtime::VERSION.transaction_version,
114+
argochain_runtime::VERSION.spec_version,
115+
argochain_runtime::VERSION.transaction_version,
116116
genesis_hash,
117117
best_hash,
118118
(),
@@ -122,10 +122,10 @@ pub fn create_extrinsic(
122122
);
123123
let signature = raw_payload.using_encoded(|e| sender.sign(e));
124124

125-
node_template_runtime::UncheckedExtrinsic::new_signed(
125+
argochain_runtime::UncheckedExtrinsic::new_signed(
126126
function,
127127
sp_runtime::AccountId32::from(sender.public()).into(),
128-
node_template_runtime::Signature::Sr25519(signature),
128+
argochain_runtime::Signature::Sr25519(signature),
129129
extra,
130130
)
131131
}
@@ -631,7 +631,7 @@ pub fn new_full(
631631
mod tests {
632632
use crate::service::{new_full_base, NewFullBase};
633633
use codec::Encode;
634-
use node_template_runtime::{
634+
use argochain_runtime::{
635635
constants::{currency::CENTS, time::SLOT_DURATION},
636636
Address, BalancesCall, RuntimeCall, UncheckedExtrinsic,
637637
};

runtime/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
2-
name = "node-template-runtime"
3-
version = "4.0.0-dev"
4-
authors = ["Parity Technologies <admin@parity.io>"]
5-
description = "Substrate node kitchensink runtime."
2+
name = "argochain-runtime"
3+
version = "1.0.0"
4+
authors = ["Argo Chain Team"]
5+
description = "Argo chain runtime."
66
edition = "2021"
77
build = "build.rs"
88
license = "Apache-2.0"

runtime/src/constants.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
pub mod currency {
2222
use node_primitives::Balance;
2323

24-
pub const MILLICENTS: Balance = 1_000_000_000;
24+
pub const MILLICENTS: Balance = 10_000_000_000_000;
2525
pub const CENTS: Balance = 1_000 * MILLICENTS; // assume this is worth about a cent.
26-
pub const DOLLARS: Balance = 100 * CENTS;
26+
pub const ARGO: Balance = 100 * CENTS;
2727

2828
pub const fn deposit(items: u32, bytes: u32) -> Balance {
2929
items as Balance * 15 * CENTS + (bytes as Balance) * 6 * CENTS
@@ -51,7 +51,7 @@ pub mod time {
5151
/// `SLOT_DURATION` should have the same value.
5252
///
5353
/// <https://research.web3.foundation/en/latest/polkadot/block-production/Babe.html#-6.-practical-results>
54-
pub const MILLISECS_PER_BLOCK: Moment = 3000;
54+
pub const MILLISECS_PER_BLOCK: Moment = 6000;
5555
pub const SECS_PER_BLOCK: Moment = MILLISECS_PER_BLOCK / 1000;
5656

5757
// NOTE: Currently it is not possible to change the slot duration after the chain has started.

0 commit comments

Comments
 (0)