Skip to content

Commit

Permalink
Remove dependency on Tendermint Core (#168)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
thanethomson authored Jan 19, 2023
1 parent a9c21a5 commit 4edcd62
Show file tree
Hide file tree
Showing 18 changed files with 546 additions and 314 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
- uses: golangci/golangci-lint-action@v3.3.1
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.49.0
version: v1.50.1
args: --timeout 10m
github-token: ${{ secrets.github_token }}
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: "1.18"
- run: make build
- run: |
go test ./... -mod=readonly -timeout 8m -race -coverprofile=coverage.txt -covermode=atomic
- run: make integration-test
- uses: codecov/codecov-action@v3.1.1
with:
file: ./coverage.txt
37 changes: 36 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GOPATH ?= $(shell go env GOPATH)
BUILD_DIR ?= ./build
BUILD_DIR ?= $(CURDIR)/build
.DEFAULT_GOAL := build
BUILD_FLAGS ?= -mod=readonly

Expand Down Expand Up @@ -31,6 +31,41 @@ test:
go test -cover -race ./...
.PHONY: test

# Builds a Docker image called "tendermint/localnode", which is based on
# Tendermint Core. Takes the current system user and group ID as the user/group
# IDs for the tmuser user within the container so as to eliminate permissions
# issues when generating testnet files in the localnet target.
localnode:
@docker build -f ./test/localnode/Dockerfile \
--build-arg UID=$(shell id -u) \
--build-arg GID=$(shell id -g) \
-t tendermint/localnode:latest \
./test/localnode/
.PHONY: localnode

localnet: localnode
@if ! [ -f build/node0/config/genesis.json ]; then \
mkdir -p build && \
docker run \
--rm \
-v $(BUILD_DIR):/tendermint:Z \
tendermint/localnode \
testnet --config /etc/tendermint/config-template.toml --o . --starting-ip-address 192.168.10.2; \
fi
.PHONY: localnet

localnet-start: localnet
@docker-compose -f ./test/docker-compose.yml up -d
.PHONY: localnet-start

localnet-stop:
@docker-compose -f ./test/docker-compose.yml down
.PHONY: localnet-stop

integration-test:
@./test/integration-test.sh
.PHONY: integration-test

bench:
go test -bench="Benchmark" -run="notests" ./...
.PHONY: bench
Expand Down
44 changes: 2 additions & 42 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,63 +8,23 @@ require (
github.com/satori/go.uuid v1.2.0
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.6.1
github.com/tendermint/tendermint v0.34.24
golang.org/x/crypto v0.5.0
)

require (
github.com/DataDog/zstd v1.4.1 // indirect
github.com/Workiva/go-datastructures v1.0.53 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcd v0.22.1 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/creachadair/taskgroup v0.3.2 // indirect
github.com/dgraph-io/badger/v2 v2.2007.2 // indirect
github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de // indirect
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c // indirect
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 // indirect
github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/gtank/merlin v0.1.1 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/lib/pq v1.10.6 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
github.com/minio/highwayhash v1.0.2 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/onsi/gomega v1.20.0 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
github.com/tendermint/tm-db v0.6.6 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/net v0.5.0 // indirect
github.com/stretchr/testify v1.8.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a // indirect
google.golang.org/grpc v1.50.1 // indirect
google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
)

replace github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.24
Loading

0 comments on commit 4edcd62

Please sign in to comment.