Skip to content

Commit 4edcd62

Browse files
author
Thane Thomson
authored
Remove dependency on Tendermint Core (#168)
* Remove dependency on tmrand Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove integration test Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove transactor dependency on rpctypes Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove network info dependency on Tendermint RPC Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove dependency on Tendermint Core Signed-off-by: Thane Thomson <connect@thanethomson.com> * Bump golangci-lint version to v1.50.1 Signed-off-by: Thane Thomson <connect@thanethomson.com> * ci: Remove code coverage, since integration tests will take place via Docker Signed-off-by: Thane Thomson <connect@thanethomson.com> * Revert "Remove integration test" This reverts commit 207b2b7. * Add Docker-based integration test Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove lint prerequisite for integration-test target (breaks CI) Signed-off-by: Thane Thomson <connect@thanethomson.com> * Change subnet for integration test to 192.168.0.0/16 Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove debug command from entrypoint script Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove hacky mutex-based approach to serializing integration tests Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove unnecessary exit condition check in integration test script Signed-off-by: Thane Thomson <connect@thanethomson.com> Signed-off-by: Thane Thomson <connect@thanethomson.com>
1 parent a9c21a5 commit 4edcd62

18 files changed

Lines changed: 546 additions & 314 deletions

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717
- uses: golangci/golangci-lint-action@v3.3.1
1818
with:
1919
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
20-
version: v1.49.0
20+
version: v1.50.1
2121
args: --timeout 10m
2222
github-token: ${{ secrets.github_token }}

.github/workflows/test.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ jobs:
1313
- uses: actions/setup-go@v3
1414
with:
1515
go-version: "1.18"
16-
- run: make build
17-
- run: |
18-
go test ./... -mod=readonly -timeout 8m -race -coverprofile=coverage.txt -covermode=atomic
16+
- run: make integration-test
1917
- uses: codecov/codecov-action@v3.1.1
2018
with:
2119
file: ./coverage.txt

Makefile

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GOPATH ?= $(shell go env GOPATH)
2-
BUILD_DIR ?= ./build
2+
BUILD_DIR ?= $(CURDIR)/build
33
.DEFAULT_GOAL := build
44
BUILD_FLAGS ?= -mod=readonly
55

@@ -31,6 +31,41 @@ test:
3131
go test -cover -race ./...
3232
.PHONY: test
3333

34+
# Builds a Docker image called "tendermint/localnode", which is based on
35+
# Tendermint Core. Takes the current system user and group ID as the user/group
36+
# IDs for the tmuser user within the container so as to eliminate permissions
37+
# issues when generating testnet files in the localnet target.
38+
localnode:
39+
@docker build -f ./test/localnode/Dockerfile \
40+
--build-arg UID=$(shell id -u) \
41+
--build-arg GID=$(shell id -g) \
42+
-t tendermint/localnode:latest \
43+
./test/localnode/
44+
.PHONY: localnode
45+
46+
localnet: localnode
47+
@if ! [ -f build/node0/config/genesis.json ]; then \
48+
mkdir -p build && \
49+
docker run \
50+
--rm \
51+
-v $(BUILD_DIR):/tendermint:Z \
52+
tendermint/localnode \
53+
testnet --config /etc/tendermint/config-template.toml --o . --starting-ip-address 192.168.10.2; \
54+
fi
55+
.PHONY: localnet
56+
57+
localnet-start: localnet
58+
@docker-compose -f ./test/docker-compose.yml up -d
59+
.PHONY: localnet-start
60+
61+
localnet-stop:
62+
@docker-compose -f ./test/docker-compose.yml down
63+
.PHONY: localnet-stop
64+
65+
integration-test:
66+
@./test/integration-test.sh
67+
.PHONY: integration-test
68+
3469
bench:
3570
go test -bench="Benchmark" -run="notests" ./...
3671
.PHONY: bench

go.mod

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,63 +8,23 @@ require (
88
github.com/satori/go.uuid v1.2.0
99
github.com/sirupsen/logrus v1.9.0
1010
github.com/spf13/cobra v1.6.1
11-
github.com/tendermint/tendermint v0.34.24
1211
golang.org/x/crypto v0.5.0
1312
)
1413

1514
require (
16-
github.com/DataDog/zstd v1.4.1 // indirect
17-
github.com/Workiva/go-datastructures v1.0.53 // indirect
1815
github.com/beorn7/perks v1.0.1 // indirect
19-
github.com/btcsuite/btcd v0.22.1 // indirect
20-
github.com/cespare/xxhash v1.1.0 // indirect
2116
github.com/cespare/xxhash/v2 v2.1.2 // indirect
22-
github.com/creachadair/taskgroup v0.3.2 // indirect
23-
github.com/dgraph-io/badger/v2 v2.2007.2 // indirect
24-
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de // indirect
25-
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
26-
github.com/dustin/go-humanize v1.0.0 // indirect
27-
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c // indirect
28-
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
29-
github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 // indirect
30-
github.com/go-kit/kit v0.12.0 // indirect
31-
github.com/go-kit/log v0.2.1 // indirect
32-
github.com/go-logfmt/logfmt v0.5.1 // indirect
33-
github.com/gogo/protobuf v1.3.2 // indirect
3417
github.com/golang/protobuf v1.5.2 // indirect
35-
github.com/golang/snappy v0.0.4 // indirect
36-
github.com/google/btree v1.0.0 // indirect
37-
github.com/google/orderedcode v0.0.1 // indirect
38-
github.com/gtank/merlin v0.1.1 // indirect
18+
github.com/google/go-cmp v0.5.9 // indirect
3919
github.com/inconshreveable/mousetrap v1.0.1 // indirect
40-
github.com/jmhodges/levigo v1.0.0 // indirect
41-
github.com/lib/pq v1.10.6 // indirect
42-
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
4320
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
44-
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
45-
github.com/minio/highwayhash v1.0.2 // indirect
4621
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
47-
github.com/onsi/gomega v1.20.0 // indirect
48-
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
49-
github.com/pkg/errors v0.9.1 // indirect
5022
github.com/prometheus/client_model v0.3.0 // indirect
5123
github.com/prometheus/common v0.37.0 // indirect
5224
github.com/prometheus/procfs v0.8.0 // indirect
53-
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
54-
github.com/rs/cors v1.8.2 // indirect
55-
github.com/sasha-s/go-deadlock v0.3.1 // indirect
5625
github.com/spf13/pflag v1.0.5 // indirect
57-
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
58-
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
59-
github.com/tendermint/tm-db v0.6.6 // indirect
60-
go.etcd.io/bbolt v1.3.6 // indirect
61-
golang.org/x/net v0.5.0 // indirect
26+
github.com/stretchr/testify v1.8.0 // indirect
6227
golang.org/x/sys v0.4.0 // indirect
63-
golang.org/x/text v0.6.0 // indirect
64-
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a // indirect
65-
google.golang.org/grpc v1.50.1 // indirect
6628
google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect
6729
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
6830
)
69-
70-
replace github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.24

0 commit comments

Comments
 (0)