Start create all services
()
| 99 | |
| 100 | //Start create all services |
| 101 | func (this *P2PServer) Start() error { |
| 102 | if this.network != nil { |
| 103 | this.network.Start() |
| 104 | } else { |
| 105 | return errors.New("[p2p]network invalid") |
| 106 | } |
| 107 | if this.msgRouter != nil { |
| 108 | this.msgRouter.Start() |
| 109 | } else { |
| 110 | return errors.New("[p2p]msg router invalid") |
| 111 | } |
| 112 | this.tryRecentPeers() |
| 113 | go this.connectSeedService() |
| 114 | go this.syncUpRecentPeers() |
| 115 | go this.keepOnlineService() |
| 116 | go this.heartBeatService() |
| 117 | go this.blockSync.Start() |
| 118 | return nil |
| 119 | } |
| 120 | |
| 121 | //Stop halt all service by send signal to channels |
| 122 | func (this *P2PServer) Stop() { |
nothing calls this directly
no test coverage detected