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

Custom token denomination #4304

Open
olimdzhon opened this issue Aug 15, 2024 · 2 comments
Open

Custom token denomination #4304

olimdzhon opened this issue Aug 15, 2024 · 2 comments

Comments

@olimdzhon
Copy link

gm, folks! this is my config.yml file

validation: sovereign
accounts:
  - name: alice
    coins:
      - 20000sputnik
      - 20000000000usputnik
  - name: bob
    coins:
      - 100sputnik
      - 100000000usputnik
client:
  openapi:
    path: docs/static/openapi.yml
faucet:
  name: bob
  coins:
    - 5sputnik
    - 100000usputnik
validators:
  - name: alice
    bonded: 1000000000usputnik
genesis:
  app_state:
    staking:
      params:
        bond_denom: "usputnik"
    crisis:
      constant_fee:
        denom: "usputnik"
        amount: "1000"
    mint:
      params:
        mint_denom: "usputnik"
    gov:
      deposit_params:
        min_deposit:
          - denom: "usputnik"
            amount: "10000000"
      params:
        expedited_min_deposit:
          - denom: "usputnik"
            amount: "50000000"
        min_deposit:
          - denom: "usputnik"
            amount: "10000000"

I'm trying to change tokens denomination. When i launch chain with "ignite chain serve" it launches chain fine...

But when i'm trying build binary from Makefile and init chain from binary it creates genesis.json file which still have some "stake" denomination properties...

i find out from this tutorial https://ida.interchain.io/tutorials/9-path-to-prod/4-genesis.html than you can change tokens denomination in genesis.json manually...

Even after changing denoms in genesis i'm still can't launch the network... it gives me such error 😅

panic: failed to execute DeliverTx for '{
          "body": {
            "messages": [
              {
                "@type": "/cosmos.staking.v1beta1.MsgCreateValidator",
                "description": {
                  "moniker": "OlimjonSputnik",
                  "identity": "",
                  "website": "",
                  "security_contact": "",
                  "details": ""
                },
                "commission": {
                  "rate": "0.100000000000000000",
                  "max_rate": "0.200000000000000000",
                  "max_change_rate": "0.010000000000000000"
                },
                "min_self_delegation": "1",
                "delegator_address": "",
                "validator_address": "sputnikvaloper10h6nfz699r6u6eltfw0a06279u34s7tur8u2qg",
                "pubkey": {
                  "@type": "/cosmos.crypto.ed25519.PubKey",
                  "key": "aPm0iB9hlWbmAjm9LTGrBEPUROCHaxQoyvBP+0U2EN0="
                },
                "value": {
                  "denom": "usputnik",
                  "amount": "10000000"
                }
              }
            ],
            "memo": "[email protected]:26656",
            "timeout_height": "0",
            "extension_options": [],
            "non_critical_extension_options": []
          },
          "auth_info": {
            "signer_infos": [
              {
                "public_key": {
                  "@type": "/cosmos.crypto.secp256k1.PubKey",
                  "key": "A3Nic92U5vrE4YCC3t7DATg7eU1yi3nMogw1e4p1jJY5"
                },
                "mode_info": {
                  "single": {
                    "mode": "SIGN_MODE_DIRECT"
                  }
                },
                "sequence": "0"
              }
            ],
            "fee": {
              "amount": [],
              "gas_limit": "200000",
              "payer": "",
              "granter": ""
            },
            "tip": null
          },
          "signatures": [
            "gt398HMPbA6cXcYz5LDTM8gc/YcJA5yMdkbNCw7zHc4KIsgusg7bG0H6bwh56opev+2ddoRe8cxMCeUs6HMUng=="
          ]
        }': failed to execute message; message index: 0: invalid coin denomination: got usputnik, expected stake: invalid request

Please, kindly point me to some working guide or tutorial so i could build and launch network with custom token denomination 🙏

ignite version Ignite CLI version: v28.5.0

@julienrbrt
Copy link
Member

Never stop I'm using ignite 😉
Joke aside, you need to modify the genesis exactly like you did in app_state in the config.yml.
Additionally check out the app_config and verify that the bond denom is correct as well.

@olimdzhon
Copy link
Author

@julienrbrt hey mate, yes i modified genesis.json manually... so i changed token denomination everywhere, however i got this error message above... btw, my project is empty. it's just generated with scaffold and i don't have MsgCreateValidator. i guess binary refers to some import of sdk maybe i need to implement or override this MsgCreateValidator?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To Discuss
Development

No branches or pull requests

2 participants