Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
383a414
Remove VestingAccount
icodezjb Jan 27, 2022
e610a6b
Fix chain specs
icodezjb Jan 28, 2022
825583c
Update rust-toolchain
icodezjb Jan 28, 2022
796d923
Update make test and benchmark
icodezjb Jan 28, 2022
5812a95
Update CI
icodezjb Jan 28, 2022
43e8b2e
Run `make format` and `make clippy`
icodezjb Jan 28, 2022
8019104
Update CI
icodezjb Jan 28, 2022
bebe98f
Quick fix
icodezjb Jan 28, 2022
1495668
Support try-runtime
icodezjb Jan 28, 2022
d36bd18
Remove pallet-randomness-collective-flip
icodezjb Feb 7, 2022
59b36b5
Migrate elections-phragmen
icodezjb Feb 7, 2022
99f71bb
Migrate PalletVersion to StorageVersion
icodezjb Feb 8, 2022
8849287
Migrate pallet-babe epoch config
icodezjb Feb 8, 2022
8cb536b
Migrate frame-system AccountInfo to AccountInfoWithTripleRefCount
icodezjb Feb 8, 2022
1462973
Migrate prefix `GrandpaFinality` -> `Grandpa`
icodezjb Feb 8, 2022
f1544a8
Migrate prefix `Instance1Collective` -> `Council`
icodezjb Feb 9, 2022
f425853
Migrate prefix `Instance2Collective` -> `TechnicalCommittee`
icodezjb Feb 9, 2022
c08d9f2
Migrate prefix `Instance1Membership` -> `TechnicalMembership`
icodezjb Feb 9, 2022
c66a7f9
Migrate pallet-tips prefix from `Treasury` -> `Tips`
icodezjb Feb 9, 2022
b2937d2
Migrate pallet-bounties prefix from `Treasury` -> `Bounties`
icodezjb Feb 9, 2022
5d42f05
Migrate prefix from `PhragmenElection` -> `Elections`
icodezjb Feb 9, 2022
b1d1309
Revert `dev` spec_name
icodezjb Feb 10, 2022
0d6a0f0
Confirm migrations order
icodezjb Feb 15, 2022
62942a3
Use ChainX substrate patch for system migration
icodezjb Feb 15, 2022
abf3d4c
Run `make format`
icodezjb Feb 15, 2022
a7e04e9
Reset spec_name `dev` -> `chainx`
icodezjb Feb 22, 2022
c659322
Add migrations.rs for mainnet and testnet
icodezjb Feb 23, 2022
d11445e
Bump ChainX version to `4.0.0`
icodezjb Feb 23, 2022
756a26a
Bump ChainX version to `4.0.0`
icodezjb Feb 23, 2022
6e13362
Update governance parameters for dev and malan
icodezjb Feb 23, 2022
0e89e85
Update malan chainspec
icodezjb Feb 23, 2022
3b498d9
Quick fix
icodezjb Feb 23, 2022
e30c9d3
Quick fix
icodezjb Feb 23, 2022
ce53dc3
Update generate_keys.sh
icodezjb Feb 23, 2022
ad5c567
Adjust malan parameters
icodezjb Feb 24, 2022
237a097
Update malan chainspec
icodezjb Feb 24, 2022
370e792
Update malan chainspec
icodezjb Feb 24, 2022
5470c73
Update malan chainspec
icodezjb Feb 24, 2022
b5bf153
Rename malan testnet name
icodezjb Feb 24, 2022
ca89dc5
Add bootnodes url
icodezjb Feb 24, 2022
5c9e40b
Run `make format`
icodezjb Feb 24, 2022
1d856dc
Regenerate weights
icodezjb Feb 24, 2022
d0b376f
Disable pre_release.yml CI
icodezjb Feb 24, 2022
4101b36
Regenerate benchmark weights
icodezjb Feb 24, 2022
dc3d1ba
Run `make clippy`
icodezjb Feb 24, 2022
e42975a
Run `make format`
icodezjb Feb 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update generate_keys.sh
  • Loading branch information
icodezjb committed Feb 23, 2022
commit ce53dc3c1ae8736b9775a566e4d5aef6ef54715d
24 changes: 16 additions & 8 deletions scripts/genesis/generate_keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,36 @@ fi
CHAIN=mainnet
DIR="keys"
CHAINX=../../target/release/chainx
SESSION_KEY=""

print_validator_address() {
address=$("$CHAINX" key inspect-key "$1" | tail -n 1 | awk '{print $NF}')
address=$("$CHAINX" key inspect "$1" | tail -n 1 | awk '{print $NF}')
echo " // $address"
}

print_validator_id() {
pubkey=$("$CHAINX" key inspect-key "$1" | tail -n 3 | head -1 | awk '{print $NF}')
pubkey=$("$CHAINX" key inspect "$1" | tail -n 3 | head -1 | awk '{print $NF}')
echo " hex![\"${pubkey:2}\"].into(),"
}

print_address() {
local_scheme=$1
local_uri=$2
address=$("$CHAINX" key inspect-key --scheme "$local_scheme" "$local_uri" | tail -n 1 | awk '{print $NF}')
address=$("$CHAINX" key inspect --scheme "$local_scheme" "$local_uri" | tail -n 1 | awk '{print $NF}')
echo " // $address"
}

print_account_key() {
pubkey=$("$CHAINX" key inspect-key "$1" | tail -n 3 | head -1 | awk '{print $NF}')
pubkey=$("$CHAINX" key inspect "$1" | tail -n 3 | head -1 | awk '{print $NF}')
echo " hex![\"${pubkey:2}\"].into(),"
}

print_aux_key() {
local_scheme=$1
local_uri=$2
pubkey=$("$CHAINX" key inspect-key --scheme "$local_scheme" "$local_uri" | tail -n 3 | head -1 | awk '{print $NF}')
pubkey=$("$CHAINX" key inspect --scheme "$local_scheme" "$local_uri" | tail -n 3 | head -1 | awk '{print $NF}')
echo " hex![\"${pubkey:2}\"].unchecked_into(),"
SESSION_KEY=$SESSION_KEY${pubkey:2}
}

generate_aux_key() {
Expand All @@ -56,10 +58,10 @@ generate_aux_key() {
}

main() {
# Generate 5 pairs of genesis keys given the root secret
# Generate some pairs of genesis keys given the root secret
for id in 1 2 3 4 5; do
echo "SECRET//validator//$id:"
echo "SECRET//babe//$id, SECRET//grandpa//$id, SECRET//im_online//$id, SECRET//authority_discovery//$id"
echo "SECRET//blockauthor/$id, SECRET//babe//$id, SECRET//grandpa//$id, SECRET//im_online//$id, SECRET//authority_discovery//$id"
echo

echo " ("
Expand All @@ -70,19 +72,25 @@ main() {
echo " b\""$referral_id"\".to_vec(),"
echo " ),"

print_address sr25519 "$SECRET//blockauthor//$id"
print_account_key "$SECRET//blockauthor//$id"

SESSION_KEY="0x"
generate_aux_key babe sr25519 "$DIR/$id" "$SECRET//babe//$id"
# Grandpa must use ed25519.
generate_aux_key gran ed25519 "$DIR/$id" "$SECRET//grandpa//$id"
generate_aux_key imon sr25519 "$DIR/$id" "$SECRET//im_online//$id"
generate_aux_key audi sr25519 "$DIR/$id" "$SECRET//authority_discovery//$id"
echo " SessionKey: [$SESSION_KEY]"

echo
done

echo 'Root:'
print_address sr25519 "$SECRET"
print_account_key "$SECRET"

echo "The generated keys are in directory $DIR"
}

main
main "$@"