MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / PingBP

Function PingBP

rpc/mux/resolve.go:162–176  ·  view source on GitHub ↗

PingBP Send DHT.Ping Request with Anonymous ETLS session.

(node *proto.Node, BPNodeID proto.NodeID)

Source from the content-addressed store, hash-verified

160
161// PingBP Send DHT.Ping Request with Anonymous ETLS session.
162func PingBP(node *proto.Node, BPNodeID proto.NodeID) (err error) {
163 client := NewCaller()
164
165 req := &proto.PingReq{
166 Node: *node,
167 }
168
169 resp := new(proto.PingResp)
170 err = client.CallNode(BPNodeID, "DHT.Ping", req, resp)
171 if err != nil {
172 err = errors.Wrap(err, "call DHT.Ping failed")
173 return
174 }
175 return
176}
177
178// GetCurrentBP returns nearest hash distance block producer as current node chief block producer.
179func GetCurrentBP() (bpNodeID proto.NodeID, err error) {

Callers 2

RegisterNodeToBPFunction · 0.85
TestCaller_CallNodeFunction · 0.85

Calls 2

CallNodeMethod · 0.95
NewCallerFunction · 0.70

Tested by 1

TestCaller_CallNodeFunction · 0.68