From 4d0e9386dd777f72e96a1ea6f5075e0492441c0e Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Wed, 9 Jul 2025 11:42:00 +0100 Subject: [PATCH 1/2] Add bootnode component --- playground/catalog.go | 1 + playground/components.go | 33 +++++++++++++++++++++++++++++++++ playground/recipe_opstack.go | 9 +++++---- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/playground/catalog.go b/playground/catalog.go index 383d94b..39c34a1 100644 --- a/playground/catalog.go +++ b/playground/catalog.go @@ -23,6 +23,7 @@ func init() { register(&nullService{}) register(&OpRbuilder{}) register(&FlashblocksRPC{}) + register(&Bootnode{}) } func FindComponent(name string) ServiceGen { diff --git a/playground/components.go b/playground/components.go index b459bd9..720be21 100644 --- a/playground/components.go +++ b/playground/components.go @@ -665,3 +665,36 @@ func (n *nullService) Run(service *Service, ctx *ExContext) { func (n *nullService) Name() string { return "null" } + +type BootnodeProtocol string + +const ( + BootnodeProtocolV5 BootnodeProtocol = "v5" +) + +type Bootnode struct { + Protocol BootnodeProtocol + Enode *EnodeAddr +} + +func (b *Bootnode) Run(service *Service, ctx *ExContext) { + b.Enode = ctx.Output.GetEnodeAddr() + + service.WithImage("ghcr.io/paradigmxyz/reth"). + WithTag("v1.5.1"). + WithEntrypoint("/usr/local/bin/reth"). + WithArgs( + "p2p", "bootnode", + "--addr", `0.0.0.0:{{Port "rpc" 30303}}`, + "--node-key", "/data/p2p_key.txt", + ). + WithArtifact("/data/p2p_key.txt", b.Enode.Artifact) + + if b.Protocol == BootnodeProtocolV5 { + service.WithArgs("--v5") + } +} + +func (b *Bootnode) Name() string { + return "bootnode" +} diff --git a/playground/recipe_opstack.go b/playground/recipe_opstack.go index 4a995b2..bdb4977 100644 --- a/playground/recipe_opstack.go +++ b/playground/recipe_opstack.go @@ -70,12 +70,12 @@ func (o *OpRecipe) Apply(ctx *ExContext, artifacts *Artifacts) *Manifest { flashblocksBuilderURLRef := o.flashblocksBuilderURL externalBuilderRef := o.externalBuilder - opGeth := &OpGeth{} - svcManager.AddService("op-geth", opGeth) + bootnode := &Bootnode{} + svcManager.AddService("bootnode", bootnode) ctx.Bootnode = &BootnodeRef{ - Service: "op-geth", - ID: opGeth.Enode.NodeID(), + Service: "bootnode", + ID: bootnode.Enode.NodeID(), } if o.externalBuilder == "op-reth" { @@ -113,6 +113,7 @@ func (o *OpRecipe) Apply(ctx *ExContext, artifacts *Artifacts) *Manifest { }) } + svcManager.AddService("op-geth", &OpGeth{}) svcManager.AddService("op-node", &OpNode{ L1Node: "el", L1Beacon: "beacon", From 5d41804d16c3403f90e443485003f2defcc2c213 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Wed, 9 Jul 2025 12:16:16 +0100 Subject: [PATCH 2/2] Trying make it work --- playground/components.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playground/components.go b/playground/components.go index 720be21..55427b8 100644 --- a/playground/components.go +++ b/playground/components.go @@ -77,7 +77,7 @@ func (o *OpRbuilder) Run(service *Service, ctx *ExContext) { WithVolume("data", "/data_op_reth") if ctx.Bootnode != nil { - service.WithArgs("--trusted-peers", ctx.Bootnode.Connect()) + service.WithArgs("--bootnodes", ctx.Bootnode.Connect()) } if o.Flashblocks { @@ -123,7 +123,7 @@ func (f *FlashblocksRPC) Run(service *Service, ctx *ExContext) { if ctx.Bootnode != nil { service.WithArgs( - "--trusted-peers", ctx.Bootnode.Connect(), + "--bootnodes", ctx.Bootnode.Connect(), ) } }