github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/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/onflow/flow-go/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  }