mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
Update node to use pallet sessions
This commit is contained in:
@@ -16,6 +16,7 @@ clap = { version = "4", features = ["derive"] }
|
||||
jsonrpsee = { version = "0.15", features = ["server"] }
|
||||
|
||||
sp-core = { git = "https://github.com/serai-dex/substrate" }
|
||||
sp-application-crypto = { git = "https://github.com/serai-dex/substrate" }
|
||||
sp-runtime = { git = "https://github.com/serai-dex/substrate" }
|
||||
sp-timestamp = { git = "https://github.com/serai-dex/substrate" }
|
||||
sp-inherents = { git = "https://github.com/serai-dex/substrate" }
|
||||
@@ -46,6 +47,7 @@ sc-rpc-api = { git = "https://github.com/serai-dex/substrate" }
|
||||
substrate-frame-rpc-system = { git = "https://github.com/serai-dex/substrate" }
|
||||
pallet-transaction-payment-rpc = { git = "https://github.com/serai-dex/substrate" }
|
||||
|
||||
pallet-tendermint = { path = "../pallet-tendermint", default-features = false }
|
||||
serai-runtime = { path = "../runtime" }
|
||||
serai-consensus = { path = "../consensus" }
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
use sc_service::ChainType;
|
||||
|
||||
use sp_core::{Pair as PairTrait, sr25519::Pair};
|
||||
use pallet_tendermint::crypto::Public;
|
||||
|
||||
use serai_runtime::{WASM_BINARY, AccountId, GenesisConfig, SystemConfig, BalancesConfig};
|
||||
use serai_runtime::{
|
||||
WASM_BINARY, AccountId, opaque::SessionKeys, GenesisConfig, SystemConfig, BalancesConfig,
|
||||
SessionConfig,
|
||||
};
|
||||
|
||||
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig>;
|
||||
|
||||
@@ -15,12 +19,16 @@ fn account_id_from_name(name: &'static str) -> AccountId {
|
||||
}
|
||||
|
||||
fn testnet_genesis(wasm_binary: &[u8], endowed_accounts: Vec<AccountId>) -> GenesisConfig {
|
||||
let alice = account_id_from_name("Alice");
|
||||
GenesisConfig {
|
||||
system: SystemConfig { code: wasm_binary.to_vec() },
|
||||
balances: BalancesConfig {
|
||||
balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(),
|
||||
},
|
||||
transaction_payment: Default::default(),
|
||||
session: SessionConfig {
|
||||
keys: vec![(alice, alice, SessionKeys { tendermint: Public::from(alice) })],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user