Compare commits

..

30 Commits

Author SHA1 Message Date
5a8e3ce9f2
fixed bug with GHOST_CLI_ARGS
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-16 21:59:00 +03:00
6a60c5a472
updated chain-spec
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-16 21:33:54 +03:00
af3895a5f0
give user write access to the folder with node
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
2024-10-16 13:59:35 +03:00
5af5647987
NODE_PATH renamed to BASE_PATH, plus additional sed for the template.service
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
2024-10-16 13:58:14 +03:00
6343fb573a
updated version of casper-runtime in Cargo.lock
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-16 13:34:12 +03:00
e184819d16
increment version for casper runtime
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-13 20:47:45 +03:00
9c5ab07cf9
small fix for the ghost executable version
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
2024-10-13 20:46:29 +03:00
f8168e525f
extra genesis preset for the casper runtime
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-13 20:39:35 +03:00
aaf842f57b
minimal requirements lowered to two stakerers at minimum
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-13 20:37:29 +03:00
f9b87d0d08
ghost-node version incremented
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
2024-10-13 19:17:29 +03:00
ee66e7a20c
additional check for keys in genesis added, purely experimented feature
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
2024-10-13 19:14:43 +03:00
bd70db94e5
genesis file for casper three way testnet
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-13 19:13:27 +03:00
c1a8cb16b2
'endowed_accounts' and 'initial_authorities' updated based on ghosties file
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-13 19:11:54 +03:00
e6e55febaf
0x prefixes removed
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
2024-10-13 19:09:46 +03:00
96163ee4d9
fix for generation of 'endowed_accounts'
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
2024-10-13 17:46:38 +03:00
88fb940bce
account removed, outdated
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-13 15:30:08 +03:00
f212707594
ghost_7's keys added
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-13 15:27:56 +03:00
ae0649a708
neptune's keys added
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-13 15:17:07 +03:00
a1423bc9e7
stash keys added for ghost_7|cosmos
Signed-off-by: ghost_7 <ghostie_7777@proton.me>
2024-10-12 12:45:01 -04:00
54f4a474ab
neptune keys
Signed-off-by: neptune <neptune3526@proton.me>
2024-10-12 10:15:59 -04:00
50ed40b9be
preparation script get data from ghosties file and create rust template code
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
2024-10-12 13:36:17 +03:00
7a4a50d588
stash keys added to ghosties file
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-12 13:34:20 +03:00
40f9dcd2ee
check-keys and insert-keys flags added
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
2024-10-12 13:32:17 +03:00
86d762fca3
rename template and make 'local identity' uppercase
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-11 12:54:51 +03:00
ea21a24c3e
keys for ghost_7 added to ghosties file
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-11 12:28:51 +03:00
e850ed9aea
session key helper added
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
2024-10-11 02:16:33 +03:00
37a7de8f93
Add_ghost7
Signed-off-by: ghost_7 <ghostie_7777@proton.me>
2024-10-09 13:37:44 -04:00
7b59411e5f
more or less working version, enough to get started
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
2024-10-07 20:36:11 +03:00
ba848bd479
node preparation basic script
Signed-off-by: Uncle Stinky <uncle.stinky@ghostchain.io>
2024-10-06 21:32:47 +03:00
a025d3b032
applied public keys of cosmos
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
2024-10-06 14:42:48 +03:00
12 changed files with 947 additions and 144 deletions

17
Cargo.lock generated
View File

@ -1186,7 +1186,7 @@ dependencies = [
[[package]]
name = "casper-runtime"
version = "3.5.17"
version = "3.5.18"
dependencies = [
"casper-runtime-constants",
"frame-benchmarking",
@ -1203,6 +1203,7 @@ dependencies = [
"ghost-networks",
"ghost-runtime-common",
"ghost-slow-clap",
"hex-literal",
"log",
"pallet-alliance",
"pallet-authority-discovery",
@ -3528,7 +3529,7 @@ dependencies = [
[[package]]
name = "ghost-cli"
version = "0.7.178"
version = "0.7.179"
dependencies = [
"cfg-if",
"clap 4.5.4",
@ -3584,7 +3585,7 @@ dependencies = [
[[package]]
name = "ghost-machine-primitives"
version = "0.7.178"
version = "0.7.179"
dependencies = [
"lazy_static",
"sc-sysinfo",
@ -3593,7 +3594,7 @@ dependencies = [
[[package]]
name = "ghost-metrics"
version = "0.7.178"
version = "0.7.179"
dependencies = [
"assert_cmd",
"bs58 0.5.1",
@ -3648,7 +3649,7 @@ dependencies = [
[[package]]
name = "ghost-networks"
version = "0.7.178"
version = "0.7.179"
dependencies = [
"frame-benchmarking",
"frame-support",
@ -3665,7 +3666,7 @@ dependencies = [
[[package]]
name = "ghost-node"
version = "0.7.178"
version = "0.7.179"
dependencies = [
"assert_cmd",
"color-eyre",
@ -3696,7 +3697,7 @@ dependencies = [
[[package]]
name = "ghost-rpc"
version = "0.7.178"
version = "0.7.179"
dependencies = [
"ghost-core-primitives",
"jsonrpsee",
@ -3748,7 +3749,7 @@ dependencies = [
[[package]]
name = "ghost-service"
version = "0.7.178"
version = "0.7.179"
dependencies = [
"assert_matches",
"async-trait",

View File

@ -17,7 +17,7 @@ homepage.workspace = true
[workspace.package]
license = "GPL-3.0-only"
authors = ["571nky", "57r37ch", "f4750"]
version = "0.7.178"
version = "0.7.179"
edition = "2021"
homepage = "https://ghostchain.io"
repository = "https://git.ghostchain.io/ghostchain/ghost-node"

View File

@ -1,6 +1,6 @@
[package]
name = "ghost-cli"
description = "Ghost Client Node"
description = "Implementation of a Ghost Client Node in Rust"
version.workspace = true
edition.workspace = true
authors.workspace = true

View File

@ -29,7 +29,7 @@ impl SubstrateCli for Cli {
}
fn impl_version() -> String {
env!("CARGO_PKG_DESCRIPTION").into()
env!("SUBSTRATE_CLI_IMPL_VERSION").into()
}
fn description() -> String {

View File

@ -1,6 +1,6 @@
[package]
name = "casper-runtime"
version = "3.5.17"
version = "3.5.18"
build = "build.rs"
description = "Runtime of the Casper Network"
edition.workspace = true
@ -17,6 +17,7 @@ codec = { features = ["derive", "max-encoded-len"], workspace = true }
scale-info = { features = ["derive"], workspace = true }
log = { workspace = true }
serde_json = { workspace = true }
hex-literal = { workspace = true, default-features = true }
frame-support = { workspace = true }
frame-system = { workspace = true }

View File

@ -1,4 +1,6 @@
use codec::Encode;
use pallet_staking::Forcing;
use sp_staking::StakerStatus;
use crate::{opaque::SessionKeys, BABE_GENESIS_EPOCH_CONFIG};
use primitives::{AccountId, AccountPublic};
@ -14,7 +16,7 @@ use sp_std::alloc::format;
use sp_std::vec::Vec;
use sp_std::prelude::*;
use sp_core::{sr25519, Pair, Public};
use sp_runtime::traits::IdentifyAccount;
use sp_runtime::{Perbill, traits::IdentifyAccount};
#[derive(Encode, Clone)]
struct PreparedNetworkData {
@ -62,7 +64,7 @@ fn get_authority_keys_from_seed(
)
}
fn testnet_accounts() -> Vec<AccountId> {
fn casper_testnet_accounts() -> Vec<AccountId> {
Vec::from([
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_account_id_from_seed::<sr25519::Public>("Bob"),
@ -79,7 +81,7 @@ fn testnet_accounts() -> Vec<AccountId> {
])
}
fn testnet_evm_accounts() -> Vec<(AccountId, u128, u8)> {
fn casper_testnet_evm_accounts() -> Vec<(AccountId, u128, u8)> {
vec![
// 01c928771aea942a1e7ac06adf2b73dfbc9a25d9eaa516e3673116af7f345198
(get_account_id_from_seed::<sr25519::Public>("1A69d2D5568D1878023EeB121a73d33B9116A760"), 1337 * CSPR, 1),
@ -92,7 +94,7 @@ fn testnet_evm_accounts() -> Vec<(AccountId, u128, u8)> {
]
}
fn testnet_evm_networks() -> Vec<(u32, Vec<u8>)> {
fn casper_testnet_evm_networks() -> Vec<(u32, Vec<u8>)> {
vec![
(1, PreparedNetworkData {
chain_name: "ethereum-mainnet".into(),
@ -128,7 +130,7 @@ fn casper_session_keys(
SessionKeys { babe, grandpa, authority_discovery, slow_clap }
}
fn casper_testnet_genesis(
fn testnet_config_genesis(
initial_authorities: Vec<(
AccountId,
AccountId,
@ -142,15 +144,16 @@ fn casper_testnet_genesis(
evm_networks: Option<Vec<(u32, Vec<u8>)>>,
) -> serde_json::Value {
let endowed_accounts: Vec<AccountId> =
endowed_accounts.unwrap_or_else(testnet_accounts);
endowed_accounts.unwrap_or_else(casper_testnet_accounts);
let ghost_accounts: Vec<(AccountId, u128, u8)> =
ghost_accounts.unwrap_or_else(testnet_evm_accounts);
ghost_accounts.unwrap_or_else(casper_testnet_evm_accounts);
let evm_networks: Vec<(u32, Vec<u8>)> =
evm_networks.unwrap_or_else(testnet_evm_networks);
evm_networks.unwrap_or_else(casper_testnet_evm_networks);
const ENDOWMENT: u128 = 1_000 * CSPR;
const STASH: u128 = 500 * CSPR;
serde_json::json!({
"balances": {
@ -179,6 +182,155 @@ fn casper_testnet_genesis(
})
.collect::<Vec<_>>(),
},
"staking": {
"validatorCount": initial_authorities.len() as u32,
"minimumValidatorCount": 1,
"invulnerables": initial_authorities
.iter()
.map(|x| x.0.clone())
.collect::<Vec<_>>(),
"forceEra": Forcing::NotForcing,
"slashRewardFraction": Perbill::from_percent(10),
"stakers": initial_authorities
.iter()
.map(|x| (x.0.clone(), x.0.clone(), STASH, StakerStatus::<AccountId>::Validator))
.collect::<Vec<_>>(),
},
"babe": {
"epochConfig": Some(BABE_GENESIS_EPOCH_CONFIG),
},
"ghostNetworks": {
"networks": evm_networks,
},
"ghostClaims": {
"total": ghost_accounts
.iter()
.fold(0, |acc, k| acc + k.1),
"membersAndRanks": ghost_accounts
.iter()
.map(|k| (k.0.clone(), k.2.clone()))
.collect::<Vec<_>>(),
},
})
}
// staging
fn casper_staging_config_genesis() -> serde_json::Value {
use hex_literal::hex;
use sp_core::crypto::UncheckedInto;
// Following keys are used in genesis config for testing (casper) chains.
// DO NOT use them in production chains such as ghost.
let endowed_accounts = vec![
// sfErNwRgZ6ypB7wY8M2smXMZjxqUkc2TgUcNvC1JNQJFXS8bw
hex!["328d3b7c3046ef7700937d99fb2e98ce2591682c2b5dcf3f562e4da157650237"].into(),
// sfEwRjyvEQcpRQ1qbCZum27nEkTggKEt7DtqxwyYQULt9UuUN
hex!["3666e4e19f87bb8680495f31864ce1f1c69d4178002cc01911aef2cc7313f203"].into(),
// sfHcJxw5cgkvukZZyxcNUMCdbm9e7773orByLrGgAREka81TK
hex!["ac871e8bab00dd56ba3a1c0bd289357203dcaf10010b0b04ad7472870cd22a3c"].into(),
];
let initial_authorities: Vec<(
AccountId,
AccountId,
BabeId,
GrandpaId,
AuthorityDiscoveryId,
SlowClapId,
)> = vec![
(
// sfFXZmnDVnkQ781J2gbqUpi7K5KgMWMdM4eeii74xxGgKYnNN
hex!["507045c82be367f95408466cd054ca39bfa52697a3ef22809af14cf9de304f02"].into(),
// sfFXZmnDVnkQ781J2gbqUpi7K5KgMWMdM4eeii74xxGgKYnNN
hex!["507045c82be367f95408466cd054ca39bfa52697a3ef22809af14cf9de304f02"].into(),
// sfJeojACBa7WiH6tBwikBKAMU2oKmseEBD1GYUYATvfWuLcPa
hex!["daaaaab6a6e574099e24ae9bb75b543610edef9d374fa85a378edb573b47615f"].unchecked_into(),
// sfFdtzNxJdeEkgHxvk144rJKxf7wcYvgX5tqfgZRutW9YvAKE
hex!["55446f9a7aa99ced06b317c80ce90d56b84e56526775683af2525969e8da0b64"].unchecked_into(),
// sfE8gsMYAjAJHk5gyYZN7AW6pfmJ7V9H7xxWto24nmhzCUXaQ
hex!["12c14850562021eb99f58f90ab624fb6cfaf3ac9228a92f8b60115fe6a6af15a"].unchecked_into(),
// sfE3GKSrKZzrZpdapJ2VGRpPor45T4D4i8QBZNumSNGqGv7PX
hex!["0e9e698c7b2bf5ce3861cb4bc4ddf9e200237c282025b093ada850d764d12a35"].unchecked_into(),
),
(
// sfHLqWNC4hMKHhwvPWmWcxZsDPhCTQKgh1Ap7pm3qML5GBTBa
hex!["a0ba0196e6ee7e6b5b0553035c5cb5c04e9725001b5732839d0529cbc00c9600"].into(),
// sfHLqWNC4hMKHhwvPWmWcxZsDPhCTQKgh1Ap7pm3qML5GBTBa
hex!["a0ba0196e6ee7e6b5b0553035c5cb5c04e9725001b5732839d0529cbc00c9600"].into(),
// sfGA6tPPF8dAc8QpMCMjxitG3j8sXPhkdpm5bwz4UsXAApUiw
hex!["6c4dd88b43e2011cf9a6a73d53446336ac9e04cdd4ca23587df63187ac455e49"].unchecked_into(),
// sfGxQZXFUQH1AXv82rpjiJHFs7YsdEuVGdyvKiS2Tajpvw6Se
hex!["8f9ea20bf4a807a8e710f7559dece86e94672b5b361de157bdaa5c1f37849f8d"].unchecked_into(),
// sfGz2enFUR22cQ5ey61MdtPqbCeEWZA1wsCFFSLGaK7vKnv8C
hex!["90db5ed339a559ed157995a48d781f44c7df972dfba4bc855e4b59fa46438e17"].unchecked_into(),
// sfEtwe5BoroNjkdLsvnjnMemUKiw8MS1X4YW8bepbbGvhS4LZ
hex!["3481cdcbcf37a4669c29a78cf9ceb39383a10ef0a18b36b92d149fdd0c24ae00"].unchecked_into(),
),
(
// sfGq75CrCrkcfqNzyyidu3D4jW3AoJSzL5tKKuv1UbS16ezzy
hex!["8a0d0b66e827bf20e79f9a499317e73925ce4f422371067edfab690e43857f13"].into(),
// sfGq75CrCrkcfqNzyyidu3D4jW3AoJSzL5tKKuv1UbS16ezzy
hex!["8a0d0b66e827bf20e79f9a499317e73925ce4f422371067edfab690e43857f13"].into(),
// sfJo2ogBpssRAU9ZPTvuXFZEdmJw9pKsPydLjXe8DypRScjzT
hex!["e0f0a776ecc9fa5e1f22e2fa001fe3fba5aea52b9444bc894b45589d42132475"].unchecked_into(),
// sfHq3EVT1sqY7o5ki3zA6LEdRDfdFc29YaZN3w2Thhz6JD5ZF
hex!["b63c5a0cf342b9b04931bc8ed74d7d0165ab99ab5f8a4514797d4b299a4501fe"].unchecked_into(),
// sfEj3wrDy9EDLCAodyEdQEYxJpNnM8Etaj3RJ5bCBRzdaDced
hex!["2cf69452e9f2a8457119139408884941ed50f590c0fc0f2b044c4d82c69e4245"].unchecked_into(),
// sfE32RmBp1xX4KRTphVGLUJBxLGPN3Dzg9BwCJktxMf3iEwck
hex!["0e6fa6934f9e99fa84874f2ed9318825a0d5443a0ced984acfbd24ece72ba55e"].unchecked_into(),
),
];
let ghost_accounts: Vec<(AccountId, u128, u8)> = casper_testnet_evm_accounts();
let evm_networks = casper_testnet_evm_networks();
const ENDOWMENT: u128 = 5_000 * CSPR;
const STASH: u128 = 500 * CSPR;
serde_json::json!({
"balances": {
"balances": endowed_accounts
.iter()
.map(|k: &AccountId| (k.clone(), ENDOWMENT))
.chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH)))
.collect::<Vec<_>>(),
},
"session": {
"keys": initial_authorities
.iter()
.map(|x| {
(
x.0.clone(),
x.0.clone(),
casper_session_keys(
x.2.clone(),
x.3.clone(),
x.4.clone(),
x.5.clone(),
),
)
})
.collect::<Vec<_>>(),
},
"staking": {
"validatorCount": 50,
"minimumValidatorCount": 4,
"stakers": initial_authorities
.iter()
.map(|x| {
(
x.0.clone(),
x.0.clone(),
STASH,
StakerStatus::<AccountId>::Validator,
)
})
.collect::<Vec<_>>(),
"invulnerables": initial_authorities.iter().map(|x| x.0.clone()).collect::<Vec<_>>(),
"forceEra": Forcing::ForceNone,
"slashRewardFraction": Perbill::from_percent(10)
},
"babe": {
"epochConfig": Some(BABE_GENESIS_EPOCH_CONFIG),
},
@ -199,7 +351,7 @@ fn casper_testnet_genesis(
// development
fn casper_development_config_genesis() -> serde_json::Value {
casper_testnet_genesis(
testnet_config_genesis(
vec![get_authority_keys_from_seed("Alice")],
None, None, None,
)
@ -207,7 +359,7 @@ fn casper_development_config_genesis() -> serde_json::Value {
// local
fn casper_local_config_genesis() -> serde_json::Value {
casper_testnet_genesis(
testnet_config_genesis(
vec![
get_authority_keys_from_seed("Alice"),
get_authority_keys_from_seed("Bob"),
@ -220,6 +372,7 @@ fn casper_local_config_genesis() -> serde_json::Value {
pub fn get_preset(id: &sp_genesis_builder::PresetId) -> Option<sp_std::vec::Vec<u8>> {
let patch = match id.try_into() {
Ok("development") => casper_development_config_genesis(),
Ok("staging") => casper_staging_config_genesis(),
Ok("local_testnet") => casper_local_config_genesis(),
_ => return None,
};
@ -233,5 +386,6 @@ pub fn preset_names() -> Vec<sp_genesis_builder::PresetId> {
Vec::from([
sp_genesis_builder::PresetId::from("local_testnet"),
sp_genesis_builder::PresetId::from("development"),
sp_genesis_builder::PresetId::from("staging"),
])
}

View File

@ -0,0 +1,38 @@
[Unit]
Description=Ghost Node
After=network.target
Documentation=https://git.ghostchain.io/ghostchain/ghost-node
[Service]
EnvironmentFile=-/etc/default/ghost
ExecStart=/usr/bin/ghost $GHOST_CLI_ARGS
ReadWritePaths=/var/lib/ghost
User=ghost
Restart=always
RestartSec=30
CapabilityBoundingSet=
LockPersonality=true
NoNewPrivileges=true
PrivateDevices=true
PrivateMounts=true
PrivateTmp=true
PrivateUsers=true
ProtectClock=true
ProtectControlGroups=true
ProtectHostname=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectSystem=strict
RemoveIPC=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_NETLINK AF_UNIX
RestrictNamespaces=false
RestrictSUIDSGID=true
SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=landlock_add_rule landlock_create_ruleset landlock_restrict_self seccomp mount umount2
SystemCallFilter=~@clock @module @reboot @swap @privileged
SystemCallFilter=pivot_root
UMask=0027
[Install]
WantedBy=multi-user.target

View File

@ -1,48 +1,46 @@
#!/usr/bin/env bash
set -e
if [ "$#" -ne 1 ]; then
echo "Please provide the number of initial validators!"
exit 1
fi
current_path=$(pwd)
current_script=$(realpath "$0")
script_folder=$(dirname "$current_script")
project_folder=("$script_folder/..")
generate_account_id() {
./target/release/ghostkey inspect ${3:-} ${4:-} "$SECRET//$1//$2" | grep "Account ID" | awk '{ print $3 }'
}
generate_address() {
./target/release/ghostkey inspect ${3:-} ${4:-} "$SECRET//$1//$2" | grep "SS58 Address" | awk '{ print $3 }'
}
generate_public_key() {
./target/release/ghostkey inspect ${3:-} ${4:-} "$SECRET//$1//$2" | grep "Public key (hex)" | awk '{ print $4 }'
}
generate_address_and_account_id() {
ACCOUNT=$(generate_account_id $1 $2 $3)
ADDRESS=$(generate_address $1 $2 $3)
if ${4:-false}; then
INTO="unchecked_into"
else
INTO="into"
fi
printf "//$ADDRESS\nhex![\"${ACCOUNT#'0x'}\"].$INTO(),"
}
V_NUM=$1
AUTHORITIES=""
for i in $(seq 1 $V_NUM); do
AUTHORITIES+="(\n"
AUTHORITIES+="$(generate_address_and_account_id $i stash)\n"
AUTHORITIES+="$(generate_address_and_account_id $i controller)\n"
AUTHORITIES+="$(generate_address_and_account_id $i babe '--scheme sr25519' true)\n"
AUTHORITIES+="$(generate_address_and_account_id $i grandpa '--scheme ed25519' true)\n"
AUTHORITIES+="$(generate_address_and_account_id $i authority_discovery '--scheme sr25519' true)\n"
AUTHORITIES+="$(generate_address_and_account_id $i slow_clap '--scheme sr25519' true)\n"
AUTHORITIES+="),\n"
num_ghosties=$(grep "Local identity" $project_folder/service/ghosties | wc -l)
echo "let endowed_accounts = vec!["
for num in $(seq 2 $num_ghosties); do
account_id=$(grep -m $num "wallet" $project_folder/service/ghosties | tail -n 1 | awk '{ print $6 }')
public_key=$(ghost key inspect $account_id --public | grep "SS58 Address" | awk '{ print $3 }')
echo -e "\t// $public_key"
echo -e "\thex![\"${account_id:2}\"].into(),"
done
echo "];"
echo -e "\n"
printf "$AUTHORITIES"
print_session_key() {
echo -e "\t\t// $1"
echo -e "\t\thex![\"${2:2}\"].$3(),"
}
echo "let initial_authorities: Vec<("
echo -e "\tAccountId,"
echo -e "\tAccountId,"
echo -e "\tBabeId,"
echo -e "\tGrandpaId,"
echo -e "\tAuthorityDiscoveryId,"
echo -e "\tSlowClapId,"
echo ")> = vec!["
for num in $(seq 2 $num_ghosties); do
echo -e "\t("
for key_word in $(echo stash stash babe gran audi slow); do
account_id=$(grep -m $num $key_word $project_folder/service/ghosties | tail -n 1 | awk '{ print $7 }')
public_key=$(ghost key inspect $account_id --public | grep "SS58 Address" | awk '{ print $3 }')
postfix="unchecked_into"
if [ $key_word = "stash" ]; then
postfix="into"
fi
print_session_key $public_key $account_id $postfix
done
echo -e "\t),"
done
echo "];"

410
scripts/starter.sh Executable file
View File

@ -0,0 +1,410 @@
#!/bin/bash
set -Ee
CHECK_KEYS=false
INSERT_KEYS=false
UNIT_FILE=false
SKIP_BUILD=false
SET_ENVIRONMENT=false
EXECUTABLE_PATH="/usr/bin/"
SPECIFICATION_PATH="/etc/ghost/"
BASE_PATH="/var/lib/ghost"
SPECIFICATION_NAME="casper"
TARGET="release"
CURRENT_PATH=$(pwd)
CURRENT_SCRIPT=$(realpath "$0")
SCRIPT_FOLDER=$(dirname "$CURRENT_SCRIPT")
PROJECT_FOLDER=("$SCRIPT_FOLDER/..")
final() {
cd $CURRENT_PATH
if [[ $1 -eq 1 ]]; then
echo "[-] error occured during execution"
else
echo "[+] execution finished"
fi
exit $1
}
prompt() {
while true; do
printf "$1 [y/N]: "
read yn
case $yn in
[Yy]* ) return 0;;
* ) return 1;;
esac
done
}
sanity_check() {
secret_seed=$(ghost key inspect --scheme="$1" "$2" | grep "Secret seed" | awk '{ print $3 }')
account_id=$(ghost key inspect --scheme="$1" "$2" | grep "Account ID" | awk '{ print $3 }')
echo "[+] inspected account id for $3: $account_id"
num_keys=$(grep $account_id "$PROJECT_FOLDER/service/ghosties" | wc -l)
num_types=$(grep $account_id "$PROJECT_FOLDER/service/ghosties" | grep $3 | wc -l)
if [ $num_keys = 1 ] && [ $num_types = 1 ]; then
echo "[+] local $3 key found in 'ghosties' with correct key type"
else
echo "[-] inspected account id not found on 'ghosties' file or wrong key type"
exit 1
fi
}
genesis_check() {
secret_seed=$(ghost key inspect --scheme="$1" "$2" | grep "Secret seed" | awk '{ print $3 }')
account_id=$(ghost key inspect --scheme="$1" "$2" | grep "Account ID" | awk '{ print $3 }')
num_keys=$(grep ${account_id:2} "$PROJECT_FOLDER/service/chain-specs/casper.json" | wc -l)
if [ ! $num_keys = 0 ]; then
echo "[+] found in genesis block"
else
echo "[-] not yet in genesis block"
fi
echo
}
extract_seed() {
name_with_spaces=$(echo $1 | tr '-' ' ')
read -p "[?] path to the file with $name_with_spaces: (default: /etc/ghost/$1) " seed_path
seed_path="${seed_path:-/etc/ghost/$1}"
if [ ! -f $seed_path ]; then
echo "[-] path to $name_with_spaces is not valid"
fi
seed=$(cat $seed_path)
echo $seed
}
help() {
echo -e "Ghost Node Build automation tool. Helper for Ghost Node environment preparation.\n"
echo -e "With no OPTION nothing will happen, possible OPTION:\n"
echo -e "-i, --set-environment\n\tSet up rust environment."
echo -e "-u, --unit-file\n\tCreation of systemd unit file."
echo -e "-m, --make-global\n\tStore compiled ghost executable and chain specification globally."
echo -e "-a, --set-arguments\n\tPrepare CLI arguments for running ghost node."
echo -e "-k, --check-keys\n\tCheck if your keys are already included in 'ghosties' file."
echo -e "-y, --insert-keys\n\tInsert session keys to the keystore via JSON RPC."
echo -e "-r, --release\n\tCompile node with '--release' flag."
echo -e "-p, --profile\n\tCompile node with '--profile [PROFILE]' flag."
echo -e "-f, --features\n\tCompilation features '--features=\"FEATURE1,FEATURE2\"'"
echo -e "-e, --executable-path\n\tPath to the executable ('/usr/lib/' is default)."
echo -e "-s, --base-path\n\tPath to the folder with chain database ('/var/lib/ghost' is default)."
echo -e "-c, --specification-path\n\tPath to specification ('/etc/ghost' is default)."
echo -e "-n, --specification-name\n\tSpecification name to be used ('casper' is default)."
echo -e "-h, --help\n\tPrints help information."
}
trap 'final "$?"' EXIT
clear
echo " ____ _ _ _ _ _"
echo " / ___| |__ ___ ___| |_ | \ | | ___ __| | ___"
echo "| | _| '_ \ / _ \/ __| __| | \| |/ _ \ / _' |/ _ \\"
echo "| |_| | | | | (_) \__ \ |_ | |\ | (_) | (_| | __/"
echo " \____|_| |_|\___/|___/\__| |_| \_|\___/ \__,_|\___|"
echo -e "\nCreated by st1nky (stinky@ghostchain.io)"
echo -e "Repository: https://git.ghostchain.io/ghostchain/ghost-node"
echo -e "Usage: local-builder.sh [OPTION]\n"
while [ $# -gt 0 ]; do
case "$1" in
--set-environment|-i)
SET_ENVIRONMENT=true
;;
--unit-file|-u)
UNIT_FILE=true
;;
--make-global|-m)
MAKE_GLOBAL=true
;;
--set-arguments|-a)
ARGUMENTS=true
;;
--check-keys|-k)
CHECK_KEYS=true
;;
--insert-keys|-k)
INSERT_KEYS=true
;;
--release|-r)
RELEASE="--release"
TARGET="release"
;;
--profile*|-p*)
if [[ "$1" != *=* ]]; then shift; fi
RELEASE="--profile=${1#*=}"
TARGET="${1#*=}"
;;
--feature*|-f*)
if [[ "$1" != *=* ]]; then shift; fi
FEATURES="--features=${1#*=}"
;;
--executable-path*|-e*)
if [[ "$1" != *=* ]]; then shift; fi
EXECUTABLE_PATH=$(echo ${1#*=}/ | tr -s /)
;;
--specification-path*|-c*)
if [[ "$1" != *=* ]]; then shift; fi
SPECIFICATION_PATH=$(echo ${1#*=}/ | tr -s /)
;;
--base-path*|-?)
if [[ "$1" != *=* ]]; then shift; fi
BASE_PATH=$(echo ${1#*=}/ | tr -s /)
;;
--specification-name*|-n*)
if [[ "$1" != *=* ]]; then shift; fi
SPECIFICATION_NAME="${1#*=}"
;;
--help|-h)
help
exit 0
;;
*)
help
exit 1
;;
esac
shift
done
if [[ $SET_ENVIRONMENT = true ]]; then
echo -e "\n"
echo "WARNING!!! THIS IS HIGHLY EXPERIMENTAL FLAG, USE IT ONLY ON YOUR"
echo "OWN RISK! NOT EVERY SYSTEM CHECKED AND PROVED TO BE WORKING AS"
echo "EXPECTED! FOR THOSE WHO FOUND BUG OR SOME INCONSISTENCY FEEL"
echo "FREE TO FILL ISSUE ON https://git.ghostchain.io/ghostchain/ghost-node/issues"
echo -e "\n"
if prompt "[?] are you brave enough?"; then
echo "[+] you were warned, I hope you know what you're doing"
else
echo "[-] aborting environment setup"
exit 1
fi
if command -v rustc >/dev/null 2>&1; then
echo "[+] rust already installed"
else
os_name=$(uname -s)
cd $HOME
if [ "$os_name" = "Darwin" ]; then
echo "[+] detected MacOS. installing dependencies via homebrew"
if command -v brew >/dev/null 2>&1; then
echo "[+] already installed: $(brew --version)"
else
if prompt "[?] do you want to install homebrew?"; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
else
echo "[-] cannot continue without homebrew"
exit 1
fi
fi
brew update
if prompt "[?] install git, cmake, openssl and protobuf?"; then
brew install git cmake openssl protobuf
else
echo "[!] assuming git, cmake, openssl and protobuf are present"
fi
elif [ "$os_name" == "Linux" ]; then
distro=$(cat /etc/*-release | tr '[:upper:]' '[:lower:]' | grep -Poi '(debian|ubuntu|arch|fedora|opensuse)' | uniq | head -n 1)
echo $distro
if [ "$distro" = "ubuntu" ]; then
echo "[+] ubuntu detected, using apt to install dependencies"
sudo apt update
sudo apt install --assume-yes git make clang curl libssl-dev protobuf-compiler
elif [ "$distro" = "debian" ]; then
echo "[+] debian detected, using apt to install dependencies"
sudo apt update
sudo apt install --assume-yes git make clang curl libssl-dev llvm libudev-dev protobuf-compiler
elif [ "$distro" = "arch" ]; then
echo "[+] arch linux detected, using pacman to install dependencies"
sudo pacman -Syu --needed --no-confirm curl git clang make protobuf
elif [ "$distro" = "fedora" ]; then
echo "[+] fedora detected, using dnf to install dependencies"
sudo dnf update --assumeyes
sudo dnf install --assumeyes clang curl git openssl-devel make protobuf-compiler perl
elif [ "$distro" = "opensuse" ]; then
echo "[+] openSUSE detected, using zypper to install dependencies"
sudo zypper install --no-confirm clang gcc gcc-c++ curl git openssl-devel llvm-devel libudev-devel make awk protobuf-devel
else
if prompt "[?] unknown linux distribution, unable to install dependencies. continue anyway?"; then
echo "[+] proceeding with unknown linux distribution"
else
echo "[-] aborting with uknown distribution"
exit 1
fi
fi
else
echo "[-] unknown operating system"
exit 1
fi
fi
if prompt "[?] setup the rust environment (e.g. WASM support)?"; then
rustup default stable
rustup update
rustup target add wasm32-unknown-unknown
rustup component add rust-src
fi
fi
if [[ ! -z $RELEASE ]]; then
if prompt "[?] 'cargo build $RELEASE $FEATURES' is what you want?"; then
cd $PROJECT_FOLDER
echo "[+] Starting build in 3 seconds..."
sleep 3
cargo build $RELEASE $FEATURES
fi
fi
if [[ $MAKE_GLOBAL = true ]]; then
cd $PROJECT_FOLDER
echo "[+] trying to copy executable to '$EXECUTABLE_PATH'"
sudo cp target/$TARGET/ghost $EXECUTABLE_PATH
cp service/chain-specs/$SPECIFICATION_NAME.json $SPECIFICATION_PATH
echo "[+] ghost executable copied in '$EXECUTABLE_PATH' from '$TARGET'"
echo "[+] specification '$SPECIFICATION_NAME.json' copied to '$SPECIFICATION_PATH'"
fi
if [ $UNIT_FILE = true ]; then
cd $SCRIPT_FOLDER
read -p "[?] name for the unit file (default: ghost-node.service) " unit_name
if [ -z $unit_name ]; then
unit_name="ghost-node"
fi
unit_name=$(echo "$unit_name" | sed -e "s/.service//g")
unit_name="$unit_name.service"
user_name="ghost"
if id $user_name > /dev/null 2>&1; then
echo "[+] user ghost found, continue for the user ghost"
else
echo "[!] user ghost not found"
if prompt "[?] do you want to create ghost user? (NOT RECOMMENDED: current $(whoami))"; then
sudo useradd --system --create-home $user_name
if [ ! -d $BASE_PATH ]; then
echo "[+] create folder for the node at '$BASE_PATH'"
sudo mkdir $BASE_PATH
fi
else
user_name=$(whoami)
fi
echo "[+] make $user_name owner of $BASE_PATH"
sudo chown -R "$user_name:" $BASE_PATH
fi
cp packaging/template.service /tmp/$unit_name
sed -i -e "s/User=ghost/User=$user_name/g" /tmp/$unit_name
sed -i -e "s#/ReadWritePaths=/var/lib/ghost#/ReadWritePaths=$BASE_PATH#g" /tmp/$unit_name
echo "[+] prepare unit file for the $unit_name"
sudo cp packaging/template.service /etc/systemd/system/$unit_name
echo "[+] reloading systemd because of updated unit file"
sudo systemctl daemon-reload
if prompt "[?] do you want to start the $unit_name?"; then
sudo systemctl restart $unit_name
fi
if prompt "[?] do you want to enable the $unit_name?"; then
sudo systemctl enable $unit_name
fi
fi
if [[ $ARGUMENTS = true ]]; then
echo "[+] setting-up default CLI arguments"
CLI_ARGS=()
read -p "[?] specify p2p protocol TCP port (default: 30333): " port
CLI_ARGS+=("--port=${port:-30333}")
read -p "[?] specify JSON-RPC server TCP port: (default: 9945): " rpc_port
CLI_ARGS+=("--rpc-port=${rpc_port:-9945}")
read -p "[?] specify the chain specification (default: /etc/ghost/casper.json): " chain
CLI_ARGS+=("--chain=${chain:-/etc/ghost/casper.json}")
read -p "[?] specify node's secret key file for p2p networking (default: /etc/ghost/node-key): " node_key
CLI_ARGS+=("--node-key-file=${node_key:-/etc/ghost/node-key}")
read -p "[?] specify name for the node (default: RANDOM_NAME): " node_name
if [[ ! -z $node_name ]]; then
CLI_ARGS+=("--name='$node_name'")
fi
CLI_ARGS+=("--validator")
if prompt "[?] disable validator mode?"; then
unset CLI_ARGS[-1]
fi
if prompt "[?] enable prometheus?"; then
read -p "[?] specify prometheus exporter TCP port: (default: 9615)" prometheus_port
CLI_ARGS+=("--prometheus-port=${prometheus_port:-9615}")
else
CLI_ARGS+=("--no-prometheus")
fi
read -p "[?] list of bootnodes if any: " bootnodes
if [ ! -z $bootnodes ]; then
CLI_ARGS+=("--bootnodes=$bootnodes")
fi
# default for now
CLI_ARGS+=("--base-path=$BASE_PATH")
CLI_ARGS+=("--state-pruning=archive")
CLI_ARGS+=("--blocks-pruning=archive")
CLI_ARGS+=("--rpc-methods=auto")
CLI_ARGS+=("--no-telemetry")
CLI_ARGS+=("--no-private-ip")
CLI_ARGS+=("--no-mdns")
CLI_ARGS+=("--no-hardware-benchmarks")
echo "[+] trying to save new node arguments"
echo "GHOST_CLI_ARGS=\"$(IFS=' '; echo "${CLI_ARGS[*]}")\"" > /tmp/ghost
sudo cp /tmp/ghost /etc/default/ghost
rm /tmp/ghost
echo "[+] new CLI arguments stored in '/etc/default/ghost'"
cat /etc/default/ghost
fi
if [ $CHECK_KEYS = true ]; then
seed=$(extract_seed "wallet-key")
sanity_check "sr25519" $seed "wallet"
genesis_check "sr25519" $seed "wallet"
seed=$(extract_seed "stash-key")
sanity_check "sr25519" $seed "stash"
genesis_check "sr25519" $seed "stash"
seed=$(extract_seed "session-key")
if [ $INSERT_KEYS = true ]; then
read -p "[?] JSON RPC endpoint to the node: (default: localhost:9945) " rpc_endpoint
rpc_endpoint="${rpc_endpoint:-localhost:9945}"
fi
for type in $(echo audi babe gran slow); do
echo "[+] parsing session key for [$type]"
scheme="sr25519"
if [ $type = "gran" ]; then
scheme="ed25519"
fi
sanity_check $scheme "$seed//$type" $type
genesis_check $scheme "$seed//$type" $type
if [ $INSERT_KEYS = true ]; then
echo "[+] trying to make an 'author_insertKey' RPC call to $rpc_endpoint..."
curl --location $rpc_endpoint \
--header "Content-Type: application/json" \
--data '{ "id":1, "jsonrpc":"2.0", "method":"author_insertKey", "params": ["'"$type"'", "'"$secret_seed"'", "'"$account_id"'"] }'
fi
echo
done
fi

File diff suppressed because one or more lines are too long

View File

@ -1,28 +1,39 @@
### TEMPLATE ###
local identity : ./PATH_TO_GHOST/ghost key inspect-node-key --bin --file PATH_TO_NODE_KEY
personal wallet : ./PATH_TO_GHOST/ghost key inspect $(cat PATH_TO_WALLET_KEY)
=======================================================================================================
session audi : ./PATH_TO_GHOST/ghost key inspect --scheme=sr25519 "$(cat PATH_TO_SESSION_KEY)//audi"
session babe : ./PATH_TO_GHOST/ghost key inspect --scheme=sr25519 "$(cat PATH_TO_SESSION_KEY)//babe"
session slow : ./PATH_TO_GHOST/ghost key inspect --scheme=sr25519 "$(cat PATH_TO_SESSION_KEY)//slow"
session gran : ./PATH_TO_GHOST/ghost key inspect --scheme=ed25519 "$(cat PATH_TO_SESSION_KEY)//gran"
Local identity : ./PATH_TO_GHOST/ghost key inspect-node-key --bin --file PATH_TO_NODE_KEY
Public key (hex) wallet : ./PATH_TO_GHOST/ghost key inspect $(cat PATH_TO_WALLET_KEY)
==================================================================================================================
Public key (hex) stash : ./PATH_TO_GHOST/ghost key inspect --scheme=sr25519 $(cat PATH_TO_STASH_KEY)
Public key (hex) audi : ./PATH_TO_GHOST/ghost key inspect --scheme=sr25519 "$(cat PATH_TO_SESSION_KEY)//audi"
Public key (hex) babe : ./PATH_TO_GHOST/ghost key inspect --scheme=sr25519 "$(cat PATH_TO_SESSION_KEY)//babe"
Public key (hex) slow : ./PATH_TO_GHOST/ghost key inspect --scheme=sr25519 "$(cat PATH_TO_SESSION_KEY)//slow"
Public key (hex) gran : ./PATH_TO_GHOST/ghost key inspect --scheme=ed25519 "$(cat PATH_TO_SESSION_KEY)//gran"
### str3tch aka Pierre ###
local identity : 12D3KooWFMiBom4mrJ57CaJZBxKWD1eDLYUyWLZzcjTaQW5crcNQ
Local identity : 12D3KooWFMiBom4mrJ57CaJZBxKWD1eDLYUyWLZzcjTaQW5crcNQ
Public key (hex) wallet : 0x328d3b7c3046ef7700937d99fb2e98ce2591682c2b5dcf3f562e4da157650237
===============================================================================================
Public key (hex) for stash : 0x507045c82be367f95408466cd054ca39bfa52697a3ef22809af14cf9de304f02
Public key (hex) for audi : 0x12c14850562021eb99f58f90ab624fb6cfaf3ac9228a92f8b60115fe6a6af15a
Public key (hex) for babe : 0xdaaaaab6a6e574099e24ae9bb75b543610edef9d374fa85a378edb573b47615f
Public key (hex) for slow : 0x0e9e698c7b2bf5ce3861cb4bc4ddf9e200237c282025b093ada850d764d12a35
Public key (hex) for gran : 0x55446f9a7aa99ced06b317c80ce90d56b84e56526775683af2525969e8da0b64
### ghost_7 ###
Local identity : 12D3KooWNZYbA3Ty1h8BqfMjzKVeJ83UTJxKUXj9zqnSirJZ51KR
Public key (hex) wallet : 0x3666e4e19f87bb8680495f31864ce1f1c69d4178002cc01911aef2cc7313f203
===============================================================================================
Public key (hex) for stash : 0xa0ba0196e6ee7e6b5b0553035c5cb5c04e9725001b5732839d0529cbc00c9600
Public key (hex) for audi : 0x90db5ed339a559ed157995a48d781f44c7df972dfba4bc855e4b59fa46438e17
Public key (hex) for babe : 0x6c4dd88b43e2011cf9a6a73d53446336ac9e04cdd4ca23587df63187ac455e49
Public key (hex) for slow : 0x3481cdcbcf37a4669c29a78cf9ceb39383a10ef0a18b36b92d149fdd0c24ae00
Public key (hex) for gran : 0x8f9ea20bf4a807a8e710f7559dece86e94672b5b361de157bdaa5c1f37849f8d
### Cosmos ###
local identity : 12D3KooWN1hdioQuovznNgw4nNfBqrp2qxJHvr6FdXH5KC55C2c1
Public key (hex) wallet : 0xfa9809611a6930c246fcd138475f1d9b5aa7b12e1573cfea5b40f7ddb24a7c74
=======================================================================
Public key (hex) for audi : 0xe8646430cc92137f8fb722ade64329e76698096185dff4170cae827b5e8bb86b
Public key (hex) for babe : 0xbc576d9ac94f37c7a3f530ee69774d52cefe2da3e829c430acbff4fb0068ee23
Public key (hex) for slow : 0x6a7d400964de8e7ddbd38c06b8927b0a988372a264b0669bf06819af25f83214
Public key (hex) for gran : 0x14fd4c3e746866cdc42099e33a5c2aea463dd561407c7bc7460eeb869fea5511
### Neptune ###
Local identity : 12D3KooWF9SWxz9dmy6vfndQhoxqCa7PESaoFWEiF8Jkqh4xKDRf
Public key (hex) wallet : 0xac871e8bab00dd56ba3a1c0bd289357203dcaf10010b0b04ad7472870cd22a3c
===============================================================================================
Public key (hex) for stash : 0x8a0d0b66e827bf20e79f9a499317e73925ce4f422371067edfab690e43857f13
Public key (hex) for audi : 0x2cf69452e9f2a8457119139408884941ed50f590c0fc0f2b044c4d82c69e4245
Public key (hex) for babe : 0xe0f0a776ecc9fa5e1f22e2fa001fe3fba5aea52b9444bc894b45589d42132475
Public key (hex) for slow : 0x0e6fa6934f9e99fa84874f2ed9318825a0d5443a0ced984acfbd24ece72ba55e
Public key (hex) for gran : 0xb63c5a0cf342b9b04931bc8ed74d7d0165ab99ab5f8a4514797d4b299a4501fe

View File

@ -288,17 +288,17 @@ fn casper_staging_config_genesis() -> serde_json::Value {
use hex_literal::hex;
use sp_core::crypto::UncheckedInto;
// Following keys are used in genesis config for development chains.
// DO NOT use them in production chains as the secret seed is public.
//
// SECRET_SEED="fall cargo frown step audit cover various urge urge six pattern leisure"
// ghostkey inspect -n casper "$SECRET_SEED"
// Following keys are used in genesis config for testing (casper) chains.
// DO NOT use them in production chains such as ghost.
let endowed_accounts = vec![
// sfFmPT1hi3iySSwEdLpNRMJWo5pvFAKpfgjhDYAgL2i2qyEWx
hex!["5afaf4bba29ed7557a0112d9664c6c3d4acd96440f1b43f3bddeffdc2b3bc800"].into(),
// sfErNwRgZ6ypB7wY8M2smXMZjxqUkc2TgUcNvC1JNQJFXS8bw
hex!["328d3b7c3046ef7700937d99fb2e98ce2591682c2b5dcf3f562e4da157650237"].into(),
// sfEwRjyvEQcpRQ1qbCZum27nEkTggKEt7DtqxwyYQULt9UuUN
hex!["3666e4e19f87bb8680495f31864ce1f1c69d4178002cc01911aef2cc7313f203"].into(),
// sfHcJxw5cgkvukZZyxcNUMCdbm9e7773orByLrGgAREka81TK
hex!["ac871e8bab00dd56ba3a1c0bd289357203dcaf10010b0b04ad7472870cd22a3c"].into(),
];
// SECRET=$SECRET_SEED ./scripts/prepare-test-net.sh 4
let initial_authorities: Vec<(
AccountId,
AccountId,
@ -308,60 +308,46 @@ fn casper_staging_config_genesis() -> serde_json::Value {
SlowClapId,
)> = vec![
(
//sfEdnhKt7YcjUP8iuvxNqTqUu7YpbARBeqFjAPRMH6yFuuPco
hex!["28f303d3b1f821edda19bf6c97ee886edd85d7dc80e2500ab5f4888a19e40a50"].into(),
//sfJxZKUmPStRqKF1sq5dpdgeCSCx5zRVa53c4q6d8SgfUUf7W
hex!["e83494e12531b122043315d780c4b5b1153c52b7a94c42b5d61cd91b1f188e31"].into(),
//sfFJMwRUaHrHPFL48SqQbvr39HFYvhgX4YKRmrN61i5vqmxnJ
hex!["465e3f1220c774ba014defd7273c3a6e57336eb87c2bea9f04419c2eb6ee895c"].unchecked_into(),
//sfEpnU74Gr7bRfTBR7pEKZdxx6SRXmw55atd9x4uJSWRJMGby
hex!["3155f271b9ca868a2eb980e35f17ee13525cb59e90848c1b0cc2ff306956c916"].unchecked_into(),
//sfEM1Bj59N9gnscE7t6fqBF1xvR4wvhmrxfviCQYDfrTY9dvJ
hex!["1c25e311eade248d63ff2103d3a0bd8909ad618e5878b423c99bd043b47fd535"].unchecked_into(),
//sfFyrauZLXLR44mBB58i73ZTnsgSHBjbgGxtXwoDTH751LaHE
hex!["647d3fc5c00e3dd975838a92a72e06edc6d060c2e79e23672425da61812a8011"].unchecked_into(),
// sfFXZmnDVnkQ781J2gbqUpi7K5KgMWMdM4eeii74xxGgKYnNN
hex!["507045c82be367f95408466cd054ca39bfa52697a3ef22809af14cf9de304f02"].into(),
// sfFXZmnDVnkQ781J2gbqUpi7K5KgMWMdM4eeii74xxGgKYnNN
hex!["507045c82be367f95408466cd054ca39bfa52697a3ef22809af14cf9de304f02"].into(),
// sfJeojACBa7WiH6tBwikBKAMU2oKmseEBD1GYUYATvfWuLcPa
hex!["daaaaab6a6e574099e24ae9bb75b543610edef9d374fa85a378edb573b47615f"].unchecked_into(),
// sfFdtzNxJdeEkgHxvk144rJKxf7wcYvgX5tqfgZRutW9YvAKE
hex!["55446f9a7aa99ced06b317c80ce90d56b84e56526775683af2525969e8da0b64"].unchecked_into(),
// sfE8gsMYAjAJHk5gyYZN7AW6pfmJ7V9H7xxWto24nmhzCUXaQ
hex!["12c14850562021eb99f58f90ab624fb6cfaf3ac9228a92f8b60115fe6a6af15a"].unchecked_into(),
// sfE3GKSrKZzrZpdapJ2VGRpPor45T4D4i8QBZNumSNGqGv7PX
hex!["0e9e698c7b2bf5ce3861cb4bc4ddf9e200237c282025b093ada850d764d12a35"].unchecked_into(),
),
(
//sfJEs3nDW3aemaCWeSjeuFtiGR3Zx5nD3uMAPvLoRkATdUicY
hex!["c867f4f1417b0aa0c1cf9805866ea3e75d810a47a1ee8d302477768d95306542"].into(),
//sfHf6BwnPaRkMqLivmsTrHGWPQ1DsPM5pVzaeodUvpUGDEuhT
hex!["aea5d94e3837022ddd3b006d77d38b70b87ebaa5423b358b871a3e05d9157e77"].into(),
//sfDzomQME6PRxB5LTEJsLYz7wxJUNNAnMop88Uj4E3wWVyu9x
hex!["0cbe89b4ea4fd1d618f9d0db15522f2ca335893abb806a638c3e9bc43f022c78"].unchecked_into(),
//sfK6CJTmSa5cGk51KFibhvbm1di6EPBnefGeCzXcprUQVokeV
hex!["ee07cb1fd2fbc6b079ec3abb6c4866a35a3f1a25aef0bd5e50d8c188a98148c9"].unchecked_into(),
//sfK9Kq2pXUW5JZBMYSFRwKCWZoMEzqkq8wRVTtpo6zxdDENqG
hex!["f06ade37706f898adce54b09f7e973e718b20fbec06eebf34e6d23046aa51d63"].unchecked_into(),
//sfEBQtB12x7xi5RPGXJiLWugdwAdDBsYePwssMLFBtr43dZiC
hex!["14d534940143dc260894c7ebfd013a0d5c65c2cd85ae89decb32d663a2628e66"].unchecked_into(),
// sfHLqWNC4hMKHhwvPWmWcxZsDPhCTQKgh1Ap7pm3qML5GBTBa
hex!["a0ba0196e6ee7e6b5b0553035c5cb5c04e9725001b5732839d0529cbc00c9600"].into(),
// sfHLqWNC4hMKHhwvPWmWcxZsDPhCTQKgh1Ap7pm3qML5GBTBa
hex!["a0ba0196e6ee7e6b5b0553035c5cb5c04e9725001b5732839d0529cbc00c9600"].into(),
// sfGA6tPPF8dAc8QpMCMjxitG3j8sXPhkdpm5bwz4UsXAApUiw
hex!["6c4dd88b43e2011cf9a6a73d53446336ac9e04cdd4ca23587df63187ac455e49"].unchecked_into(),
// sfGxQZXFUQH1AXv82rpjiJHFs7YsdEuVGdyvKiS2Tajpvw6Se
hex!["8f9ea20bf4a807a8e710f7559dece86e94672b5b361de157bdaa5c1f37849f8d"].unchecked_into(),
// sfGz2enFUR22cQ5ey61MdtPqbCeEWZA1wsCFFSLGaK7vKnv8C
hex!["90db5ed339a559ed157995a48d781f44c7df972dfba4bc855e4b59fa46438e17"].unchecked_into(),
// sfEtwe5BoroNjkdLsvnjnMemUKiw8MS1X4YW8bepbbGvhS4LZ
hex!["3481cdcbcf37a4669c29a78cf9ceb39383a10ef0a18b36b92d149fdd0c24ae00"].unchecked_into(),
),
(
//sfF4sfGLNyVtYMYZbte6A6kcncFi4hG65vPpbftQZxcBVbavS
hex!["3c14dca7697cd193184708b00abf3c148c2d78eae6d8c102b84683ec6936123b"].into(),
//sfJUHCESTjHwXKmHbzhApCDRgzUTcP5kcUUCATeBaTUwtyx8X
hex!["d2a36dc75ef7933c2934b0855e2568a85c11347a48f0a1bfbcf1fc3757db1a07"].into(),
//sfGS5ypMSqG3VSWyhKghZzCxSUdp4JC3Qaw3eu2oe8iaSy1TM
hex!["787eb8a2780f422382474cfa7e44493fffd86824963a0da22d0f0c82f9d39860"].unchecked_into(),
//sfFH1EKd6KCqCJ9HPPW5oBr5gigsEKBkHtFT4GoBqu5iUdYzZ
hex!["45554a1b748fed1f2f51f06970c8cd764edbdefd82d697993ddfe7f97290918c"].unchecked_into(),
//sfG28QRqEgkAgvpjZc3N86xDTebiwKiSvKYfg1NdwW2GNDbP6
hex!["6638fe19b4331656dacf3be9d6a81506fa71db1fbe4bd9db0ab8c9cc0e364f1b"].unchecked_into(),
//sfFUfGqByAJGfe3e4vxiDJv5A1v1dp2piSNGpR8Kz5U9dFvMp
hex!["4e390dd2dad59ff8709e0cb714bfccdbadde8b4e91d5931cb98ba6e6eb48a93b"].unchecked_into(),
),
(
//sfG7zdnf5t6JHbi9tBfkKesz13x7B9mSiYwDJfnDQ1LQwXwAi
hex!["6ab24f598a38e1d91004487faedadc8c338a7cb2a07e29899eccc7d106a2195e"].into(),
//sfDu1voz5vmiKXeiCHutmCp96C6LqLogsWE4rkaUZeZyhdt1B
hex!["085401d14ff3c620c76347a9e9a7e020fd3575d081c8352728db56ea6cc52677"].into(),
//sfH9hH4P98SohVs3Aj4cBoDXZvgYbF8dPXi3NfyEng5eMry9G
hex!["983a9aa148f94a54f313aca8537fb00f3c3353f70fafa8c14d4de22b44366f3c"].unchecked_into(),
//sfJQChmUKaDDQgzsAyZvuRNQZxV4CQ2qmxzmZk27tdWczKtRa
hex!["cf875474e8dfe94f4e9e0e2a4743e02c18cebf87b2c763710c9630f3fc94c9c4"].unchecked_into(),
//sfEMDH3w5xvZCwhXaMKYV7hsSL36evqHhqianntoiNDEtewLT
hex!["1c4e97776053b47b5b48035bab5f5f4afb3e6e13b15d1964195502cf40124c2a"].unchecked_into(),
//sfEPb5wWLKAHZH8k8KXpBtfnbBQPBBTkyv2ZQ1YP3GRKKpP1w
hex!["1e1e7f0781828178bd1237d9a8c2e057bbb15f2f46d1fc5fb316ebd9f5d1ad04"].unchecked_into(),
// sfGq75CrCrkcfqNzyyidu3D4jW3AoJSzL5tKKuv1UbS16ezzy
hex!["8a0d0b66e827bf20e79f9a499317e73925ce4f422371067edfab690e43857f13"].into(),
// sfGq75CrCrkcfqNzyyidu3D4jW3AoJSzL5tKKuv1UbS16ezzy
hex!["8a0d0b66e827bf20e79f9a499317e73925ce4f422371067edfab690e43857f13"].into(),
// sfJo2ogBpssRAU9ZPTvuXFZEdmJw9pKsPydLjXe8DypRScjzT
hex!["e0f0a776ecc9fa5e1f22e2fa001fe3fba5aea52b9444bc894b45589d42132475"].unchecked_into(),
// sfHq3EVT1sqY7o5ki3zA6LEdRDfdFc29YaZN3w2Thhz6JD5ZF
hex!["b63c5a0cf342b9b04931bc8ed74d7d0165ab99ab5f8a4514797d4b299a4501fe"].unchecked_into(),
// sfEj3wrDy9EDLCAodyEdQEYxJpNnM8Etaj3RJ5bCBRzdaDced
hex!["2cf69452e9f2a8457119139408884941ed50f590c0fc0f2b044c4d82c69e4245"].unchecked_into(),
// sfE32RmBp1xX4KRTphVGLUJBxLGPN3Dzg9BwCJktxMf3iEwck
hex!["0e6fa6934f9e99fa84874f2ed9318825a0d5443a0ced984acfbd24ece72ba55e"].unchecked_into(),
),
];
@ -374,10 +360,10 @@ fn casper_staging_config_genesis() -> serde_json::Value {
serde_json::json!({
"balances": {
"balances": endowed_accounts
.iter()
.map(|k: &AccountId| (k.clone(), ENDOWMENT))
.chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH)))
.collect::<Vec<_>>(),
.iter()
.map(|k: &AccountId| (k.clone(), ENDOWMENT))
.chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH)))
.collect::<Vec<_>>(),
},
"session": {
"keys": initial_authorities
@ -398,7 +384,7 @@ fn casper_staging_config_genesis() -> serde_json::Value {
},
"staking": {
"validatorCount": 50,
"minimumValidatorCount": 4,
"minimumValidatorCount": 2,
"stakers": initial_authorities
.iter()
.map(|x| {