From e102a2b5ac3044212facfdbf4beeebf5ee2b6e45 Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Mon, 23 May 2022 19:08:17 +0530 Subject: [PATCH 1/2] Upgrade dependencies to v4 --- go.mod | 8 ++++---- go.sum | 16 ++++++++-------- pkg/validator/config.go | 2 +- pkg/validator/validator.go | 6 +++--- test/integration_test.go | 4 ++-- validator_test/validator_test.go | 4 ++-- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/go.mod b/go.mod index 37ee04c..5f58553 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,8 @@ require ( github.com/sirupsen/logrus v1.8.1 github.com/spf13/cobra v1.4.0 github.com/spf13/viper v1.11.0 - github.com/vulcanize/ipfs-ethdb/v3 v3.0.1 - github.com/vulcanize/ipld-eth-server/v3 v3.1.0 + github.com/vulcanize/ipfs-ethdb/v4 v4.0.0-alpha + github.com/vulcanize/ipld-eth-server/v4 v4.0.1-alpha ) require ( @@ -233,7 +233,7 @@ require ( github.com/tklauser/go-sysconf v0.3.6 // indirect github.com/tklauser/numcpus v0.2.2 // indirect github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef // indirect - github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.0 // indirect + github.com/vulcanize/eth-ipfs-state-validator/v4 v4.0.0-alpha // indirect github.com/whyrusleeping/base32 v0.0.0-20170828182744-c30ac30633cc // indirect github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2 // indirect github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect @@ -270,4 +270,4 @@ require ( lukechampine.com/blake3 v1.1.6 // indirect ) -replace github.com/ethereum/go-ethereum v1.10.17 => github.com/vulcanize/go-ethereum v1.10.17-statediff-3.2.1 +replace github.com/ethereum/go-ethereum v1.10.17 => github.com/vulcanize/go-ethereum v1.10.17-statediff-4.0.1-alpha diff --git a/go.sum b/go.sum index fbbeb66..b9ace88 100644 --- a/go.sum +++ b/go.sum @@ -1819,15 +1819,15 @@ github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPU github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= -github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.0 h1:hQcbewsJX5Xpd3xdE9n3JpGyuzUqMhwhpQCpbN+9Uiw= -github.com/vulcanize/eth-ipfs-state-validator/v3 v3.0.0/go.mod h1:CuuygZPciwwLV5vNY1LcIi0PZxXZbOmicw1/IkrPpPI= +github.com/vulcanize/eth-ipfs-state-validator/v4 v4.0.0-alpha h1:9TtxGBNl/hVQ8wegrZx//UnAMivImbcNcYTQxHfhjlQ= +github.com/vulcanize/eth-ipfs-state-validator/v4 v4.0.0-alpha/go.mod h1:cY+XmYdOtBc84s02GdDTFoybJF+mR7WDcr3Z7l4Fb1g= github.com/vulcanize/gap-filler v0.3.1/go.mod h1:qowG1cgshVpBqMokiWro/1xhh0uypw7oAu8FQ42JMy4= -github.com/vulcanize/go-ethereum v1.10.17-statediff-3.2.1 h1:BUIaiqqsWM61KfzIowqrGJ8TM2SWwmral4iJ/nhTSe0= -github.com/vulcanize/go-ethereum v1.10.17-statediff-3.2.1/go.mod h1:mDwZX+QoWdqzQo6SDG3YVqCYACutcSG6uzpziMvTu28= -github.com/vulcanize/ipfs-ethdb/v3 v3.0.1 h1:gm+6SgxcNOCz6mgwvhsxORLXsr9yIFvbJDuoAK85ONs= -github.com/vulcanize/ipfs-ethdb/v3 v3.0.1/go.mod h1:SPBTTl5CqRexYfkI66pbzE5nQziYpoQ+7hH0XveA9IU= -github.com/vulcanize/ipld-eth-server/v3 v3.1.0 h1:j63y6R3cPtGrwIacYgDdDsaonR/ai/1NXeqnQvgSjo4= -github.com/vulcanize/ipld-eth-server/v3 v3.1.0/go.mod h1:0NEHDLl5dAZMvpt6+9CBbSdFBfgi8Bcwqo5LqQRUrvI= +github.com/vulcanize/go-ethereum v1.10.17-statediff-4.0.1-alpha h1:ANyTG2JJkOaQD3IqkLLl2OjtTC+PKlrdmy6HIddpqZw= +github.com/vulcanize/go-ethereum v1.10.17-statediff-4.0.1-alpha/go.mod h1:mDwZX+QoWdqzQo6SDG3YVqCYACutcSG6uzpziMvTu28= +github.com/vulcanize/ipfs-ethdb/v4 v4.0.0-alpha h1:XaltpDMGFqcEe+tsYTmqICeFhR+jTHHzc85YTVigEdE= +github.com/vulcanize/ipfs-ethdb/v4 v4.0.0-alpha/go.mod h1:sSTqwalaV7CiXq83YkMJpZetoSxgcdzr0AG0NnuaGMM= +github.com/vulcanize/ipld-eth-server/v4 v4.0.1-alpha h1:uum5g/j8LZy/3Fbg/EFCRVc+mChoe84a5fLZ7iqFqOY= +github.com/vulcanize/ipld-eth-server/v4 v4.0.1-alpha/go.mod h1:a+3NzmUjaA8fqdwPtCbDBBB8j35cN8XghTpMUBAgufk= github.com/wangjia184/sortedset v0.0.0-20160527075905-f5d03557ba30/go.mod h1:YkocrP2K2tcw938x9gCOmT5G5eCD6jsTz0SZuyAqwIE= github.com/warpfork/go-testmark v0.3.0 h1:Q81c4u7hT+BR5kNfNQhEF0VT2pmL7+Kk0wD+ORYl7iA= github.com/warpfork/go-testmark v0.3.0/go.mod h1:jhEf8FVxd+F17juRubpmut64NEG6I2rgkUhlcqqXwE0= diff --git a/pkg/validator/config.go b/pkg/validator/config.go index 068f10d..785bc6b 100644 --- a/pkg/validator/config.go +++ b/pkg/validator/config.go @@ -9,7 +9,7 @@ import ( "github.com/ethereum/go-ethereum/statediff/indexer/database/sql/postgres" "github.com/jmoiron/sqlx" "github.com/spf13/viper" - "github.com/vulcanize/ipld-eth-server/v3/pkg/shared" + "github.com/vulcanize/ipld-eth-server/v4/pkg/shared" ) var ( diff --git a/pkg/validator/validator.go b/pkg/validator/validator.go index ba6668a..c264f3e 100644 --- a/pkg/validator/validator.go +++ b/pkg/validator/validator.go @@ -19,9 +19,9 @@ import ( "github.com/ethereum/go-ethereum/rpc" "github.com/jmoiron/sqlx" log "github.com/sirupsen/logrus" - ipfsethdb "github.com/vulcanize/ipfs-ethdb/v3/postgres" - ipldEth "github.com/vulcanize/ipld-eth-server/v3/pkg/eth" - ethServerShared "github.com/vulcanize/ipld-eth-server/v3/pkg/shared" + ipfsethdb "github.com/vulcanize/ipfs-ethdb/v4/postgres" + ipldEth "github.com/vulcanize/ipld-eth-server/v4/pkg/eth" + ethServerShared "github.com/vulcanize/ipld-eth-server/v4/pkg/shared" ) var ( diff --git a/test/integration_test.go b/test/integration_test.go index 1941724..e26f8c2 100644 --- a/test/integration_test.go +++ b/test/integration_test.go @@ -9,8 +9,8 @@ import ( "github.com/vulcanize/ipld-eth-db-validator/pkg/validator" - "github.com/vulcanize/ipld-eth-server/v3/pkg/shared" - integration "github.com/vulcanize/ipld-eth-server/v3/test" + "github.com/vulcanize/ipld-eth-server/v4/pkg/shared" + integration "github.com/vulcanize/ipld-eth-server/v4/test" ) const trail = 0 diff --git a/validator_test/validator_test.go b/validator_test/validator_test.go index 83a75b2..f0f0bfc 100644 --- a/validator_test/validator_test.go +++ b/validator_test/validator_test.go @@ -12,8 +12,8 @@ import ( "github.com/jmoiron/sqlx" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/vulcanize/ipld-eth-server/v3/pkg/eth/test_helpers" - "github.com/vulcanize/ipld-eth-server/v3/pkg/shared" + "github.com/vulcanize/ipld-eth-server/v4/pkg/eth/test_helpers" + "github.com/vulcanize/ipld-eth-server/v4/pkg/shared" "github.com/vulcanize/ipld-eth-db-validator/pkg/validator" "github.com/vulcanize/ipld-eth-db-validator/validator_test" From a56da1782a9d372d70bd61ee4e4cb5dad6b1af6a Mon Sep 17 00:00:00 2001 From: prathamesh0 Date: Mon, 23 May 2022 19:43:09 +0530 Subject: [PATCH 2/2] Update instructions to run tests --- docker-compose.yml | 22 +++++++++++++++++----- scripts/run_integration_test.sh | 2 ++ scripts/run_unit_test.sh | 12 ++++++++++-- test/README.md | 8 ++++---- 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index e284ce8..628519b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,18 +1,30 @@ version: '3.2' services: + migrations: + restart: on-failure + depends_on: + - ipld-eth-db + image: vulcanize/ipld-eth-db:v4.1.1-alpha + environment: + DATABASE_USER: "vdbm" + DATABASE_NAME: "vulcanize_testing" + DATABASE_PASSWORD: "password" + DATABASE_HOSTNAME: "ipld-eth-db" + DATABASE_PORT: 5432 + ipld-eth-db: + image: timescale/timescaledb:latest-pg14 restart: always - image: vulcanize/ipld-eth-db:v3.2.0 + command: ["postgres", "-c", "log_statement=all"] environment: POSTGRES_USER: "vdbm" POSTGRES_DB: "vulcanize_testing" POSTGRES_PASSWORD: "password" - volumes: - - vdb_db_eth_validator:/var/lib/postgresql/data ports: - "127.0.0.1:8077:5432" - command: ["postgres", "-c", "log_statement=all"] + volumes: + - vdb_db_eth_validator:/var/lib/postgresql/data volumes: - vdb_db_eth_validator: \ No newline at end of file + vdb_db_eth_validator: diff --git a/scripts/run_integration_test.sh b/scripts/run_integration_test.sh index c9aaa1c..052e7f2 100755 --- a/scripts/run_integration_test.sh +++ b/scripts/run_integration_test.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -e set -o xtrace diff --git a/scripts/run_unit_test.sh b/scripts/run_unit_test.sh index 567f4dd..74d586e 100755 --- a/scripts/run_unit_test.sh +++ b/scripts/run_unit_test.sh @@ -1,9 +1,17 @@ +#!/bin/bash + +set -e + # Clear up existing docker images and volume. docker-compose down --remove-orphans --volumes -docker-compose -f docker-compose.yml up -d ipld-eth-db -sleep 10 +# Spin up TimescaleDB +docker-compose -f docker-compose.yml up -d migrations ipld-eth-db +sleep 45 +# Run unit tests +go clean -testcache PGPASSWORD=password DATABASE_USER=vdbm DATABASE_PORT=8077 DATABASE_PASSWORD=password DATABASE_HOSTNAME=127.0.0.1 DATABASE_NAME=vulcanize_testing make test +# Clean up docker-compose down --remove-orphans --volumes diff --git a/test/README.md b/test/README.md index 0f8b5ad..508500a 100644 --- a/test/README.md +++ b/test/README.md @@ -1,4 +1,4 @@ -# Test Insructions +# Test Instructions ## Setup @@ -6,18 +6,18 @@ - Clone [stack-orchestrator](https://github.com/vulcanize/stack-orchestrator) and [go-ethereum](https://github.com/vulcanize/go-ethereum) repositories. - - Checkout [v3 release](https://github.com/vulcanize/go-ethereum/releases/tag/v1.10.17-statediff-3.2.1) in go-ethereum repo. + - Checkout [v4 release](https://github.com/vulcanize/go-ethereum/releases/tag/v1.10.17-statediff-4.0.1-alpha) in go-ethereum repo. ```bash # In go-ethereum repo. - git checkout v1.10.17-statediff-3.2.1 + git checkout v1.10.17-statediff-4.0.1-alpha ``` - Checkout working commit in stack-orchestrator repo. ```bash # In stack-orchestrator repo. - git checkout 3bb1796a59827fb755410c5ce69fac567a0f832b + git checkout 42af57a2963bb6ca55fb5fcb16ed75b39fae60f9 ``` ## Run