@@ -15,6 +15,7 @@ import (
1515 "github.com/evstack/ev-node/da/jsonrpc"
1616 rollcmd "github.com/evstack/ev-node/pkg/cmd"
1717 rollconf "github.com/evstack/ev-node/pkg/config"
18+ genesispkg "github.com/evstack/ev-node/pkg/genesis"
1819 "github.com/evstack/ev-node/pkg/p2p"
1920 "github.com/evstack/ev-node/pkg/p2p/key"
2021 "github.com/evstack/ev-node/pkg/store"
@@ -138,11 +139,16 @@ func NewExtendedRunNodeCmd(ctx context.Context) *cobra.Command {
138139 return fmt .Errorf ("failed to create datastore: %w" , err )
139140 }
140141
142+ genesisPath := filepath .Join (filepath .Dir (nodeConfig .ConfigPath ()), "genesis.json" )
143+ genesis , err := genesispkg .LoadGenesis (genesisPath )
144+ if err != nil {
145+ return fmt .Errorf ("failed to load genesis: %w" , err )
146+ }
141147 // Pass raw DA implementation and namespace to NewSequencer
142148 sequencer , err := based .NewSequencer (
143149 logger ,
144150 basedDA ,
145- []byte (nodeConfig .ChainID ),
151+ []byte (genesis .ChainID ),
146152 basedStartHeight ,
147153 basedMaxHeightDrift ,
148154 datastore ,
@@ -164,7 +170,7 @@ func NewExtendedRunNodeCmd(ctx context.Context) *cobra.Command {
164170 return fmt .Errorf ("failed to load node key: %w" , err )
165171 }
166172
167- p2pClient , err := p2p .NewClient (nodeConfig , nodeKey , datastore , logger , p2p .NopMetrics ())
173+ p2pClient , err := p2p .NewClient (nodeConfig . P2P , nodeKey . PrivKey , datastore , genesis . ChainID , logger , p2p .NopMetrics ())
168174 if err != nil {
169175 return fmt .Errorf ("failed to create P2P client: %w" , err )
170176 }
@@ -173,7 +179,7 @@ func NewExtendedRunNodeCmd(ctx context.Context) *cobra.Command {
173179 // StartNode might need adjustment if it strictly requires coreda.Client methods.
174180 // For now, assume it can work with coreda.DA or will be adjusted later.
175181 // We also need to pass the namespace config for rollDA.
176- return rollcmd .StartNode (logger , cmd , executor , sequencer , rollDA , p2pClient , datastore , nodeConfig , node.NodeOptions {})
182+ return rollcmd .StartNode (logger , cmd , executor , sequencer , rollDA , p2pClient , datastore , nodeConfig , genesis , node.NodeOptions {})
177183 },
178184 }
179185
0 commit comments