update init.sh script (#241)

Changed the removal lines to removed everything using a wildcard
Changed the the common parameters into variables

Fixes #238
This commit is contained in:
Jay B Payne 2020-04-06 15:11:52 -05:00 committed by GitHub
parent 70cc4af3b4
commit eaaae0e3fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

28
init.sh
View File

@ -1,26 +1,33 @@
#!/bin/bash
rm -rf ~/.emintcli
rm -rf ~/.emintd
KEY="ethermintkey"
CHAINID=8
MONIKER="mymoniker"
# remove existing chain environment, data and
rm -rf ~/.emint*
make install
emintcli config keyring-backend test
emintcli keys add mykey
# if mykey exists it should be deleted
emintcli keys add $KEY
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
emintd init mymoniker --chain-id 8
emintd init $MONIKER --chain-id $CHAINID
# Set up config for CLI
emintcli config chain-id 8
emintcli config chain-id $CHAINID
emintcli config output json
emintcli config indent true
emintcli config trust-node true
# Allocate genesis accounts (cosmos formatted addresses)
emintd add-genesis-account $(emintcli keys show mykey -a) 1000000000000000000photon,1000000000000000000stake
emintd add-genesis-account $(emintcli keys show $KEY -a) 1000000000000000000photon,1000000000000000000stake
# Sign genesis transaction
emintd gentx --name mykey --keyring-backend test
emintd gentx --name $KEY --keyring-backend test
# Collect genesis tx
emintd collect-gentxs
@ -28,5 +35,10 @@ emintd collect-gentxs
# Run this to ensure everything worked and that the genesis file is setup correctly
emintd validate-genesis
# Command to run the rest server in a different terminal/window
echo -e '\n\nRun this rest-server command in a different terminal/window:'
echo -e "emintcli rest-server --laddr \"tcp://localhost:8545\" --unlock-key $KEY --chain-id $CHAINID\n\n"
# Start the node (remove the --pruning=nothing flag if historical queries are not needed)
emintd start --pruning=nothing
emintd start --pruning=nothing --rpc.unsafe --log_level "main:info,state:info,mempool:info"