Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cerc-io/ipld-eth-server
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.5-alpha
Choose a base ref
...
head repository: cerc-io/ipld-eth-server
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Apr 12, 2021

  1. Copy the full SHA
    08df7be View commit details

Commits on Apr 13, 2021

  1. Merge pull request #46 from vulcanize/get_logs

    eth_getLogs use FilterCriteria not FilterQuery
    i-norden authored Apr 13, 2021
    Copy the full SHA
    325516d View commit details

Commits on Apr 14, 2021

  1. normilize CLI options, environment variables

    merge gap-filler library to "serve" commnad
    ramilexe committed Apr 14, 2021
    Copy the full SHA
    524ab42 View commit details

Commits on Apr 15, 2021

  1. fix serve command

    ramilexe committed Apr 15, 2021
    Copy the full SHA
    0751946 View commit details

Commits on Apr 16, 2021

  1. remove proxy command

    ramilexe committed Apr 16, 2021
    Copy the full SHA
    75debec View commit details
  2. Copy the full SHA
    31cbaec View commit details
  3. Copy the full SHA
    141b3ea View commit details

Commits on Apr 19, 2021

  1. Copy the full SHA
    3c57fa1 View commit details
  2. Copy the full SHA
    53f06a6 View commit details
  3. Copy the full SHA
    c813ff0 View commit details
  4. Copy the full SHA
    50d5353 View commit details
  5. fix unit tests

    ramilexe committed Apr 19, 2021
    Copy the full SHA
    9d67917 View commit details
  6. test eth_chainId

    ramilexe committed Apr 19, 2021
    Copy the full SHA
    7d88e78 View commit details
  7. Copy the full SHA
    d5cf74e View commit details
  8. Copy the full SHA
    9d590e1 View commit details
  9. Copy the full SHA
    f8b9d94 View commit details

Commits on Apr 20, 2021

  1. update migration version

    ramilexe authored Apr 20, 2021
    Copy the full SHA
    2e5286b View commit details

Commits on Apr 21, 2021

  1. Copy the full SHA
    9b960a1 View commit details
  2. Copy the full SHA
    36b62f9 View commit details
  3. Copy the full SHA
    d09b756 View commit details
  4. Copy the full SHA
    bcbd2de View commit details
  5. Copy the full SHA
    8ac6d48 View commit details
  6. integration tests: eth call

    ramilexe committed Apr 21, 2021
    Copy the full SHA
    0aa0f38 View commit details
  7. Copy the full SHA
    39141bd View commit details
  8. Copy the full SHA
    cef4b1d View commit details
  9. Copy the full SHA
    c62799f View commit details
  10. Copy the full SHA
    1141f39 View commit details

Commits on Apr 23, 2021

  1. integration tests: fix issue with eth_call (pass chain config via jso…

    …n file to match geth chain config)
    
    added additional test case: gets balance for a non-existing account without block number
    ramilexe committed Apr 23, 2021
    Copy the full SHA
    97d8c4d View commit details
  2. Merge pull request #60 from vulcanize/shadowing

    minor refactor; fix error shadowing
    i-norden authored Apr 23, 2021
    Copy the full SHA
    6844c60 View commit details

Commits on Apr 29, 2021

  1. custom comparation for tx and block (exclude time)

    enrich receipts and logs with non-rlp encoded data (block number, block hash, etc)
    ramilexe committed Apr 29, 2021
    Copy the full SHA
    954e028 View commit details

Commits on Jun 3, 2021

  1. Fix failing test

    arijitAD committed Jun 3, 2021
    Copy the full SHA
    7babaf6 View commit details

Commits on Jun 9, 2021

  1. Fix get logs unit test.

    arijitAD committed Jun 9, 2021
    Copy the full SHA
    8c16dc2 View commit details
  2. Copy the full SHA
    b3ef293 View commit details

Commits on Jun 10, 2021

  1. Copy the full SHA
    3b37164 View commit details
  2. Copy the full SHA
    9cf75ca View commit details
  3. Copy the full SHA
    2c1bc55 View commit details
  4. Optimize docker build.

    arijitAD committed Jun 10, 2021
    Copy the full SHA
    491d779 View commit details

Commits on Jun 14, 2021

  1. Add test scripts.

    arijitAD committed Jun 14, 2021
    Copy the full SHA
    e7744cc View commit details
  2. Fix typo.

    arijitAD committed Jun 14, 2021
    Copy the full SHA
    b1a6fb0 View commit details

Commits on Jun 18, 2021

  1. Address comments.

    arijitAD committed Jun 18, 2021
    Copy the full SHA
    c4f7fa2 View commit details
  2. Merge pull request #53 from vulcanize/integration_tests

    integration test
    arijitAD authored Jun 18, 2021
    Copy the full SHA
    f7fe3c2 View commit details
  3. Copy the full SHA
    969da82 View commit details
  4. Address comments.

    arijitAD committed Jun 18, 2021
    Copy the full SHA
    9aaea6e View commit details

Commits on Jun 28, 2021

  1. Add Integration Test

    Add Integration Test
    arijitAD authored Jun 28, 2021
    Copy the full SHA
    42f0667 View commit details
  2. Copy the full SHA
    18266c4 View commit details
  3. Copy the full SHA
    b90fcb5 View commit details
  4. Copy the full SHA
    a284a56 View commit details
  5. Compute leaf key from slot.

    ashwinphatak authored and arijitAD committed Jun 28, 2021
    Copy the full SHA
    b2828a8 View commit details
  6. Copy the full SHA
    a3ca08b View commit details

Commits on Jun 29, 2021

  1. Copy the full SHA
    0a14bd9 View commit details
Showing with 36,635 additions and 3,691 deletions.
  1. +29 −0 .github/workflows/issues-notion-sync.yml
  2. +0 −25 .github/workflows/on-master.yaml
  3. +6 −31 .github/workflows/on-pr.yaml
  4. +25 −1 .github/workflows/publish.yaml
  5. +29 −0 .github/workflows/run_unit_test.sh
  6. +189 −0 .github/workflows/tests.yaml
  7. +12 −4 Dockerfile
  8. +9 −36 Makefile
  9. +30 −4 README.md
  10. +16 −0 chain.json
  11. +37 −0 cmd/common.go
  12. +0 −125 cmd/proxy.go
  13. +31 −17 cmd/root.go
  14. +288 −37 cmd/serve.go
  15. +4 −5 cmd/subscribe.go
  16. +87 −0 cmd/validate.go
  17. +1 −1 cmd/version.go
  18. +0 −8 db/migrations/00001_create_ipfs_blocks_table.sql
  19. +0 −13 db/migrations/00002_create_nodes_table.sql
  20. +0 −5 db/migrations/00003_create_eth_schema.sql
  21. +0 −23 db/migrations/00004_create_eth_header_cids_table.sql
  22. +0 −14 db/migrations/00005_create_eth_uncle_cids_table.sql
  23. +0 −16 db/migrations/00006_create_eth_transaction_cids_table.sql
  24. +0 −20 db/migrations/00007_create_eth_receipt_cids_table.sql
  25. +0 −15 db/migrations/00008_create_eth_state_cids_table.sql
  26. +0 −15 db/migrations/00009_create_eth_storage_cids_table.sql
  27. +0 −13 db/migrations/00010_create_eth_state_accouts_table.sql
  28. +0 −6 db/migrations/00011_create_postgraphile_comments.sql
  29. +0 −69 db/migrations/00012_potgraphile_triggers.sql
  30. +0 −121 db/migrations/00013_create_cid_indexes.sql
  31. +0 −158 db/migrations/00014_create_stored_functions.sql
  32. +0 −1,201 db/schema.sql
  33. +12 −0 docker-compose.test.yml
  34. +21 −35 docker-compose.yml
  35. +11 −11 documentation/apis.md
  36. +0 −16 entrypoint.sh
  37. +4 −1 environments/example.toml
  38. +280 −19 go.mod
  39. +1,344 −256 go.sum
  40. +1 −1 main.go
  41. BIN pkg/.DS_Store
  42. +2 −3 pkg/client/client.go
  43. +303 −129 pkg/eth/api.go
  44. +239 −104 pkg/eth/api_test.go
  45. +270 −76 pkg/eth/backend.go
  46. +36 −59 pkg/eth/backend_utils.go
  47. +360 −207 pkg/eth/cid_retriever.go
  48. +114 −53 pkg/eth/cid_retriever_test.go
  49. +155 −89 pkg/eth/eth_state_test.go
  50. +91 −51 pkg/eth/filterer.go
  51. +51 −52 pkg/eth/filterer_test.go
  52. +0 −46 pkg/eth/helpers.go
  53. +29 −32 pkg/eth/ipld_fetcher.go
  54. +24 −14 pkg/eth/ipld_fetcher_test.go
  55. +147 −88 pkg/eth/ipld_retriever.go
  56. +5 −30 pkg/eth/test_helpers.go
  57. +1 −0 pkg/eth/test_helpers/chain_maker.go
  58. +338 −157 pkg/eth/test_helpers/test_data.go
  59. +166 −46 pkg/eth/types.go
  60. +267 −0 pkg/graphql/client.go
  61. +438 −13 pkg/graphql/graphql.go
  62. +306 −3 pkg/graphql/graphql_test.go
  63. +103 −23 pkg/graphql/schema.go
  64. +2 −2 pkg/graphql/service.go
  65. +122 −0 pkg/graphql/types.go
  66. +1 −1 pkg/net/api_test.go
  67. +3 −3 pkg/rpc/http.go
  68. +1 −1 pkg/rpc/ipc.go
  69. +2 −2 pkg/rpc/ws.go
  70. +15 −9 pkg/serve/api.go
  71. +193 −42 pkg/serve/config.go
  72. +50 −0 pkg/serve/env.go
  73. +30 −20 pkg/serve/service.go
  74. +7 −0 pkg/shared/constants.go
  75. +41 −0 pkg/shared/database.go
  76. +3 −3 pkg/shared/functions.go
  77. +76 −2 pkg/shared/test_helpers.go
  78. +38 −0 pkg/shared/types.go
  79. +17 −0 scripts/run_integration_test.sh
  80. +17 −0 scripts/run_integration_test_forward_eth_calls.sh
  81. +8 −0 scripts/run_unit_test.sh
  82. +87 −0 test/README.md
  83. +3 −0 test/contract/.dockerignore
  84. +5 −0 test/contract/.gitignore
  85. +14 −0 test/contract/Dockerfile
  86. +10 −0 test/contract/contracts/GLDToken.sol
  87. +25 −0 test/contract/contracts/SLVToken.sol
  88. +43 −0 test/contract/hardhat.config.js
  89. +27,651 −0 test/contract/package-lock.json
  90. +28 −0 test/contract/package.json
  91. +18 −0 test/contract/scripts/deploy.js
  92. +36 −0 test/contract/scripts/sample-script.js
  93. +186 −0 test/contract/src/index.js
  94. +54 −0 test/contract/src/utils.js
  95. +14 −0 test/contract/test/sample-test.js
  96. +437 −0 test/direct_proxy_integration_test.go
  97. +187 −0 test/helper.go
  98. +19 −0 test/integration_suite_test.go
  99. +602 −0 test/integration_test.go
  100. +671 −0 test/watch_address_integration_test.go
  101. +4 −5 test_config/test_config.go
  102. +4 −4 version/version.go
29 changes: 29 additions & 0 deletions .github/workflows/issues-notion-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Notion Sync

on:
workflow_dispatch:
issues:
types:
[
opened,
edited,
labeled,
unlabeled,
assigned,
unassigned,
milestoned,
demilestoned,
reopened,
closed,
]

jobs:
notion_job:
runs-on: ubuntu-latest
name: Add GitHub Issues to Notion
steps:
- name: Add GitHub Issues to Notion
uses: vulcanize/notion-github-action@v1.2.4-issueid
with:
notion-token: ${{ secrets.NOTION_TOKEN }}
notion-db: ${{ secrets.NOTION_DATABASE }}
25 changes: 0 additions & 25 deletions .github/workflows/on-master.yaml

This file was deleted.

37 changes: 6 additions & 31 deletions .github/workflows/on-pr.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,10 @@
name: Docker Build

on: [pull_request]

jobs:
build:
name: Run docker build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run docker build
run: make docker-build
test:
name: Run integration tests
env:
GOPATH: /tmp/go
strategy:
matrix:
go-version: [1.14.x, 1.15.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Create GOPATH
run: mkdir -p /tmp/go
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v2
- name: Run database
run: docker-compose up -d db
- name: Test
run: |
sleep 10
PGPASSWORD=password DATABASE_USER=vdbm DATABASE_PORT=8077 DATABASE_PASSWORD=password DATABASE_HOSTNAME=127.0.0.1 make test
run-tests:
uses: ./.github/workflows/tests.yaml
secrets:
BUILD_HOSTNAME: ${{ secrets.BUILD_HOSTNAME }}
BUILD_USERNAME: ${{ secrets.BUILD_USERNAME }}
BUILD_KEY: ${{ secrets.BUILD_KEY }}
26 changes: 25 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -3,9 +3,34 @@ on:
release:
types: [published]
jobs:
run-tests:
uses: ./.github/workflows/tests.yaml
secrets:
BUILD_HOSTNAME: ${{ secrets.BUILD_HOSTNAME }}
BUILD_USERNAME: ${{ secrets.BUILD_USERNAME }}
BUILD_KEY: ${{ secrets.BUILD_KEY }}
build:
name: Run docker build
runs-on: ubuntu-latest
needs: run-tests
steps:
- uses: actions/checkout@v2
- name: Get the version
id: vars
run: echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7})
- name: Run docker build
run: make docker-build
- name: Tag docker image
run: docker tag vulcanize/ipld-eth-server docker.pkg.github.com/vulcanize/ipld-eth-server/ipld-eth-server:${{steps.vars.outputs.sha}}
- name: Docker Login
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u vulcanize --password-stdin
- name: Docker Push
run: docker push docker.pkg.github.com/vulcanize/ipld-eth-server/ipld-eth-server:${{steps.vars.outputs.sha}}

push_to_registries:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
needs: build
steps:
- name: Get the version
id: vars
@@ -22,4 +47,3 @@ jobs:
run: docker tag docker.pkg.github.com/vulcanize/ipld-eth-server/ipld-eth-server:${{steps.vars.outputs.sha}} vulcanize/ipld-eth-server:${{steps.vars.outputs.tag}}
- name: Docker Push to Docker Hub
run: docker push vulcanize/ipld-eth-server:${{steps.vars.outputs.tag}}

29 changes: 29 additions & 0 deletions .github/workflows/run_unit_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

set -e

# Set up repo
start_dir=$(pwd)
temp_dir=$(mktemp -d)
cd $temp_dir
git clone -b $(cat /tmp/git_head_ref) "https://github.com/$(cat /tmp/git_repository).git"
cd ipld-eth-server

## Remove the branch and github related info. This way future runs wont be confused.
rm -f /tmp/git_head_ref /tmp/git_repository

# Spin up DB
docker-compose -f docker-compose.yml up -d ipld-eth-db
trap "docker-compose down --remove-orphans; cd $start_dir ; rm -r $temp_dir" SIGINT SIGTERM ERR
sleep 10

# Remove old logs so there's no confusion, then run test
rm -f /tmp/test.log /tmp/return_test.txt
PGPASSWORD=password DATABASE_USER=vdbm DATABASE_PORT=8077 DATABASE_PASSWORD=password DATABASE_HOSTNAME=127.0.0.1 DATABASE_NAME=vulcanize_testing make test > /tmp/test.log
echo $? > /tmp/return_test.txt

# Clean up
docker-compose -f docker-compose.yml down -v --remove-orphans
cd $start_dir
rm -fr $temp_dir

189 changes: 189 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
name: Test the stack.
on:
workflow_call:
secrets:
BUILD_HOSTNAME:
required: true
BUILD_USERNAME:
required: true
BUILD_KEY:
required: true

jobs:
build:
name: Run docker build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run docker build
run: make docker-build
test:
name: Run unit tests
env:
GOPATH: /tmp/go
# To run the unit tests you need to add secrets to your repository.
BUILD_HOSTNAME: ${{ secrets.BUILD_HOSTNAME }}
BUILD_USERNAME: ${{ secrets.BUILD_USERNAME }}
BUILD_KEY: ${{ secrets.BUILD_KEY }}
#strategy:
# matrix:
# go-version: [1.16.x, 1.17.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

# Passed experience with GHA has taught me to store variables in files instead of passing them as variables.
- name: Output variables to files
run: |
echo $GITHUB_REPOSITORY > /tmp/git_repository
[ -z "$GITHUB_HEAD_REF" ] && echo $GITHUB_REF_NAME > /tmp/git_head_ref || echo $GITHUB_HEAD_REF > /tmp/git_head_ref
echo "-----BEGIN OPENSSH PRIVATE KEY-----" >> /tmp/key
echo ${{ env.BUILD_KEY }} >> /tmp/key
echo "-----END OPENSSH PRIVATE KEY-----" >> /tmp/key
chmod 400 /tmp/key
cat /tmp/git_repository
cat /tmp/git_head_ref
echo
- name: Raw SCP
run: |
scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key /tmp/git_repository ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/git_repository
scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key /tmp/git_head_ref ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/git_head_ref
scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key .github/workflows/run_unit_test.sh ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/run_unit_test.sh
- name: Trigger Unit Test
run: |
ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} go install github.com/onsi/ginkgo/ginkgo@latest
ssh -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }} /tmp/run_unit_test.sh
- name: Get the logs and cat them
run: |
scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/test.log .
cat ./test.log
- name: Check Error Code
run: |
scp -o 'StrictHostKeyChecking no' -o UserKnownHostsFile=/dev/null -q -i /tmp/key ${{ env.BUILD_USERNAME }}@${{ env.BUILD_HOSTNAME }}:/tmp/return_test.txt .
[ $(cat ./return_test.txt) -eq 0 ]
integrationtest:
name: Run integration tests
env:
STACK_ORCHESTRATOR_REF: fcbc74451c5494664fe21f765e89c9c6565c07cb
GO_ETHEREUM_REF: 498101102c891c4f8c3cab5649158c642ee1fd6b
GOPATH: /tmp/go
DB_WRITE: true
ETH_FORWARD_ETH_CALLS: false
ETH_PROXY_ON_ERROR: false
ETH_HTTP_PATH: "go-ethereum:8545"
runs-on: ubuntu-latest
steps:
- name: Create GOPATH
run: mkdir -p /tmp/go
- uses: actions/setup-go@v3
with:
go-version: ">=1.18.0"
check-latest: true
- uses: actions/checkout@v2
with:
path: "./ipld-eth-server"
- uses: actions/checkout@v2
with:
ref: ${{ env.STACK_ORCHESTRATOR_REF }}
path: "./stack-orchestrator/"
repository: vulcanize/stack-orchestrator
- uses: actions/checkout@v2
with:
ref: ${{ env.GO_ETHEREUM_REF }}
repository: vulcanize/go-ethereum
path: "./go-ethereum/"
- name: Create config file
run: |
echo vulcanize_go_ethereum=$GITHUB_WORKSPACE/go-ethereum/ > ./config.sh
echo vulcanize_ipld_eth_server=$GITHUB_WORKSPACE/ipld-eth-server/ >> ./config.sh
echo db_write=$DB_WRITE >> ./config.sh
echo eth_forward_eth_calls=$ETH_FORWARD_ETH_CALLS >> ./config.sh
echo eth_proxy_on_error=$ETH_PROXY_ON_ERROR >> ./config.sh
echo eth_http_path=$ETH_HTTP_PATH >> ./config.sh
cat ./config.sh
- name: Build geth
run: |
cd $GITHUB_WORKSPACE/stack-orchestrator/helper-scripts
./compile-geth.sh \
-p "$GITHUB_WORKSPACE/config.sh" \
-e docker
- name: Run docker compose
run: |
docker-compose \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/latest/docker-compose-db.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \
--env-file "$GITHUB_WORKSPACE/config.sh" \
up -d --build
- name: Test
run: |
cd $GITHUB_WORKSPACE/ipld-eth-server
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8081)" != "200" ]; do echo "waiting for ipld-eth-server..." && sleep 5; done && \
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8545)" != "200" ]; do echo "waiting for geth-statediff..." && sleep 5; done && \
make integrationtest
integrationtest_forwardethcalls:
name: Run integration tests for direct proxy fall-through of eth_calls
env:
STACK_ORCHESTRATOR_REF: fcbc74451c5494664fe21f765e89c9c6565c07cb
GO_ETHEREUM_REF: 498101102c891c4f8c3cab5649158c642ee1fd6b
GOPATH: /tmp/go
DB_WRITE: false
ETH_FORWARD_ETH_CALLS: true
ETH_PROXY_ON_ERROR: false
ETH_HTTP_PATH: "go-ethereum:8545"
runs-on: ubuntu-latest
steps:
- name: Create GOPATH
run: mkdir -p /tmp/go
- uses: actions/setup-go@v3
with:
go-version: ">=1.18.0"
check-latest: true
- uses: actions/checkout@v2
with:
path: "./ipld-eth-server"
- uses: actions/checkout@v2
with:
ref: ${{ env.STACK_ORCHESTRATOR_REF }}
path: "./stack-orchestrator/"
repository: vulcanize/stack-orchestrator
- uses: actions/checkout@v2
with:
ref: ${{ env.GO_ETHEREUM_REF }}
repository: vulcanize/go-ethereum
path: "./go-ethereum/"
- name: Create config file
run: |
echo vulcanize_go_ethereum=$GITHUB_WORKSPACE/go-ethereum/ > ./config.sh
echo vulcanize_ipld_eth_server=$GITHUB_WORKSPACE/ipld-eth-server/ >> ./config.sh
echo db_write=$DB_WRITE >> ./config.sh
echo eth_forward_eth_calls=$ETH_FORWARD_ETH_CALLS >> ./config.sh
echo eth_proxy_on_error=$ETH_PROXY_ON_ERROR >> ./config.sh
echo eth_http_path=$ETH_HTTP_PATH >> ./config.sh
cat ./config.sh
- name: Build geth
run: |
cd $GITHUB_WORKSPACE/stack-orchestrator/helper-scripts
./compile-geth.sh \
-p "$GITHUB_WORKSPACE/config.sh" \
-e docker
- name: Run docker compose
run: |
docker-compose \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/latest/docker-compose-db.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-go-ethereum.yml" \
-f "$GITHUB_WORKSPACE/stack-orchestrator/docker/local/docker-compose-ipld-eth-server.yml" \
--env-file "$GITHUB_WORKSPACE/config.sh" \
up -d --build
- name: Test
run: |
cd $GITHUB_WORKSPACE/ipld-eth-server
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8081)" != "200" ]; do echo "waiting for ipld-eth-server..." && sleep 5; done && \
while [ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8545)" != "200" ]; do echo "waiting for geth-statediff..." && sleep 5; done && \
make integrationtest
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
FROM golang:1.13-alpine as builder
FROM golang:1.18-alpine as builder

RUN apk --update --no-cache add make git g++ linux-headers
# DEBUG
RUN apk add busybox-extras

# Build ipld-eth-server
WORKDIR /go/src/github.com/vulcanize/ipld-eth-server
ADD . .
RUN GO111MODULE=on GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o ipld-eth-server .

# Cache the modules
ENV GO111MODULE=on
COPY go.mod .
COPY go.sum .
RUN go mod download

COPY . .

# Build the binary
RUN GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o ipld-eth-server .

# Copy migration tool
WORKDIR /
@@ -35,7 +44,6 @@ COPY --chown=5000:5000 --from=builder /go/src/github.com/vulcanize/ipld-eth-serv
# keep binaries immutable
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-server/ipld-eth-server ipld-eth-server
COPY --from=builder /goose goose
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-server/db/migrations migrations/vulcanizedb
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-server/environments environments

ENTRYPOINT ["/app/entrypoint.sh"]
Loading