(ctx context.Context, cfg *Config)
| 220 | } |
| 221 | |
| 222 | func (n *EsNode) initP2P(ctx context.Context, cfg *Config) error { |
| 223 | if cfg.P2P != nil { |
| 224 | p2pNode, err := p2p.NewNodeP2P(n.resourcesCtx, cfg.ChainID, n.lg, cfg.P2P, n.storageManager, n.db, n.metrics, n.feed) |
| 225 | if err != nil || p2pNode == nil { |
| 226 | return err |
| 227 | } |
| 228 | n.p2pNode = p2pNode |
| 229 | if n.p2pNode.Dv5Udp() != nil { |
| 230 | go n.p2pNode.DiscoveryProcess(n.resourcesCtx, n.lg, cfg.ChainID.Uint64(), cfg.P2P.TargetPeers()) |
| 231 | } |
| 232 | } |
| 233 | return nil |
| 234 | } |
| 235 | |
| 236 | func (n *EsNode) initStorageManager(ctx context.Context, cfg *Config) error { |
| 237 | shardManager := ethstorage.NewShardManager(cfg.Storage.L1Contract, cfg.Storage.KvSize, cfg.Storage.KvEntriesPerShard, cfg.Storage.ChunkSize) |
no test coverage detected