Documentation ¶
Overview ¶
Package node defines a gRPC node service implementation, providing useful endpoints for checking a node's sync status, peer info, genesis data, and version information.
Index ¶
- type Server
- func (ns *Server) GetHealth(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)
- func (ns *Server) GetIdentity(ctx context.Context, _ *emptypb.Empty) (*zondpb.IdentityResponse, error)
- func (ns *Server) GetPeer(ctx context.Context, req *zondpb.PeerRequest) (*zondpb.PeerResponse, error)
- func (s *Server) GetSyncStatus(w http.ResponseWriter, r *http.Request)
- func (_ *Server) GetVersion(ctx context.Context, _ *emptypb.Empty) (*zondpb.VersionResponse, error)
- func (ns *Server) ListPeers(ctx context.Context, req *zondpb.PeersRequest) (*zondpb.PeersResponse, error)
- func (ns *Server) PeerCount(ctx context.Context, _ *emptypb.Empty) (*zondpb.PeerCountResponse, error)
- type SyncStatusResponse
- type SyncStatusResponseData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { SyncChecker sync.Checker OptimisticModeFetcher blockchain.OptimisticModeFetcher Server *grpc.Server BeaconDB db.ReadOnlyDatabase PeersFetcher p2p.PeersProvider PeerManager p2p.PeerManager MetadataProvider p2p.MetadataProvider GenesisTimeFetcher blockchain.TimeFetcher HeadFetcher blockchain.HeadFetcher ExecutionChainInfoFetcher execution.ChainInfoFetcher }
Server defines a server implementation of the gRPC Node service, providing RPC endpoints for verifying a beacon node's sync status, genesis and version information.
func (*Server) GetHealth ¶
GetHealth returns node health status in http status codes. Useful for load balancers. Response Usage:
"200": description: Node is ready "206": description: Node is syncing but can serve incomplete data "503": description: Node not initialized or having issues
func (*Server) GetIdentity ¶
func (ns *Server) GetIdentity(ctx context.Context, _ *emptypb.Empty) (*zondpb.IdentityResponse, error)
GetIdentity retrieves data about the node's network presence.
func (*Server) GetPeer ¶
func (ns *Server) GetPeer(ctx context.Context, req *zondpb.PeerRequest) (*zondpb.PeerResponse, error)
GetPeer retrieves data about the given peer.
func (*Server) GetSyncStatus ¶
func (s *Server) GetSyncStatus(w http.ResponseWriter, r *http.Request)
GetSyncStatus requests the beacon node to describe if it's currently syncing or not, and if it is, what block it is up to.
func (*Server) GetVersion ¶
GetVersion requests that the beacon node identify information about its implementation in a format similar to a HTTP User-Agent field.
func (*Server) ListPeers ¶
func (ns *Server) ListPeers(ctx context.Context, req *zondpb.PeersRequest) (*zondpb.PeersResponse, error)
ListPeers retrieves data about the node's network peers.
type SyncStatusResponse ¶
type SyncStatusResponse struct {
Data *SyncStatusResponseData `json:"data"`
}