2020-03-18 12:42:46 +00:00
|
|
|
#!/bin/bash
|
2020-04-06 20:11:52 +00:00
|
|
|
|
|
|
|
KEY="ethermintkey"
|
|
|
|
CHAINID=8
|
|
|
|
MONIKER="mymoniker"
|
|
|
|
|
|
|
|
# remove existing chain environment, data and
|
|
|
|
rm -rf ~/.emint*
|
2020-03-18 12:42:46 +00:00
|
|
|
|
|
|
|
make install
|
|
|
|
|
|
|
|
emintcli config keyring-backend test
|
2020-04-06 20:11:52 +00:00
|
|
|
|
|
|
|
# if mykey exists it should be deleted
|
|
|
|
emintcli keys add $KEY
|
2020-03-18 12:42:46 +00:00
|
|
|
|
|
|
|
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
|
2020-04-06 20:11:52 +00:00
|
|
|
emintd init $MONIKER --chain-id $CHAINID
|
2020-03-18 12:42:46 +00:00
|
|
|
|
|
|
|
# Set up config for CLI
|
2020-04-06 20:11:52 +00:00
|
|
|
emintcli config chain-id $CHAINID
|
2020-03-18 12:42:46 +00:00
|
|
|
emintcli config output json
|
|
|
|
emintcli config indent true
|
|
|
|
emintcli config trust-node true
|
|
|
|
|
|
|
|
# Allocate genesis accounts (cosmos formatted addresses)
|
2020-04-06 20:11:52 +00:00
|
|
|
emintd add-genesis-account $(emintcli keys show $KEY -a) 1000000000000000000photon,1000000000000000000stake
|
2020-03-18 12:42:46 +00:00
|
|
|
|
|
|
|
# Sign genesis transaction
|
2020-04-06 20:11:52 +00:00
|
|
|
emintd gentx --name $KEY --keyring-backend test
|
2020-03-18 12:42:46 +00:00
|
|
|
|
|
|
|
# Collect genesis tx
|
|
|
|
emintd collect-gentxs
|
|
|
|
|
|
|
|
# Run this to ensure everything worked and that the genesis file is setup correctly
|
|
|
|
emintd validate-genesis
|
|
|
|
|
2020-04-06 20:11:52 +00:00
|
|
|
# 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"
|
|
|
|
|
2020-03-18 12:42:46 +00:00
|
|
|
# Start the node (remove the --pruning=nothing flag if historical queries are not needed)
|
2020-04-06 20:11:52 +00:00
|
|
|
emintd start --pruning=nothing --rpc.unsafe --log_level "main:info,state:info,mempool:info"
|
|
|
|
|