Skip to content

Instantly share code, notes, and snippets.

@xlab
Created March 25, 2021 14:36
Show Gist options
  • Save xlab/d3eb48e68abc1425da2542497f668d45 to your computer and use it in GitHub Desktop.
Save xlab/d3eb48e68abc1425da2542497f668d45 to your computer and use it in GitHub Desktop.

Cosmos Daemon

Examples of bootstraping Cosmos networks:

$ CHAIN_ID=888 DENOM=inj ./test/cosmos/multinode.sh injectived
$ CHAIN_ID=somm DENOM=samoleans STAKE_DENOM=stake SCALE_FACTOR=000000 ./test/cosmos/multinode.sh sommelier

Full list of the supported ENV variables:

  • CHAIN_ID - specifies Cosmos Chain ID, like cosmos-1
  • CHAIN_DIR - is a prefix for all data dirs and logs, will be removed if CLEANUP=1
  • DENOM - Cosmos coin denom, the default coin of the network. Examples: uatom, aphoton, samoleans etc
  • STAKE_DENOM - Cosmos coin denom that is used for staking and governance. On the Cosmos Hub it's stake. Defaults to value of DENOM in the script.
  • SCALE_FACTOR - Scale factor for the Cosmos coin. Defaults to 1e18 to reflect Ethereum token balances. Use 000000 to follow Cosmos uatom (1e6) style.
  • CLEANUP - if this option set to 1, then the CHAIN_DIR will be removed in the most unsafe manner.
  • LOG_LEVEL - sets the log level of the Cosmos node configuration. Defaults to Cosmos' default (main:info,state:info,statesync:info,*:error).

Important: it is safe to run the script multiple times, it will stop nodes upon running, and optionally cleanup the state. If the state is not empty, the script will start nodes without running initialization again. So it could be used for manually retriable tests.

Cosmos Accounts

The script imports 3 validator accounts and 1 user account, specified by mnemonics in the script itself. Each validator account accessible as val on the corresponding nodes, and user account is shared across all three nodes as user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment