Skip to content

Commit

Permalink
Merge pull request #11 from base-org/jack/log-fetcher
Browse files Browse the repository at this point in the history
feat(PROTO-329): Implement Log Fetcher
  • Loading branch information
jackchuma authored Nov 21, 2024
2 parents c6d7b09 + f19cea0 commit 2eb9e78
Show file tree
Hide file tree
Showing 27 changed files with 2,394 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.idea/
1 change: 1 addition & 0 deletions contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ libs = ["lib"]
solc_version = "0.8.24"
fs_permissions = [{ access = "read-write", path = "./"}]
evm_version = "shanghai"
extra_output_files = ['abi']
1 change: 1 addition & 0 deletions services/go-filler/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
15 changes: 15 additions & 0 deletions services/go-filler/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-include .env
export

.PHONY: bindings

test-log-fetcher:
go test ./log-fetcher/internal/...

run-log-fetcher:
go run ./log-fetcher/cmd

bindings:
go install github.com/ethereum/go-ethereum/cmd/[email protected]
cd ../../contracts && forge build
abigen --abi ../../contracts/out/RIP7755Outbox.sol/RIP7755Outbox.abi.json --pkg bindings --type RIP7755Outbox --out bindings/rip_7755_outbox.go
46 changes: 45 additions & 1 deletion services/go-filler/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,45 @@
# An Example Filler App implemented in Go
# An Example Fulfiller App implemented in Go

## Getting Started

Navigate to the `go-filler` directory:

```bash
cd services/go-filler
```

Install dependencies:

```bash
go mod tidy
```

Spin up the docker containers:

```bash
docker-compose up -d
```

Create a `.env` file (the rpc urls must be websocket):

```txt
ARBITRUM_SEPOLIA_RPC=
BASE_SEPOLIA_RPC=
OPTIMISM_SEPOLIA_RPC=
SEPOLIA_RPC=
MONGO_URI=
```

### Log Fetcher

Run the log fetcher:

```bash
make run-log-fetcher
```

Run log fetcher unit tests:

```bash
make test-log-fetcher
```
688 changes: 688 additions & 0 deletions services/go-filler/bindings/rip_7755_outbox.go

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions services/go-filler/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "3.8"
services:
database:
image: mongo
container_name: mongodb
restart: always
ports:
- 27017:27017
environment:
- MONGODB_DATABASE="calls"
63 changes: 63 additions & 0 deletions services/go-filler/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
module github.com/base-org/RIP-7755-poc/services/go-filler

go 1.23.2

require (
github.com/ethereum/go-ethereum v1.14.11
github.com/stretchr/testify v1.9.0
github.com/urfave/cli/v2 v2.27.5
go.mongodb.org/mongo-driver v1.17.1
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.5 // indirect
github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/go-bexpr v0.1.11 // indirect
github.com/holiman/uint256 v1.3.1 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/montanaflynn/stats v0.7.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.13.0 // indirect
github.com/rivo/uniseg v0.3.4 // indirect
github.com/rs/cors v1.8.2 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/supranational/blst v0.3.13 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
Loading

0 comments on commit 2eb9e78

Please sign in to comment.