Skip to content

Commit 10a8bdd

Browse files
committed
Implement the RPCBlockHeaderSubscriber for indexing finalized results
1 parent 56428e2 commit 10a8bdd

File tree

8 files changed

+694
-129
lines changed

8 files changed

+694
-129
lines changed

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,3 +227,36 @@ endif
227227

228228
docker run $(MODE) -p $(HOST_PORT):8545 -p $(HOST_METRICS_PORT):8080 $(MOUNT) "$(CONTAINER_REGISTRY)/flow-evm-gateway:$(IMAGE_TAG)" $(CMD_ARGS)
229229

230+
.PHONY: start-testnet
231+
start-testnet:
232+
rm -rf testnet-db-block-headers/
233+
rm -rf metrics/data/
234+
go run cmd/main.go run \
235+
--database-dir=testnet-db-block-headers \
236+
--access-node-grpc-host=access.devnet.nodes.onflow.org:9000 \
237+
--access-node-spork-hosts=access-001.devnet51.nodes.onflow.org:9000 \
238+
--flow-network-id=flow-testnet \
239+
--init-cadence-height=211176670 \
240+
--ws-enabled=true \
241+
--coinbase=FACF71692421039876a5BB4F10EF7A439D8ef61E \
242+
--coa-address=0x62631c28c9fc5a91 \
243+
--coa-key=2892fba444f1d5787739708874e3b01160671924610411ac787ac1379d420f49 \
244+
--gas-price=100 \
245+
--log-level=info
246+
247+
.PHONY: start-mainnet
248+
start-mainnet:
249+
rm -rf mainnet-db-block-headers/
250+
rm -rf metrics/data/
251+
go run cmd/main.go run \
252+
--database-dir=mainnet-db-block-headers \
253+
--access-node-grpc-host=access.mainnet.nodes.onflow.org:9000 \
254+
--access-node-spork-hosts=access-001.mainnet25.nodes.onflow.org:9000 \
255+
--flow-network-id=flow-mainnet \
256+
--init-cadence-height=85981135 \
257+
--ws-enabled=true \
258+
--coinbase=FACF71692421039876a5BB4F10EF7A439D8ef61E \
259+
--coa-address=0xf1ab99c82dee3526 \
260+
--coa-key=2892fba444f1d5787739708874e3b01160671924610411ac787ac1379d420f49 \
261+
--gas-price=100 \
262+
--log-level=info

bootstrap/bootstrap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func (b *Bootstrap) StartEventIngestion(ctx context.Context) error {
142142
chainID := b.config.FlowNetworkID
143143

144144
// create event subscriber
145-
subscriber := ingestion.NewRPCEventSubscriber(
145+
subscriber := ingestion.NewRPCBlockHeaderSubscriber(
146146
b.logger,
147147
b.client,
148148
chainID,

go.mod

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ require (
66
github.com/cockroachdb/pebble v1.1.1
77
github.com/goccy/go-json v0.10.2
88
github.com/hashicorp/go-multierror v1.1.1
9-
github.com/onflow/atree v0.8.0
10-
github.com/onflow/cadence v1.2.2
9+
github.com/onflow/atree v0.8.1
10+
github.com/onflow/cadence v1.3.0
1111
github.com/onflow/flow-go v0.38.0-preview.0.4
12-
github.com/onflow/flow-go-sdk v1.2.3
12+
github.com/onflow/flow-go-sdk v1.3.0
1313
github.com/onflow/go-ethereum v1.14.7
1414
github.com/prometheus/client_golang v1.18.0
1515
github.com/rs/cors v1.8.0
@@ -18,20 +18,19 @@ require (
1818
github.com/sethvargo/go-limiter v1.0.0
1919
github.com/sethvargo/go-retry v0.2.3
2020
github.com/spf13/cobra v1.8.1
21-
github.com/stretchr/testify v1.9.0
21+
github.com/stretchr/testify v1.10.0
2222
go.uber.org/ratelimit v0.3.1
2323
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a
2424
golang.org/x/sync v0.8.0
25-
google.golang.org/grpc v1.63.2
25+
google.golang.org/grpc v1.64.1
2626
)
2727

2828
require (
29-
cloud.google.com/go v0.112.0 // indirect
30-
cloud.google.com/go/compute v1.24.0 // indirect
31-
cloud.google.com/go/compute/metadata v0.2.3 // indirect
29+
cloud.google.com/go v0.112.1 // indirect
30+
cloud.google.com/go/compute/metadata v0.5.0 // indirect
3231
cloud.google.com/go/iam v1.1.6 // indirect
3332
cloud.google.com/go/kms v1.15.7 // indirect
34-
cloud.google.com/go/storage v1.36.0 // indirect
33+
cloud.google.com/go/storage v1.38.0 // indirect
3534
github.com/DataDog/zstd v1.5.2 // indirect
3635
github.com/Microsoft/go-winio v0.6.2 // indirect
3736
github.com/SaveTheRbtz/mph v0.1.1-0.20240117162131-4166ec7869bc // indirect
@@ -88,7 +87,7 @@ require (
8887
github.com/google/s2a-go v0.1.7 // indirect
8988
github.com/google/uuid v1.6.0 // indirect
9089
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
91-
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
90+
github.com/googleapis/gax-go/v2 v2.12.2 // indirect
9291
github.com/gorilla/websocket v1.5.0 // indirect
9392
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
9493
github.com/hashicorp/errwrap v1.1.0 // indirect
@@ -181,10 +180,10 @@ require (
181180
github.com/vmihailenco/msgpack/v4 v4.3.11 // indirect
182181
github.com/vmihailenco/tagparser v0.1.1 // indirect
183182
github.com/x448/float16 v0.8.4 // indirect
184-
github.com/zeebo/blake3 v0.2.3 // indirect
183+
github.com/zeebo/blake3 v0.2.4 // indirect
185184
go.opencensus.io v0.24.0 // indirect
186-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect
187-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect
185+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
186+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
188187
go.opentelemetry.io/otel v1.24.0 // indirect
189188
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
190189
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 // indirect
@@ -196,19 +195,19 @@ require (
196195
go.uber.org/multierr v1.11.0 // indirect
197196
go.uber.org/zap v1.26.0 // indirect
198197
golang.org/x/crypto v0.28.0 // indirect
199-
golang.org/x/net v0.25.0 // indirect
200-
golang.org/x/oauth2 v0.17.0 // indirect
198+
golang.org/x/net v0.26.0 // indirect
199+
golang.org/x/oauth2 v0.18.0 // indirect
201200
golang.org/x/sys v0.26.0 // indirect
202201
golang.org/x/text v0.19.0 // indirect
203202
golang.org/x/time v0.5.0 // indirect
204203
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
205204
gonum.org/v1/gonum v0.14.0 // indirect
206-
google.golang.org/api v0.162.0 // indirect
205+
google.golang.org/api v0.169.0 // indirect
207206
google.golang.org/appengine v1.6.8 // indirect
208207
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
209-
google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
210-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect
211-
google.golang.org/protobuf v1.33.0 // indirect
208+
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect
209+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
210+
google.golang.org/protobuf v1.34.2 // indirect
212211
gopkg.in/ini.v1 v1.67.0 // indirect
213212
gopkg.in/yaml.v3 v3.0.1 // indirect
214213
lukechampine.com/blake3 v1.3.0 // indirect

0 commit comments

Comments
 (0)