difftreelog
Add chain spec entries for system properties and vesting
in: master
3 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3522,6 +3522,8 @@
"sc-rpc-api",
"sc-service",
"sc-transaction-pool",
+ "serde",
+ "serde_json",
"sp-api",
"sp-block-builder",
"sp-blockchain",
node/Cargo.tomldiffbeforeafterboth1[build-dependencies.substrate-build-script-utils]2git = 'https://github.com/usetech-llc/substrate.git'3branch = 'release_flexi'4version = '2.0.0'56[[bin]]7name = 'nft'89[package]10authors = ['UseTech Professional <https://usetech.com/blockchain>']11build = 'build.rs'12description = 'Substrate node nft'13edition = '2018'14homepage = 'https://usetech.com/blockchain'15license = 'Unlicense'16name = 'nft'17repository = 'https://github.com/substrate-developer-hub/nft/'18version = '2.0.0'1920[package.metadata.docs.rs]21targets = ['x86_64-unknown-linux-gnu']2223[dependencies]24futures = '0.3.4'25log = '0.4.8'26flexi_logger = "0.15.7"27parking_lot = '0.10.0'28structopt = '0.3.8'29jsonrpc-core = '15.0.0'3031# Substrate dependencies32nft-runtime = { path = '../runtime', version = '2.0.0' }33frame-benchmarking = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}34frame-benchmarking-cli = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}35pallet-transaction-payment-rpc = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}36sc-basic-authorship = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}37sc-cli = { features = ['wasmtime'], version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi' }38sc-client-api = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}39sc-consensus = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}40sc-consensus-aura = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}41sc-executor = { features = ['wasmtime'], version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi' }42sc-finality-grandpa = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}43sc-rpc = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}44sc-rpc-api = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}45sc-service = { features = ['wasmtime'], version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi' }46sc-transaction-pool = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}47sp-api = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}48sp-block-builder = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}49sp-blockchain = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}50sp-consensus = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}51sp-consensus-aura = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}52sp-core = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}53sp-finality-grandpa = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}54sp-inherents = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}55sp-runtime = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}56sp-transaction-pool = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}57sc-network = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'} 58substrate-frame-rpc-system = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}59pallet-contracts-rpc = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'} 6061[features]62default = []63runtime-benchmarks = ['nft-runtime/runtime-benchmarks']node/src/chain_spec.rsdiffbeforeafterboth--- a/node/src/chain_spec.rs
+++ b/node/src/chain_spec.rs
@@ -9,6 +9,7 @@
use sp_core::{sr25519, Pair, Public};
use sp_finality_grandpa::AuthorityId as GrandpaId;
use sp_runtime::traits::{IdentifyAccount, Verify};
+use serde_json::map::Map;
// Note this is the URL for the telemetry server
//const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
@@ -41,6 +42,11 @@
pub fn development_config() -> Result<ChainSpec, String> {
let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;
+ let mut properties = Map::new();
+ properties.insert("tokenSymbol".into(), "UniqueTest".into());
+ properties.insert("tokenDecimals".into(), 15.into());
+ properties.insert("ss58Format".into(), 0.into());
+
Ok(ChainSpec::from_genesis(
// Name
"Development",
@@ -71,7 +77,7 @@
// Protocol ID
None,
// Properties
- None,
+ Some(properties),
// Extensions
None,
))
@@ -132,6 +138,11 @@
endowed_accounts: Vec<AccountId>,
enable_println: bool,
) -> GenesisConfig {
+
+ let vested_accounts = vec![
+ get_account_id_from_seed::<sr25519::Public>("Bob"),
+ ];
+
GenesisConfig {
system: Some(SystemConfig {
code: wasm_binary.to_vec(),
@@ -155,7 +166,13 @@
}),
pallet_treasury: Some(Default::default()),
pallet_sudo: Some(SudoConfig { key: root_key }),
- pallet_vesting: Some(Default::default()),
+ pallet_vesting: Some(VestingConfig {
+ vesting: vested_accounts
+ .iter()
+ .cloned()
+ .map(|k| (k, 1000, 100, 1 << 98))
+ .collect(),
+ }),
pallet_nft: Some(NftConfig {
collection: vec![(
1,