Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to run cmd oraid start: error invalid coin denomination: got orai, expected stake: invalid request #3

Open
ledanghuy1811 opened this issue Sep 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ledanghuy1811
Copy link

ledanghuy1811 commented Sep 5, 2024

  • We set up test to run local node like below:
#!/bin/bash
set -ux

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 
  • But we got error "invalid coin denomination":
Screenshot 2024-09-05 at 16 31 47
@ledanghuy1811
Copy link
Author

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:
Screenshot 2024-09-05 at 16 41 34 Screenshot 2024-09-05 at 16 42 59
  • Then we make custom gensis state function and init cmd function to change default genesis state of our app:
Screenshot 2024-09-05 at 16 45 56 Screenshot 2024-09-05 at 16 47 13
  • Custom genesis state:
Screenshot 2024-09-05 at 16 48 53 For detail, please visit file: https://github.com/oraichain/wasmd/blob/e7b98ae041b2fe8db1d7bf9701b2aba53bf1194d/app/genesis.go#L32-L97

@ducphamle2 ducphamle2 added this to the Upgrade Oraichain to 0.50 milestone Oct 30, 2024
@ducphamle2 ducphamle2 added the bug Something isn't working label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants