Unverified Commit c80f7b6b authored by Peter Goodspeed-Niklaus's avatar Peter Goodspeed-Niklaus Committed by GitHub
Browse files

Revert "Remove Old Service, 2nd try (#1732)" (#1758)

This reverts commit 42fbca6e.
parent 42fbca6e
......@@ -4727,6 +4727,7 @@ dependencies = [
"futures 0.3.5",
"log 0.4.11",
"polkadot-service",
"polkadot-service-new",
"sc-cli",
"sc-client-api",
"sc-client-db",
......@@ -5359,6 +5360,65 @@ dependencies = [
[[package]]
name = "polkadot-service"
version = "0.8.24"
dependencies = [
"env_logger",
"frame-benchmarking",
"frame-system-rpc-runtime-api",
"futures 0.3.5",
"hex-literal 0.2.1",
"kusama-runtime",
"lazy_static",
"log 0.4.11",
"pallet-babe",
"pallet-im-online",
"pallet-staking",
"pallet-transaction-payment-rpc-runtime-api",
"parity-scale-codec",
"parking_lot 0.9.0",
"polkadot-primitives",
"polkadot-rpc",
"polkadot-runtime",
"polkadot-test-runtime-client",
"polkadot-validation",
"sc-authority-discovery",
"sc-block-builder",
"sc-chain-spec",
"sc-client-api",
"sc-client-db",
"sc-consensus",
"sc-consensus-babe",
"sc-executor",
"sc-finality-grandpa",
"sc-keystore",
"sc-network",
"sc-service",
"sc-telemetry",
"sc-transaction-pool",
"serde",
"slog",
"sp-api",
"sp-authority-discovery",
"sp-block-builder",
"sp-blockchain",
"sp-consensus",
"sp-consensus-babe",
"sp-core",
"sp-finality-grandpa",
"sp-inherents",
"sp-io",
"sp-offchain",
"sp-runtime",
"sp-session",
"sp-storage",
"sp-transaction-pool",
"sp-trie",
"substrate-prometheus-endpoint",
"westend-runtime",
]
[[package]]
name = "polkadot-service-new"
version = "0.8.3"
dependencies = [
"env_logger",
......@@ -5378,12 +5438,10 @@ dependencies = [
"polkadot-node-core-proposer",
"polkadot-node-subsystem",
"polkadot-overseer",
"polkadot-parachain",
"polkadot-primitives",
"polkadot-rpc",
"polkadot-runtime",
"polkadot-test-runtime-client",
"rococo-v1-runtime",
"sc-authority-discovery",
"sc-block-builder",
"sc-chain-spec",
......@@ -5487,7 +5545,6 @@ dependencies = [
"polkadot-parachain",
"polkadot-primitives",
"polkadot-runtime-common",
"polkadot-runtime-parachains",
"rustc-hex",
"serde",
"serde_derive",
......@@ -5549,7 +5606,6 @@ dependencies = [
"pallet-balances",
"pallet-staking",
"pallet-transaction-payment",
"polkadot-overseer",
"polkadot-primitives",
"polkadot-rpc",
"polkadot-runtime-common",
......
......@@ -14,7 +14,7 @@ readme = "README.md"
[dependencies]
cli = { package = "polkadot-cli", path = "cli" }
futures = "0.3.4"
service = { package = "polkadot-service", path = "node/service" }
service = { package = "polkadot-service", path = "service" }
parity-util-mem = { version = "*", default-features = false, features = ["jemalloc-global"] }
[dev-dependencies]
......@@ -36,7 +36,9 @@ members = [
"runtime/westend",
"runtime/test-runtime",
"runtime/test-runtime/client",
"service",
"statement-table",
"service",
"validation",
"node/collation-generation",
......@@ -77,6 +79,9 @@ panic = "unwind"
[features]
runtime-benchmarks=["cli/runtime-benchmarks"]
service-rewr= [
"cli/service-rewr",
]
# Configuration for building a .deb package - for use with `cargo-deb`
[package.metadata.deb]
......
......@@ -24,7 +24,8 @@ sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "mas
sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" }
service = { package = "polkadot-service", path = "../node/service", default-features = false, optional = true }
service = { package = "polkadot-service", path = "../service", default-features = false, optional = true }
service-new = { package = "polkadot-service-new", path = "../node/service", default-features = false, optional = true }
tokio = { version = "0.2.13", features = ["rt-threaded"], optional = true }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
......@@ -42,7 +43,7 @@ sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master",
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }
[features]
default = [ "wasmtime", "db", "cli", "full-node", "trie-memory-tracker" ]
default = [ "wasmtime", "db", "cli", "service-old", "trie-memory-tracker" ]
wasmtime = [ "sc-cli/wasmtime" ]
db = [ "service/db" ]
cli = [
......@@ -51,6 +52,7 @@ cli = [
"sc-service",
"frame-benchmarking-cli",
]
service-old = [ "service/full-node" ]
browser = [
"wasm-bindgen",
"wasm-bindgen-futures",
......@@ -58,5 +60,5 @@ browser = [
"service",
]
runtime-benchmarks = [ "service/runtime-benchmarks" ]
service-rewr = [ "service-new/full-node" ]
trie-memory-tracker = [ "sp-trie/memory-tracker" ]
full-node = [ "service/full-node" ]
......@@ -79,10 +79,6 @@ pub struct RunCmd {
#[structopt(long = "force-westend")]
pub force_westend: bool,
/// Force using Rococo native runtime.
#[structopt(long = "force-rococo")]
pub force_rococo: bool,
/// Enable the authority discovery module on validator or sentry nodes.
///
/// When enabled:
......
......@@ -15,7 +15,10 @@
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
use log::info;
#[cfg(not(feature = "service-rewr"))]
use service::{IdentifyVariant, self};
#[cfg(feature = "service-rewr")]
use service_new::{IdentifyVariant, self as service};
use sc_cli::{SubstrateCli, Result, RuntimeVersion, Role};
use crate::cli::{Cli, Subcommand};
use std::sync::Arc;
......@@ -45,7 +48,7 @@ impl SubstrateCli for Cli {
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
let id = if id == "" {
let n = get_exec_name().unwrap_or_default();
["polkadot", "kusama", "westend", "rococo"].iter()
["polkadot", "kusama", "westend"].iter()
.cloned()
.find(|&chain| n.starts_with(chain))
.unwrap_or("polkadot")
......@@ -63,9 +66,6 @@ impl SubstrateCli for Cli {
"westend-dev" => Box::new(service::chain_spec::westend_development_config()?),
"westend-local" => Box::new(service::chain_spec::westend_local_testnet_config()?),
"westend-staging" => Box::new(service::chain_spec::westend_staging_testnet_config()?),
"rococo-staging" => Box::new(service::chain_spec::rococo_staging_testnet_config()?),
"rococo-local" => Box::new(service::chain_spec::rococo_local_testnet_config()?),
"rococo" => Box::new(service::chain_spec::rococo_config()?),
path => {
let path = std::path::PathBuf::from(path);
......@@ -75,9 +75,7 @@ impl SubstrateCli for Cli {
// When `force_*` is given or the file name starts with the name of one of the known chains,
// we use the chain spec for the specific chain.
if self.run.force_rococo || starts_with("rococo") {
Box::new(service::RococoChainSpec::from_json_file(path)?)
} else if self.run.force_kusama || starts_with("kusama") {
if self.run.force_kusama || starts_with("kusama") {
Box::new(service::KusamaChainSpec::from_json_file(path)?)
} else if self.run.force_westend || starts_with("westend") {
Box::new(service::WestendChainSpec::from_json_file(path)?)
......@@ -93,8 +91,6 @@ impl SubstrateCli for Cli {
&service::kusama_runtime::VERSION
} else if spec.is_westend() {
&service::westend_runtime::VERSION
} else if spec.is_rococo() {
&service::rococo_runtime::VERSION
} else {
&service::polkadot_runtime::VERSION
}
......@@ -151,7 +147,7 @@ pub fn run() -> Result<()> {
None,
authority_discovery_enabled,
grandpa_pause,
).map(|full| full.task_manager),
).map(|r| r.0),
}
})
},
......@@ -183,14 +179,10 @@ pub fn run() -> Result<()> {
runner.async_run(|config| {
let chain_spec = config.chain_spec.cloned_box();
let network_config = config.network.clone();
let service::NewFull {
task_manager,
client,
network_status_sinks,
..
} = service::build_full(
config, None, authority_discovery_enabled, grandpa_pause,
)?;
let service::NewFull { task_manager, client, network_status_sinks, .. }
= service::new_full_nongeneric(
config, None, authority_discovery_enabled, grandpa_pause, false,
)?;
let client = Arc::new(client);
Ok((cmd.run(chain_spec, network_config, client, network_status_sinks), task_manager))
......
......@@ -26,10 +26,17 @@ mod cli;
#[cfg(feature = "cli")]
mod command;
#[cfg(not(feature = "service-rewr"))]
pub use service::{
self,
ProvideRuntimeApi, CoreApi, IdentifyVariant,
Block, RuntimeApiCollection, TFullClient
ProvideRuntimeApi, CoreApi, ParachainHost, IdentifyVariant,
Block, self, RuntimeApiCollection, TFullClient
};
#[cfg(feature = "service-rewr")]
pub use service_new::{
self as service,
ProvideRuntimeApi, CoreApi, ParachainHost, IdentifyVariant,
Block, self, RuntimeApiCollection, TFullClient
};
#[cfg(feature = "cli")]
......
[package]
name = "polkadot-service"
name = "polkadot-service-new"
version = "0.8.3"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
# Substrate Client
authority-discovery = { package = "sc-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" }
babe = { package = "sc-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" }
grandpa = { package = "sc-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" }
parking_lot = "0.9.0"
serde = { version = "1.0.102", features = ["derive"] }
lazy_static = "1.4.0"
log = "0.4.8"
futures = "0.3.4"
slog = "2.5.2"
hex-literal = "0.2.1"
polkadot-primitives = { path = "../../primitives" }
polkadot-runtime = { path = "../../runtime/polkadot" }
polkadot-overseer = { path = "../overseer" }
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../subsystem" }
kusama-runtime = { path = "../../runtime/kusama" }
westend-runtime = { path = "../../runtime/westend" }
polkadot-rpc = { path = "../../rpc" }
polkadot-node-core-proposer = { path = "../core/proposer" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
service = { package = "sc-service", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
telemetry = { package = "sc-telemetry", git = "https://github.com/paritytech/substrate", branch = "master" }
# Substrate Primitives
authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" }
babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-storage = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" }
consensus_common = { package = "sp-consensus", git = "https://github.com/paritytech/substrate", branch = "master" }
grandpa = { package = "sc-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "master" }
grandpa_primitives = { package = "sp-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "master" }
inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-offchain = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-storage = { git = "https://github.com/paritytech/substrate", branch = "master" }
service = { package = "sc-service", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
telemetry = { package = "sc-telemetry", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" }
# Substrate Pallets
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master" }
authority-discovery = { package = "sc-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" }
authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" }
babe = { package = "sc-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" }
babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
# Substrate Other
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master" }
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/paritytech/substrate", branch = "master" }
# External Crates
codec = { package = "parity-scale-codec", version = "1.3.4" }
futures = "0.3.4"
hex-literal = "0.2.1"
lazy_static = "1.4.0"
log = "0.4.8"
parking_lot = "0.9.0"
serde = { version = "1.0.102", features = ["derive"] }
slog = "2.5.2"
# Polkadot
kusama-runtime = { path = "../../runtime/kusama" }
polkadot-node-core-proposer = { path = "../core/proposer" }
polkadot-overseer = { path = "../overseer" }
polkadot-parachain = { path = "../../parachain" }
polkadot-primitives = { path = "../../primitives" }
polkadot-rpc = { path = "../../rpc" }
polkadot-runtime = { path = "../../runtime/polkadot" }
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../subsystem" }
rococo-runtime = { package = "rococo-v1-runtime", path = "../../runtime/rococo-v1" }
westend-runtime = { path = "../../runtime/westend" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-offchain = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master" }
prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/paritytech/substrate", branch = "master" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master" }
[dev-dependencies]
polkadot-test-runtime-client = { path = "../../runtime/test-runtime/client" }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -16,31 +16,28 @@
//! Polkadot chain configurations.
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use babe_primitives::AuthorityId as BabeId;
use grandpa::AuthorityId as GrandpaId;
use hex_literal::hex;
use kusama::constants::currency::DOTS as KSM;
use kusama_runtime as kusama;
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
use pallet_staking::Forcing;
use polkadot::constants::currency::DOTS;
use sp_core::{Pair, Public, crypto::UncheckedInto, sr25519};
use polkadot_primitives::v1::{AccountId, AccountPublic, ValidatorId};
use polkadot_runtime as polkadot;
use rococo_runtime as rococo;
use rococo_runtime::constants::currency::DOTS as ROC;
use kusama_runtime as kusama;
use westend_runtime as westend;
use polkadot::constants::currency::DOTS;
use kusama::constants::currency::DOTS as KSM;
use westend::constants::currency::DOTS as WND;
use sc_chain_spec::{ChainSpecExtension, ChainType};
use serde::{Deserialize, Serialize};
use sp_core::{crypto::UncheckedInto, sr25519, Pair, Public};
use sp_runtime::{traits::IdentifyAccount, Perbill};
use serde::{Serialize, Deserialize};
use telemetry::TelemetryEndpoints;
use westend::constants::currency::DOTS as WND;
use westend_runtime as westend;
use hex_literal::hex;
use babe_primitives::AuthorityId as BabeId;
use grandpa::AuthorityId as GrandpaId;
use pallet_im_online::sr25519::{AuthorityId as ImOnlineId};
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use pallet_staking::Forcing;
const POLKADOT_STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
const KUSAMA_STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
const WESTEND_STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
const ROCOCO_STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
const DEFAULT_PROTOCOL_ID: &str = "dot";
/// Node `ChainSpec` extensions.
......@@ -56,32 +53,34 @@ pub struct Extensions {
pub bad_blocks: sc_client_api::BadBlocks<polkadot_primitives::v1::Block>,
}
/// The `ChainSpec` parametrised for the polkadot runtime.
pub type PolkadotChainSpec = service::GenericChainSpec<polkadot::GenesisConfig, Extensions>;
/// The `ChainSpec` parametrised for the kusama runtime.
pub type KusamaChainSpec = service::GenericChainSpec<kusama::GenesisConfig, Extensions>;
/// The `ChainSpec parametrised for polkadot runtime`.
pub type PolkadotChainSpec = service::GenericChainSpec<
polkadot::GenesisConfig,
Extensions,
>;
/// The `ChainSpec` parametrised for the westend runtime.
pub type WestendChainSpec = service::GenericChainSpec<westend::GenesisConfig, Extensions>;
/// The `ChainSpec parametrised for kusama runtime`.
pub type KusamaChainSpec = service::GenericChainSpec<
kusama::GenesisConfig,
Extensions,
>;
/// The `ChainSpec` parametrized for the rococo runtime.
pub type RococoChainSpec = service::GenericChainSpec<rococo::GenesisConfig, Extensions>;
/// The `ChainSpec parametrised for westend runtime`.
pub type WestendChainSpec = service::GenericChainSpec<
westend::GenesisConfig,
Extensions,
>;
pub fn polkadot_config() -> Result<PolkadotChainSpec, String> {
PolkadotChainSpec::from_json_bytes(&include_bytes!("../res/polkadot.json")[..])
PolkadotChainSpec::from_json_bytes(&include_bytes!("../../../service/res/polkadot.json")[..])
}
pub fn kusama_config() -> Result<KusamaChainSpec, String> {
KusamaChainSpec::from_json_bytes(&include_bytes!("../res/kusama.json")[..])
KusamaChainSpec::from_json_bytes(&include_bytes!("../../../service/res/kusama.json")[..])
}
pub fn westend_config() -> Result<PolkadotChainSpec, String> {
PolkadotChainSpec::from_json_bytes(&include_bytes!("../res/westend.json")[..])
}
pub fn rococo_config() -> Result<PolkadotChainSpec, String> {
PolkadotChainSpec::from_json_bytes(&include_bytes!("../res/rococo.json")[..])
PolkadotChainSpec::from_json_bytes(&include_bytes!("../../../service/res/westend.json")[..])
}
fn polkadot_session_keys(
......@@ -89,15 +88,9 @@ fn polkadot_session_keys(
grandpa: GrandpaId,
im_online: ImOnlineId,
parachain_validator: ValidatorId,
authority_discovery: AuthorityDiscoveryId,
authority_discovery: AuthorityDiscoveryId
) -> polkadot::SessionKeys {
polkadot::SessionKeys {
babe,
grandpa,
im_online,
parachain_validator,
authority_discovery,
}
polkadot::SessionKeys { babe, grandpa, im_online, parachain_validator, authority_discovery }
}
fn kusama_session_keys(
......@@ -105,15 +98,9 @@ fn kusama_session_keys(
grandpa: GrandpaId,
im_online: ImOnlineId,
parachain_validator: ValidatorId,
authority_discovery: AuthorityDiscoveryId,
authority_discovery: AuthorityDiscoveryId
) -> kusama::SessionKeys {
kusama::SessionKeys {
babe,
grandpa,
im_online,
parachain_validator,
authority_discovery,
}
kusama::SessionKeys { babe, grandpa, im_online, parachain_validator, authority_discovery }
}
fn westend_session_keys(
......@@ -121,29 +108,9 @@ fn westend_session_keys(
grandpa: GrandpaId,
im_online: ImOnlineId,
parachain_validator: ValidatorId,
authority_discovery: AuthorityDiscoveryId,
authority_discovery: AuthorityDiscoveryId
) -> westend::SessionKeys {
westend::SessionKeys {
babe,
grandpa,
im_online,
parachain_validator,
authority_discovery,
}
}
fn rococo_session_keys(
babe: BabeId,
_grandpa: GrandpaId,
im_online: ImOnlineId,
parachain_validator: ValidatorId,
_authority_discovery: AuthorityDiscoveryId
) -> rococo_runtime::SessionKeys {
rococo_runtime::SessionKeys {
babe,
im_online,
parachain_validator,
}
westend::SessionKeys { babe, grandpa, im_online, parachain_validator, authority_discovery }
}
fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::GenesisConfig {
......@@ -157,7 +124,7 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene
GrandpaId,
ImOnlineId,
ValidatorId,
AuthorityDiscoveryId,
AuthorityDiscoveryId
)> = vec![];
const ENDOWMENT: u128 = 1_000_000 * DOTS;
......@@ -169,49 +136,32 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene
changes_trie_config: Default::default(),
}),
pallet_balances: Some(polkadot::BalancesConfig {
balances: endowed_accounts
.iter()
balances: endowed_accounts.iter()
.map(|k: &AccountId| (k.clone(), ENDOWMENT))
.chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH)))
.collect(),
}),
pallet_indices: Some(polkadot::IndicesConfig { indices: vec![] }),
pallet_indices: Some(polkadot::IndicesConfig {
indices: vec![],
}),
pallet_session: Some(polkadot::SessionConfig {
keys: initial_authorities
.iter()
.map(|x| {
(
x.0.clone(),
x.0.clone(),
polkadot_session_keys(
x.2.clone(),
x.3.clone(),
x.4.clone(),
x.5.clone(),
x.6.clone(),
),
)
})
.collect::<Vec<_>>(),
keys: initial_authorities.iter().map(|x| (
x.0.clone(),
x.0.clone(),
polkadot_session_keys(x.2.clone(), x.3.clone(), x.4.clone(), x.5.clone(), x.6.clone()),
)).collect::<Vec<_>>(),
}),
pallet_staking: Some(polkadot::StakingConfig {
validator_count: 50,
minimum_validator_count: 4,
stakers: initial_authorities
.iter()
.map(|x| {