Compare commits

..

No commits in common. "f9b87d0d08293b8e48b655d26f066c97a0348932" and "88fb940bce63facb8da98c5950b79632c4d95811" have entirely different histories.

6 changed files with 75 additions and 268 deletions

14
Cargo.lock generated
View File

@ -3528,7 +3528,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-cli" name = "ghost-cli"
version = "0.7.179" version = "0.7.178"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"clap 4.5.4", "clap 4.5.4",
@ -3584,7 +3584,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-machine-primitives" name = "ghost-machine-primitives"
version = "0.7.179" version = "0.7.178"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"sc-sysinfo", "sc-sysinfo",
@ -3593,7 +3593,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-metrics" name = "ghost-metrics"
version = "0.7.179" version = "0.7.178"
dependencies = [ dependencies = [
"assert_cmd", "assert_cmd",
"bs58 0.5.1", "bs58 0.5.1",
@ -3648,7 +3648,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-networks" name = "ghost-networks"
version = "0.7.179" version = "0.7.178"
dependencies = [ dependencies = [
"frame-benchmarking", "frame-benchmarking",
"frame-support", "frame-support",
@ -3665,7 +3665,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-node" name = "ghost-node"
version = "0.7.179" version = "0.7.178"
dependencies = [ dependencies = [
"assert_cmd", "assert_cmd",
"color-eyre", "color-eyre",
@ -3696,7 +3696,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-rpc" name = "ghost-rpc"
version = "0.7.179" version = "0.7.178"
dependencies = [ dependencies = [
"ghost-core-primitives", "ghost-core-primitives",
"jsonrpsee", "jsonrpsee",
@ -3748,7 +3748,7 @@ dependencies = [
[[package]] [[package]]
name = "ghost-service" name = "ghost-service"
version = "0.7.179" version = "0.7.178"
dependencies = [ dependencies = [
"assert_matches", "assert_matches",
"async-trait", "async-trait",

View File

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

View File

@ -12,14 +12,14 @@ for num in $(seq 2 $num_ghosties); do
account_id=$(grep -m $num "wallet" $project_folder/service/ghosties | tail -n 1 | awk '{ print $6 }') 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 }') public_key=$(ghost key inspect $account_id --public | grep "SS58 Address" | awk '{ print $3 }')
echo -e "\t// $public_key" echo -e "\t// $public_key"
echo -e "\thex![\"${account_id:2}\"].into()," echo -e "\thex![\"${account_id:2}\"].into();"
done done
echo "];" echo "];"
echo -e "\n" echo -e "\n"
print_session_key() { print_session_key() {
echo -e "\t\t// $1" echo -e "\t\t// $1"
echo -e "\t\thex![\"${2:2}\"].$3()," echo -e "\t\thex![\"$2\"].$3(),"
} }
echo "let initial_authorities: Vec<(" echo "let initial_authorities: Vec<("

View File

@ -46,27 +46,12 @@ sanity_check() {
echo "[+] inspected account id for $3: $account_id" echo "[+] inspected account id for $3: $account_id"
num_keys=$(grep $account_id "$PROJECT_FOLDER/service/ghosties" | wc -l) num_keys=$(grep $account_id "$PROJECT_FOLDER/service/ghosties" | wc -l)
num_types=$(grep $account_id "$PROJECT_FOLDER/service/ghosties" | grep $3 | wc -l) num_types=$(grep $account_id "$PROJECT_FOLDER/service/ghosties" | grep $3 | wc -l)
if [ $num_keys = 1 ] && [ $num_types = 1 ]; then 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" echo "[-] inspected account id not found on 'ghosties' file or wrong key type"
exit 1 exit 1
fi 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() { extract_seed() {
name_with_spaces=$(echo $1 | tr '-' ' ') name_with_spaces=$(echo $1 | tr '-' ' ')
read -p "[?] path to the file with $name_with_spaces: (default: /etc/ghost/$1) " seed_path read -p "[?] path to the file with $name_with_spaces: (default: /etc/ghost/$1) " seed_path
@ -366,11 +351,13 @@ fi
if [ $CHECK_KEYS = true ]; then if [ $CHECK_KEYS = true ]; then
seed=$(extract_seed "wallet-key") seed=$(extract_seed "wallet-key")
sanity_check "sr25519" $seed "wallet" sanity_check "sr25519" $seed "wallet"
genesis_check "sr25519" $seed "wallet" echo "[+] local wallet key found in 'ghosties' with correct key type"
echo
seed=$(extract_seed "stash-key") seed=$(extract_seed "stash-key")
sanity_check "sr25519" $seed "stash" sanity_check "sr25519" $seed "stash"
genesis_check "sr25519" $seed "stash" echo "[+] local stash key from found in 'ghosties' with correct key type"
echo
seed=$(extract_seed "session-key") seed=$(extract_seed "session-key")
if [ $INSERT_KEYS = true ]; then if [ $INSERT_KEYS = true ]; then
@ -386,7 +373,8 @@ if [ $CHECK_KEYS = true ]; then
fi fi
sanity_check $scheme "$seed//$type" $type sanity_check $scheme "$seed//$type" $type
genesis_check $scheme "$seed//$type" $type echo "[+] inspected account id found in 'ghosties' file with correct key type"
if [ $INSERT_KEYS = true ]; then if [ $INSERT_KEYS = true ]; then
echo "[+] trying to make an 'author_insertKey' RPC call to $rpc_endpoint..." echo "[+] trying to make an 'author_insertKey' RPC call to $rpc_endpoint..."
curl --location $rpc_endpoint \ curl --location $rpc_endpoint \

File diff suppressed because one or more lines are too long

View File

@ -288,17 +288,17 @@ fn casper_staging_config_genesis() -> serde_json::Value {
use hex_literal::hex; use hex_literal::hex;
use sp_core::crypto::UncheckedInto; use sp_core::crypto::UncheckedInto;
// Following keys are used in genesis config for testing (casper) chains. // Following keys are used in genesis config for development chains.
// DO NOT use them in production chains such as ghost. // 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"
let endowed_accounts = vec![ let endowed_accounts = vec![
// sfErNwRgZ6ypB7wY8M2smXMZjxqUkc2TgUcNvC1JNQJFXS8bw // sfFmPT1hi3iySSwEdLpNRMJWo5pvFAKpfgjhDYAgL2i2qyEWx
hex!["328d3b7c3046ef7700937d99fb2e98ce2591682c2b5dcf3f562e4da157650237"].into(), hex!["5afaf4bba29ed7557a0112d9664c6c3d4acd96440f1b43f3bddeffdc2b3bc800"].into(),
// sfEwRjyvEQcpRQ1qbCZum27nEkTggKEt7DtqxwyYQULt9UuUN
hex!["3666e4e19f87bb8680495f31864ce1f1c69d4178002cc01911aef2cc7313f203"].into(),
// sfHcJxw5cgkvukZZyxcNUMCdbm9e7773orByLrGgAREka81TK
hex!["ac871e8bab00dd56ba3a1c0bd289357203dcaf10010b0b04ad7472870cd22a3c"].into(),
]; ];
// SECRET=$SECRET_SEED ./scripts/prepare-test-net.sh 4
let initial_authorities: Vec<( let initial_authorities: Vec<(
AccountId, AccountId,
AccountId, AccountId,
@ -308,46 +308,60 @@ fn casper_staging_config_genesis() -> serde_json::Value {
SlowClapId, SlowClapId,
)> = vec![ )> = vec![
( (
// sfFXZmnDVnkQ781J2gbqUpi7K5KgMWMdM4eeii74xxGgKYnNN //sfEdnhKt7YcjUP8iuvxNqTqUu7YpbARBeqFjAPRMH6yFuuPco
hex!["507045c82be367f95408466cd054ca39bfa52697a3ef22809af14cf9de304f02"].into(), hex!["28f303d3b1f821edda19bf6c97ee886edd85d7dc80e2500ab5f4888a19e40a50"].into(),
// sfFXZmnDVnkQ781J2gbqUpi7K5KgMWMdM4eeii74xxGgKYnNN //sfJxZKUmPStRqKF1sq5dpdgeCSCx5zRVa53c4q6d8SgfUUf7W
hex!["507045c82be367f95408466cd054ca39bfa52697a3ef22809af14cf9de304f02"].into(), hex!["e83494e12531b122043315d780c4b5b1153c52b7a94c42b5d61cd91b1f188e31"].into(),
// sfJeojACBa7WiH6tBwikBKAMU2oKmseEBD1GYUYATvfWuLcPa //sfFJMwRUaHrHPFL48SqQbvr39HFYvhgX4YKRmrN61i5vqmxnJ
hex!["daaaaab6a6e574099e24ae9bb75b543610edef9d374fa85a378edb573b47615f"].unchecked_into(), hex!["465e3f1220c774ba014defd7273c3a6e57336eb87c2bea9f04419c2eb6ee895c"].unchecked_into(),
// sfFdtzNxJdeEkgHxvk144rJKxf7wcYvgX5tqfgZRutW9YvAKE //sfEpnU74Gr7bRfTBR7pEKZdxx6SRXmw55atd9x4uJSWRJMGby
hex!["55446f9a7aa99ced06b317c80ce90d56b84e56526775683af2525969e8da0b64"].unchecked_into(), hex!["3155f271b9ca868a2eb980e35f17ee13525cb59e90848c1b0cc2ff306956c916"].unchecked_into(),
// sfE8gsMYAjAJHk5gyYZN7AW6pfmJ7V9H7xxWto24nmhzCUXaQ //sfEM1Bj59N9gnscE7t6fqBF1xvR4wvhmrxfviCQYDfrTY9dvJ
hex!["12c14850562021eb99f58f90ab624fb6cfaf3ac9228a92f8b60115fe6a6af15a"].unchecked_into(), hex!["1c25e311eade248d63ff2103d3a0bd8909ad618e5878b423c99bd043b47fd535"].unchecked_into(),
// sfE3GKSrKZzrZpdapJ2VGRpPor45T4D4i8QBZNumSNGqGv7PX //sfFyrauZLXLR44mBB58i73ZTnsgSHBjbgGxtXwoDTH751LaHE
hex!["0e9e698c7b2bf5ce3861cb4bc4ddf9e200237c282025b093ada850d764d12a35"].unchecked_into(), hex!["647d3fc5c00e3dd975838a92a72e06edc6d060c2e79e23672425da61812a8011"].unchecked_into(),
), ),
( (
// sfHLqWNC4hMKHhwvPWmWcxZsDPhCTQKgh1Ap7pm3qML5GBTBa //sfJEs3nDW3aemaCWeSjeuFtiGR3Zx5nD3uMAPvLoRkATdUicY
hex!["a0ba0196e6ee7e6b5b0553035c5cb5c04e9725001b5732839d0529cbc00c9600"].into(), hex!["c867f4f1417b0aa0c1cf9805866ea3e75d810a47a1ee8d302477768d95306542"].into(),
// sfHLqWNC4hMKHhwvPWmWcxZsDPhCTQKgh1Ap7pm3qML5GBTBa //sfHf6BwnPaRkMqLivmsTrHGWPQ1DsPM5pVzaeodUvpUGDEuhT
hex!["a0ba0196e6ee7e6b5b0553035c5cb5c04e9725001b5732839d0529cbc00c9600"].into(), hex!["aea5d94e3837022ddd3b006d77d38b70b87ebaa5423b358b871a3e05d9157e77"].into(),
// sfGA6tPPF8dAc8QpMCMjxitG3j8sXPhkdpm5bwz4UsXAApUiw //sfDzomQME6PRxB5LTEJsLYz7wxJUNNAnMop88Uj4E3wWVyu9x
hex!["6c4dd88b43e2011cf9a6a73d53446336ac9e04cdd4ca23587df63187ac455e49"].unchecked_into(), hex!["0cbe89b4ea4fd1d618f9d0db15522f2ca335893abb806a638c3e9bc43f022c78"].unchecked_into(),
// sfGxQZXFUQH1AXv82rpjiJHFs7YsdEuVGdyvKiS2Tajpvw6Se //sfK6CJTmSa5cGk51KFibhvbm1di6EPBnefGeCzXcprUQVokeV
hex!["8f9ea20bf4a807a8e710f7559dece86e94672b5b361de157bdaa5c1f37849f8d"].unchecked_into(), hex!["ee07cb1fd2fbc6b079ec3abb6c4866a35a3f1a25aef0bd5e50d8c188a98148c9"].unchecked_into(),
// sfGz2enFUR22cQ5ey61MdtPqbCeEWZA1wsCFFSLGaK7vKnv8C //sfK9Kq2pXUW5JZBMYSFRwKCWZoMEzqkq8wRVTtpo6zxdDENqG
hex!["90db5ed339a559ed157995a48d781f44c7df972dfba4bc855e4b59fa46438e17"].unchecked_into(), hex!["f06ade37706f898adce54b09f7e973e718b20fbec06eebf34e6d23046aa51d63"].unchecked_into(),
// sfEtwe5BoroNjkdLsvnjnMemUKiw8MS1X4YW8bepbbGvhS4LZ //sfEBQtB12x7xi5RPGXJiLWugdwAdDBsYePwssMLFBtr43dZiC
hex!["3481cdcbcf37a4669c29a78cf9ceb39383a10ef0a18b36b92d149fdd0c24ae00"].unchecked_into(), hex!["14d534940143dc260894c7ebfd013a0d5c65c2cd85ae89decb32d663a2628e66"].unchecked_into(),
), ),
( (
// sfGq75CrCrkcfqNzyyidu3D4jW3AoJSzL5tKKuv1UbS16ezzy //sfF4sfGLNyVtYMYZbte6A6kcncFi4hG65vPpbftQZxcBVbavS
hex!["8a0d0b66e827bf20e79f9a499317e73925ce4f422371067edfab690e43857f13"].into(), hex!["3c14dca7697cd193184708b00abf3c148c2d78eae6d8c102b84683ec6936123b"].into(),
// sfGq75CrCrkcfqNzyyidu3D4jW3AoJSzL5tKKuv1UbS16ezzy //sfJUHCESTjHwXKmHbzhApCDRgzUTcP5kcUUCATeBaTUwtyx8X
hex!["8a0d0b66e827bf20e79f9a499317e73925ce4f422371067edfab690e43857f13"].into(), hex!["d2a36dc75ef7933c2934b0855e2568a85c11347a48f0a1bfbcf1fc3757db1a07"].into(),
// sfJo2ogBpssRAU9ZPTvuXFZEdmJw9pKsPydLjXe8DypRScjzT //sfGS5ypMSqG3VSWyhKghZzCxSUdp4JC3Qaw3eu2oe8iaSy1TM
hex!["e0f0a776ecc9fa5e1f22e2fa001fe3fba5aea52b9444bc894b45589d42132475"].unchecked_into(), hex!["787eb8a2780f422382474cfa7e44493fffd86824963a0da22d0f0c82f9d39860"].unchecked_into(),
// sfHq3EVT1sqY7o5ki3zA6LEdRDfdFc29YaZN3w2Thhz6JD5ZF //sfFH1EKd6KCqCJ9HPPW5oBr5gigsEKBkHtFT4GoBqu5iUdYzZ
hex!["b63c5a0cf342b9b04931bc8ed74d7d0165ab99ab5f8a4514797d4b299a4501fe"].unchecked_into(), hex!["45554a1b748fed1f2f51f06970c8cd764edbdefd82d697993ddfe7f97290918c"].unchecked_into(),
// sfEj3wrDy9EDLCAodyEdQEYxJpNnM8Etaj3RJ5bCBRzdaDced //sfG28QRqEgkAgvpjZc3N86xDTebiwKiSvKYfg1NdwW2GNDbP6
hex!["2cf69452e9f2a8457119139408884941ed50f590c0fc0f2b044c4d82c69e4245"].unchecked_into(), hex!["6638fe19b4331656dacf3be9d6a81506fa71db1fbe4bd9db0ab8c9cc0e364f1b"].unchecked_into(),
// sfE32RmBp1xX4KRTphVGLUJBxLGPN3Dzg9BwCJktxMf3iEwck //sfFUfGqByAJGfe3e4vxiDJv5A1v1dp2piSNGpR8Kz5U9dFvMp
hex!["0e6fa6934f9e99fa84874f2ed9318825a0d5443a0ced984acfbd24ece72ba55e"].unchecked_into(), 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(),
), ),
]; ];