diff --git a/.env.example b/.env.example index f1c599a3..841fcf01 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,6 @@ MNEMONIC= # Required: The keyring password must be at least 8 characters. KEYRING_PASSWORD=qwertyuiop # Required: The id of the network you wish to join. i.e. ('devnet', 'testnet') -NETWORK=devnet +NETWORK=testnet # Required: The address of external node to connect to for syncing. -NODE_ADDRESS=http://18.130.31.180:26657 \ No newline at end of file +NODE_ADDRESS=https://3.10.185.200:26657 \ No newline at end of file diff --git a/README.md b/README.md index 3797ef81..db2bfe5e 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ docker run -d --name seda_node \ --env 'MONIKER=' \ --env 'MNEMONIC=' \ --env 'KEYRING_PASSWORD=' \ ---env 'NETWORK_ID=' \ +--env 'NETWORK=' \ --env 'NODE_ADDRESS=' \ --volume ~/.seda-chain:/root/.seda-chain \ --volume $(pwd)/seda.env:/seda-chain/.env \ @@ -194,29 +194,49 @@ Otherwise simply have that field filled out, and it will add the account automat There are a few things you may like to check as an operator(these assume your container is running): -1. If your node is synced. This can be done with the following command: +1. The current height of the chain: ```bash - docker exec seda_node seda-chaind status | jq '.SyncInfo.catching_up' - ``` - In which it outputs: - - `true`: if the node is **not** synced. - - `false`: if the node is synced. - -2. The current height of the chain: - ```bash - docker exec seda_node seda-chaind query block | jq '.block.header.height' + docker exec seda_node /bin/bash -c "seda-chaind query block | jq '.block.header.height'" ``` Which outputs a number, the current chain height. +2. More commands coming soon. -#### Becoming a Validator +#### Staking **NOTE**: This assumes you already have funds in your account. If you don't please add some funds to your account before trying. +To become a validator run the following command: +**NOTE**: The amount at the end is the amount of tokens in `aseda` to stake. + +```bash +docker exec seda_node /bin/bash -c "./staking.sh 1000" + +# Which should produce some output: +gas estimate: 181315 +code: 0 +codespace: "" +data: "" +events: [] +gas_used: "0" +gas_wanted: "0" +height: "0" +info: "" +logs: [] +raw_log: '[]' +timestamp: "" +tx: null +txhash: 6C8A6C1925F3B373BBEA4DF609D8F1FAE6CDA094586763652557B527E88893A6 +``` + +#### Unstaking + +**NOTE**: This assumes you have already staked. + To become a validator run the following command: **NOTE**: The amount at the end is the amount of tokens in `aseda` to stake. ```bash -docker exec seda_node /bin/bash -c "./become_validator.sh 1000" +docker exec seda_node /bin/bash -c "./unstaking.sh 1000" # Which should produce some output: gas estimate: 181315 @@ -235,7 +255,10 @@ tx: null txhash: 6C8A6C1925F3B373BBEA4DF609D8F1FAE6CDA094586763652557B527E88893A6 ``` +#### Checking Validator Status + You can then monitor your validator status by running: +**NOTE**: To be a validator you must be one of the top 100 stakers. ```bash docker exec seda_node /bin/bash -c "./check_validator.sh" diff --git a/scripts/node_setup/become_validator.sh b/scripts/node_setup/staking.sh similarity index 100% rename from scripts/node_setup/become_validator.sh rename to scripts/node_setup/staking.sh diff --git a/scripts/node_setup/unstaking.sh b/scripts/node_setup/unstaking.sh new file mode 100644 index 00000000..1aeac7ba --- /dev/null +++ b/scripts/node_setup/unstaking.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Tell script to exit immediately if any cmd fails +set -e + +BIN="seda-chaind" +KEY_NAME="${KEY_NAME:-default_key}" +STAKE_AMOUNT="$1aseda" + +source common.sh + +validator_pub_key=$($BIN tendermint show-validator --home=$HOME/.seda-chain) + +chain_id=$(cat $HOME/.seda-chain/config/genesis.json | jq .chain_id | tr -d '"') +auth_seda_chaind_command tx undbound create-validator $validator_pub_key --amount=$STAKE_AMOUNT --pubkey=$validator_pub_key --moniker=$MONIKER --commission-rate=0.10 --commission-max-rate=0.20 --commission-max-change-rate=0.01 --gas=auto --gas-adjustment=1.2 --gas-prices=0.0025aseda --from=$KEY_NAME --min-self-delegation=1 --yes --home=$HOME/.seda-chain --chain-id=$chain_id +