Update priv validator format in stack.sh to support tm v0.28.0+

Signed-off-by: David Dashyan <mail@davie.li>
This commit is contained in:
David Dashyan
2020-09-07 20:58:21 +03:00
parent d77ab60651
commit 62ae66fef7
4 changed files with 89 additions and 20 deletions

36
pkg/scripts/tm_start Normal file
View File

@@ -0,0 +1,36 @@
#!/usr/bin/env bash
# Comment: This script is was carved out of start.yml task command. It's
# purpose is to copy generated in tm_config_gen configuration files from mounted
# volume, compile `--p2p.persistent_peers' cmd argument and start tendermint
# node.
# NOTE following environment have to be set!
# $_ITEM -- stack size position identifier
# $STACK_SIZE -- self explanatory
# $TM_DOCKER_NAME -- used to identify tendermint containers in the network
# $BIGCHAINDB_DOCKER_NAME -- self explanatory
# $TM_P2P_PORT -- self explanatory
# Copy confguration files from mounted config volume
cp /tendermint_config/genesis.json \
/tendermint/config/genesis.json
cp /tendermint_config/priv_validator_key$_ITEM.json \
/tendermint/config/priv_validator_key.json
cp /tendermint_config/node_key$_ITEM.json \
/tendermint/config/node_key.json
# Create peers array (to be passed to `tendermint node' command
peers=()
for i in $(seq $STACK_SIZE); do
peers+=($(cat /tendermint_config/node_id$i)@"$TM_DOCKER_NAME$i:$TM_P2P_PORT");
done
peers=$(IFS=","; echo "${peers[*]}")
echo "starting node with persistent peers set to:"
echo $peers
tendermint node \
--p2p.persistent_peers="$peers" \
--p2p.laddr "tcp://"$TM_DOCKER_NAME$_ITEM":26656" \
--proxy_app="tcp://"$BIGCHAINDB_DOCKER_NAME$_ITEM":26658" \
--consensus.create_empty_blocks=false \
--p2p.pex=false