diff --git a/DOCKER/Dockerfile b/DOCKER/Dockerfile index 55f2e14ab..019e1f30d 100644 --- a/DOCKER/Dockerfile +++ b/DOCKER/Dockerfile @@ -1,8 +1,8 @@ FROM alpine:3.6 # This is the release of tendermint to pull in. -ENV TM_VERSION 0.10.0 -ENV TM_SHA256SUM a29852b8d51c00db93c87c3d148fa419a047abd38f32b2507a905805131acc19 +ENV TM_VERSION 0.11.0 +ENV TM_SHA256SUM 7e443bac4d42f12e7beaf9cee63b4a565dad8c58895291fdedde8057088b70c5 # Tendermint will be looking for genesis file in /tendermint (unless you change # `genesis_file` in config.toml). You can put your config.toml and private diff --git a/DOCKER/README.md b/DOCKER/README.md index e191abc39..e5c6fee35 100644 --- a/DOCKER/README.md +++ b/DOCKER/README.md @@ -1,6 +1,7 @@ # Supported tags and respective `Dockerfile` links -- `0.10.0`, `latest` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/e5342f4054ab784b2cd6150e14f01053d7c8deb2/DOCKER/Dockerfile) +- `0.11.0`, `latest` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/9177cc1f64ca88a4a0243c5d1773d10fba67e201/DOCKER/Dockerfile) +- `0.10.0` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/e5342f4054ab784b2cd6150e14f01053d7c8deb2/DOCKER/Dockerfile) - `0.9.1`, `0.9`, [(Dockerfile)](https://github.com/tendermint/tendermint/blob/809e0e8c5933604ba8b2d096803ada7c5ec4dfd3/DOCKER/Dockerfile) - `0.9.0` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/d474baeeea6c22b289e7402449572f7c89ee21da/DOCKER/Dockerfile) - `0.8.0`, `0.8` [(Dockerfile)](https://github.com/tendermint/tendermint/blob/bf64dd21fdb193e54d8addaaaa2ecf7ac371de8c/DOCKER/Dockerfile) @@ -8,13 +9,24 @@ `develop` tag points to the [develop](https://github.com/tendermint/tendermint/tree/develop) branch. +# Quick reference + +* **Where to get help:** + [Chat on Rocket](https://cosmos.rocket.chat/) + +* **Where to file issues:** + https://github.com/tendermint/tendermint/issues + +* **Supported Docker versions:** + [the latest release](https://github.com/moby/moby/releases) (down to 1.6 on a best-effort basis) + # Tendermint Tendermint Core is Byzantine Fault Tolerant (BFT) middleware that takes a state transition machine, written in any programming language, and securely replicates it on many machines. -For more background, see the [introduction](https://tendermint.com/intro). +For more background, see the [introduction](https://tendermint.readthedocs.io/en/master/introduction.html). -To get started developing applications, see the [application developers guide](https://tendermint.com/docs/guides/app-development). +To get started developing applications, see the [application developers guide](https://tendermint.readthedocs.io/en/master/getting-started.html). # How to use this image @@ -31,26 +43,12 @@ docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint node --proxy_app If you want to see many containers talking to each other, consider using [mintnet-kubernetes](https://github.com/tendermint/tools/tree/master/mintnet-kubernetes), which is a tool for running Tendermint-based applications on a Kubernetes cluster. -# Supported Docker versions - -This image is officially supported on Docker version 1.13.1. - -Support for older versions (down to 1.6) is provided on a best-effort basis. - -Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon. - # License View [license information](https://raw.githubusercontent.com/tendermint/tendermint/master/LICENSE) for the software contained in this image. # User Feedback -## Issues - -If you have any problems with or questions about this image, please contact us through a [GitHub](https://github.com/tendermint/tendermint/issues) issue. If the issue is related to a CVE, please check for [a `cve-tracker` issue on the `official-images` repository](https://github.com/docker-library/official-images/issues?q=label%3Acve-tracker) first. - -You can also reach the image maintainers via [Slack](http://forum.tendermint.com:3000/). - ## Contributing You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can. diff --git a/Makefile b/Makefile index 8c9c5214d..a557dd86e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ GOTOOLS = \ github.com/mitchellh/gox \ + github.com/tcnksm/ghr \ github.com/Masterminds/glide \ honnef.co/go/tools/cmd/megacheck diff --git a/README.md b/README.md index 420057976..6aa4d8789 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/6874 [![](https://tokei.rs/b1/github/tendermint/tendermint?category=lines)](https://github.com/tendermint/tendermint) -Branch | Tests | Coverage +Branch | Tests | Coverage ----------|-------|---------- master | [![CircleCI](https://circleci.com/gh/tendermint/tendermint/tree/master.svg?style=shield)](https://circleci.com/gh/tendermint/tendermint/tree/master) | [![codecov](https://codecov.io/gh/tendermint/tendermint/branch/master/graph/badge.svg)](https://codecov.io/gh/tendermint/tendermint) develop | [![CircleCI](https://circleci.com/gh/tendermint/tendermint/tree/develop.svg?style=shield)](https://circleci.com/gh/tendermint/tendermint/tree/develop) | [![codecov](https://codecov.io/gh/tendermint/tendermint/branch/develop/graph/badge.svg)](https://codecov.io/gh/tendermint/tendermint) @@ -56,6 +56,7 @@ All resources involving the use of, building application on, or developing for, * [Ethermint](http://github.com/tendermint/ethermint); Ethereum on Tendermint * [Cosmos SDK](http://github.com/cosmos/cosmos-sdk); a cryptocurrency application framework +* [Many more](https://tendermint.readthedocs.io/en/master/ecosystem.html#abci-applications) ### More diff --git a/Vagrantfile b/Vagrantfile index c465ed73a..0f69feed2 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -17,11 +17,11 @@ Vagrant.configure("2") do |config| usermod -a -G docker vagrant apt-get autoremove -y - curl -O https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz - tar -xvf go1.8.linux-amd64.tar.gz + curl -O https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz + tar -xvf go1.9.linux-amd64.tar.gz rm -rf /usr/local/go mv go /usr/local - rm -f go1.8.linux-amd64.tar.gz + rm -f go1.9.linux-amd64.tar.gz mkdir -p /home/vagrant/go/bin echo 'export PATH=$PATH:/usr/local/go/bin:/home/vagrant/go/bin' >> /home/vagrant/.bash_profile echo 'export GOPATH=/home/vagrant/go' >> /home/vagrant/.bash_profile diff --git a/docs/ecosystem.rst b/docs/ecosystem.rst index 188f50092..c0c386304 100644 --- a/docs/ecosystem.rst +++ b/docs/ecosystem.rst @@ -36,37 +36,50 @@ Ethermint The go-ethereum state machine run as a ABCI app, written in Go, `authored by Tendermint `__. +IAVL +^^^^ -Merkle AVL Tree -^^^^^^^^^^^^^^^ +Immutable AVL+ tree with Merkle proofs, Written in Go, `authored by Tendermint `__. -The following are implementations of the Tendermint IAVL tree as an ABCI application - -Merkleeyes -~~~~~~~~~~ +Lotion +^^^^^^ -Written in Go, `authored by Tendermint `__. +A Javascript microframework for building blockchain applications with Tendermint, written in Javascript, `authored by Judd Keppel of Tendermint `__. See also `lotion-chat `__ and `lotion-coin `__ apps written using Lotion. MerkleTree -~~~~~~~~~~ +^^^^^^^^^^ -Written in Java, `authored by jTendermint `__. +Immutable AVL+ tree with Merkle proofs, Written in Java, `authored by jTendermint `__. +Passchain +^^^^^^^^^ -TMChat -^^^^^^ +Passchain is a tool to securely store and share passwords, tokens and other short secrets, `authored by trusch `__. -P2P chat using Tendermint, written in Java, `authored by woldposd `__. - Passwerk ^^^^^^^^ Encrypted storage web-utility backed by Tendermint, written in Go, `authored by Rigel Rozanski `__. +Py-Tendermint +^^^^^^^^^^^^^ + +A Python microframework for building blockchain applications with Tendermint, written in Python, `authored by Dave Bryson `__. + +Stratumn +^^^^^^^^ + +SDK for "Proof-of-Process" networks, written in Go, `authored by the Stratumn team `__. + +TMChat +^^^^^^ + +P2P chat using Tendermint, written in Java, `authored by wolfposd `__. + + ABCI Servers ------------ - +-------------------------------------------------------------+--------------------+--------------+ | **Name** | **Author** | **Language** | | | | | @@ -75,7 +88,9 @@ ABCI Servers +-------------------------------------------------------------+--------------------+--------------+ | `js abci `__ | Tendermint | Javascript | +-------------------------------------------------------------+--------------------+--------------+ -| `cpp-tmsp `__ | Martin Dyring | C++ | +| `cpp-tmsp `__ | Martin Dyring | C++ | ++-------------------------------------------------------------+--------------------+--------------+ +| `c-abci `__ | ChainX | C | +-------------------------------------------------------------+--------------------+--------------+ | `jabci `__ | jTendermint | Java | +-------------------------------------------------------------+--------------------+--------------+ @@ -85,6 +100,12 @@ ABCI Servers +-------------------------------------------------------------+--------------------+--------------+ | `abci_server `__ | Krzysztof Jurewicz | Erlang | +-------------------------------------------------------------+--------------------+--------------+ +| `rust-tsp `__   | Adrian Brink | Rust       | ++-------------------------------------------------------------+--------------------+--------------+ +| `hs-abci `__ | Alberto Gonzalez | Haskell | ++-------------------------------------------------------------+--------------------+--------------+ +| `haskell-abci `__ | Christoper Goes | Haskell | ++-------------------------------------------------------------+--------------------+--------------+ Deployment Tools ---------------- diff --git a/docs/specification.rst b/docs/specification.rst index 2e8b35668..3afa9c659 100644 --- a/docs/specification.rst +++ b/docs/specification.rst @@ -2,19 +2,19 @@ Specification ############# -Here you'll find details of the Tendermint specification. See `the spec repo `__ for upcoming material. Tendermint's types are produced by `godoc `__ +Here you'll find details of the Tendermint specification. See `the spec repo `__ for upcoming material. Tendermint's types are produced by `godoc `__. .. toctree:: :maxdepth: 2 - specification/block-structure.rst - specification/byzantine-consensus-algorithm.rst - specification/configuration.rst - specification/fast-sync.rst - specification/genesis.rst - specification/light-client-protocol.rst - specification/merkle.rst - specification/rpc.rst - specification/secure-p2p.rst - specification/validators.rst - specification/wire-protocol.rst + specification/block-structure.rst + specification/byzantine-consensus-algorithm.rst + specification/configuration.rst + specification/fast-sync.rst + specification/genesis.rst + specification/light-client-protocol.rst + specification/merkle.rst + specification/rpc.rst + specification/secure-p2p.rst + specification/validators.rst + specification/wire-protocol.rst diff --git a/rpc/client/httpclient.go b/rpc/client/httpclient.go index 7f29183d5..7b09b5bd0 100644 --- a/rpc/client/httpclient.go +++ b/rpc/client/httpclient.go @@ -226,7 +226,9 @@ func (w *WSEvents) Start() (bool, error) { st, err := w.EventSwitch.Start() // if we did start, then OnStart here... if st && err == nil { - ws := rpcclient.NewWSClient(w.remote, w.endpoint) + ws := rpcclient.NewWSClient(w.remote, w.endpoint, rpcclient.OnReconnect(func() { + w.redoSubscriptions() + })) _, err = ws.Start() if err == nil { w.ws = ws @@ -305,6 +307,14 @@ func (w *WSEvents) RemoveListener(listenerID string) { w.EventSwitch.RemoveListener(listenerID) } +// After being reconnected, it is necessary to redo subscription +// to server otherwise no data will be automatically received +func (w *WSEvents) redoSubscriptions() { + for event, _ := range w.evtCount { + w.subscribe(event) + } +} + // eventListener is an infinite loop pulling all websocket events // and pushing them to the EventSwitch. // diff --git a/rpc/grpc/types.proto b/rpc/grpc/types.proto index b32393a04..a7d18daec 100644 --- a/rpc/grpc/types.proto +++ b/rpc/grpc/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package core_grpc; -import "github.com/tendermint/abci/types/types.proto"; +import "github.com/tendermint/abci/blob/master/types/types.proto"; //---------------------------------------- // Message types diff --git a/rpc/lib/client/ws_client.go b/rpc/lib/client/ws_client.go index 1407073ae..2bdfa5c9a 100644 --- a/rpc/lib/client/ws_client.go +++ b/rpc/lib/client/ws_client.go @@ -44,6 +44,9 @@ type WSClient struct { ResultsCh chan json.RawMessage ErrorsCh chan error + // Callback, which will be called each time after successful reconnect. + onReconnect func() + // internal channels send chan types.RPCRequest // user requests backlog chan types.RPCRequest // stores a single user request received during a conn failure @@ -124,6 +127,14 @@ func PingPeriod(pingPeriod time.Duration) func(*WSClient) { } } +// OnReconnect sets the callback, which will be called every time after +// successful reconnect. +func OnReconnect(cb func()) func(*WSClient) { + return func(c *WSClient) { + c.onReconnect = cb + } +} + // String returns WS client full address. func (c *WSClient) String() string { return fmt.Sprintf("%s (%s)", c.Address, c.Endpoint) @@ -254,6 +265,9 @@ func (c *WSClient) reconnect() error { c.Logger.Error("failed to redial", "err", err) } else { c.Logger.Info("reconnected") + if c.onReconnect != nil { + go c.onReconnect() + } return nil } diff --git a/scripts/publish.sh b/scripts/publish.sh index 3091575ff..ba9440878 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -12,6 +12,7 @@ if [ -z "$VERSION" ]; then echo "Please specify a version." exit 1 fi +echo "==> Copying ${DIST_DIR} to S3..." # copy to s3 aws s3 cp --recursive ${DIST_DIR} s3://tendermint/binaries/tendermint/v${VERSION} --acl public-read diff --git a/scripts/release.sh b/scripts/release.sh new file mode 100755 index 000000000..02899ad5d --- /dev/null +++ b/scripts/release.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +set -e + +# Get the version from the environment, or try to figure it out. +if [ -z $VERSION ]; then + VERSION=$(awk -F\" '/Version =/ { print $2; exit }' < version/version.go) +fi +if [ -z "$VERSION" ]; then + echo "Please specify a version." + exit 1 +fi +echo "==> Releasing version $VERSION..." + +# Get the parent directory of where this script is. +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done +DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )" + +# Change into that dir because we expect that. +cd "$DIR" + +# Building binaries +sh -c "'$DIR/scripts/dist.sh'" + +# Pushing binaries to S3 +sh -c "'$DIR/scripts/publish.sh'" + +echo "==> Crafting a Github release" +today=$(date +"%B-%d-%Y") +ghr -b "https://github.com/tendermint/tendermint/blob/master/CHANGELOG.md#${VERSION//.}-${today,}" "v$VERSION" "$DIR/build/dist" + +# Build and push Docker image + +## Get SHA256SUM of the linux archive +SHA256SUM=$(shasum -a256 "${DIR}/build/dist/tendermint_${VERSION}_linux_amd64.zip" | awk '{print $1;}') + +## Replace TM_VERSION and TM_SHA256SUM with the new values +sed -i -e "s/TM_VERSION .*/TM_VERSION $VERSION/g" "$DIR/DOCKER/Dockerfile" +sed -i -e "s/TM_SHA256SUM .*/TM_SHA256SUM $SHA256SUM/g" "$DIR/DOCKER/Dockerfile" +git commit -m "update Dockerfile" -a "$DIR/DOCKER/Dockerfile" +echo "==> TODO: update DOCKER/README.md (latest Dockerfile's hash is $(git rev-parse HEAD)) and copy it's content to https://store.docker.com/community/images/tendermint/tendermint" + +pushd "$DIR/DOCKER" + +## Build Docker image +TAG=$VERSION sh -c "'./build.sh'" + +## Push Docker image +TAG=$VERSION sh -c "'./push.sh'" + +popd + +exit 0 diff --git a/scripts/tendermint-builder/Dockerfile b/scripts/tendermint-builder/Dockerfile index daf931715..0c5130c50 100644 --- a/scripts/tendermint-builder/Dockerfile +++ b/scripts/tendermint-builder/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.8.3 +FROM golang:1.9.0 RUN apt-get update && apt-get install -y --no-install-recommends \ zip \ diff --git a/test/docker/Dockerfile b/test/docker/Dockerfile index 8a2702fc8..7e5cecef8 100644 --- a/test/docker/Dockerfile +++ b/test/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.8.3 +FROM golang:1.9.0 # Add testing deps for curl RUN echo 'deb http://httpredir.debian.org/debian testing main non-free contrib' >> /etc/apt/sources.list