-
Notifications
You must be signed in to change notification settings - Fork 14
/
init_single.sh
executable file
·78 lines (63 loc) · 2.94 KB
/
init_single.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash
set -ex
mode="mainnet"
if [[ $1 == "docker" ]]
then
if [[ $2 == "testnet" ]]
then
mode="testnet"
fi
FNSAD="docker run -i -p 26656:26656 -p 26657:26657 -v ${HOME}/.finschia:/root/.finschia finschia/finschianode fnsad"
elif [[ $1 == "testnet" ]]
then
mode="testnet"
fi
FNSAD=${FNSAD:-fnsad}
# initialize
rm -rf ~/.finschia
# TODO
# Configure your CLI to eliminate need for chain-id flag
#${FNSAD} config chain-id finschia
#${FNSAD} config output json
#${FNSAD} config indent true
#${FNSAD} config trust-node true
#${FNSAD} config keyring-backend test
# Initialize configuration files and genesis file
# moniker is the name of your node
${FNSAD} init solo --chain-id=finschia
# configure for testnet
if [[ ${mode} == "testnet" ]]
then
if [[ $1 == "docker" ]]
then
docker run -i -p 26656:26656 -p 26657:26657 -v ${HOME}/.finschia:/root/.finschia finschia/finschianode sh -c "export FNSAD_TESTNET=true"
else
export FNSAD_TESTNET=true
fi
fi
# Please do not use the TEST_MNEMONIC for production purpose
TEST_MNEMONIC="mind flame tobacco sense move hammer drift crime ring globe art gaze cinnamon helmet cruise special produce notable negative wait path scrap recall have"
${FNSAD} keys add jack --keyring-backend=test --recover --account=0 <<< ${TEST_MNEMONIC}
${FNSAD} keys add alice --keyring-backend=test --recover --account=1 <<< ${TEST_MNEMONIC}
${FNSAD} keys add bob --keyring-backend=test --recover --account=2 <<< ${TEST_MNEMONIC}
${FNSAD} keys add rinah --keyring-backend=test --recover --account=3 <<< ${TEST_MNEMONIC}
${FNSAD} keys add sam --keyring-backend=test --recover --account=4 <<< ${TEST_MNEMONIC}
${FNSAD} keys add evelyn --keyring-backend=test --recover --account=5 <<< ${TEST_MNEMONIC}
# TODO
#if [[ ${mode} == "testnet" ]]
#then
# ${FNSAD} add-genesis-account tlink15la35q37j2dcg427kfy4el2l0r227xwhc2v3lg 9223372036854775807link,1stake
#else
# ${FNSAD} add-genesis-account link15la35q37j2dcg427kfy4el2l0r227xwhuaapxd 9223372036854775807link,1stake
#fi
# Add both accounts, with coins to the genesis file
${FNSAD} add-genesis-account $(${FNSAD} keys show jack -a --keyring-backend=test) 1000link,1000000000000stake
${FNSAD} add-genesis-account $(${FNSAD} keys show alice -a --keyring-backend=test) 1000link,1000000000000stake
${FNSAD} add-genesis-account $(${FNSAD} keys show bob -a --keyring-backend=test) 1000link,1000000000000stake
${FNSAD} add-genesis-account $(${FNSAD} keys show rinah -a --keyring-backend=test) 1000link,1000000000000stake
${FNSAD} add-genesis-account $(${FNSAD} keys show sam -a --keyring-backend=test) 1000link,1000000000000stake
${FNSAD} add-genesis-account $(${FNSAD} keys show evelyn -a --keyring-backend=test) 1000link,1000000000000stake
${FNSAD} gentx jack 100000000stake --keyring-backend=test --chain-id=finschia
${FNSAD} collect-gentxs
${FNSAD} validate-genesis
# ${FNSAD} start --log_level *:debug --rpc.laddr=tcp://0.0.0.0:26657 --p2p.laddr=tcp://0.0.0.0:26656