Closed sandoche closed 4 weeks ago
there should be 3 lines with pruning options
sed -i.bak 's/pruning = "default"/pruning = "custom"/g' "$APP_TOML"
sed -i.bak 's/pruning-keep-recent = "0"/pruning-keep-recent = "2"/g' "$APP_TOML"
sed -i.bak 's/pruning-interval = "0"/pruning-interval = "10"/g' "$APP_TOML"
remove the bottom 2 and on the first one replace custom with nothing
Steps
Start local chain
local_node.sh
CHAINID="${CHAIN_ID:-evmos_9000-1}" MONIKER="localtestnet"
Remember to change to other types of keyring like 'file' in-case exposing to outside world,
otherwise your balance will be wiped quickly
The keyring test does not require private key to steal tokens from you
KEYRING="test" KEYALGO="eth_secp256k1" LOGLEVEL="info"
Set dedicated home directory for the evmosd instance
HOMEDIR="$HOME/.tmp-evmosd"
to trace evm
TRACE="--trace"
TRACE=""
feemarket params basefee
BASEFEE=1000000000
Path variables
CONFIG=$HOMEDIR/config/config.toml APP_TOML=$HOMEDIR/config/app.toml GENESIS=$HOMEDIR/config/genesis.json TMP_GENESIS=$HOMEDIR/config/tmp_genesis.json
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 }
used to exit on first error (any non-zero exit code)
set -e
Parse input flags
install=true overwrite=""
while [[ $# -gt 0 ]]; do key="$1" case $key in -y) echo "Flag -y passed -> Overwriting the previous chain data." overwrite="y" shift # Move past the flag ;; -n) echo "Flag -n passed -> Not overwriting the previous chain data." overwrite="n" shift # Move past the argument ;; --no-install) echo "Flag --no-install passed -> Skipping installation of the evmosd binary." install=false shift # Move past the flag ;; *) echo "Unknown flag passed: $key -> Exiting script!" exit 1 ;; esac done
if [[ $install == true ]]; then
(Re-)install daemon
fi
User prompt if neither -y nor -n was passed as a flag
and an existing local node configuration is found.
if [[ $overwrite = "" ]]; then if [ -d "$HOMEDIR" ]; then printf "\nAn existing folder at '%s' was found. You can choose to delete this folder and start a new local node with new keys from genesis. When declined, the existing local node is started. \n" "$HOMEDIR" echo "Overwrite the existing configuration and start a new local node? [y/n]" read -r overwrite else overwrite="y" fi fi
Setup local node if overwrite is set to Yes, otherwise skip setup
if [[ $overwrite == "y" || $overwrite == "Y" ]]; then
Remove the previous folder
Add token pair for uatom
jq '.app_state["erc20"]["token_pairs"][1]["erc20_address"]="0x5db67696C3c088DfBf588d3dd849f44266ff0ffa"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" jq '.app_state["erc20"]["token_pairs"][1]["denom"]="uatom"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" jq '.app_state["erc20"]["token_pairs"][1]["enabled"]=true' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" jq '.app_state["erc20"]["token_pairs"][1]["contract_owner"]=1' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS"
fi
Start the node
evmosd start \ --metrics "$TRACE" \ --log_level $LOGLEVEL \ --minimum-gas-prices=0.0001aevmos \ --json-rpc.api eth,txpool,personal,net,debug,web3 \ --home "$HOMEDIR" \ --chain-id "$CHAINID"
Change epoch duration
Gets tests accounts private keys
List accounts
Export private key
Add network to metamask
RPC -
http://127.0.0.1:8545/
chainId -9000
Check balance uatom
evmosd q bank balances evmos1cml96vmptgw99syqrrz8az79xer2pcgp84pdun --home ~/.tmp-evmosd
Load precompile on remix
⚠️ When restarting the chain from genesis clear data and reset nonce in metamask