build: refactor init.sh (#294)

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
Jongwhan Lee 2021-07-16 18:40:33 +09:00 committed by GitHub
parent c8ddb503c1
commit 333a76bdf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

13
init.sh
View File

@ -2,17 +2,20 @@
KEY="mykey"
CHAINID="ethermint-2"
MONIKER="localtestnet"
KEYRING="test"
KEYALGO="eth_secp256k1"
LOGLEVEL="info"
# remove existing daemon and client
rm -rf ~/.ethermintd*
make install
ethermintd config keyring-backend test
ethermintd config keyring-backend $KEYRING
ethermintd config chain-id $CHAINID
# if $KEY exists it should be deleted
ethermintd keys add $KEY --keyring-backend test --algo "eth_secp256k1"
ethermintd keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
ethermintd init $MONIKER --chain-id $CHAINID
@ -58,10 +61,10 @@ if [[ $1 == "pending" ]]; then
fi
# Allocate genesis accounts (cosmos formatted addresses)
ethermintd add-genesis-account $KEY 100000000000000000000000000aphoton --keyring-backend test
ethermintd add-genesis-account $KEY 100000000000000000000000000aphoton --keyring-backend $KEYRING
# Sign genesis transaction
ethermintd gentx $KEY 1000000000000000000000aphoton --keyring-backend test --chain-id $CHAINID
ethermintd gentx $KEY 1000000000000000000000aphoton --keyring-backend $KEYRING --chain-id $CHAINID
# Collect genesis tx
ethermintd collect-gentxs
@ -74,4 +77,4 @@ if [[ $1 == "pending" ]]; then
fi
# Start the node (remove the --pruning=nothing flag if historical queries are not needed)
ethermintd start --pruning=nothing --trace --log_level info --minimum-gas-prices=0.0001aphoton
ethermintd start --pruning=nothing --trace --log_level $LOGLEVEL --minimum-gas-prices=0.0001aphoton