2020-09-01 21:16:28 +00:00
#!/bin/bash
2021-08-17 14:11:26 +00:00
CHAINID = "ethermint_9000-1"
2020-09-01 21:16:28 +00:00
MONIKER = "localtestnet"
2021-04-17 10:00:07 +00:00
# localKey address 0x7cb61d4117ae31a12e393a1cfa3bac666481d02e
2020-09-01 21:16:28 +00:00
VAL_KEY = "localkey"
VAL_MNEMONIC = "gesture inject test cycle original hollow east ridge hen combine junk child bacon zero hope comfort vacuum milk pitch cage oppose unhappy lunar seat"
2021-04-17 10:00:07 +00:00
# user1 address 0xc6fe5d33615a1c52c08018c47e8bc53646a0e101
2020-09-01 21:16:28 +00:00
USER1_KEY = "user1"
USER1_MNEMONIC = "copper push brief egg scan entry inform record adjust fossil boss egg comic alien upon aspect dry avoid interest fury window hint race symptom"
2021-04-17 10:00:07 +00:00
# user2 address 0x963ebdf2e1f8db8707d05fc75bfeffba1b5bac17
2020-09-01 21:16:28 +00:00
USER2_KEY = "user2"
USER2_MNEMONIC = "maximum display century economy unlock van census kite error heart snow filter midnight usage egg venture cash kick motor survey drastic edge muffin visual"
# remove existing daemon and client
rm -rf ~/.ethermint*
# Import keys from mnemonics
2021-04-17 10:00:07 +00:00
echo $VAL_MNEMONIC | ethermintd keys add $VAL_KEY --recover --keyring-backend test --algo "eth_secp256k1"
echo $USER1_MNEMONIC | ethermintd keys add $USER1_KEY --recover --keyring-backend test --algo "eth_secp256k1"
echo $USER2_MNEMONIC | ethermintd keys add $USER2_KEY --recover --keyring-backend test --algo "eth_secp256k1"
2020-09-01 21:16:28 +00:00
ethermintd init $MONIKER --chain-id $CHAINID
2021-07-19 01:52:44 +00:00
# Set gas limit in genesis
cat $HOME /.ethermintd/config/genesis.json | jq '.consensus_params["block"]["max_gas"]="10000000"' > $HOME /.ethermintd/config/tmp_genesis.json && mv $HOME /.ethermintd/config/tmp_genesis.json $HOME /.ethermintd/config/genesis.json
2020-09-01 21:16:28 +00:00
# Allocate genesis accounts (cosmos formatted addresses)
2021-04-17 10:00:07 +00:00
ethermintd add-genesis-account " $( ethermintd keys show $VAL_KEY -a --keyring-backend test ) " 1000000000000000000000aphoton,1000000000000000000stake --keyring-backend test
ethermintd add-genesis-account " $( ethermintd keys show $USER1_KEY -a --keyring-backend test ) " 1000000000000000000000aphoton,1000000000000000000stake --keyring-backend test
ethermintd add-genesis-account " $( ethermintd keys show $USER2_KEY -a --keyring-backend test ) " 1000000000000000000000aphoton,1000000000000000000stake --keyring-backend test
2020-09-01 21:16:28 +00:00
# Sign genesis transaction
2021-04-17 10:00:07 +00:00
ethermintd gentx $VAL_KEY 1000000000000000000stake --amount= 1000000000000000000000aphoton --chain-id $CHAINID --keyring-backend test
2020-09-01 21:16:28 +00:00
# Collect genesis tx
ethermintd collect-gentxs
# Run this to ensure everything worked and that the genesis file is setup correctly
ethermintd validate-genesis
# Start the node (remove the --pruning=nothing flag if historical queries are not needed)
2021-10-08 13:38:42 +00:00
ethermintd start --pruning= nothing --rpc.unsafe --keyring-backend test --log_level info --json-rpc.api eth,txpool,personal,net,debug,web3