Skip to content

Commit

Permalink
Merge pull request #24 from dongrie/ganache-to-geth
Browse files Browse the repository at this point in the history
Change ganache to geth
  • Loading branch information
siburu authored Mar 6, 2024
2 parents 12261ad + b7011d8 commit 6606fdc
Show file tree
Hide file tree
Showing 39 changed files with 7,602 additions and 18,457 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/v0.4-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on: [push, pull_request]
env:
CACHE_BIN_RELAYER_KEY: bin-relayer
CACHE_BIN_RELAYER_PATH: ./build/yrly
CACHE_DOCKER_ETHEREUM_GANACHE_KEY: docker-ethereum-ganache
CACHE_DOCKER_ETHEREUM_GANACHE_DIR: /tmp/ethereum/ganache
CACHE_DOCKER_ETHEREUM_GETH_KEY: docker-ethereum-geth
CACHE_DOCKER_ETHEREUM_GETH_DIR: /tmp/ethereum/geth
CACHE_DOCKER_FABRIC_KEY: docker-fabric
CACHE_DOCKER_FABRIC_DIR: /tmp/fabric
CACHE_DOCKER_CORDA_KEY: docker-corda
Expand Down Expand Up @@ -79,4 +79,4 @@ jobs:
if: steps.cache-docker-ethereum.outputs.cache-hit != 'true'
working-directory: ./tests/scripts
run: |
./save_docker_images $CACHE_DOCKER_ETHEREUM_DIR ethereum-ganache0:latest ethereum-ganache1:latest
./save_docker_images $CACHE_DOCKER_ETHEREUM_DIR ethereum-geth0:latest ethereum-geth1:latest
2 changes: 1 addition & 1 deletion .github/workflows/v0.4-eth2eth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Load Ethereum docker images
working-directory: ./tests/scripts
run: |
./load_docker_images $CACHE_DOCKER_ETHEREUM_DIR ethereum-ganache0:latest ethereum-ganache1:latest
./load_docker_images $CACHE_DOCKER_ETHEREUM_DIR ethereum-geth0:latest ethereum-geth1:latest
- name: Run Test
working-directory: ./tests/cases/eth2eth
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/v0.4-tm2eth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
working-directory: ./tests/scripts
run: |
./load_docker_images $CACHE_DOCKER_TENDERMINT_DIR tendermint-chain0:latest
./load_docker_images $CACHE_DOCKER_ETHEREUM_DIR ethereum-ganache0:latest
./load_docker_images $CACHE_DOCKER_ETHEREUM_DIR ethereum-geth0:latest
- name: Run Test
working-directory: ./tests/cases/tm2eth
run: |
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ replace (
)

require (
github.com/datachainlab/ethereum-ibc-relay-chain v0.2.10
github.com/hyperledger-labs/yui-relayer v0.4.20
github.com/datachainlab/ethereum-ibc-relay-chain v0.2.16
github.com/hyperledger-labs/yui-relayer v0.4.25
)

require (
Expand Down Expand Up @@ -65,7 +65,7 @@ require (
github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect
github.com/creachadair/taskgroup v0.4.2 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/datachainlab/ibc-mock-client v0.3.2 // indirect
github.com/datachainlab/ibc-mock-client v0.3.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,10 @@ github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbd
github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts=
github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0=
github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0=
github.com/datachainlab/ethereum-ibc-relay-chain v0.2.10 h1:2bAUn9yYFQTFj0gRIbWWXgZY48FGIrAwA9gH0YQLrxM=
github.com/datachainlab/ethereum-ibc-relay-chain v0.2.10/go.mod h1:FDKiZNh2r8kz/KAXBG9tNDcoT6jyiUR1EfiE9W7Xjbc=
github.com/datachainlab/ibc-mock-client v0.3.2 h1:SxBkaiuHWQ+1L085m2L35Fku3am7I6YL6B7dwurtDOM=
github.com/datachainlab/ibc-mock-client v0.3.2/go.mod h1:FfqyF+VJKp8jlIG21lTNJJIp8RCaxSrx6vjhNkfwgBM=
github.com/datachainlab/ethereum-ibc-relay-chain v0.2.16 h1:1hm8qVm52nDLOWWO+g5Q9Ymba0ckA3XioBCxltCv76E=
github.com/datachainlab/ethereum-ibc-relay-chain v0.2.16/go.mod h1:FDKiZNh2r8kz/KAXBG9tNDcoT6jyiUR1EfiE9W7Xjbc=
github.com/datachainlab/ibc-mock-client v0.3.3 h1:jZQvvd88g/6Jq8LULaqeYviOSQYqWhgsUMYMtUzosiA=
github.com/datachainlab/ibc-mock-client v0.3.3/go.mod h1:FfqyF+VJKp8jlIG21lTNJJIp8RCaxSrx6vjhNkfwgBM=
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand Down Expand Up @@ -740,8 +740,8 @@ github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXM
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
github.com/huin/goupnp v1.0.3 h1:N8No57ls+MnjlB+JPiCVSOyy/ot7MJTqlo7rn+NYSqQ=
github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE=
github.com/hyperledger-labs/yui-relayer v0.4.20 h1:kkE4XcgkKtPvVUNJZBXOdGPujLVMeL7LZ34a4Sw1boE=
github.com/hyperledger-labs/yui-relayer v0.4.20/go.mod h1:Hdc/ERCPDhbipri45/U6+/3kDH7EttIWGdql+Rd3tZg=
github.com/hyperledger-labs/yui-relayer v0.4.25 h1:KQRcHO/mzss6OKd5r6P3FmntFrBVsmPSMDSZyv761HM=
github.com/hyperledger-labs/yui-relayer v0.4.25/go.mod h1:noot+qdFpngVV99bC4Pynu4S4Tg7K8JLPBgxsGLtE8Y=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=
Expand Down
12 changes: 6 additions & 6 deletions tests/cases/docker-compose-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ services:
USE_MOCK_CLIENT: 1

# Ethereum
ethereum-ganache0:
container_name: ethereum-ganache0
image: ethereum-ganache0:${TAG}
ethereum-geth0:
container_name: ethereum-geth0
image: ethereum-geth0:${TAG}
ports:
- 8645:8545
healthcheck:
Expand All @@ -58,9 +58,9 @@ services:
retries: 5
networks:
- *network-common
ethereum-ganache1:
container_name: ethereum-ganache1
image: ethereum-ganache1:${TAG}
ethereum-geth1:
container_name: ethereum-geth1
image: ethereum-geth1:${TAG}
ports:
- 8745:8545
healthcheck:
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/eth2eth/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ network:
TAG=${DOCKER_TAG} $(DOCKER_COMPOSE) \
-f ../docker-compose-test.yaml \
up -d \
ethereum-ganache0 ethereum-ganache1
ethereum-geth0 ethereum-geth1

.PHONY: test
test:
Expand Down
9 changes: 8 additions & 1 deletion tests/cases/eth2eth/configs/chains/ibc-0.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@
"initial_recv_checkpoint": 1,
"enable_debug_trace": true,
"average_block_time_msec": 1000,
"max_retry_for_inclusion": 5
"max_retry_for_inclusion": 5,
"gas_estimate_rate": {
"numerator": 3,
"denominator": 2
},
"max_gas_limit": 10000000,
"tx_type": "auto",
"blocks_per_event_query": 1000
},
"prover": {
"@type": "/relayer.provers.mock.config.ProverConfig",
Expand Down
9 changes: 8 additions & 1 deletion tests/cases/eth2eth/configs/chains/ibc-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@
"initial_recv_checkpoint": 1,
"enable_debug_trace": true,
"average_block_time_msec": 1000,
"max_retry_for_inclusion": 5
"max_retry_for_inclusion": 5,
"gas_estimate_rate": {
"numerator": 3,
"denominator": 2
},
"max_gas_limit": 10000000,
"tx_type": "auto",
"blocks_per_event_query": 1000
},
"prover": {
"@type": "/relayer.provers.mock.config.ProverConfig",
Expand Down
6 changes: 3 additions & 3 deletions tests/cases/eth2eth/scripts/test-tx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ if ! which ${ICS20_CLI} > /dev/null 2>&1; then
export PATH=$PATH:$(go env GOPATH)/bin
fi

ERC20_TOKEN_ADDRESS="0xaa43d337145E8930d01cb4E60Abf6595C692921E"
ICS20_TRANSFER_BANK_ADDRESS="0x2F5703804E29F4252FA9405B8D357220d11b3bd9"
ICS20_BANK_ADDRESS="0xff77D90D6aA12db33d3Ba50A34fB25401f6e4c4F"
ERC20_TOKEN_ADDRESS="0x702E40245797c5a2108A566b3CE2Bf14Bc6aF841"
ICS20_TRANSFER_BANK_ADDRESS="0xff77D90D6aA12db33d3Ba50A34fB25401f6e4c4F"
ICS20_BANK_ADDRESS="0xaa43d337145E8930d01cb4E60Abf6595C692921E"

DENOM=$(echo "$ERC20_TOKEN_ADDRESS" | tr '[:upper:]' '[:lower:]')

Expand Down
2 changes: 1 addition & 1 deletion tests/cases/tm2eth/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ network:
TAG=${DOCKER_TAG} $(DOCKER_COMPOSE) \
-f ../docker-compose-test.yaml \
up -d \
tendermint-chain0-mock ethereum-ganache0
tendermint-chain0-mock ethereum-geth0

.PHONY: test
test:
Expand Down
9 changes: 8 additions & 1 deletion tests/cases/tm2eth/configs/demo/ibc-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@
"initial_recv_checkpoint": 1,
"enable_debug_trace": true,
"average_block_time_msec": 1000,
"max_retry_for_inclusion": 5
"max_retry_for_inclusion": 5,
"gas_estimate_rate": {
"numerator": 3,
"denominator": 2
},
"max_gas_limit": 10000000,
"tx_type": "auto",
"blocks_per_event_query": 1000
},
"prover": {
"@type": "/relayer.provers.mock.config.ProverConfig",
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/tm2eth/scripts/test-tx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TX_INTERVAL=3

TM_ADDRESS=$(${RLY} tendermint keys show ibc0 testkey)

ICS20_BANK_ADDRESS="0xff77D90D6aA12db33d3Ba50A34fB25401f6e4c4F"
ICS20_BANK_ADDRESS="0xaa43d337145E8930d01cb4E60Abf6595C692921E"

PATH_JSON=${CONF_DIR}/path.json
PORT_ID=$(jq -r '.dst."port-id"' ${PATH_JSON})
Expand Down
15 changes: 0 additions & 15 deletions tests/chains/ethereum/Dockerfiles/ganache/Dockerfile

This file was deleted.

11 changes: 0 additions & 11 deletions tests/chains/ethereum/Dockerfiles/ganache/run.sh

This file was deleted.

22 changes: 5 additions & 17 deletions tests/chains/ethereum/Makefile
Original file line number Diff line number Diff line change
@@ -1,40 +1,28 @@
include ../../docker.mk

HARDHAT ?= npx hardhat
SCRIPT_DIR ?= $(CURDIR)/scripts

NETWORK_ID0 ?= 13370
NETWORK_ID1 ?= 13380

export NETWORK_ID0
export NETWORK_ID1

.PHONY: docker-images
docker-images:
make up-scaffold
make deploy-contract
make save-contract-address
make docker-commit
make down-scaffold

.PHONY: deploy-contract
deploy-contract:
make wait-for-launch ATTEMPT=30 CONTAINER=ethereum-ganache0-scaffold
cd contract && npm install && npm run migrate
cd contracts && npm install && $(HARDHAT) run ./scripts/deploy.js --network ibc0 && $(HARDHAT) run ./scripts/deploy.js --network ibc1

.PHONY: up-scaffold
up-scaffold:
$(DOCKER_COMPOSE) up --build -d
$(DOCKER_COMPOSE) up --build -d geth0-scaffold geth1-scaffold

.PHONY: down-scaffold
down-scaffold:
$(DOCKER_COMPOSE) down --volumes --remove-orphans

.PHONY: save-contract-address
save-contract-address:
$(SCRIPT_DIR)/docker/saveContractAddress.sh $(NETWORK_ID0)
$(SCRIPT_DIR)/docker/saveContractAddress.sh $(NETWORK_ID1)

.PHONY: docker-commit
docker-commit:
$(SCRIPT_DIR)/docker/commitImage.sh $(DOCKER_REPO) $(DOCKER_TAG) ethereum-ganache0 ethereum-ganache0-scaffold $(NETWORK_ID0)
$(SCRIPT_DIR)/docker/commitImage.sh $(DOCKER_REPO) $(DOCKER_TAG) ethereum-ganache1 ethereum-ganache1-scaffold $(NETWORK_ID1)
$(SCRIPT_DIR)/docker/commitImage.sh $(DOCKER_REPO) $(DOCKER_TAG) ethereum-geth0 ethereum-geth0-scaffold
$(SCRIPT_DIR)/docker/commitImage.sh $(DOCKER_REPO) $(DOCKER_TAG) ethereum-geth1 ethereum-geth1-scaffold
3 changes: 0 additions & 3 deletions tests/chains/ethereum/contract/.gitignore

This file was deleted.

33 changes: 0 additions & 33 deletions tests/chains/ethereum/contract/migrations/1_deploy_contracts.js

This file was deleted.

24 changes: 0 additions & 24 deletions tests/chains/ethereum/contract/migrations/2_initialize_contract.js

This file was deleted.

Loading

0 comments on commit 6606fdc

Please sign in to comment.