Merge pull request #692 from tendermint/unstable

add the unstable changes
This commit is contained in:
Ethan Buchman 2017-10-03 12:47:16 -04:00 committed by GitHub
commit 9cbcd4b5e3
14 changed files with 158 additions and 59 deletions

View File

@ -1,8 +1,8 @@
FROM alpine:3.6 FROM alpine:3.6
# This is the release of tendermint to pull in. # This is the release of tendermint to pull in.
ENV TM_VERSION 0.10.0 ENV TM_VERSION 0.11.0
ENV TM_SHA256SUM a29852b8d51c00db93c87c3d148fa419a047abd38f32b2507a905805131acc19 ENV TM_SHA256SUM 7e443bac4d42f12e7beaf9cee63b4a565dad8c58895291fdedde8057088b70c5
# Tendermint will be looking for genesis file in /tendermint (unless you change # 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 # `genesis_file` in config.toml). You can put your config.toml and private

View File

@ -1,6 +1,7 @@
# Supported tags and respective `Dockerfile` links # 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.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.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) - `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. `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
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. 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 # 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. 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 # License
View [license information](https://raw.githubusercontent.com/tendermint/tendermint/master/LICENSE) for the software contained in this image. View [license information](https://raw.githubusercontent.com/tendermint/tendermint/master/LICENSE) for the software contained in this image.
# User Feedback # 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 ## 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. 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.

View File

@ -1,5 +1,6 @@
GOTOOLS = \ GOTOOLS = \
github.com/mitchellh/gox \ github.com/mitchellh/gox \
github.com/tcnksm/ghr \
github.com/Masterminds/glide \ github.com/Masterminds/glide \
honnef.co/go/tools/cmd/megacheck honnef.co/go/tools/cmd/megacheck

View File

@ -13,7 +13,7 @@ https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/6874
[![](https://tokei.rs/b1/github/tendermint/tendermint?category=lines)](https://github.com/tendermint/tendermint) [![](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) 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) 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 * [Ethermint](http://github.com/tendermint/ethermint); Ethereum on Tendermint
* [Cosmos SDK](http://github.com/cosmos/cosmos-sdk); a cryptocurrency application framework * [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 ### More

6
Vagrantfile vendored
View File

@ -17,11 +17,11 @@ Vagrant.configure("2") do |config|
usermod -a -G docker vagrant usermod -a -G docker vagrant
apt-get autoremove -y apt-get autoremove -y
curl -O https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz curl -O https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz
tar -xvf go1.8.linux-amd64.tar.gz tar -xvf go1.9.linux-amd64.tar.gz
rm -rf /usr/local/go rm -rf /usr/local/go
mv go /usr/local 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 mkdir -p /home/vagrant/go/bin
echo 'export PATH=$PATH:/usr/local/go/bin:/home/vagrant/go/bin' >> /home/vagrant/.bash_profile 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 echo 'export GOPATH=/home/vagrant/go' >> /home/vagrant/.bash_profile

View File

@ -36,37 +36,50 @@ Ethermint
The go-ethereum state machine run as a ABCI app, written in Go, `authored by Tendermint <https://github.com/tendermint/ethermint>`__. The go-ethereum state machine run as a ABCI app, written in Go, `authored by Tendermint <https://github.com/tendermint/ethermint>`__.
IAVL
^^^^
Merkle AVL Tree Immutable AVL+ tree with Merkle proofs, Written in Go, `authored by Tendermint <https://github.com/tendermint/iavl>`__.
^^^^^^^^^^^^^^^
The following are implementations of the Tendermint IAVL tree as an ABCI application Lotion
Merkleeyes
~~~~~~~~~~
Written in Go, `authored by Tendermint <https://github.com/tendermint/merkleeyes>`__.
MerkleTree
~~~~~~~~~~
Written in Java, `authored by jTendermint <https://github.com/jTendermint/MerkleTree>`__.
TMChat
^^^^^^ ^^^^^^
P2P chat using Tendermint, written in Java, `authored by woldposd <https://github.com/wolfposd/TMChat>`__. A Javascript microframework for building blockchain applications with Tendermint, written in Javascript, `authored by Judd Keppel of Tendermint <https://github.com/keppel/lotion>`__. See also `lotion-chat <https://github.com/keppel/lotion-chat>`__ and `lotion-coin <https://github.com/keppel/lotion-coin>`__ apps written using Lotion.
MerkleTree
^^^^^^^^^^
Immutable AVL+ tree with Merkle proofs, Written in Java, `authored by jTendermint <https://github.com/jTendermint/MerkleTree>`__.
Passchain
^^^^^^^^^
Passchain is a tool to securely store and share passwords, tokens and other short secrets, `authored by trusch <https://github.com/trusch/passchain>`__.
Passwerk Passwerk
^^^^^^^^ ^^^^^^^^
Encrypted storage web-utility backed by Tendermint, written in Go, `authored by Rigel Rozanski <https://github.com/rigelrozanski/passwerk>`__. Encrypted storage web-utility backed by Tendermint, written in Go, `authored by Rigel Rozanski <https://github.com/rigelrozanski/passwerk>`__.
Py-Tendermint
^^^^^^^^^^^^^
A Python microframework for building blockchain applications with Tendermint, written in Python, `authored by Dave Bryson <https://github.com/davebryson/py-tendermint>`__.
Stratumn
^^^^^^^^
SDK for "Proof-of-Process" networks, written in Go, `authored by the Stratumn team <https://github.com/stratumn/sdk>`__.
TMChat
^^^^^^
P2P chat using Tendermint, written in Java, `authored by wolfposd <https://github.com/wolfposd/TMChat>`__.
ABCI Servers ABCI Servers
------------ ------------
+-------------------------------------------------------------+--------------------+--------------+ +-------------------------------------------------------------+--------------------+--------------+
| **Name** | **Author** | **Language** | | **Name** | **Author** | **Language** |
| | | | | | | |
@ -75,7 +88,9 @@ ABCI Servers
+-------------------------------------------------------------+--------------------+--------------+ +-------------------------------------------------------------+--------------------+--------------+
| `js abci <https://github.com/tendermint/js-abci>`__ | Tendermint | Javascript | | `js abci <https://github.com/tendermint/js-abci>`__ | Tendermint | Javascript |
+-------------------------------------------------------------+--------------------+--------------+ +-------------------------------------------------------------+--------------------+--------------+
| `cpp-tmsp <https://github.com/mdyring/cpp-tmsp>`__ | Martin Dyring | C++ | | `cpp-tmsp <https://github.com/block-finance/cpp-abci>`__ | Martin Dyring | C++ |
+-------------------------------------------------------------+--------------------+--------------+
| `c-abci <https://github.com/chainx-org/c-abci>`__ | ChainX | C |
+-------------------------------------------------------------+--------------------+--------------+ +-------------------------------------------------------------+--------------------+--------------+
| `jabci <https://github.com/jTendermint/jabci>`__ | jTendermint | Java | | `jabci <https://github.com/jTendermint/jabci>`__ | jTendermint | Java |
+-------------------------------------------------------------+--------------------+--------------+ +-------------------------------------------------------------+--------------------+--------------+
@ -85,6 +100,12 @@ ABCI Servers
+-------------------------------------------------------------+--------------------+--------------+ +-------------------------------------------------------------+--------------------+--------------+
| `abci_server <https://github.com/KrzysiekJ/abci_server>`__ | Krzysztof Jurewicz | Erlang | | `abci_server <https://github.com/KrzysiekJ/abci_server>`__ | Krzysztof Jurewicz | Erlang |
+-------------------------------------------------------------+--------------------+--------------+ +-------------------------------------------------------------+--------------------+--------------+
| `rust-tsp <https://github.com/tendermint/rust-tsp>`__   | Adrian Brink | Rust       |
+-------------------------------------------------------------+--------------------+--------------+
| `hs-abci <https://github.com/albertov/hs-abci>`__ | Alberto Gonzalez | Haskell |
+-------------------------------------------------------------+--------------------+--------------+
| `haskell-abci <https://github.com/cwgoes/haskell-abci>`__ | Christoper Goes | Haskell |
+-------------------------------------------------------------+--------------------+--------------+
Deployment Tools Deployment Tools
---------------- ----------------

View File

@ -2,19 +2,19 @@
Specification Specification
############# #############
Here you'll find details of the Tendermint specification. See `the spec repo <https://github.com/tendermint/spec>`__ for upcoming material. Tendermint's types are produced by `godoc <https://godoc.org/github.com/tendermint/tendermint/types>`__ Here you'll find details of the Tendermint specification. See `the spec repo <https://github.com/tendermint/spec>`__ for upcoming material. Tendermint's types are produced by `godoc <https://godoc.org/github.com/tendermint/tendermint/types>`__.
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
specification/block-structure.rst specification/block-structure.rst
specification/byzantine-consensus-algorithm.rst specification/byzantine-consensus-algorithm.rst
specification/configuration.rst specification/configuration.rst
specification/fast-sync.rst specification/fast-sync.rst
specification/genesis.rst specification/genesis.rst
specification/light-client-protocol.rst specification/light-client-protocol.rst
specification/merkle.rst specification/merkle.rst
specification/rpc.rst specification/rpc.rst
specification/secure-p2p.rst specification/secure-p2p.rst
specification/validators.rst specification/validators.rst
specification/wire-protocol.rst specification/wire-protocol.rst

View File

@ -226,7 +226,9 @@ func (w *WSEvents) Start() (bool, error) {
st, err := w.EventSwitch.Start() st, err := w.EventSwitch.Start()
// if we did start, then OnStart here... // if we did start, then OnStart here...
if st && err == nil { 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() _, err = ws.Start()
if err == nil { if err == nil {
w.ws = ws w.ws = ws
@ -305,6 +307,14 @@ func (w *WSEvents) RemoveListener(listenerID string) {
w.EventSwitch.RemoveListener(listenerID) 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 // eventListener is an infinite loop pulling all websocket events
// and pushing them to the EventSwitch. // and pushing them to the EventSwitch.
// //

View File

@ -1,7 +1,7 @@
syntax = "proto3"; syntax = "proto3";
package core_grpc; package core_grpc;
import "github.com/tendermint/abci/types/types.proto"; import "github.com/tendermint/abci/blob/master/types/types.proto";
//---------------------------------------- //----------------------------------------
// Message types // Message types

View File

@ -44,6 +44,9 @@ type WSClient struct {
ResultsCh chan json.RawMessage ResultsCh chan json.RawMessage
ErrorsCh chan error ErrorsCh chan error
// Callback, which will be called each time after successful reconnect.
onReconnect func()
// internal channels // internal channels
send chan types.RPCRequest // user requests send chan types.RPCRequest // user requests
backlog chan types.RPCRequest // stores a single user request received during a conn failure 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. // String returns WS client full address.
func (c *WSClient) String() string { func (c *WSClient) String() string {
return fmt.Sprintf("%s (%s)", c.Address, c.Endpoint) 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) c.Logger.Error("failed to redial", "err", err)
} else { } else {
c.Logger.Info("reconnected") c.Logger.Info("reconnected")
if c.onReconnect != nil {
go c.onReconnect()
}
return nil return nil
} }

View File

@ -12,6 +12,7 @@ if [ -z "$VERSION" ]; then
echo "Please specify a version." echo "Please specify a version."
exit 1 exit 1
fi fi
echo "==> Copying ${DIST_DIR} to S3..."
# copy to s3 # copy to s3
aws s3 cp --recursive ${DIST_DIR} s3://tendermint/binaries/tendermint/v${VERSION} --acl public-read aws s3 cp --recursive ${DIST_DIR} s3://tendermint/binaries/tendermint/v${VERSION} --acl public-read

53
scripts/release.sh Executable file
View File

@ -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

View File

@ -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 \ RUN apt-get update && apt-get install -y --no-install-recommends \
zip \ zip \

View File

@ -1,4 +1,4 @@
FROM golang:1.8.3 FROM golang:1.9.0
# Add testing deps for curl # Add testing deps for curl
RUN echo 'deb http://httpredir.debian.org/debian testing main non-free contrib' >> /etc/apt/sources.list RUN echo 'deb http://httpredir.debian.org/debian testing main non-free contrib' >> /etc/apt/sources.list