github.com/koko1123/flow-go-1@v0.29.6/network/ping.go (about) 1 package network 2 3 import ( 4 "context" 5 "time" 6 7 "github.com/libp2p/go-libp2p/core/peer" 8 9 "github.com/koko1123/flow-go-1/network/message" 10 ) 11 12 // PingInfoProvider is the interface used by the PingService to respond to incoming PingRequest with a PingResponse 13 // populated with the necessary details 14 type PingInfoProvider interface { 15 SoftwareVersion() string 16 SealedBlockHeight() uint64 17 HotstuffView() uint64 18 } 19 20 type PingService interface { 21 Ping(ctx context.Context, peerID peer.ID) (message.PingResponse, time.Duration, error) 22 }