PingBP Send DHT.Ping Request with Anonymous ETLS session.
(node *proto.Node, BPNodeID proto.NodeID)
| 160 | |
| 161 | // PingBP Send DHT.Ping Request with Anonymous ETLS session. |
| 162 | func 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. |
| 179 | func GetCurrentBP() (bpNodeID proto.NodeID, err error) { |