Release/0.17.0pull/1377/head v0.17.0
@ -0,0 +1,222 @@ | |||
version: 2 | |||
defaults: &defaults | |||
working_directory: /go/src/github.com/tendermint/tendermint | |||
docker: | |||
- image: circleci/golang:1.10.0 | |||
environment: | |||
GOBIN: /tmp/workspace/bin | |||
jobs: | |||
setup_dependencies: | |||
<<: *defaults | |||
steps: | |||
- run: mkdir -p /tmp/workspace/bin | |||
- run: mkdir -p /tmp/workspace/profiles | |||
- checkout | |||
- restore_cache: | |||
keys: | |||
- v1-pkg-cache | |||
- run: | |||
name: tools | |||
command: | | |||
export PATH="$GOBIN:$PATH" | |||
make get_tools | |||
- run: | |||
name: dependencies | |||
command: | | |||
export PATH="$GOBIN:$PATH" | |||
make get_vendor_deps | |||
- run: | |||
name: binaries | |||
command: | | |||
export PATH="$GOBIN:$PATH" | |||
make install | |||
- persist_to_workspace: | |||
root: /tmp/workspace | |||
paths: | |||
- bin | |||
- profiles | |||
- save_cache: | |||
key: v1-pkg-cache | |||
paths: | |||
- /go/pkg | |||
- save_cache: | |||
key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} | |||
paths: | |||
- /go/src/github.com/tendermint/tendermint | |||
setup_abci: | |||
<<: *defaults | |||
steps: | |||
- attach_workspace: | |||
at: /tmp/workspace | |||
- restore_cache: | |||
key: v1-pkg-cache | |||
- restore_cache: | |||
key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} | |||
- run: | |||
name: Checkout abci | |||
command: | | |||
commit=$(bash scripts/dep_utils/parse.sh abci) | |||
go get -v -u -d github.com/tendermint/abci/... | |||
cd /go/src/github.com/tendermint/abci | |||
git checkout "$commit" | |||
- run: | |||
working_directory: /go/src/github.com/tendermint/abci | |||
name: Install abci | |||
command: | | |||
set -ex | |||
export PATH="$GOBIN:$PATH" | |||
make get_tools | |||
make get_vendor_deps | |||
make install | |||
- run: ls -lah /tmp/workspace/bin | |||
- persist_to_workspace: | |||
root: /tmp/workspace | |||
paths: | |||
- "bin/abci*" | |||
lint: | |||
<<: *defaults | |||
steps: | |||
- attach_workspace: | |||
at: /tmp/workspace | |||
- restore_cache: | |||
key: v1-pkg-cache | |||
- restore_cache: | |||
key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} | |||
- run: | |||
name: metalinter | |||
command: | | |||
set -ex | |||
export PATH="$GOBIN:$PATH" | |||
make metalinter | |||
test_apps: | |||
<<: *defaults | |||
steps: | |||
- attach_workspace: | |||
at: /tmp/workspace | |||
- restore_cache: | |||
key: v1-pkg-cache | |||
- restore_cache: | |||
key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} | |||
- run: sudo apt-get update && sudo apt-get install -y --no-install-recommends bsdmainutils | |||
- run: | |||
name: Run tests | |||
command: bash test/app/test.sh | |||
test_cover: | |||
<<: *defaults | |||
parallelism: 4 | |||
steps: | |||
- attach_workspace: | |||
at: /tmp/workspace | |||
- restore_cache: | |||
key: v1-pkg-cache | |||
- restore_cache: | |||
key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} | |||
- run: | |||
name: Run tests | |||
command: | | |||
for pkg in $(go list github.com/tendermint/tendermint/... | grep -v /vendor/ | circleci tests split --split-by=timings); do | |||
id=$(basename "$pkg") | |||
go test -timeout 5m -race -coverprofile=/tmp/workspace/profiles/$id.out -covermode=atomic "$pkg" | |||
done | |||
- persist_to_workspace: | |||
root: /tmp/workspace | |||
paths: | |||
- "profiles/*" | |||
test_libs: | |||
<<: *defaults | |||
steps: | |||
- attach_workspace: | |||
at: /tmp/workspace | |||
- restore_cache: | |||
key: v1-pkg-cache | |||
- restore_cache: | |||
key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} | |||
- run: | |||
name: Run tests | |||
command: bash test/test_libs.sh | |||
test_persistence: | |||
<<: *defaults | |||
steps: | |||
- attach_workspace: | |||
at: /tmp/workspace | |||
- restore_cache: | |||
key: v1-pkg-cache | |||
- restore_cache: | |||
key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} | |||
- run: | |||
name: Run tests | |||
command: bash test/persist/test_failure_indices.sh | |||
test_p2p: | |||
environment: | |||
GOBIN: /home/circleci/.go_workspace/bin | |||
GOPATH: /home/circleci/.go_workspace | |||
machine: | |||
image: circleci/classic:latest | |||
steps: | |||
- checkout | |||
- run: mkdir -p $GOPATH/src/github.com/tendermint | |||
- run: ln -sf /home/circleci/project $GOPATH/src/github.com/tendermint/tendermint | |||
- run: bash test/circleci/p2p.sh | |||
upload_coverage: | |||
<<: *defaults | |||
steps: | |||
- attach_workspace: | |||
at: /tmp/workspace | |||
- restore_cache: | |||
key: v1-tree-{{ .Environment.CIRCLE_SHA1 }} | |||
- run: | |||
name: gather | |||
command: | | |||
set -ex | |||
echo "mode: atomic" > coverage.txt | |||
for prof in $(ls /tmp/workspace/profiles/); do | |||
tail -n +2 /tmp/workspace/profiles/"$prof" >> coverage.txt | |||
done | |||
- run: | |||
name: upload | |||
command: bash <(curl -s https://codecov.io/bash) -f coverage.txt | |||
workflows: | |||
version: 2 | |||
test-suite: | |||
jobs: | |||
- setup_dependencies | |||
- setup_abci: | |||
requires: | |||
- setup_dependencies | |||
- lint: | |||
requires: | |||
- setup_dependencies | |||
- test_apps: | |||
requires: | |||
- setup_abci | |||
- test_cover: | |||
requires: | |||
- setup_dependencies | |||
- test_libs: | |||
filters: | |||
branches: | |||
only: | |||
- develop | |||
- master | |||
requires: | |||
- setup_dependencies | |||
- test_persistence: | |||
requires: | |||
- setup_abci | |||
- test_p2p | |||
- upload_coverage: | |||
requires: | |||
- test_cover |
@ -1,26 +0,0 @@ | |||
# | |||
# This codecov.yml is the default configuration for | |||
# all repositories on Codecov. You may adjust the settings | |||
# below in your own codecov.yml in your repository. | |||
# | |||
coverage: | |||
precision: 2 | |||
round: down | |||
range: 70...100 | |||
status: | |||
# Learn more at https://codecov.io/docs#yaml_default_commit_status | |||
project: | |||
default: | |||
threshold: 1% # allow this much decrease on project | |||
changes: false | |||
comment: | |||
layout: "header, diff" | |||
behavior: default # update if exists else create new | |||
ignore: | |||
- "docs" | |||
- "*.md" | |||
- "*.rst" |
@ -0,0 +1,386 @@ | |||
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. | |||
[[projects]] | |||
branch = "master" | |||
name = "github.com/btcsuite/btcd" | |||
packages = ["btcec"] | |||
revision = "2be2f12b358dc57d70b8f501b00be450192efbc3" | |||
[[projects]] | |||
name = "github.com/davecgh/go-spew" | |||
packages = ["spew"] | |||
revision = "346938d642f2ec3594ed81d874461961cd0faa76" | |||
version = "v1.1.0" | |||
[[projects]] | |||
branch = "master" | |||
name = "github.com/ebuchman/fail-test" | |||
packages = ["."] | |||
revision = "95f809107225be108efcf10a3509e4ea6ceef3c4" | |||
[[projects]] | |||
name = "github.com/fortytw2/leaktest" | |||
packages = ["."] | |||
revision = "a5ef70473c97b71626b9abeda80ee92ba2a7de9e" | |||
version = "v1.2.0" | |||
[[projects]] | |||
name = "github.com/fsnotify/fsnotify" | |||
packages = ["."] | |||
revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9" | |||
version = "v1.4.7" | |||
[[projects]] | |||
name = "github.com/go-kit/kit" | |||
packages = [ | |||
"log", | |||
"log/level", | |||
"log/term" | |||
] | |||
revision = "4dc7be5d2d12881735283bcab7352178e190fc71" | |||
version = "v0.6.0" | |||
[[projects]] | |||
name = "github.com/go-logfmt/logfmt" | |||
packages = ["."] | |||
revision = "390ab7935ee28ec6b286364bba9b4dd6410cb3d5" | |||
version = "v0.3.0" | |||
[[projects]] | |||
name = "github.com/go-stack/stack" | |||
packages = ["."] | |||
revision = "259ab82a6cad3992b4e21ff5cac294ccb06474bc" | |||
version = "v1.7.0" | |||
[[projects]] | |||
name = "github.com/gogo/protobuf" | |||
packages = [ | |||
"gogoproto", | |||
"jsonpb", | |||
"proto", | |||
"protoc-gen-gogo/descriptor", | |||
"sortkeys", | |||
"types" | |||
] | |||
revision = "1adfc126b41513cc696b209667c8656ea7aac67c" | |||
version = "v1.0.0" | |||
[[projects]] | |||
name = "github.com/golang/protobuf" | |||
packages = [ | |||
"proto", | |||
"ptypes", | |||
"ptypes/any", | |||
"ptypes/duration", | |||
"ptypes/timestamp" | |||
] | |||
revision = "925541529c1fa6821df4e44ce2723319eb2be768" | |||
version = "v1.0.0" | |||
[[projects]] | |||
branch = "master" | |||
name = "github.com/golang/snappy" | |||
packages = ["."] | |||
revision = "553a641470496b2327abcac10b36396bd98e45c9" | |||
[[projects]] | |||
name = "github.com/gorilla/websocket" | |||
packages = ["."] | |||
revision = "ea4d1f681babbce9545c9c5f3d5194a789c89f5b" | |||
version = "v1.2.0" | |||
[[projects]] | |||
branch = "master" | |||
name = "github.com/hashicorp/hcl" | |||
packages = [ | |||
".", | |||
"hcl/ast", | |||
"hcl/parser", | |||
"hcl/printer", | |||
"hcl/scanner", | |||
"hcl/strconv", | |||
"hcl/token", | |||
"json/parser", | |||
"json/scanner", | |||
"json/token" | |||
] | |||
revision = "f40e974e75af4e271d97ce0fc917af5898ae7bda" | |||
[[projects]] | |||
name = "github.com/inconshreveable/mousetrap" | |||
packages = ["."] | |||
revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75" | |||
version = "v1.0" | |||
[[projects]] | |||
branch = "master" | |||
name = "github.com/jmhodges/levigo" | |||
packages = ["."] | |||
revision = "c42d9e0ca023e2198120196f842701bb4c55d7b9" | |||
[[projects]] | |||
branch = "master" | |||
name = "github.com/kr/logfmt" | |||
packages = ["."] | |||
revision = "b84e30acd515aadc4b783ad4ff83aff3299bdfe0" | |||
[[projects]] | |||
name = "github.com/magiconair/properties" | |||
packages = ["."] | |||
revision = "c3beff4c2358b44d0493c7dda585e7db7ff28ae6" | |||
version = "v1.7.6" | |||
[[projects]] | |||
branch = "master" | |||
name = "github.com/mitchellh/mapstructure" | |||
packages = ["."] | |||
revision = "00c29f56e2386353d58c599509e8dc3801b0d716" | |||
[[projects]] | |||
name = "github.com/pelletier/go-toml" | |||
packages = ["."] | |||
revision = "acdc4509485b587f5e675510c4f2c63e90ff68a8" | |||
version = "v1.1.0" | |||
[[projects]] | |||
name = "github.com/pkg/errors" | |||
packages = ["."] | |||
revision = "645ef00459ed84a119197bfb8d8205042c6df63d" | |||
version = "v0.8.0" | |||
[[projects]] | |||
name = "github.com/pmezard/go-difflib" | |||
packages = ["difflib"] | |||
revision = "792786c7400a136282c1664665ae0a8db921c6c2" | |||
version = "v1.0.0" | |||
[[projects]] | |||
branch = "master" | |||
name = "github.com/rcrowley/go-metrics" | |||
packages = ["."] | |||
revision = "8732c616f52954686704c8645fe1a9d59e9df7c1" | |||
[[projects]] | |||
name = "github.com/spf13/afero" | |||
packages = [ | |||
".", | |||
"mem" | |||
] | |||
revision = "bb8f1927f2a9d3ab41c9340aa034f6b803f4359c" | |||
version = "v1.0.2" | |||
[[projects]] | |||
name = "github.com/spf13/cast" | |||
packages = ["."] | |||
revision = "8965335b8c7107321228e3e3702cab9832751bac" | |||
version = "v1.2.0" | |||
[[projects]] | |||
name = "github.com/spf13/cobra" | |||
packages = ["."] | |||
revision = "7b2c5ac9fc04fc5efafb60700713d4fa609b777b" | |||
version = "v0.0.1" | |||
[[projects]] | |||
branch = "master" | |||
name = "github.com/spf13/jwalterweatherman" | |||
packages = ["."] | |||
revision = "7c0cea34c8ece3fbeb2b27ab9b59511d360fb394" | |||
[[projects]] | |||
name = "github.com/spf13/pflag" | |||
packages = ["."] | |||
revision = "e57e3eeb33f795204c1ca35f56c44f83227c6e66" | |||
version = "v1.0.0" | |||
[[projects]] | |||
name = "github.com/spf13/viper" | |||
packages = ["."] | |||
revision = "b5e8006cbee93ec955a89ab31e0e3ce3204f3736" | |||
version = "v1.0.2" | |||
[[projects]] | |||
name = "github.com/stretchr/testify" | |||
packages = [ | |||
"assert", | |||
"require" | |||
] | |||
revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71" | |||
version = "v1.2.1" | |||
[[projects]] | |||
branch = "master" | |||
name = "github.com/syndtr/goleveldb" | |||
packages = [ | |||
"leveldb", | |||
"leveldb/cache", | |||
"leveldb/comparer", | |||
"leveldb/errors", | |||
"leveldb/filter", | |||
"leveldb/iterator", | |||
"leveldb/journal", | |||
"leveldb/memdb", | |||
"leveldb/opt", | |||
"leveldb/storage", | |||
"leveldb/table", | |||
"leveldb/util" | |||
] | |||
revision = "169b1b37be738edb2813dab48c97a549bcf99bb5" | |||
[[projects]] | |||
name = "github.com/tendermint/abci" | |||
packages = [ | |||
"client", | |||
"example/code", | |||
"example/counter", | |||
"example/kvstore", | |||
"server", | |||
"types" | |||
] | |||
revision = "46686763ba8ea595ede16530ed4a40fb38f49f94" | |||
version = "v0.10.2" | |||
[[projects]] | |||
branch = "master" | |||
name = "github.com/tendermint/ed25519" | |||
packages = [ | |||
".", | |||
"edwards25519", | |||
"extra25519" | |||
] | |||
revision = "d8387025d2b9d158cf4efb07e7ebf814bcce2057" | |||
[[projects]] | |||
name = "github.com/tendermint/go-crypto" | |||
packages = ["."] | |||
revision = "c3e19f3ea26f5c3357e0bcbb799b0761ef923755" | |||
version = "v0.5.0" | |||
[[projects]] | |||
name = "github.com/tendermint/go-wire" | |||
packages = [ | |||
".", | |||
"data" | |||
] | |||
revision = "fa721242b042ecd4c6ed1a934ee740db4f74e45c" | |||
source = "github.com/tendermint/go-amino" | |||
version = "v0.7.3" | |||
[[projects]] | |||
name = "github.com/tendermint/tmlibs" | |||
packages = [ | |||
"autofile", | |||
"cli", | |||
"cli/flags", | |||
"clist", | |||
"common", | |||
"db", | |||
"flowrate", | |||
"log", | |||
"merkle", | |||
"pubsub", | |||
"pubsub/query", | |||
"test" | |||
] | |||
revision = "24da7009c3d8c019b40ba4287495749e3160caca" | |||
version = "v0.7.1" | |||
[[projects]] | |||
branch = "master" | |||
name = "golang.org/x/crypto" | |||
packages = [ | |||
"curve25519", | |||
"nacl/box", | |||
"nacl/secretbox", | |||
"openpgp/armor", | |||
"openpgp/errors", | |||
"poly1305", | |||
"ripemd160", | |||
"salsa20/salsa" | |||
] | |||
revision = "88942b9c40a4c9d203b82b3731787b672d6e809b" | |||
[[projects]] | |||
branch = "master" | |||
name = "golang.org/x/net" | |||
packages = [ | |||
"context", | |||
"http2", | |||
"http2/hpack", | |||
"idna", | |||
"internal/timeseries", | |||
"lex/httplex", | |||
"trace" | |||
] | |||
revision = "6078986fec03a1dcc236c34816c71b0e05018fda" | |||
[[projects]] | |||
branch = "master" | |||
name = "golang.org/x/sys" | |||
packages = ["unix"] | |||
revision = "91ee8cde435411ca3f1cd365e8f20131aed4d0a1" | |||
[[projects]] | |||
name = "golang.org/x/text" | |||
packages = [ | |||
"collate", | |||
"collate/build", | |||
"internal/colltab", | |||
"internal/gen", | |||
"internal/tag", | |||
"internal/triegen", | |||
"internal/ucd", | |||
"language", | |||
"secure/bidirule", | |||
"transform", | |||
"unicode/bidi", | |||
"unicode/cldr", | |||
"unicode/norm", | |||
"unicode/rangetable" | |||
] | |||
revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" | |||
version = "v0.3.0" | |||
[[projects]] | |||
branch = "master" | |||
name = "google.golang.org/genproto" | |||
packages = ["googleapis/rpc/status"] | |||
revision = "f8c8703595236ae70fdf8789ecb656ea0bcdcf46" | |||
[[projects]] | |||
name = "google.golang.org/grpc" | |||
packages = [ | |||
".", | |||
"balancer", | |||
"codes", | |||
"connectivity", | |||
"credentials", | |||
"grpclb/grpc_lb_v1/messages", | |||
"grpclog", | |||
"internal", | |||
"keepalive", | |||
"metadata", | |||
"naming", | |||
"peer", | |||
"resolver", | |||
"stats", | |||
"status", | |||
"tap", | |||
"transport" | |||
] | |||
revision = "5b3c4e850e90a4cf6a20ebd46c8b32a0a3afcb9e" | |||
version = "v1.7.5" | |||
[[projects]] | |||
name = "gopkg.in/yaml.v2" | |||
packages = ["."] | |||
revision = "7f97868eec74b32b0982dd158a51a446d1da7eb5" | |||
version = "v2.1.1" | |||
[solve-meta] | |||
analyzer-name = "dep" | |||
analyzer-version = 1 | |||
inputs-digest = "4dca5dbd2d280d093d7c8fc423606ab86d6ad1b241b076a7716c2093b5a09231" | |||
solver-name = "gps-cdcl" | |||
solver-version = 1 |
@ -0,0 +1,95 @@ | |||
# Gopkg.toml example | |||
# | |||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md | |||
# for detailed Gopkg.toml documentation. | |||
# | |||
# required = ["github.com/user/thing/cmd/thing"] | |||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] | |||
# | |||
# [[constraint]] | |||
# name = "github.com/user/project" | |||
# version = "1.0.0" | |||
# | |||
# [[constraint]] | |||
# name = "github.com/user/project2" | |||
# branch = "dev" | |||
# source = "github.com/myfork/project2" | |||
# | |||
# [[override]] | |||
# name = "github.com/x/y" | |||
# version = "2.4.0" | |||
# | |||
# [prune] | |||
# non-go = false | |||
# go-tests = true | |||
# unused-packages = true | |||
[[constraint]] | |||
branch = "master" | |||
name = "github.com/ebuchman/fail-test" | |||
[[constraint]] | |||
branch = "master" | |||
name = "github.com/fortytw2/leaktest" | |||
[[constraint]] | |||
name = "github.com/go-kit/kit" | |||
version = "~0.6.0" | |||
[[constraint]] | |||
name = "github.com/gogo/protobuf" | |||
version = "~1.0.0" | |||
[[constraint]] | |||
name = "github.com/golang/protobuf" | |||
version = "~1.0.0" | |||
[[constraint]] | |||
name = "github.com/gorilla/websocket" | |||
version = "~1.2.0" | |||
[[constraint]] | |||
name = "github.com/pkg/errors" | |||
version = "~0.8.0" | |||
[[constraint]] | |||
branch = "master" | |||
name = "github.com/rcrowley/go-metrics" | |||
[[constraint]] | |||
name = "github.com/spf13/cobra" | |||
version = "~0.0.1" | |||
[[constraint]] | |||
name = "github.com/spf13/viper" | |||
version = "~1.0.0" | |||
[[constraint]] | |||
name = "github.com/stretchr/testify" | |||
version = "~1.2.1" | |||
[[constraint]] | |||
name = "github.com/tendermint/abci" | |||
version = "~0.10.2" | |||
[[constraint]] | |||
name = "github.com/tendermint/go-crypto" | |||
version = "~0.5.0" | |||
[[constraint]] | |||
name = "github.com/tendermint/go-wire" | |||
source = "github.com/tendermint/go-amino" | |||
version = "~0.7.3" | |||
[[constraint]] | |||
name = "github.com/tendermint/tmlibs" | |||
version = "~0.7.1" | |||
[[constraint]] | |||
name = "google.golang.org/grpc" | |||
version = "~1.7.3" | |||
[prune] | |||
go-tests = true | |||
unused-packages = true |
@ -1,35 +0,0 @@ | |||
--- | |||
machine: | |||
environment: | |||
MACH_PREFIX: tendermint-test-mach | |||
DOCKER_VERSION: 1.10.0 | |||
DOCKER_MACHINE_VERSION: 0.9.0 | |||
GOPATH: "$HOME/.go_project" | |||
PROJECT_PARENT_PATH: "$GOPATH/src/github.com/$CIRCLE_PROJECT_USERNAME" | |||
PROJECT_PATH: "$PROJECT_PARENT_PATH/$CIRCLE_PROJECT_REPONAME" | |||
PATH: "$HOME/.go_project/bin:${PATH}" | |||
hosts: | |||
localhost: 127.0.0.1 | |||
dependencies: | |||
override: | |||
- curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | sudo bash -s -- $DOCKER_VERSION | |||
- sudo start docker | |||
- sudo curl -sSL -o /usr/bin/docker-machine "https://github.com/docker/machine/releases/download/v$DOCKER_MACHINE_VERSION/docker-machine-`uname -s`-`uname -m`"; sudo chmod 0755 /usr/bin/docker-machine | |||
- mkdir -p "$PROJECT_PARENT_PATH" | |||
- ln -sf "$HOME/$CIRCLE_PROJECT_REPONAME/" "$PROJECT_PATH" | |||
post: | |||
- go version | |||
- docker version | |||
- docker-machine version | |||
test: | |||
override: | |||
- cd "$PROJECT_PATH" && set -o pipefail && make test_integrations 2>&1 | tee test_integrations.log: | |||
timeout: 1800 | |||
post: | |||
- cd "$PROJECT_PATH" && mv test_integrations.log "${CIRCLE_ARTIFACTS}" | |||
- cd "$PROJECT_PATH" && bash <(curl -s https://codecov.io/bash) -f coverage.txt | |||
- cd "$PROJECT_PATH" && mv coverage.txt "${CIRCLE_ARTIFACTS}" | |||
- cd "$PROJECT_PATH" && cp test/logs/messages "${CIRCLE_ARTIFACTS}/docker.log" | |||
- cd "${CIRCLE_ARTIFACTS}" && tar czf logs.tar.gz *.log |
@ -0,0 +1,53 @@ | |||
package main | |||
import ( | |||
"flag" | |||
"os" | |||
crypto "github.com/tendermint/go-crypto" | |||
cmn "github.com/tendermint/tmlibs/common" | |||
"github.com/tendermint/tmlibs/log" | |||
priv_val "github.com/tendermint/tendermint/types/priv_validator" | |||
) | |||
func main() { | |||
var ( | |||
addr = flag.String("addr", ":46659", "Address of client to connect to") | |||
chainID = flag.String("chain-id", "mychain", "chain id") | |||
privValPath = flag.String("priv", "", "priv val file path") | |||
logger = log.NewTMLogger( | |||
log.NewSyncWriter(os.Stdout), | |||
).With("module", "priv_val") | |||
) | |||
flag.Parse() | |||
logger.Info( | |||
"Starting private validator", | |||
"addr", *addr, | |||
"chainID", *chainID, | |||
"privPath", *privValPath, | |||
) | |||
privVal := priv_val.LoadPrivValidatorJSON(*privValPath) | |||
rs := priv_val.NewRemoteSigner( | |||
logger, | |||
*chainID, | |||
*addr, | |||
privVal, | |||
crypto.GenPrivKeyEd25519(), | |||
) | |||
err := rs.Start() | |||
if err != nil { | |||
panic(err) | |||
} | |||
cmn.TrapSignal(func() { | |||
err := rs.Stop() | |||
if err != nil { | |||
panic(err) | |||
} | |||
}) | |||
} |
@ -0,0 +1,25 @@ | |||
package commands | |||
import ( | |||
"fmt" | |||
"github.com/spf13/cobra" | |||
"github.com/tendermint/tendermint/p2p" | |||
) | |||
// ShowNodeIDCmd dumps node's ID to the standard output. | |||
var ShowNodeIDCmd = &cobra.Command{ | |||
Use: "show_node_id", | |||
Short: "Show this node's ID", | |||
RunE: showNodeID, | |||
} | |||
func showNodeID(cmd *cobra.Command, args []string) error { | |||
nodeKey, err := p2p.LoadOrGenNodeKey(config.NodeKeyFile()) | |||
if err != nil { | |||
return err | |||
} | |||
fmt.Println(nodeKey.ID()) | |||
return nil | |||
} |
@ -0,0 +1,18 @@ | |||
coverage: | |||
precision: 2 | |||
round: down | |||
range: "70...100" | |||
status: | |||
project: | |||
default: | |||
threshold: 1% | |||
patch: on | |||
changes: off | |||
comment: | |||
layout: "diff, files" | |||
behavior: default | |||
require_changes: no | |||
require_base: no | |||
require_head: yes |
@ -0,0 +1,128 @@ | |||
# ADR 008: PrivValidator | |||
## Context | |||
The current PrivValidator is monolithic and isn't easily reuseable by alternative signers. | |||
For instance, see https://github.com/tendermint/tendermint/issues/673 | |||
The goal is to have a clean PrivValidator interface like: | |||
``` | |||
type PrivValidator interface { | |||
Address() data.Bytes | |||
PubKey() crypto.PubKey | |||
SignVote(chainID string, vote *types.Vote) error | |||
SignProposal(chainID string, proposal *types.Proposal) error | |||
SignHeartbeat(chainID string, heartbeat *types.Heartbeat) error | |||
} | |||
``` | |||
It should also be easy to re-use the LastSignedInfo logic to avoid double signing. | |||
## Decision | |||
Tendermint node's should support only two in-process PrivValidator implementations: | |||
- PrivValidatorUnencrypted uses an unencrypted private key in a "priv_validator.json" file - no configuration required (just `tendermint init`). | |||
- PrivValidatorSocket uses a socket to send signing requests to another process - user is responsible for starting that process themselves. | |||
The PrivValidatorSocket address can be provided via flags at the command line - | |||
doing so will cause Tendermint to ignore any "priv_validator.json" file and to listen | |||
on the given address for incoming connections from an external priv_validator process. | |||
It will halt any operation until at least one external process succesfully | |||
connected. | |||
The external priv_validator process will dial the address to connect to Tendermint, | |||
and then Tendermint will send requests on the ensuing connection to sign votes and proposals. | |||
Thus the external process initiates the connection, but the Tendermint process makes all requests. | |||
In a later stage we're going to support multiple validators for fault | |||
tolerance. To prevent double signing they need to be synced, which is deferred | |||
to an external solution (see #1185). | |||
In addition, Tendermint will provide implementations that can be run in that external process. | |||
These include: | |||
- PrivValidatorEncrypted uses an encrypted private key persisted to disk - user must enter password to decrypt key when process is started. | |||
- PrivValidatorLedger uses a Ledger Nano S to handle all signing. | |||
What follows are descriptions of useful types | |||
### Signer | |||
``` | |||
type Signer interface { | |||
Sign(msg []byte) (crypto.Signature, error) | |||
} | |||
``` | |||
Signer signs a message. It can also return an error. | |||
### ValidatorID | |||
ValidatorID is just the Address and PubKey | |||
``` | |||
type ValidatorID struct { | |||
Address data.Bytes `json:"address"` | |||
PubKey crypto.PubKey `json:"pub_key"` | |||
} | |||
``` | |||
### LastSignedInfo | |||
LastSignedInfo tracks the last thing we signed: | |||
``` | |||
type LastSignedInfo struct { | |||
Height int64 `json:"height"` | |||
Round int `json:"round"` | |||
Step int8 `json:"step"` | |||
Signature crypto.Signature `json:"signature,omitempty"` // so we dont lose signatures | |||
SignBytes data.Bytes `json:"signbytes,omitempty"` // so we dont lose signatures | |||
} | |||
``` | |||
It exposes methods for signing votes and proposals using a `Signer`. | |||
This allows it to easily be reused by developers implemented their own PrivValidator. | |||
### PrivValidatorUnencrypted | |||
``` | |||
type PrivValidatorUnencrypted struct { | |||
ID types.ValidatorID `json:"id"` | |||
PrivKey PrivKey `json:"priv_key"` | |||
LastSignedInfo *LastSignedInfo `json:"last_signed_info"` | |||
} | |||
``` | |||
Has the same structure as currently, but broken up into sub structs. | |||
Note the LastSignedInfo is mutated in place every time we sign. | |||
### PrivValidatorJSON | |||
The "priv_validator.json" file supports only the PrivValidatorUnencrypted type. | |||
It unmarshals into PrivValidatorJSON, which is used as the default PrivValidator type. | |||
It wraps the PrivValidatorUnencrypted and persists it to disk after every signature. | |||
## Status | |||
Accepted. | |||
## Consequences | |||
### Positive | |||
- Cleaner separation of components enabling re-use. | |||
### Negative | |||
- More files - led to creation of new directory. | |||
### Neutral | |||
@ -0,0 +1,8 @@ | |||
On Determinism | |||
============== | |||
Arguably, the most difficult part of blockchain programming is determinism - that is, ensuring that sources of indeterminism do not creep into the design of such systems. | |||
See `this issue <https://github.com/tendermint/abci/issues/56>`__ for more information on the potential sources of indeterminism. | |||
@ -1,206 +0,0 @@ | |||
hash: 322a0d4b9be08c59bf65df0e17e3be8d60762eaf9516f0c4126b50f9fd676f26 | |||
updated: 2018-02-21T03:31:35.382568482Z | |||
imports: | |||
- name: github.com/btcsuite/btcd | |||
version: 50de9da05b50eb15658bb350f6ea24368a111ab7 | |||
subpackages: | |||
- btcec | |||
- name: github.com/ebuchman/fail-test | |||
version: 95f809107225be108efcf10a3509e4ea6ceef3c4 | |||
- name: github.com/fsnotify/fsnotify | |||
version: c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9 | |||
- name: github.com/go-kit/kit | |||
version: 4dc7be5d2d12881735283bcab7352178e190fc71 | |||
subpackages: | |||
- log | |||
- log/level | |||
- log/term | |||
- name: github.com/go-logfmt/logfmt | |||
version: 390ab7935ee28ec6b286364bba9b4dd6410cb3d5 | |||
- name: github.com/go-stack/stack | |||
version: 259ab82a6cad3992b4e21ff5cac294ccb06474bc | |||
- name: github.com/gogo/protobuf | |||
version: 1adfc126b41513cc696b209667c8656ea7aac67c | |||
subpackages: | |||
- gogoproto | |||
- jsonpb | |||
- proto | |||
- protoc-gen-gogo/descriptor | |||
- sortkeys | |||
- types | |||
- name: github.com/golang/protobuf | |||
version: 925541529c1fa6821df4e44ce2723319eb2be768 | |||
subpackages: | |||
- proto | |||
- ptypes | |||
- ptypes/any | |||
- ptypes/duration | |||
- ptypes/timestamp | |||
- name: github.com/golang/snappy | |||
version: 553a641470496b2327abcac10b36396bd98e45c9 | |||
- name: github.com/gorilla/websocket | |||
version: ea4d1f681babbce9545c9c5f3d5194a789c89f5b | |||
- name: github.com/hashicorp/hcl | |||
version: 23c074d0eceb2b8a5bfdbb271ab780cde70f05a8 | |||
subpackages: | |||
- hcl/ast | |||
- hcl/parser | |||
- hcl/scanner | |||
- hcl/strconv | |||
- hcl/token | |||
- json/parser | |||
- json/scanner | |||
- json/token | |||
- name: github.com/inconshreveable/mousetrap | |||
version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 | |||
- name: github.com/jmhodges/levigo | |||
version: c42d9e0ca023e2198120196f842701bb4c55d7b9 | |||
- name: github.com/kr/logfmt | |||
version: b84e30acd515aadc4b783ad4ff83aff3299bdfe0 | |||
- name: github.com/magiconair/properties | |||
version: 49d762b9817ba1c2e9d0c69183c2b4a8b8f1d934 | |||
- name: github.com/mitchellh/mapstructure | |||
version: b4575eea38cca1123ec2dc90c26529b5c5acfcff | |||
- name: github.com/pelletier/go-toml | |||
version: acdc4509485b587f5e675510c4f2c63e90ff68a8 | |||
- name: github.com/pkg/errors | |||
version: 645ef00459ed84a119197bfb8d8205042c6df63d | |||
- name: github.com/rcrowley/go-metrics | |||
version: 8732c616f52954686704c8645fe1a9d59e9df7c1 | |||
- name: github.com/spf13/afero | |||
version: bb8f1927f2a9d3ab41c9340aa034f6b803f4359c | |||
subpackages: | |||
- mem | |||
- name: github.com/spf13/cast | |||
version: acbeb36b902d72a7a4c18e8f3241075e7ab763e4 | |||
- name: github.com/spf13/cobra | |||
version: 7b2c5ac9fc04fc5efafb60700713d4fa609b777b | |||
- name: github.com/spf13/jwalterweatherman | |||
version: 7c0cea34c8ece3fbeb2b27ab9b59511d360fb394 | |||
- name: github.com/spf13/pflag | |||
version: e57e3eeb33f795204c1ca35f56c44f83227c6e66 | |||
- name: github.com/spf13/viper | |||
version: 25b30aa063fc18e48662b86996252eabdcf2f0c7 | |||
- name: github.com/syndtr/goleveldb | |||
version: 34011bf325bce385408353a30b101fe5e923eb6e | |||
subpackages: | |||
- leveldb | |||
- leveldb/cache | |||
- leveldb/comparer | |||
- leveldb/errors | |||
- leveldb/filter | |||
- leveldb/iterator | |||
- leveldb/journal | |||
- leveldb/memdb | |||
- leveldb/opt | |||
- leveldb/storage | |||
- leveldb/table | |||
- leveldb/util | |||
- name: github.com/tendermint/abci | |||
version: 68592f4d8ee34e97db94b7a7976b1309efdb7eb9 | |||
subpackages: | |||
- client | |||
- example/code | |||
- example/counter | |||
- example/dummy | |||
- server | |||
- types | |||
- name: github.com/tendermint/ed25519 | |||
version: d8387025d2b9d158cf4efb07e7ebf814bcce2057 | |||
subpackages: | |||
- edwards25519 | |||
- extra25519 | |||
- name: github.com/tendermint/go-crypto | |||
version: dd20358a264c772b4a83e477b0cfce4c88a7001d | |||
- name: github.com/tendermint/go-wire | |||
version: b6fc872b42d41158a60307db4da051dd6f179415 | |||
subpackages: | |||
- data | |||
- name: github.com/tendermint/tmlibs | |||
version: 1b9b5652a199ab0be2e781393fb275b66377309d | |||
subpackages: | |||
- autofile | |||
- cli | |||
- cli/flags | |||
- clist | |||
- common | |||
- db | |||
- flowrate | |||
- log | |||
- merkle | |||
- pubsub | |||
- pubsub/query | |||
- test | |||
- name: golang.org/x/crypto | |||
version: 1875d0a70c90e57f11972aefd42276df65e895b9 | |||
subpackages: | |||
- curve25519 | |||
- nacl/box | |||
- nacl/secretbox | |||
- openpgp/armor | |||
- openpgp/errors | |||
- poly1305 | |||
- ripemd160 | |||
- salsa20/salsa | |||
- name: golang.org/x/net | |||
version: 2fb46b16b8dda405028c50f7c7f0f9dd1fa6bfb1 | |||
subpackages: | |||
- context | |||
- http2 | |||
- http2/hpack | |||
- idna | |||
- internal/timeseries | |||
- lex/httplex | |||
- trace | |||
- name: golang.org/x/sys | |||
version: 37707fdb30a5b38865cfb95e5aab41707daec7fd | |||
subpackages: | |||
- unix | |||
- name: golang.org/x/text | |||
version: e19ae1496984b1c655b8044a65c0300a3c878dd3 | |||
subpackages: | |||
- secure/bidirule | |||
- transform | |||
- unicode/bidi | |||
- unicode/norm | |||
- name: google.golang.org/genproto | |||
version: 4eb30f4778eed4c258ba66527a0d4f9ec8a36c45 | |||
subpackages: | |||
- googleapis/rpc/status | |||
- name: google.golang.org/grpc | |||
version: 401e0e00e4bb830a10496d64cd95e068c5bf50de | |||
subpackages: | |||
- balancer | |||
- codes | |||
- connectivity | |||
- credentials | |||
- grpclb/grpc_lb_v1/messages | |||
- grpclog | |||
- internal | |||
- keepalive | |||
- metadata | |||
- naming | |||
- peer | |||
- resolver | |||
- stats | |||
- status | |||
- tap | |||
- transport | |||
- name: gopkg.in/yaml.v2 | |||
version: d670f9405373e636a5a2765eea47fac0c9bc91a4 | |||
testImports: | |||
- name: github.com/davecgh/go-spew | |||
version: 346938d642f2ec3594ed81d874461961cd0faa76 | |||
subpackages: | |||
- spew | |||
- name: github.com/fortytw2/leaktest | |||
version: 3b724c3d7b8729a35bf4e577f71653aec6e53513 | |||
- name: github.com/pmezard/go-difflib | |||
version: 792786c7400a136282c1664665ae0a8db921c6c2 | |||
subpackages: | |||
- difflib | |||
- name: github.com/stretchr/testify | |||
version: 12b6f73e6084dad08a7c6e575284b177ecafbc71 | |||
subpackages: | |||
- assert | |||
- require |
@ -1,63 +0,0 @@ | |||
package: github.com/tendermint/tendermint | |||
import: | |||
- package: github.com/ebuchman/fail-test | |||
- package: github.com/gogo/protobuf | |||
version: ^1.0.0 | |||
subpackages: | |||
- proto | |||
- package: github.com/golang/protobuf | |||
version: ^1.0.0 | |||
subpackages: | |||
- proto | |||
- package: github.com/gorilla/websocket | |||
version: v1.2.0 | |||
- package: github.com/pkg/errors | |||
version: ~0.8.0 | |||
- package: github.com/rcrowley/go-metrics | |||
- package: github.com/spf13/cobra | |||
version: v0.0.1 | |||
- package: github.com/spf13/viper | |||
version: v1.0.0 | |||
- package: github.com/tendermint/abci | |||
version: 0.10.0 | |||
subpackages: | |||
- client | |||
- example/dummy | |||
- types | |||
- package: github.com/tendermint/go-crypto | |||
version: 0.4.1 | |||
- package: github.com/tendermint/go-wire | |||
version: 0.7.2 | |||
subpackages: | |||
- data | |||
- package: github.com/tendermint/tmlibs | |||
version: 0.7.0 | |||
subpackages: | |||
- autofile | |||
- cli | |||
- cli/flags | |||
- clist | |||
- common | |||
- db | |||
- flowrate | |||
- log | |||
- merkle | |||
- pubsub | |||
- pubsub/query | |||
- package: golang.org/x/crypto | |||
subpackages: | |||
- nacl/box | |||
- nacl/secretbox | |||
- ripemd160 | |||
- package: google.golang.org/grpc | |||
version: v1.7.3 | |||
testImport: | |||
- package: github.com/fortytw2/leaktest | |||
- package: github.com/go-kit/kit | |||
version: ^0.6.0 | |||
subpackages: | |||
- log/term | |||
- package: github.com/stretchr/testify | |||
subpackages: | |||
- assert | |||
- require |
@ -0,0 +1,72 @@ | |||
package dummy | |||
import ( | |||
p2p "github.com/tendermint/tendermint/p2p" | |||
tmconn "github.com/tendermint/tendermint/p2p/conn" | |||
cmn "github.com/tendermint/tmlibs/common" | |||
) | |||
type peer struct { | |||
cmn.BaseService | |||
kv map[string]interface{} | |||
} | |||
var _ p2p.Peer = (*peer)(nil) | |||
// NewPeer creates new dummy peer. | |||
func NewPeer() *peer { | |||
p := &peer{ | |||
kv: make(map[string]interface{}), | |||
} | |||
p.BaseService = *cmn.NewBaseService(nil, "peer", p) | |||
return p | |||
} | |||
// ID always returns dummy. | |||
func (p *peer) ID() p2p.ID { | |||
return p2p.ID("dummy") | |||
} | |||
// IsOutbound always returns false. | |||
func (p *peer) IsOutbound() bool { | |||
return false | |||
} | |||
// IsPersistent always returns false. | |||
func (p *peer) IsPersistent() bool { | |||
return false | |||
} | |||
// NodeInfo always returns empty node info. | |||
func (p *peer) NodeInfo() p2p.NodeInfo { | |||
return p2p.NodeInfo{} | |||
} | |||
// Status always returns empry connection status. | |||
func (p *peer) Status() tmconn.ConnectionStatus { | |||
return tmconn.ConnectionStatus{} | |||
} | |||
// Send does not do anything and just returns true. | |||
func (p *peer) Send(byte, interface{}) bool { | |||
return true | |||
} | |||
// TrySend does not do anything and just returns true. | |||
func (p *peer) TrySend(byte, interface{}) bool { | |||
return true | |||
} | |||
// Set records value under key specified in the map. | |||
func (p *peer) Set(key string, value interface{}) { | |||
p.kv[key] = value | |||
} | |||
// Get returns a value associated with the key. Nil is returned if no value | |||
// found. | |||
func (p *peer) Get(key string) interface{} { | |||
if value, ok := p.kv[key]; ok { | |||
return value | |||
} | |||
return nil | |||
} |
@ -0,0 +1,31 @@ | |||
package core | |||
import ( | |||
ctypes "github.com/tendermint/tendermint/rpc/core/types" | |||
) | |||
// Get node health. Returns empty result (200 OK) on success, no response - in | |||
// case of an error. | |||
// | |||
// ```shell | |||
// curl 'localhost:46657/health' | |||
// ``` | |||
// | |||
// ```go | |||
// client := client.NewHTTP("tcp://0.0.0.0:46657", "/websocket") | |||
// result, err := client.Health() | |||
// ``` | |||
// | |||
// > The above command returns JSON structured like this: | |||
// | |||
// ```json | |||
// { | |||
// "error": "", | |||
// "result": {}, | |||
// "id": "", | |||
// "jsonrpc": "2.0" | |||
// } | |||
// ``` | |||
func Health() (*ctypes.ResultHealth, error) { | |||
return &ctypes.ResultHealth{}, nil | |||
} |