forked from ComposableFi/picasso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testnode.sh
executable file
·47 lines (36 loc) · 1.99 KB
/
testnode.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
KEY="mykey"
CHAINID="banksy-testnet-1"
MONIKER="localtestnet"
KEYALGO="secp256k1"
KEYRING="test"
LOGLEVEL="info"
# to trace evm
#TRACE="--trace"
TRACE=""
# validate dependencies are installed
command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 1; }
# remove existing daemon
rm -rf ~/.banksy*
banksyd config keyring-backend $KEYRING
banksyd config chain-id $CHAINID
# if $KEY exists it should be deleted
echo "taste shoot adapt slow truly grape gift need suggest midnight burger horn whisper hat vast aspect exit scorpion jewel axis great area awful blind" | banksyd keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO --recover
banksyd init $MONIKER --chain-id $CHAINID
# Allocate genesis accounts (cosmos formatted addresses)
banksyd add-genesis-account $KEY 10000000000upicax --keyring-backend $KEYRING
banksyd add-genesis-account banksy1594tdya20hxz7kjenkn5w09jljyvdfk8kx5rd6 1000000000000000upicax --keyring-backend $KEYRING
# Sign genesis transaction banksy1594tdya20hxz7kjenkn5w09jljyvdfk8kx5rd6
banksyd gentx $KEY 10000000000upicax --keyring-backend $KEYRING --chain-id $CHAINID
# Collect genesis tx
banksyd collect-gentxs
# Run this to ensure everything worked and that the genesis file is setup correctly
banksyd validate-genesis
if [[ $1 == "pending" ]]; then
echo "pending mode is on, please wait for the first block committed."
fi
# update request max size so that we can upload the light client
# '' -e is a must have params on mac, if use linux please delete before run
sed -i'' -e 's/max_body_bytes = /max_body_bytes = 1/g' ~/.banksy/config/config.toml
cat $HOME/.banksy/config/genesis.json | jq '.app_state["gov"]["voting_params"]["voting_period"]="45s"' > $HOME/.banksy/config/tmp_genesis.json && mv $HOME/.banksy/config/tmp_genesis.json $HOME/.banksy/config/genesis.json
# Start the node (remove the --pruning=nothing flag if historical queries are not needed)
# banksyd start --pruning=nothing --minimum-gas-prices=0.0001stake