Skip to content

Commit

Permalink
Problem: (fix crypto-org-chain#88) missing docs for check-validator-u…
Browse files Browse the repository at this point in the history
…p.sh when node is using tmkms in the background

Solution: add description for check-validator-up.sh usage and fix check-validator-up.sh
  • Loading branch information
allthatjazzleo committed Jan 2, 2021
1 parent 3420ef7 commit 6d6bd11
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ check_chain_maind() {
RET_VALUE=$?
set -e
}
helpFunction() {
cat << EOF
Flags:
--help help for the script
--tendermint-url tendermint rpc interface for this chain (default "http://127.0.0.1:26657")
--pubkey tendermint Ed25519 PubKey; can be found in ".chain-maind/config/priv_validator_key.json"
--bechpubkey bech32 consensus PubKey; converted to tendermint Ed25519 PubKey automatically; useful for node using tmkms.
EOF
exit 1 # Exit script after printing help
}
check_curl
if [[ "${RET_VALUE}" != 0 ]]; then
echoerr "curl is not installed. Please install it first."
Expand All @@ -47,16 +58,20 @@ while [[ $# > 0 ]]; do
BECH_PUBKEY="$1"
shift 1
;;
--help)
helpFunction
;;
*)
echoerr "Unknown argument: $1"
echo "Unknown argument: $1"
helpFunction
;;
esac
done
set +u
if [[ ! -z "${BECH_PUBKEY}" ]]; then
check_chain_maind
if [[ "${RET_VALUE}" != 0 ]]; then
echoerr "curl is not installed. Please install it first for key conversion"
echoerr "chain-maind is not installed or not in PATH. Please install it first or check chain-maind is added to PATH for pubkey key conversion."
fi
PUBKEY=$(chain-maind debug pubkey ${BECH_PUBKEY} 2>&1 | grep "tendermint/PubKeyEd25519" | cut -d : -f2- | jq -r .value || echoerr "Decode Pubkey Failed ❌")
fi
Expand Down
10 changes: 9 additions & 1 deletion docs/getting-started/croeseid-testnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,15 @@ Once the `create-validator` transaction completes, you can check if your validat
To further check if the validator is signing blocks, kindly run this [script](https://github.com/crypto-com/chain-docs/blob/master/docs/getting-started/assets/signature_checking/check-validator-up.sh), for example:
```bash
$ ./check-validator-up.sh --tendermint-url https://testnet-croeseid.crypto.com:26657 --pubkey $(cat ~/.chain-maind/config/priv_validator_key.json | jq -r '.pub_key.value')
$ curl -sSL https://raw.githubusercontent.com/crypto-com/chain-docs/master/docs/getting-started/assets/signature_checking/check-validator-up.sh | bash -s -- --tendermint-url https://testnet-croeseid.crypto.com:26657 --pubkey $(cat ~/.chain-maind/config/priv_validator_key.json | jq -r '.pub_key.value')
The validator is in the active validator set under the address <YOUR_VALIDATOR_ADDRESS>
The validator is signing @ Block#<BLOCK_HEIGHT> 👍
```
For those who are using tmkms in background([AWS](./testnet-aws-1click.html)/[Azure](./testnet-azure-1click.html) 1-click deployment are using tmkms), you should use `--bechpubkey` the consensus pubkey with prefix `tcrocnclconspub1....` directly instead of `--pubkey` tendermint pubkey since the node is not using `~/.chain-maind/config/priv_validator_key.json` for signing.
```bash
$ curl -sSL https://raw.githubusercontent.com/crypto-com/chain-docs/master/docs/getting-started/assets/signature_checking/check-validator-up.sh | bash -s -- --tendermint-url https://testnet-croeseid.crypto.com:26657 --bechpubkey tcrocnclconspub1....
The validator is in the active validator set under the address <YOUR_VALIDATOR_ADDRESS>
The validator is signing @ Block#<BLOCK_HEIGHT> 👍
Expand Down

0 comments on commit 6d6bd11

Please sign in to comment.