Custom chian with Native token

i am create new custom chain using cosmosSdk help of ignite cli.the chian run locally.Now i want create native coin for that blockchain, by default its have two assets “token”, “stake”. i want add native coin name “ABC”. how to customize to add native coin for that blockchian anyone have answers please share some knowledge or resources

hey,

if i understand your goal correctly, you can replace stake with uabc in yourchain/config.yml before building, something like:

version: 1
validation: sovereign

accounts:
  - name: alice
    coins:
      - 20000token
      - 200000000uabc
  - name: bob
    coins:
      - 10000token
      - 100000000uabc

client:
  openapi:
    path: docs/static/openapi.yml

faucet:
  name: bob
  coins:
    - 5token
    - 100000uabc

validators:
  - name: alice
    bonded: 100000000uabc
  - name: validator1
    bonded: 100000000uabc
  - name: validator2
    bonded: 200000000uabc
  - name: validator3
    bonded: 300000000uabc

staking:
  bond_denom: uabc

genesis:
  app_state:
    staking:
      params:
        bond_denom: uabc
    bank:
      denom_metadata:
        - base: uabc
          display: ABC
          name: ABC Token
          symbol: ABC
          denom_units:
            - denom: uabc
              exponent: 0
            - denom: ABC
              exponent: 6
      send_enabled:
        - denom: uabc
          enabled: true

then execute

ignite chain build --clear-cache
ignite chain serve --reset-once

after that you should be able to query balances, send and stake uabc, and use it for tx fees also:

  • get bob address
    chaind keys list
    
  • query bob balances
    chaind query bank balances <address> 
    
  • query validators
    chaind q staking validators
    
  • stake some uabc with a validator from bob address (replace validator address with your local one)
    chaind tx staking delegate cosmosvaloper10p2cxyyc5a6dnmwfcd4m64jcg6g7flc2ng4ydu 10000uabc --from bob --fees 1000uabc
    

tokenfactory

if you want to have more control (minting, burning, etc.) - you can try using tokenfactory

ignite scaffold module tokenfactory --dep bank
ignite scaffold message create-coin denom:string amount:string --module tokenfactory

this lets you mint uabc after launch

chaind tx tokenfactory create-coin uabc 1000 ...

you will need to code minting logic in x/tokenfactory/keeper/.


for resources: this websites has some good tutorials: https://tutorials.cosmos.network, https://ida.interchain.io

you will also likely get a faster response on discord or telegram.
there is an ai helper for developers in discord for some quick help.

thanks for your resposnse, yes i want ABC coin for staking and pay fees using ABC. could you please share sample code and your guidance.

hey, i updated my answer for the latest version of ignite (v29.0.0-beta.1) - it shows how to replace stake with uabc, so that uabc can be used for staking and as fee also

1 Like

Big thanks brother, its working

1 Like