forked from 3Dpass/3DP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
keygen_seed.sh
22 lines (21 loc) · 1.22 KB
/
keygen_seed.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /bin/bash
# A keyset will be generated out of the seed phrase below
MEMO_SEED="PUT YOUR MEMO SEED HERE"
# inspecting the account
ACCOUNT="$(./target/release/poscan-consensus key inspect --scheme Sr25519 "$MEMO_SEED")"
echo "----Mining account----"
echo "$ACCOUNT"
# importing mining key
./target/release/poscan-consensus import-mining-key "$MEMO_SEED" --base-path ~/3dp-chain/ --chain mainnetSpecRaw.json
# deriving GRANDPA key from the seed phrase
GRANDPA_KEY="$(./target/release/poscan-consensus key inspect --scheme Ed25519 "$MEMO_SEED" | sed -n 's/.*Secret seed://p')"
GRANDPA_ACCOUNT="$(./target/release/poscan-consensus key inspect --scheme Ed25519 "$MEMO_SEED")"
echo "---- GRANDPA key derived ----:"
echo "$GRANDPA_ACCOUNT"
# inserting GRANDPA key
./target/release/poscan-consensus key insert --scheme Ed25519 --base-path ~/3dp-chain/ --chain mainnetSpecRaw.json --key-type gran --suri $GRANDPA_KEY
# inserting ImOnline key
./target/release/poscan-consensus key insert --scheme Sr25519 --base-path ~/3dp-chain/ --chain mainnetSpecRaw.json --key-type imon --suri $GRANDPA_KEY
echo "These are the keys in your keystore ~/3dp-chain/chains/3dpass/keystore/..."
# checking up the keys in the keystore
ls "../3dp-chain/chains/3dpass/keystore/"