node

package
v1.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2021 License: GPL-3.0 Imports: 19 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	LogsStreamer         logutil.Streamer
	StreamLogsBufferSize int
	SyncChecker          sync.Checker
	Server               *grpc.Server
	BeaconDB             db.ReadOnlyDatabase
	PeersFetcher         p2p.PeersProvider
	PeerManager          p2p.PeerManager
	GenesisTimeFetcher   blockchain.TimeFetcher
	GenesisFetcher       blockchain.GenesisFetcher
	BeaconMonitoringHost string
	BeaconMonitoringPort int
}

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, and services the node implements and runs.

func (*Server) GetGenesis

func (ns *Server) GetGenesis(ctx context.Context, _ *ptypes.Empty) (*ethpb.Genesis, error)

GetGenesis fetches genesis chain information of Ethereum 2.0. Returns unix timestamp 0 if a genesis time has yet to be determined.

func (*Server) GetHost added in v1.0.0

func (ns *Server) GetHost(_ context.Context, _ *ptypes.Empty) (*ethpb.HostData, error)

GetHost returns the p2p data on the current local and host peer.

func (*Server) GetPeer added in v1.0.0

func (ns *Server) GetPeer(_ context.Context, peerReq *ethpb.PeerRequest) (*ethpb.Peer, error)

GetPeer returns the data known about the peer defined by the provided peer id.

func (*Server) GetSyncStatus

func (ns *Server) GetSyncStatus(_ context.Context, _ *ptypes.Empty) (*ethpb.SyncStatus, error)

GetSyncStatus checks the current network sync status of the node.

func (*Server) GetVersion

func (ns *Server) GetVersion(_ context.Context, _ *ptypes.Empty) (*ethpb.Version, error)

GetVersion checks the version information of the beacon node.

func (*Server) ListImplementedServices

func (ns *Server) ListImplementedServices(_ context.Context, _ *ptypes.Empty) (*ethpb.ImplementedServices, error)

ListImplementedServices lists the services implemented and enabled by this node.

Any service not present in this list may return UNIMPLEMENTED or PERMISSION_DENIED. The server may also support fetching services by grpc reflection.

func (*Server) ListPeers added in v0.3.0

func (ns *Server) ListPeers(ctx context.Context, _ *ptypes.Empty) (*ethpb.Peers, error)

ListPeers lists the peers connected to this node.

func (*Server) StreamBeaconLogs added in v1.1.0

func (ns *Server) StreamBeaconLogs(_ *empty.Empty, stream pb.Health_StreamBeaconLogsServer) error

StreamBeaconLogs from the beacon node via a gRPC server-side stream.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL