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

Method Start

p2pserver/p2pserver.go:101–119  ·  view source on GitHub ↗

Start create all services

()

Source from the content-addressed store, hash-verified

99
100//Start create all services
101func (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
122func (this *P2PServer) Stop() {

Callers

nothing calls this directly

Calls 6

tryRecentPeersMethod · 0.95
connectSeedServiceMethod · 0.95
syncUpRecentPeersMethod · 0.95
keepOnlineServiceMethod · 0.95
heartBeatServiceMethod · 0.95
StartMethod · 0.65

Tested by

no test coverage detected