mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Problem: Old --p2p.seeds is now --p2p.persistent_peers (#2249)
Solution As per Tendermint 0.16.0 , --p2p.seeds is now --p2p.persistent_peers. Update bigchaindb/tendermint container to use that configuration. Also disable --p2p.pex, we currently don't want the peer exchange.
This commit is contained in:
parent
f81dfc744d
commit
5ce0538c61
@ -56,8 +56,8 @@ MongoDB admin user credentials, username and password.
|
||||
This user is created on the *admin* database with the authorization to create other users.
|
||||
|
||||
|
||||
vars.BDB_SEEDS, BDB_VALIDATORS, BDB_VALIDATORS_POWERS, BDB_GENESIS_TIME and BDB_CHAIN_ID
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
vars.BDB_PERSISTENT_PEERS, BDB_VALIDATORS, BDB_VALIDATORS_POWERS, BDB_GENESIS_TIME and BDB_CHAIN_ID
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
These parameters are shared across the cluster. More information about the generation
|
||||
of these parameters can be found at :ref:`generate-the-blockchain-id-and-genesis-time`.
|
||||
|
||||
|
@ -21,7 +21,7 @@ They look like this:
|
||||
.. code::
|
||||
|
||||
# Tendermint data
|
||||
BDB_SEEDS='bdb-instance-1,bdb-instance-2,bdb-instance-3,bdb-instance-4'
|
||||
BDB_PERSISTENT_PEERS='bdb-instance-1,bdb-instance-2,bdb-instance-3,bdb-instance-4'
|
||||
BDB_VALIDATORS='bdb-instance-1,bdb-instance-2,bdb-instance-3,bdb-instance-4'
|
||||
BDB_VALIDATOR_POWERS='10,10,10,10'
|
||||
BDB_GENESIS_TIME='0001-01-01T00:00:00Z'
|
||||
@ -32,7 +32,7 @@ That person will then share the results (Tendermint setup parameters)
|
||||
with all the node operators.
|
||||
|
||||
The above example parameters are for a cluster of 4 initial (seed) nodes.
|
||||
Note how ``BDB_SEEDS``, ``BDB_VALIDATORS`` and ``BDB_VALIDATOR_POWERS`` are lists
|
||||
Note how ``BDB_PERSISTENT_PEERS``, ``BDB_VALIDATORS`` and ``BDB_VALIDATOR_POWERS`` are lists
|
||||
with 4 items each.
|
||||
**If your consortium has a different number of initial nodes,
|
||||
then those lists should have that number or items.**
|
||||
@ -143,4 +143,4 @@ and then you will deploy all the stuff that you need to have a BigchainDB node.
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
@ -59,11 +59,11 @@ spec:
|
||||
imagePullPolicy: Always
|
||||
image: bigchaindb/tendermint:2.0.0-alpha3
|
||||
env:
|
||||
- name: TM_SEEDS
|
||||
- name: TM_PERSISTENT_PEERS
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: tendermint-config
|
||||
key: bdb-seeds
|
||||
key: bdb-persistent-peers
|
||||
- name: TM_VALIDATOR_POWER
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
|
@ -13,7 +13,7 @@ reflect any changes made to the container.
|
||||
docker run \
|
||||
--name=tendermint \
|
||||
--env TM_PUB_KEY_ACCESS_PORT=<port to access public keys hosted by nginx> \
|
||||
--env TM_SEEDS=<commad separated list of all nodes IP addresses/Hostnames> \
|
||||
--env TM_PERSISTENT_PEERS=<commad separated list of all peers IP addresses/Hostnames> \
|
||||
--env TM_VALIDATOR_POWER=<voting power of node> \
|
||||
--env TM_VALIDATORS=<list of all validators> \
|
||||
--env TM_GENESIS_TIME=<genesis time> \
|
||||
|
@ -2,7 +2,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
# Cluster vars
|
||||
tm_seeds=`printenv TM_SEEDS`
|
||||
tm_persistent_peers=`printenv TM_PERSISTENT_PEERS`
|
||||
tm_validators=`printenv TM_VALIDATORS`
|
||||
tm_validator_power=`printenv TM_VALIDATOR_POWER`
|
||||
tm_pub_key_access_port=`printenv TM_PUB_KEY_ACCESS_PORT`
|
||||
@ -23,7 +23,7 @@ CANNOT_INITIATLIZE_INSTANCE='Cannot start instance, if initial validator(s) are
|
||||
|
||||
|
||||
# sanity check
|
||||
if [[ -z "${tm_seeds:?TM_SEEDS not specified. Exiting!}" || \
|
||||
if [[ -z "${tm_persistent_peers:?TM_PERSISTENT_PEERS not specified. Exiting!}" || \
|
||||
-z "${tm_validators:?TM_VALIDATORS not specified. Exiting!}" || \
|
||||
-z "${tm_validator_power:?TM_VALIDATOR_POWER not specified. Exiting!}" || \
|
||||
-z "${tm_pub_key_access_port:?TM_PUB_KEY_ACCESS_PORT not specified. Exiting!}" || \
|
||||
@ -36,7 +36,7 @@ if [[ -z "${tm_seeds:?TM_SEEDS not specified. Exiting!}" || \
|
||||
echo "Missing required enviroment variables."
|
||||
exit 1
|
||||
else
|
||||
echo tm_seeds="$TM_SEEDS"
|
||||
echo tm_persistent_peers="$TM_PERSISTENT_PEERS"
|
||||
echo tm_validators="$TM_VALIDATORS"
|
||||
echo tm_validator_power="$TM_VALIDATOR_POWER"
|
||||
echo tm_pub_key_access_port="$TM_PUB_KEY_ACCESS_PORT"
|
||||
@ -104,10 +104,10 @@ for i in "${!VALS_ARR[@]}"; do
|
||||
rm pub_validator.json
|
||||
done
|
||||
|
||||
# construct seeds
|
||||
IFS=',' read -ra SEEDS_ARR <<< "$tm_seeds"
|
||||
seeds=()
|
||||
for s in "${SEEDS_ARR[@]}"; do
|
||||
# construct persistent peers
|
||||
IFS=',' read -ra PEERS_ARR <<< "$tm_persistent_peers"
|
||||
peers=()
|
||||
for s in "${PEERS_ARR[@]}"; do
|
||||
echo "http://$s:$tm_pub_key_access_port/address"
|
||||
curl -s --fail "http://$s:$tm_pub_key_access_port/address" > /dev/null
|
||||
ERR=$?
|
||||
@ -123,11 +123,11 @@ for s in "${SEEDS_ARR[@]}"; do
|
||||
ERR=$?
|
||||
echo "Cannot get address for Tendermint instance: ${s}"
|
||||
done
|
||||
seed_addr=$(curl -s "http://$s:$tm_pub_key_access_port/address")
|
||||
seeds+=("$seed_addr@$s:$tm_p2p_port")
|
||||
peer_addr=$(curl -s "http://$s:$tm_pub_key_access_port/address")
|
||||
peers+=("$peer_addr@$s:$tm_p2p_port")
|
||||
done
|
||||
seeds=$(IFS=','; echo "${seeds[*]}")
|
||||
peers=$(IFS=','; echo "${peers[*]}")
|
||||
|
||||
# start nginx
|
||||
echo "INFO: starting tendermint..."
|
||||
exec tendermint node --p2p.seeds="$seeds" --moniker="$tm_instance_name" --proxy_app="tcp://$tm_proxy_app:$tm_abci_port" --consensus.create_empty_blocks=false
|
||||
exec tendermint node --p2p.persistent_peers="$peers" --moniker="$tm_instance_name" --proxy_app="tcp://$tm_proxy_app:$tm_abci_port" --consensus.create_empty_blocks=false --p2p.pex=false
|
||||
|
@ -129,8 +129,8 @@ metadata:
|
||||
name: tendermint-config
|
||||
namespace: default
|
||||
data:
|
||||
# bdb-seeds is the list of all the peers in the network.
|
||||
bdb-seeds: "<',' separated list of all tendermint nodes in the network>"
|
||||
# bdb-persistent-peers is the list of all the peers in the network.
|
||||
bdb-persistent-peers: "<',' separated list of all tendermint peers in the network>"
|
||||
|
||||
# bdb-validators is the list of all validators in the network.
|
||||
bdb-validators: "<',' separated list of all validators in the network>"
|
||||
|
@ -228,7 +228,7 @@ function generate_config_map(){
|
||||
bdb_user=`cat "${1}"/"$BDB_CN".user`
|
||||
mdb_admin_username="${2}"
|
||||
node_fqdn="${3}"
|
||||
bdb_seeds="${4}"
|
||||
bdb_persistent_peers="${4}"
|
||||
bdb_validators="${5}"
|
||||
bdb_validators_power="${6}"
|
||||
bdb_genesis_time="${7}"
|
||||
@ -361,8 +361,8 @@ metadata:
|
||||
name: tendermint-config
|
||||
namespace: default
|
||||
data:
|
||||
# bdb-seeds is the list of all the peers in the network.
|
||||
bdb-seeds: "${bdb_seeds}"
|
||||
# bdb-persistent-peers is the list of all the peers in the network.
|
||||
bdb-persistent-peers: "${bdb_persistent_peers}"
|
||||
|
||||
# bdb-validators is the list of all validators in the network.
|
||||
bdb-validators: "${bdb_validators}"
|
||||
|
@ -87,4 +87,4 @@ convert_b64 $BASE_K8S_DIR $BASE_CA_DIR/$BASE_EASY_RSA_PATH $BASE_CLIENT_CERT_DIR
|
||||
get_users $BASE_USERS_DIR $BASE_CA_DIR/$BASE_EASY_RSA_PATH
|
||||
generate_secretes_no_threescale $BASE_K8S_DIR $SECRET_TOKEN $HTTPS_CERT_KEY_FILE_NAME $HTTPS_CERT_CHAIN_FILE_NAME $MDB_ADMIN_PASSWORD
|
||||
|
||||
generate_config_map $BASE_USERS_DIR $MDB_ADMIN_USER $NODE_FQDN $BDB_SEEDS $BDB_VALIDATORS $BDB_VALIDATOR_POWERS $BDB_GENESIS_TIME $BDB_CHAIN_ID $BDB_INSTANCE_NAME $NODE_DNS_SERVER
|
||||
generate_config_map $BASE_USERS_DIR $MDB_ADMIN_USER $NODE_FQDN $BDB_PERSISTENT_PEERS $BDB_VALIDATORS $BDB_VALIDATOR_POWERS $BDB_GENESIS_TIME $BDB_CHAIN_ID $BDB_INSTANCE_NAME $NODE_DNS_SERVER
|
||||
|
@ -20,7 +20,7 @@ BDB_INSTANCE_NAME='bdb-instance-0'
|
||||
|
||||
# Comma separated list of initial peers in the
|
||||
# network.
|
||||
BDB_SEEDS='bdb-instance-0,bdb-instance-1,bdb-instance-2,bdb-instance-3'
|
||||
BDB_PERSISTENT_PEERS='bdb-instance-0,bdb-instance-1,bdb-instance-2,bdb-instance-3'
|
||||
|
||||
# Comma separated list of validators in the
|
||||
# network
|
||||
|
Loading…
x
Reference in New Issue
Block a user