1+ # RUN THIS LINE BY LINE; COMMENTING OUT EVERYTHING ELSE !!!
2+
3+ # OPTIONAL STEP: create keys (write down the memo words)(you need this only once per environment)
4+ pchaind keys add user1
5+ pchaind keys add user2
6+
7+ # # make 3 folders with all configs and genesis files and validator keys for
8+ # a testnetwork (tn) of 3 nodes: pushnode1(.tn/pn1), .tn/pn2, .tn/pn3
9+ pchaind init pn1 --home ~ /.tn/pn1 --chain-id test-push-chain
10+ pchaind init pn2 --home ~ /.tn/pn2 --chain-id test-push-chain
11+ pchaind init pn3 --home ~ /.tn/pn3 --chain-id test-push-chain
12+
13+ # build config/genesis.json
14+ # ## register 2 genesis accounts with 500k push each
15+ # user1 would own nodes pn1,pn2,pn3
16+ export user1=$( pchaind keys show user1 -a)
17+ pchaind genesis add-genesis-account $user1 500000000000npush --home ~ /.tn/pn1
18+ # user2 would own nothing
19+ export user2=$( pchaind keys show user2 -a)
20+ pchaind genesis add-genesis-account $user2 500000000000npush --home ~ /.tn/pn1
21+
22+ # replace all tokens with npush; npush is nano push; it is 1/1 000 000 of push
23+ sed -i ' ' ' s/stake/npush/g' ~ /.tn/pn1/config/genesis.json
24+
25+
26+ # I cannot register more no matter how hord I try
27+ # this is the command we have in 0.50:
28+ # pchaind genesis gentx <key_name> <amount> [flags]
29+ # this is the command which I need in 0.52:
30+ # pchaind genesis gentx <key_name> 10000000000stake --chain-id push-test-chain --moniker="pn1" --commission-rate="0.10" --commission-max-rate="0.20" --commission-max-change-rate="0.01" --min-self-delegation="1" --ip "192.168.88.114" --node-id <your_node_id> --home ~/.tn/pn2
31+ # register 1 founder validator in genesis.json ;
32+ pchaind genesis gentx user1 10000000000npush --chain-id test-push-chain --home ~ /.tn/pn1
33+ # put all txs into genesis.json
34+ pchaind genesis collect-gentxs --home ~ /.tn/pn1
35+ # copy genesis to other nodes
36+ cp ~ /.tn/pn1/config/genesis.json ~ /.tn/pn2/config/genesis.json
37+ cp ~ /.tn/pn1/config/genesis.json ~ /.tn/pn3/config/genesis.json
38+
39+ # # configs
40+
41+ # build config/app.toml
42+ sed -i ' ' ' s/minimum-gas-prices = ""/minimum-gas-prices = "0.25npush"/g' ~ /.tn/pn1/config/app.toml
43+ cp ~ /.tn/pn1/config/app.toml ~ /.tn/pn2/config/app.toml
44+ cp ~ /.tn/pn1/config/app.toml ~ /.tn/pn3/config/app.toml
45+
46+
47+ # build config/config.toml
48+ export pn1_id=$( pchaind tendermint show-node-id --home ~ /.tn/pn1)
49+ export pn1_url=" $pn1_id @pn1.dev.push.org:26656"
50+
51+ export pn2_id=$( pchaind tendermint show-node-id --home ~ /.tn/pn2)
52+ export pn2_url=" $pn2_id @pn2.dev.push.org:26656"
53+
54+ export pn3_id=$( pchaind tendermint show-node-id --home ~ /.tn/pn3)
55+ export pn3_url=" $pn3_id @pn3.dev.push.org:26656"
56+
57+ export pn1_peers=" \" $pn2_url , $pn3_url \" "
58+ sed -i ' ' " s/persistent_peers = \"\" /persistent_peers = $pn1_peers /g" ~ /.tn/pn1/config/config.toml
59+ grep -i persistent_peers ~ /.tn/pn1/config/config.toml
60+
61+ export pn2_peers=" \" $pn1_url , $pn3_url \" "
62+ sed -i ' ' " s/persistent_peers = \"\" /persistent_peers = $pn2_peers /g" ~ /.tn/pn2/config/config.toml
63+ grep -i persistent_peers ~ /.tn/pn2/config/config.toml
64+
65+ export pn3_peers=" \" $pn1_url , $pn2_url \" "
66+ sed -i ' ' " s/persistent_peers = \"\" /persistent_peers = $pn3_peers /g" ~ /.tn/pn3/config/config.toml
67+ grep -i " persistent_peers =" ~ /.tn/pn3/config/config.toml
0 commit comments