(ctx context.Context, cfg *Config)
| 98 | } |
| 99 | |
| 100 | func (n *EsNode) init(ctx context.Context, cfg *Config) error { |
| 101 | if err := n.initL1(ctx, cfg); err != nil { |
| 102 | return err |
| 103 | } |
| 104 | if err := n.initDatabase(cfg); err != nil { |
| 105 | return err |
| 106 | } |
| 107 | if err := n.initStorageManager(ctx, cfg); err != nil { |
| 108 | return err |
| 109 | } |
| 110 | if err := n.initP2P(ctx, cfg); err != nil { |
| 111 | return err |
| 112 | } |
| 113 | if err := n.initL2(ctx, cfg); err != nil { |
| 114 | return err |
| 115 | } |
| 116 | if err := n.initMiner(ctx, cfg); err != nil { |
| 117 | return err |
| 118 | } |
| 119 | |
| 120 | // Only expose the server at the end, ensuring all RPC backend components are initialized. |
| 121 | if err := n.initRPCServer(ctx, cfg); err != nil { |
| 122 | return err |
| 123 | } |
| 124 | if err := n.initMetricsServer(ctx, cfg); err != nil { |
| 125 | return err |
| 126 | } |
| 127 | if err := n.initArchiver(ctx, cfg); err != nil { |
| 128 | return err |
| 129 | } |
| 130 | return nil |
| 131 | } |
| 132 | |
| 133 | func (n *EsNode) initL2(ctx context.Context, cfg *Config) error { |
| 134 | n.blobCache = downloader.NewBlobDiskCache(cfg.DataDir, n.lg) |
no test coverage detected