MCPcopy Create free account
hub / github.com/ethstorage/es-node / Start

Method Start

ethstorage/node/node.go:347–375  ·  view source on GitHub ↗
(ctx context.Context, cfg *Config)

Source from the content-addressed store, hash-verified

345}
346
347func (n *EsNode) Start(ctx context.Context, cfg *Config) error {
348 n.startL1(cfg)
349
350 // miner must be started before p2p sync
351 if n.miner != nil {
352 n.miner.Start()
353 }
354
355 if err := n.downloader.Start(); err != nil {
356 n.lg.Error("Could not start a downloader", "err", err)
357 return err
358 }
359 // Scanner must be started after downloader resets storage manager
360 n.initScanner(ctx, cfg)
361
362 if n.p2pNode != nil {
363 if err := n.p2pNode.Start(); err != nil {
364 n.lg.Error("Could not start a p2pNode", "err", err)
365 return err
366 }
367 }
368
369 if cfg.StateUploadURL != "" {
370 n.lg.Info("Start upload node state")
371 go n.UploadNodeState(cfg.StateUploadURL)
372 }
373
374 return nil
375}
376
377func (n *EsNode) UploadNodeState(url string) {
378 <-time.After(2 * time.Minute)

Callers 3

initRPCServerMethod · 0.45
initArchiverMethod · 0.45
initScannerMethod · 0.45

Calls 4

startL1Method · 0.95
initScannerMethod · 0.95
UploadNodeStateMethod · 0.95
ErrorMethod · 0.45

Tested by

no test coverage detected