Open ledanghuy1811 opened 2 months ago
Fixed in #2 The error come up because we haven't customed our genesis state yet!
In initRootCmd
function, we add InitCmd
follow genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
package and by default it create genesis app state for us:
Then we make custom gensis state function and init cmd function to change default genesis state of our app:
Custom genesis state:
For detail, please visit file: https://github.com/oraichain/wasmd/blob/e7b98ae041b2fe8db1d7bf9701b2aba53bf1194d/app/genesis.go#L32-L97
CHAIN_ID=${CHAIN_ID:-testing} USER=${USER:-tupt} MONIKER=${MONIKER:-node001} HIDE_LOGS="/dev/null"
PASSWORD=${PASSWORD:-$1}
rm -rf .oraid/
oraid init --chain-id "$CHAIN_ID" "$MONIKER" > $HIDE_LOGS
oraid keys add $USER --keyring-backend test 2>&1 | tee account.txt oraid keys add $USER-eth --keyring-backend test --eth 2>&1 | tee account-eth.txt oraid keys unsafe-export-eth-key $USER-eth --keyring-backend test 2>&1 | tee priv-eth.txt
hardcode the validator account for this instance
oraid genesis add-genesis-account $USER "100000000000000orai" --keyring-backend test oraid genesis add-genesis-account $USER-eth "100000000000000orai" --keyring-backend test oraid genesis add-genesis-account orai1kzkf6gttxqar9yrkxfe34ye4vg5v4m588ew7c9 "100000000000000orai" --keyring-backend test
submit a genesis validator tx
Workraround for https://github.com/cosmos/cosmos-sdk/issues/8251
oraid genesis gentx $USER "250000000orai" --chain-id="$CHAIN_ID" -y --keyring-backend test
oraid genesis collect-gentxs
oraid start