From 9cfc1e6f5a616279a02366f9fd3ef15a313fa005 Mon Sep 17 00:00:00 2001 From: Muawia Khan Date: Wed, 11 Jul 2018 16:59:42 +0200 Subject: [PATCH] Update to tendermint version 0.22.3 (#2380) * Update to tendermint version 0.22.3 for dev/test deployment docs and scripts * Update version and parameters for 0.22.3 - Sync docker-compose - Power should be a "string" not a int,uint --- docker-compose.yml | 2 +- .../run-dev-network-stack.md | 12 ++++++------ .../run-node-as-processes.md | 8 ++++---- .../production-deployment-template/workflow.rst | 2 +- docs/server/source/simple-network-setup.md | 8 ++++---- k8s/bigchaindb/tendermint_container/Dockerfile | 2 +- .../tendermint_container/tendermint_entrypoint.bash | 2 +- pkg/configuration/roles/tendermint/files/Dockerfile | 2 +- pkg/configuration/roles/tendermint/tasks/start.yml | 2 +- .../roles/tendermint/templates/start_tendermint.j2 | 2 +- pkg/scripts/stack.sh | 2 +- pkg/scripts/unstack.sh | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 30bb23b6..9201e12c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -44,7 +44,7 @@ services: retries: 3 command: '.ci/entrypoint.sh' tendermint: - image: tendermint/tendermint:0.22.0 + image: tendermint/tendermint:0.22.3 # volumes: # - ./tmdata:/tendermint entrypoint: '' diff --git a/docs/contributing/source/dev-setup-coding-and-contribution-process/run-dev-network-stack.md b/docs/contributing/source/dev-setup-coding-and-contribution-process/run-dev-network-stack.md index d9833ca0..cb8555f3 100644 --- a/docs/contributing/source/dev-setup-coding-and-contribution-process/run-dev-network-stack.md +++ b/docs/contributing/source/dev-setup-coding-and-contribution-process/run-dev-network-stack.md @@ -32,7 +32,7 @@ $ curl -fOL https://raw.githubusercontent.com/bigchaindb/bigchaindb/${GIT_BRANCH ## Quick Start If you run `stack.sh` out of the box i.e. without any configuration changes, you will be able to deploy a 4 node -BigchainDB network with Docker containers, created from `master` branch of `bigchaindb/bigchaindb` repo and Tendermint version `0.19.9`. +BigchainDB network with Docker containers, created from `master` branch of `bigchaindb/bigchaindb` repo and Tendermint version `0.22.3`. **Note**: Run `stack.sh` with either root or non-root user with sudo enabled. @@ -90,7 +90,7 @@ $ bash stack.sh -h variable. (default: master) ENV[TM_VERSION] - (Optional) Tendermint version to use for the setup. (default: 0.19.9) + (Optional) Tendermint version to use for the setup. (default: 0.22.3) ENV[MONGO_VERSION] (Optional) MongoDB version to use with the setup. (default: 3.6) @@ -171,8 +171,8 @@ $ export STACK_REPO=bigchaindb/bigchaindb # Default: master $ export STACK_BRANCH=master -#Optional, since 0.19.9 is the default tendermint version. -$ export TM_VERSION=0.19.9 +#Optional, since 0.22.3 is the default tendermint version. +$ export TM_VERSION=0.22.3 #Optional, since 3.6 is the default MongoDB version. $ export MONGO_VERSION=3.6 @@ -222,8 +222,8 @@ $ export STACK_REPO=bigchaindb/bigchaindb # Default: master $ export STACK_BRANCH=master -#Optional, since 0.19.9 is the default tendermint version -$ export TM_VERSION=0.19.9 +#Optional, since 0.22.3 is the default tendermint version +$ export TM_VERSION=0.22.3 #Optional, since 3.6 is the default MongoDB version. $ export MONGO_VERSION=3.6 diff --git a/docs/contributing/source/dev-setup-coding-and-contribution-process/run-node-as-processes.md b/docs/contributing/source/dev-setup-coding-and-contribution-process/run-node-as-processes.md index 822ef569..2c739555 100644 --- a/docs/contributing/source/dev-setup-coding-and-contribution-process/run-node-as-processes.md +++ b/docs/contributing/source/dev-setup-coding-and-contribution-process/run-node-as-processes.md @@ -19,13 +19,13 @@ After the installation of MongoDB is complete, run MongoDB using `sudo mongod` ### Installing a Tendermint Executable -Find [the version number of the latest Tendermint release](https://github.com/tendermint/tendermint/releases) and install it using the following, where 0.19.7 should be replaced by the latest released version number: +Find [the version number of the latest Tendermint release](https://github.com/tendermint/tendermint/releases) and install it using the following, where 0.22.3 should be replaced by the latest released version number: ```bash $ sudo apt install -y unzip -$ wget https://github.com/tendermint/tendermint/releases/download/v0.19.7/tendermint_0.19.7_linux_amd64.zip -$ unzip tendermint_0.19.7_linux_amd64.zip -$ rm tendermint_0.19.7_linux_amd64.zip +$ wget https://github.com/tendermint/tendermint/releases/download/v0.22.3/tendermint_0.22.3_linux_amd64.zip +$ unzip tendermint_0.22.3_linux_amd64.zip +$ rm tendermint_0.22.3_linux_amd64.zip $ sudo mv tendermint /usr/local/bin ``` diff --git a/docs/server/source/production-deployment-template/workflow.rst b/docs/server/source/production-deployment-template/workflow.rst index 51550242..197cd231 100644 --- a/docs/server/source/production-deployment-template/workflow.rst +++ b/docs/server/source/production-deployment-template/workflow.rst @@ -44,7 +44,7 @@ you can do this: .. code:: $ mkdir $(pwd)/tmdata - $ docker run --rm -v $(pwd)/tmdata:/tendermint/config tendermint/tendermint:0.19.9 init + $ docker run --rm -v $(pwd)/tmdata:/tendermint/config tendermint/tendermint:0.22.3 init $ cat $(pwd)/tmdata/genesis.json You should see something that looks like: diff --git a/docs/server/source/simple-network-setup.md b/docs/server/source/simple-network-setup.md index a744d9f3..165cf006 100644 --- a/docs/server/source/simple-network-setup.md +++ b/docs/server/source/simple-network-setup.md @@ -74,13 +74,13 @@ Note: The `mongodb` package is _not_ the official MongoDB package from MongoDB t #### Install Tendermint -Install a [recent version of Tendermint][tendermint:releases]. BigchainDB Server requires version 0.19.9 or newer. +Install a [recent version of Tendermint][tendermint:releases]. BigchainDB Server requires version 0.22.3 or newer. ``` sudo apt install -y unzip -wget https://github.com/tendermint/tendermint/releases/download/v0.19.9/tendermint_0.19.9_linux_amd64.zip -unzip tendermint_0.19.9_linux_amd64.zip -rm tendermint_0.19.9_linux_amd64.zip +wget https://github.com/tendermint/tendermint/releases/download/v0.22.3/tendermint_0.22.3_linux_amd64.zip +unzip tendermint_0.22.3_linux_amd64.zip +rm tendermint_0.22.3_linux_amd64.zip sudo mv tendermint /usr/local/bin ``` diff --git a/k8s/bigchaindb/tendermint_container/Dockerfile b/k8s/bigchaindb/tendermint_container/Dockerfile index ab389f3c..25a523c0 100644 --- a/k8s/bigchaindb/tendermint_container/Dockerfile +++ b/k8s/bigchaindb/tendermint_container/Dockerfile @@ -1,4 +1,4 @@ -FROM tendermint/tendermint:0.19.9 +FROM tendermint/tendermint:0.22.3 LABEL maintainer "dev@bigchaindb.com" WORKDIR / USER root diff --git a/k8s/bigchaindb/tendermint_container/tendermint_entrypoint.bash b/k8s/bigchaindb/tendermint_container/tendermint_entrypoint.bash index 89575213..287015bd 100755 --- a/k8s/bigchaindb/tendermint_container/tendermint_entrypoint.bash +++ b/k8s/bigchaindb/tendermint_container/tendermint_entrypoint.bash @@ -99,7 +99,7 @@ for i in "${!VALS_ARR[@]}"; do done set -e # add validator to genesis file along with its pub_key - curl -s "http://${VALS_ARR[$i]}:$tm_pub_key_access_port/pub_key.json" | jq ". as \$k | {pub_key: \$k, power: ${VAL_POWERS_ARR[$i]}, name: \"${VALS_ARR[$i]}\"}" > pub_validator.json + curl -s "http://${VALS_ARR[$i]}:$tm_pub_key_access_port/pub_key.json" | jq ". as \$k | {pub_key: \$k, power: \"${VAL_POWERS_ARR[$i]}\", name: \"${VALS_ARR[$i]}\"}" > pub_validator.json cat /tendermint/config/genesis.json | jq ".validators |= .+ [$(cat pub_validator.json)]" > tmpgenesis && mv tmpgenesis /tendermint/config/genesis.json rm pub_validator.json done diff --git a/pkg/configuration/roles/tendermint/files/Dockerfile b/pkg/configuration/roles/tendermint/files/Dockerfile index ada57e2e..68dab41c 100644 --- a/pkg/configuration/roles/tendermint/files/Dockerfile +++ b/pkg/configuration/roles/tendermint/files/Dockerfile @@ -1,4 +1,4 @@ -ARG tm_version=0.19.9 +ARG tm_version=0.22.3 FROM tendermint/tendermint:${tm_version} LABEL maintainer "dev@bigchaindb.com" WORKDIR / diff --git a/pkg/configuration/roles/tendermint/tasks/start.yml b/pkg/configuration/roles/tendermint/tasks/start.yml index 3f253d50..9b458a1d 100644 --- a/pkg/configuration/roles/tendermint/tasks/start.yml +++ b/pkg/configuration/roles/tendermint/tasks/start.yml @@ -27,7 +27,7 @@ for i in $( seq {{ stack_size }} );do tendermint gen_validator > /tendermint/config/priv_validator$i.json; tendermint gen_node_key > /tendermint/config/node_id$i; mv /tendermint/config/node_key.json /tendermint/config/node_key$i.json; - cat tendermint/config/priv_validator$i.json | jq ".pub_key" | jq ". as \$k | {pub_key: \$k, power: 10, + cat tendermint/config/priv_validator$i.json | jq ".pub_key" | jq ". as \$k | {pub_key: \$k, power: \"10\", name: \"{{ tendermint_docker_name }}$i\"}" > pub_validator$i.json; cat /tendermint/config/genesis.json | jq ".validators |= .+ [$(cat pub_validator$i.json)]" > tmpgenesis; mv tmpgenesis /tendermint/config/genesis.json; diff --git a/pkg/configuration/roles/tendermint/templates/start_tendermint.j2 b/pkg/configuration/roles/tendermint/templates/start_tendermint.j2 index 35961df2..75631f43 100644 --- a/pkg/configuration/roles/tendermint/templates/start_tendermint.j2 +++ b/pkg/configuration/roles/tendermint/templates/start_tendermint.j2 @@ -65,7 +65,7 @@ for i in "${!VALS_ARR[@]}"; do done set -e # add validator to genesis file along with its pub_key - curl -s "http://${VALS_ARR[$i]}:$tm_pub_key_access_port/pub_key.json" | jq ". as \$k | {pub_key: \$k, power: ${VAL_POWERS_ARR[$i]}, name: \"${VALS_ARR[$i]}\"}" > pub_validator.json + curl -s "http://${VALS_ARR[$i]}:$tm_pub_key_access_port/pub_key.json" | jq ". as \$k | {pub_key: \$k, power: \"${VAL_POWERS_ARR[$i]}\", name: \"${VALS_ARR[$i]}\"}" > pub_validator.json cat /tendermint/config/genesis.json | jq ".validators |= .+ [$(cat pub_validator.json)]" > tmpgenesis && mv tmpgenesis /tendermint/config/genesis.json rm pub_validator.json done diff --git a/pkg/scripts/stack.sh b/pkg/scripts/stack.sh index 2cd98864..25292065 100755 --- a/pkg/scripts/stack.sh +++ b/pkg/scripts/stack.sh @@ -11,7 +11,7 @@ stack_repo=${STACK_REPO:="bigchaindb/bigchaindb"} stack_size=${STACK_SIZE:=4} stack_type=${STACK_TYPE:="docker"} stack_type_provider=${STACK_TYPE_PROVIDER:=""} -tm_version=${TM_VERSION:="0.19.9"} +tm_version=${TM_VERSION:="0.22.3"} mongo_version=${MONGO_VERSION:="3.6"} stack_vm_memory=${STACK_VM_MEMORY:=2048} stack_vm_cpus=${STACK_VM_CPUS:=2} diff --git a/pkg/scripts/unstack.sh b/pkg/scripts/unstack.sh index 11661472..2c5359d9 100755 --- a/pkg/scripts/unstack.sh +++ b/pkg/scripts/unstack.sh @@ -11,7 +11,7 @@ stack_repo=${STACK_REPO:="bigchaindb/bigchaindb"} stack_size=${STACK_SIZE:=4} stack_type=${STACK_TYPE:="docker"} stack_type_provider=${STACK_TYPE_PROVIDER:=""} -tm_version=${TM_VERSION:="0.19.9"} +tm_version=${TM_VERSION:="0.22.3"} mongo_version=${MONGO_VERSION:="3.6"} stack_vm_memory=${STACK_VM_MEMORY:=2048} stack_vm_cpus=${STACK_VM_CPUS:=2}