MCPcopy Create free account
hub / github.com/DNAProject/DNA / initTxPool

Function initTxPool

main.go:279–299  ·  view source on GitHub ↗
(ctx *cli.Context)

Source from the content-addressed store, hash-verified

277}
278
279func initTxPool(ctx *cli.Context) (*proc.TXPoolServer, error) {
280 disablePreExec := ctx.GlobalBool(utils.GetFlagName(utils.TxpoolPreExecDisableFlag))
281 bactor.DisableSyncVerifyTx = ctx.GlobalBool(utils.GetFlagName(utils.DisableSyncVerifyTxFlag))
282 disableBroadcastNetTx := ctx.GlobalBool(utils.GetFlagName(utils.DisableBroadcastNetTxFlag))
283 txPoolServer, err := txnpool.StartTxnPoolServer(disablePreExec, disableBroadcastNetTx)
284 if err != nil {
285 return nil, fmt.Errorf("Init txpool error: %s", err)
286 }
287 stlValidator, _ := stateless.NewValidator("stateless_validator")
288 stlValidator.Register(txPoolServer.GetPID(tc.VerifyRspActor))
289 stlValidator2, _ := stateless.NewValidator("stateless_validator2")
290 stlValidator2.Register(txPoolServer.GetPID(tc.VerifyRspActor))
291 stfValidator, _ := stateful.NewValidator("stateful_validator")
292 stfValidator.Register(txPoolServer.GetPID(tc.VerifyRspActor))
293
294 hserver.SetTxnPoolPid(txPoolServer.GetPID(tc.TxPoolActor))
295 hserver.SetTxPid(txPoolServer.GetPID(tc.TxActor))
296
297 log.Infof("TxPool init success")
298 return txPoolServer, nil
299}
300
301func initP2PNode(ctx *cli.Context, txpoolSvr *proc.TXPoolServer) (*p2pserver.P2PServer, *actor.PID, error) {
302 if config.DefConfig.Genesis.ConsensusType == config.CONSENSUS_TYPE_SOLO {

Callers 1

startDNAFunction · 0.85

Calls 8

RegisterMethod · 0.95
GetFlagNameFunction · 0.92
StartTxnPoolServerFunction · 0.92
NewValidatorFunction · 0.92
NewValidatorFunction · 0.92
ErrorfMethod · 0.80
InfofMethod · 0.80
GetPIDMethod · 0.65

Tested by

no test coverage detected