ignite / cli

Ignite is a CLI tool and hub designed for constructing Proof of Stake Blockchains rooted in Cosmos-SDK
https://ignite.com
Other
1.25k stars 546 forks source link

Custom token denomination #4304

Open olimdzhon opened 1 month ago

olimdzhon commented 1 month ago

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": "2308c6b7378af4ff161c88c9b27a63a0c56fd8fb@109.199.96.98: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 commented 1 month ago

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 commented 3 weeks ago

@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?