(ctx *cli.Context)
| 144 | } |
| 145 | |
| 146 | func startDNA(ctx *cli.Context) { |
| 147 | initLog(ctx) |
| 148 | |
| 149 | log.Infof("version %s", config.Version) |
| 150 | |
| 151 | setMaxOpenFiles() |
| 152 | |
| 153 | cfg, err := initConfig(ctx) |
| 154 | if err != nil { |
| 155 | log.Errorf("initConfig error: %s", err) |
| 156 | return |
| 157 | } |
| 158 | acc, err := initAccount(ctx) |
| 159 | if err != nil { |
| 160 | log.Errorf("initWallet error: %s", err) |
| 161 | return |
| 162 | } |
| 163 | stateHashHeight := config.GetStateHashCheckHeight(cfg.P2PNode.NetworkId) |
| 164 | ldg, err := initLedger(ctx, stateHashHeight) |
| 165 | if err != nil { |
| 166 | log.Errorf("%s", err) |
| 167 | return |
| 168 | } |
| 169 | txpool, err := initTxPool(ctx) |
| 170 | if err != nil { |
| 171 | log.Errorf("initTxPool error: %s", err) |
| 172 | return |
| 173 | } |
| 174 | p2pSvr, p2pPid, err := initP2PNode(ctx, txpool) |
| 175 | if err != nil { |
| 176 | log.Errorf("initP2PNode error: %s", err) |
| 177 | return |
| 178 | } |
| 179 | _, err = initConsensus(ctx, p2pPid, txpool, acc) |
| 180 | if err != nil { |
| 181 | log.Errorf("initConsensus error: %s", err) |
| 182 | return |
| 183 | } |
| 184 | err = initRpc(ctx) |
| 185 | if err != nil { |
| 186 | log.Errorf("initRpc error: %s", err) |
| 187 | return |
| 188 | } |
| 189 | err = initLocalRpc(ctx) |
| 190 | if err != nil { |
| 191 | log.Errorf("initLocalRpc error: %s", err) |
| 192 | return |
| 193 | } |
| 194 | initRestful(ctx) |
| 195 | initWs(ctx) |
| 196 | initNodeInfo(ctx, p2pSvr) |
| 197 | |
| 198 | go logCurrBlockHeight() |
| 199 | waitToExit(ldg) |
| 200 | } |
| 201 | |
| 202 | func initLog(ctx *cli.Context) { |
| 203 | //init log module |
nothing calls this directly
no test coverage detected