Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Indexer] Integrate #51

Merged
merged 66 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
a817f0b
Implement the eth_call JSON-RPC endpoint
m-Peter Jan 23, 2024
570218c
Introduce a FlowAccessAPI interface for injecting a Flow gRPC client …
m-Peter Jan 29, 2024
655c8f5
Use access.Client interface from flow-go-sdk and generate a mock for it
m-Peter Jan 29, 2024
86a9487
Extract the bridged account call Cadence script to its own file and e…
m-Peter Jan 31, 2024
1b20bb5
Proper mock generation for FlowAccessClient proxy to access.Client
m-Peter Jan 31, 2024
cb7c919
Merge pull request #24 from m-Peter/eth-call-endpoint
m-Peter Jan 31, 2024
6f97c77
Implement the eth_sendRawTransaction JSON-RPC endpoint
m-Peter Jan 23, 2024
4ad8061
Add TODOs for the eth_sendRawTransaction endpoint
m-Peter Jan 31, 2024
0ef8dd5
Merge pull request #26 from m-Peter/eth-send-raw-transaction-endpoint
m-Peter Jan 31, 2024
746afca
Implement the eth_getTransactionByHash JSON-RPC endpoint
m-Peter Feb 1, 2024
4d4d3d3
Merge pull request #35 from m-Peter/eth-get-transaction-by-hash-endpoint
m-Peter Feb 1, 2024
a3510c3
Make value returned by eth_gasPrice configurable
m-Peter Feb 6, 2024
7a979d0
Move DefaultGasPrice variable to config file
m-Peter Feb 6, 2024
c8c43be
Merge pull request #39 from m-Peter/configurable-gas-price
m-Peter Feb 6, 2024
bf48fb2
Implement the eth_getBalance JSON-RPC endpoint
m-Peter Feb 6, 2024
036e395
Extract some common functions to a utils file
m-Peter Feb 7, 2024
99170a1
Implement more block & transaction related JSON-RPC endpoints
m-Peter Feb 7, 2024
bbac807
Create deploy.yml
franklywatson Feb 7, 2024
a0bc86b
Return propert blockHash and from in transaction endpoints
m-Peter Feb 8, 2024
0b6d8ab
Merge pull request #43 from m-Peter/block-and-tx-related-endpoints
m-Peter Feb 8, 2024
4ac588d
Implement the eth_getBlockReceipts JSON-RPC endpoint
m-Peter Feb 8, 2024
56879c9
Docker file
nialexsan Feb 9, 2024
d01b36b
test deployment
nialexsan Feb 9, 2024
49bea52
Setup improvements for running the Flow EVM Gateway
m-Peter Feb 9, 2024
b4cff0a
Merge pull request #46 from m-Peter/setup-improvements
nialexsan Feb 9, 2024
d47f861
tweak dockerfile
nialexsan Feb 9, 2024
38dc2a9
clone via https
nialexsan Feb 9, 2024
472e3fc
Merge remote-tracking branch 'origin/main' into nialexsan/docker
nialexsan Feb 9, 2024
929027f
fix port
nialexsan Feb 9, 2024
5d22705
fixed paths
nialexsan Feb 9, 2024
8fa33ed
run script
nialexsan Feb 10, 2024
429c349
listen on port
nialexsan Feb 10, 2024
63d70ae
address PR comments
nialexsan Feb 12, 2024
ff69c7e
Merge pull request #45 from onflow/nialexsan/docker
nialexsan Feb 12, 2024
6382a16
Merge pull request #44 from m-Peter/eth-get-block-receipts-endpoint
m-Peter Feb 13, 2024
db202a5
Update to latest additions in flow-go and cadence
m-Peter Feb 13, 2024
31a2a66
Merge pull request #48 from m-Peter/update-to-latest-additions
m-Peter Feb 13, 2024
d398e27
add bootstrap
Feb 13, 2024
d23ef93
add basic config
Feb 13, 2024
02ff517
improve logging and some errors
Feb 13, 2024
fbabd1e
add parsing config
Feb 13, 2024
64bb455
add todo
Feb 13, 2024
0d14cb5
clean up main
Feb 13, 2024
675d743
refactor out config
Feb 13, 2024
a54f4ba
start server refactor
Feb 13, 2024
9bd53b2
Update deploy.yml with required Flow envs
franklywatson Feb 13, 2024
5a19a0e
merge
Feb 14, 2024
91d0d5b
resolve additional changes from merge
Feb 14, 2024
400374e
mod tidy
Feb 14, 2024
8c552d3
update mocks
Feb 14, 2024
d16516b
skip generating block option
Feb 14, 2024
b53a38a
compiles with merged main
Feb 14, 2024
fe938cc
move bootstrap
Feb 14, 2024
6e6d98a
add storage types
Feb 14, 2024
8b2b3f4
fix comment warnings
Feb 14, 2024
930e966
remove unneeded
Feb 14, 2024
c5e3156
fix receiver name warning
Feb 14, 2024
f966fe1
use proper errors and remove fake data
Feb 14, 2024
416ed1a
fix errors in the API
Feb 14, 2024
a1d6dfc
temp comment api tests
Feb 14, 2024
500da4d
remove old store
Feb 14, 2024
354a90b
remove old storage implementation
Feb 14, 2024
c35dcc7
add gitignore for integration
Feb 14, 2024
79d573f
fix starting up
Feb 14, 2024
72a4f54
fix default network
Feb 14, 2024
ab39199
better naming for ingestion
Feb 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: "Deploy EVM Gateway to Cloud Run"

on:
push:
branches:
- main

env:
DOCKER_IMAGE_URL: ${{ vars.GCP_DOCKER_IMAGE_URL }}:${{ github.sha }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Google auth
id: auth
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
workload_identity_provider: ${{ vars.BUILDER_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.BUILDER_SERVICE_ACCOUNT }}

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ vars.GAR_PROJECT_ID }}

- name: Docker Auth
run: |-
gcloud auth configure-docker ${{ vars.GAR_LOCATION }}-docker.pkg.dev
docker build -t ${{ env.DOCKER_IMAGE_URL }} --file Dockerfile .
docker push ${{ env.DOCKER_IMAGE_URL }}

deploy-canary:
needs: [build]
environment: canary
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Google auth
id: auth
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
workload_identity_provider: ${{ vars.DEPLOYER_GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.DEPLOYER_SERVICE_ACCOUNT }}
- name: Deploy EVM Gateway to Cloud Run
uses: google-github-actions/deploy-cloudrun@v1
with:
service: ${{ vars.GCP_SERVICE }}
image: ${{ env.DOCKER_IMAGE_URL }}

deploy-crescendo:
needs: [build]
environment: crescendo
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Google auth
id: auth
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
workload_identity_provider: ${{ vars.DEPLOYER_GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.DEPLOYER_SERVICE_ACCOUNT }}
- name: Deploy EVM Gateway to Cloud Run
uses: google-github-actions/deploy-cloudrun@v1
with:
service: ${{ vars.GCP_SERVICE }}
image: ${{ env.DOCKER_IMAGE_URL }}

deploy-testnet:
needs: [build]
environment: testnet
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Google auth
id: auth
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
workload_identity_provider: ${{ vars.DEPLOYER_GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.DEPLOYER_SERVICE_ACCOUNT }}
- name: Deploy EVM Gateway to Cloud Run
uses: google-github-actions/deploy-cloudrun@v1
with:
service: ${{ vars.GCP_SERVICE }}
image: ${{ env.DOCKER_IMAGE_URL }}

deploy-mainnet:
needs: [build]
environment: mainnet
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Google auth
id: auth
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
workload_identity_provider: ${{ vars.DEPLOYER_GCP_WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ vars.DEPLOYER_SERVICE_ACCOUNT }}
- name: Deploy EVM Gateway to Cloud Run
uses: google-github-actions/deploy-cloudrun@v1
with:
service: ${{ vars.GCP_SERVICE }}
image: ${{ env.DOCKER_IMAGE_URL }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
integration/db-test
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

# BUILD BIN

FROM golang:1.22.0 as builder
# Install go modules
WORKDIR /flow-evm-gateway
COPY go.* ./
COPY . ./
RUN go mod download
RUN go mod verify
RUN CGO_ENABLED=0 go build -o evm-gateway ./cmd/server/main.go
RUN chmod a+x evm-gateway
RUN chmod a+x ./scripts/run.sh

RUN wget https://github.com/m-Peter/flow-cli-custom-builds/raw/main/flow-x86_64-linux-
RUN chmod a+x flow-x86_64-linux-

# RUN APP
FROM debian:latest
WORKDIR /flow-evm-gateway
COPY --from=builder /flow-evm-gateway/evm-gateway /flow-evm-gateway/evm-gateway
COPY --from=builder /flow-evm-gateway/flow-x86_64-linux- /flow-evm-gateway/flow-x86_64-linux-
COPY --from=builder /flow-evm-gateway/flow.json /flow-evm-gateway/flow.json
COPY --from=builder /flow-evm-gateway/api/cadence/transactions/create_bridged_account.cdc /flow-evm-gateway/create_bridged_account.cdc
COPY --from=builder /flow-evm-gateway/scripts/run.sh /flow-evm-gateway/run.sh
EXPOSE 8545
CMD cd /flow-evm-gateway && ./run.sh
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,22 @@ check-tidy:
.PHONY: generate
generate:
go get -d github.com/vektra/mockery/[email protected]
mockery --all --dir=storage --output=storage/mocks
mockery --dir=storage --name=BlockIndexer --output=storage/mocks
mockery --dir=storage --name=ReceiptIndexer --output=storage/mocks
mockery --dir=storage --name=TransactionIndexer --output=storage/mocks
mockery --all --dir=services/events --output=services/events/mocks

.PHONY: ci
ci: check-tidy test

.PHONY: start-emulator
start-emulator:
./flow-x86_64-linux- emulator --evm-enabled

.PHONY: setup-account
setup-account:
./flow-x86_64-linux- transactions send api/cadence/transactions/create_bridged_account.cdc 1500.0 --network=emulator --signer=emulator-account

.PHONY: start
start:
go run ./cmd/server/main.go
Loading
Loading