From bb658fbb3688e446ea4b4a9df46b42d066a86a47 Mon Sep 17 00:00:00 2001 From: gluax <16431709+gluax@users.noreply.github.com> Date: Fri, 3 Nov 2023 09:53:26 -0700 Subject: [PATCH] fix: more scripts and docs fixes --- README.md | 34 +++++++-------------------------- scripts/node_setup/unstaking.sh | 2 +- 2 files changed, 8 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index db2bfe5e..8e4a328a 100644 --- a/README.md +++ b/README.md @@ -131,23 +131,7 @@ docker run -d --name seda_node \ ghcr.io/sedaprotocol/node:latest start ``` -where `seda.env` is a `dotenv` described [here](#env-variables-configuration) - -Alternatively, you can pass the env variables manually: - -```bash -docker run -d --name seda_node \ ---env 'MONIKER=' \ ---env 'MNEMONIC=' \ ---env 'KEYRING_PASSWORD=' \ ---env 'NETWORK=' \ ---env 'NODE_ADDRESS=' \ ---volume ~/.seda-chain:/root/.seda-chain \ ---volume $(pwd)/seda.env:/seda-chain/.env \ -ghcr.io/sedaprotocol/node:latest start -``` - -**NOTE**: To run you must have these fields filled out. So to generate a mnemonic check out [here](#key-creation). +where `seda.env` is a `dotenv` described [here](#env-variables-configuration). ##### Stop and Start @@ -172,8 +156,8 @@ docker logs seda_node -n 100 Sometimes you may need to execute commands for example: - To generate a [key](#key-creation) -- Check if the dockerized node is a validator. -- Or to make the dockerized node a validator. +- Check if the dockerized node is a [validator](#checking-validator-status). +- Or how to [stake](#staking)/[unstake](#unstaking). These commands will all start with `docker exec seda_node`. @@ -189,7 +173,6 @@ The `docker` image will handle this for you. If in your passed in env file the m Otherwise simply have that field filled out, and it will add the account automatically. - #### Checking Chain Status There are a few things you may like to check as an operator(these assume your container is running): @@ -206,7 +189,7 @@ There are a few things you may like to check as an operator(these assume your co **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: +To stake run the following command: **NOTE**: The amount at the end is the amount of tokens in `aseda` to stake. ```bash @@ -233,13 +216,13 @@ txhash: 6C8A6C1925F3B373BBEA4DF609D8F1FAE6CDA094586763652557B527E88893A6 **NOTE**: This assumes you have already staked. -To become a validator run the following command: +To unstake 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 "./unstaking.sh 1000" # Which should produce some output: -gas estimate: 181315 +gas estimate: 164451 code: 0 codespace: "" data: "" @@ -249,10 +232,7 @@ gas_wanted: "0" height: "0" info: "" logs: [] -raw_log: '[]' -timestamp: "" -tx: null -txhash: 6C8A6C1925F3B373BBEA4DF609D8F1FAE6CDA094586763652557B527E88893A6 +txhash: 1BA768C240B379E7BBFF74D68148E95A64BFB167497C341842F4C2AF94376A77 ``` #### Checking Validator Status diff --git a/scripts/node_setup/unstaking.sh b/scripts/node_setup/unstaking.sh index 1aeac7ba..2c003322 100644 --- a/scripts/node_setup/unstaking.sh +++ b/scripts/node_setup/unstaking.sh @@ -11,5 +11,5 @@ 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 +auth_seda_chaind_command tx unbond $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