Skip to content

Commit 48d4aa8

Browse files
committed
feat(migration): implement TCP to NATS datastream migration tool with metadata management
1 parent 525487c commit 48d4aa8

11 files changed

Lines changed: 2820 additions & 5 deletions

File tree

.github/scripts/test-tcp-to-nats-migration.sh

Lines changed: 646 additions & 0 deletions
Large diffs are not rendered by default.

eth/backend.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,12 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger
10091009
if err := backend.natsManager.Start(); err != nil {
10101010
log.Error(err.Error())
10111011
}
1012+
} else if config.Zk.L2NatsUrl != "" {
1013+
log.Info("Configuring NATS client-only mode", "remoteURL", config.Zk.L2NatsUrl)
1014+
backend.natsManager = natsstream.NewManager(natsstream.Config{}, logger)
1015+
if err := backend.natsManager.ConnectRemote(config.Zk.L2NatsUrl); err != nil {
1016+
log.Error("Failed to configure NATS client mode", "error", err)
1017+
}
10121018
}
10131019

10141020
// zkevm: create a data stream server if we have the appropriate config for one. This will be started on the call to Init

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ require (
4343
github.com/erigontech/erigon-lib v1.0.0
4444
github.com/erigontech/erigonwatch v0.1.16
4545
github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c
46-
github.com/gateway-fm/zkevm-data-streamer v0.2.11
46+
github.com/gateway-fm/zkevm-data-streamer v0.2.12
4747
github.com/gballet/go-verkle v0.0.0-20221121182333-31427a1f2d35
4848
github.com/gfx-labs/sse v0.0.0-20231226060816-f747e26a9baa
4949
github.com/go-chi/chi/v5 v5.0.12

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ github.com/gateway-fm/poseidongold v1.0.0 h1:XzREf6J1lLuUXJ0is8j+90tZvNhhPCe/sLV
319319
github.com/gateway-fm/poseidongold v1.0.0/go.mod h1:seCePAMBsE9apTjGlVne/UzsPJb7qd7JOjdPoO8krl0=
320320
github.com/gateway-fm/vectorized-poseidon-gold v0.0.0-20251001120011-50af27b06dbb h1:cgMpmodToBj3X/WEgVq7cBrpwwUBA9T5cfSZsREjSvM=
321321
github.com/gateway-fm/vectorized-poseidon-gold v0.0.0-20251001120011-50af27b06dbb/go.mod h1:sT4lwC93Iooo716dMMcYulTgyFX1UXcVUL6YVFsqUCw=
322-
github.com/gateway-fm/zkevm-data-streamer v0.2.11 h1:JHtjggg7Yw98/ieb7kKKTjMGaRoaHTHKbzIBwElELtA=
323-
github.com/gateway-fm/zkevm-data-streamer v0.2.11/go.mod h1:gBFqz1o6TESMDtVqLL4tF/k+tcm/IsX37gDeCOQ/YPs=
322+
github.com/gateway-fm/zkevm-data-streamer v0.2.12 h1:qiFRoLONGnYj8/cFAbulcY/ewufG2i9FQ3eO4sKU0k4=
323+
github.com/gateway-fm/zkevm-data-streamer v0.2.12/go.mod h1:gBFqz1o6TESMDtVqLL4tF/k+tcm/IsX37gDeCOQ/YPs=
324324
github.com/gballet/go-verkle v0.0.0-20221121182333-31427a1f2d35 h1:I8QswD9gf3VEpr7bpepKKOm7ChxFITIG+oc1I5/S0no=
325325
github.com/gballet/go-verkle v0.0.0-20221121182333-31427a1f2d35/go.mod h1:DMDd04jjQgdynaAwbEgiRERIGpC8fDjx0+y06an7Psg=
326326
github.com/gfx-labs/sse v0.0.0-20231226060816-f747e26a9baa h1:b6fBm4SLM8jywQHNmc3ZCl6zQEhEyZl6bp7is4en72M=

0 commit comments

Comments
 (0)