-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
executable file
·67 lines (45 loc) · 2.19 KB
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
KEY="mykey"
KEY1="wade"
CHAINID=200812
MONIKER="mymoniker"
# remove existing chain environment, data and
rm -rf ~/.halle*
make install
hallecli config keyring-backend test
# if mykey exists it should be deleted
hallecli keys add $KEY
hallecli keys add $KEY1
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
halled init $MONIKER --chain-id $CHAINID
os=`uname -a`
mac='Darwin'
if [[ $os =~ $mac ]];then
sed -i '' 's/"max_gas": "-1"/"max_gas": "1000000000"/g' ~/.halled/config/genesis.json
else
sed -i 's/"max_gas": "-1"/"max_gas": "1000000000"/g' ~/.halled/config/genesis.json
fi
# Set up config for CLI
hallecli config chain-id $CHAINID
hallecli config output json
hallecli config indent true
hallecli config trust-node true
# if $KEY exists it should be deleted
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
# Allocate genesis accounts (cosmos formatted addresses)
echo "add-genesis-account "
echo $(hallecli keys show $KEY -a)
halled add-genesis-account $(hallecli keys show $KEY -a) 100000000000000000000000000uhale
halled add-genesis-account $(hallecli keys show $KEY1 -a) 100000000000000000000000000uhale # --vesting-amount 600hale --vesting-start-time 1591781100 --vesting-end-time 1591781700
# Sign genesis transaction
halled gentx --name $KEY --keyring-backend test
# Collect genesis tx
halled collect-gentxs
# Run this to ensure everything worked and that the genesis file is setup correctly
halled 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 "hallecli 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)
halled start --minimum-gas-prices 5.0uhale --pruning=nothing --rpc.unsafe --log_level "main:info,state:info,mempool:info" --rpc.laddr "tcp://0.0.0.0:26657"
# halled start --minimum-gas-prices 5.0uhale --pruning-snapshot-every 10 --rpc.unsafe --log_level "main:info,state:info,mempool:info" --rpc.laddr "tcp://0.0.0.0:26657"