Skip to content

Instantly share code, notes, and snippets.

@hydrogen18
Created December 8, 2020 19:20
Show Gist options
  • Save hydrogen18/1d1fa2c57b64fb045428ad6f6df5dd02 to your computer and use it in GitHub Desktop.
Save hydrogen18/1d1fa2c57b64fb045428ad6f6df5dd02 to your computer and use it in GitHub Desktop.
creating a validator

To make a node a validator in Akash do the following

  1. Initialize a new node
  2. Copy over the genesis file for the new network
  3. Create a new key, name it myvalidator
  4. Tranfser 100000uakt to the new key
  5. Figure out your validator address by running
akash --home $AKASH_HOME tendermint show-validator

This will output a value like this

akashvalconspub1zcjduepq3wkvh6k0r36qrfprwqza7tkmd4u4rrvx2400m5zdhctt3auk4zls6g604m

Notice this address starts with 'akashvalconspub`.

Next we need to stake tokens onto that address

akash --home "$AKASH_HOME" tx staking create-validator --keyring-backend test --from myvalidator --moniker myvalidator --amount=1uakt --pubkey $PUBKEY --commission-rate=0.1 --commission-max-rate=0.2 --commission-max-change-rate=0.01 --min-self-delegation=1 --gas=auto --chain-id=$CHAIN_ID

where $PUB_KEY is the value from above.

At this point the transaction should automatically have the gas calculated and be executed.

Next, get your validator operator address

akash --home "$AKASH_HOME" keys --keyring-backend=test show myvalidator --bech val

The output has a line like this

address: akashvaloper17mhnhk2mly30gs2z7aj4qyky548z6ycrzrq53w

This part after the colon is the address. Now we can query to see what the status of the validator is

akash --home $AKASH_HOME query staking validator $OPER_ADDR

Replacing $OPER_ADDR with the value from above.

This shows output like this

commission:
  commission_rates:
    max_change_rate: "0.010000000000000000"
    max_rate: "0.200000000000000000"
    rate: "0.100000000000000000"
  update_time: "2020-12-08T19:04:03.348496087Z"
consensus_pubkey:
  '@type': /cosmos.crypto.ed25519.PubKey
  key: i6zL6s8cdAGkI3AF3y7bbXlRjYZVXv3QTb4WuPeWqL8=
delegator_shares: "1.000000000000000000"
description:
  details: ""
  identity: ""
  moniker: node1
  security_contact: ""
  website: ""
jailed: false
min_self_delegation: "1"
operator_address: akashvaloper17mhnhk2mly30gs2z7aj4qyky548z6ycrzrq53w
status: BOND_STATUS_UNBONDED
tokens: "1"
unbonding_height: "0"
unbonding_time: "1970-01-01T00:00:00Z"

The update_time listed should be when the validator is created and that tokens list the amount specified when the validator was created.

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