From 27363d64e36398a79df3424b2da0b5fd70095a14 Mon Sep 17 00:00:00 2001 From: expertdicer Date: Fri, 10 Nov 2023 12:48:31 +0700 Subject: [PATCH] add local testnode --- scripts/testnode.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 scripts/testnode.sh diff --git a/scripts/testnode.sh b/scripts/testnode.sh new file mode 100644 index 00000000..a59866c7 --- /dev/null +++ b/scripts/testnode.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +KEY="mykey" +CHAINID="test-1" +MONIKER="localtestnet" +KEYALGO="secp256k1" +KEYRING="test" +LOGLEVEL="info" +# to trace evm +#TRACE="--trace" +TRACE="" + +# remove existing daemon +rm -rf ~/.migaloo* + +migalood config keyring-backend $KEYRING +migalood config chain-id $CHAINID + +# if $KEY exists it should be deleted +echo "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry" | migalood keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO --recover + +migalood init $MONIKER --chain-id $CHAINID + +# Allocate genesis accounts (cosmos formatted addresses) +migalood add-genesis-account $KEY 100000000000000000000000000stake --keyring-backend $KEYRING + +# Sign genesis transaction +migalood gentx $KEY 1000000000000000000000stake --keyring-backend $KEYRING --chain-id $CHAINID + +# Collect genesis tx +migalood collect-gentxs + +# Run this to ensure everything worked and that the genesis file is setup correctly +migalood 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' ~/.migaloo/config/config.toml + +# Start the node (remove the --pruning=nothing flag if historical queries are not needed) +migalood start --pruning=nothing --minimum-gas-prices=0.0001stake --rpc.laddr tcp://0.0.0.0:26657