forked from eminmtas/aligned_layer_tendermint
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup_validator.sh
More file actions
executable file
·36 lines (30 loc) · 832 Bytes
/
setup_validator.sh
File metadata and controls
executable file
·36 lines (30 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
set -e
if [ $# -lt 2 ]; then
echo "Usage: $0 <account> <staking_amount>"
exit 1
else
VALIDATOR=$1
STAKING_AMOUNT=$2
fi
NODE_HOME=$HOME/.alignedlayer
CHAIN_BINARY=alignedlayerd
: ${CHAIN_ID:="alignedlayer"}
: ${FEES:="50stake"}
: ${PEER_ADDR:="91.107.239.79"}
VALIDATOR_KEY=$($CHAIN_BINARY tendermint show-validator)
MONIKER=$($CHAIN_BINARY config get config moniker)
cat << EOF > $NODE_HOME/config/validator.json
{
"pubkey": $VALIDATOR_KEY,
"amount": "$STAKING_AMOUNT",
"moniker": $MONIKER,
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1"
}
EOF
$CHAIN_BINARY tx staking create-validator $NODE_HOME/config/validator.json \
--from $VALIDATOR --chain-id $CHAIN_ID \
--node tcp://$(echo $PEER_ADDR | cut -d, -f1):26657 --fees $FEES