Versions in this module Expand all Collapse all v0 v0.5.0 Mar 23, 2021 Changes in this version + func NewDiscoveryListener(logger *logrus.Logger, addr net.Addr) interfaces.RPCListener + func NewListener(logger *logrus.Logger, addr net.Addr) interfaces.RPCListener + type DiscoveryListener struct + func (rpcl *DiscoveryListener) Accept() (net.Conn, error) + func (rpcl *DiscoveryListener) Addr() net.Addr + func (rpcl *DiscoveryListener) Close() error + func (rpcl *DiscoveryListener) NewConnection(conn interfaces.P2PConn) error + type GossipFunc func(fn func(interfaces.PeerLease) error) + type Listener struct + func (rpcl *Listener) Accept() (net.Conn, error) + func (rpcl *Listener) Addr() net.Addr + func (rpcl *Listener) Close() error + func (rpcl *Listener) NewConnection(conn interfaces.P2PConn) error + type MockP2PClient struct + func NewMockP2PClient(ctrl *gomock.Controller) *MockP2PClient + func (m *MockP2PClient) Close() error + func (m *MockP2PClient) CloseChan() <-chan struct{} + func (m *MockP2PClient) EXPECT() *MockP2PClientMockRecorder + func (m *MockP2PClient) GetBlockHeaders(arg0 context.Context, arg1 *proto.GetBlockHeadersRequest, ...) (*proto.GetBlockHeadersResponse, error) + func (m *MockP2PClient) GetMinedTxs(arg0 context.Context, arg1 *proto.GetMinedTxsRequest, arg2 ...grpc.CallOption) (*proto.GetMinedTxsResponse, error) + func (m *MockP2PClient) GetPeers(arg0 context.Context, arg1 *proto.GetPeersRequest, arg2 ...grpc.CallOption) (*proto.GetPeersResponse, error) + func (m *MockP2PClient) GetPendingTxs(arg0 context.Context, arg1 *proto.GetPendingTxsRequest, ...) (*proto.GetPendingTxsResponse, error) + func (m *MockP2PClient) GetSnapShotNode(arg0 context.Context, arg1 *proto.GetSnapShotNodeRequest, ...) (*proto.GetSnapShotNodeResponse, error) + func (m *MockP2PClient) GetSnapShotStateData(arg0 context.Context, arg1 *proto.GetSnapShotStateDataRequest, ...) (*proto.GetSnapShotStateDataResponse, error) + func (m *MockP2PClient) GossipBlockHeader(arg0 context.Context, arg1 *proto.GossipBlockHeaderMessage, ...) (*proto.GossipBlockHeaderAck, error) + func (m *MockP2PClient) GossipNextHeight(arg0 context.Context, arg1 *proto.GossipNextHeightMessage, ...) (*proto.GossipNextHeightAck, error) + func (m *MockP2PClient) GossipNextRound(arg0 context.Context, arg1 *proto.GossipNextRoundMessage, ...) (*proto.GossipNextRoundAck, error) + func (m *MockP2PClient) GossipPreCommit(arg0 context.Context, arg1 *proto.GossipPreCommitMessage, ...) (*proto.GossipPreCommitAck, error) + func (m *MockP2PClient) GossipPreCommitNil(arg0 context.Context, arg1 *proto.GossipPreCommitNilMessage, ...) (*proto.GossipPreCommitNilAck, error) + func (m *MockP2PClient) GossipPreVote(arg0 context.Context, arg1 *proto.GossipPreVoteMessage, ...) (*proto.GossipPreVoteAck, error) + func (m *MockP2PClient) GossipPreVoteNil(arg0 context.Context, arg1 *proto.GossipPreVoteNilMessage, ...) (*proto.GossipPreVoteNilAck, error) + func (m *MockP2PClient) GossipProposal(arg0 context.Context, arg1 *proto.GossipProposalMessage, ...) (*proto.GossipProposalAck, error) + func (m *MockP2PClient) GossipTransaction(arg0 context.Context, arg1 *proto.GossipTransactionMessage, ...) (*proto.GossipTransactionAck, error) + func (m *MockP2PClient) NodeAddr() interfaces.NodeAddr + func (m *MockP2PClient) Status(arg0 context.Context, arg1 *proto.StatusRequest, arg2 ...grpc.CallOption) (*proto.StatusResponse, error) + type MockP2PClientMockRecorder struct + func (mr *MockP2PClientMockRecorder) Close() *gomock.Call + func (mr *MockP2PClientMockRecorder) CloseChan() *gomock.Call + func (mr *MockP2PClientMockRecorder) GetBlockHeaders(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) GetMinedTxs(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) GetPeers(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) GetPendingTxs(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) GetSnapShotNodes(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) GetSnapShotStateData(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) GossipBlockHeader(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) GossipNextHeight(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) GossipNextRound(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) GossipPreCommit(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) GossipPreCommitNil(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) GossipPreVote(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) GossipPreVoteNil(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) GossipProposal(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) GossipTransaction(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + func (mr *MockP2PClientMockRecorder) NodeAddr() *gomock.Call + func (mr *MockP2PClientMockRecorder) Status(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call + type MuxHandler struct + func NewMuxServerHandler(logger *logrus.Logger, addr net.Addr, service interfaces.P2PServer) *MuxHandler + func (rpcm *MuxHandler) Close() error + func (rpcm *MuxHandler) HandleConnection(conn interfaces.P2PMuxConn) (interfaces.P2PClient, error) + type PeerLeaseFunc func(ctx context.Context) (interfaces.PeerLease, error) + type PeerManager struct + func NewPeerManager(p2pServer interfaces.P2PServer, chainID uint32, pLimMin int, pLimMax int, ...) (*PeerManager, error) + func (ps *PeerManager) Close() error + func (ps *PeerManager) CloseChan() <-chan struct{} + func (ps *PeerManager) Counts() (int, int) + func (ps *PeerManager) GetPeers(ctx context.Context, req *pb.GetPeersRequest) (*pb.GetPeersResponse, error) + func (ps *PeerManager) HandleP2PGetPeers(ctx context.Context, req *pb.GetPeersRequest) (*pb.GetPeersResponse, error) + func (ps *PeerManager) PeeringComplete() bool + func (ps *PeerManager) Start() + func (ps *PeerManager) Status(smap map[string]interface{}) (map[string]interface{}, error) + func (ps *PeerManager) Subscribe() interfaces.PeerSubscription + type PeerSubscription struct + func (p *PeerSubscription) CloseChan() <-chan struct{} + func (p *PeerSubscription) GossipConsensus(hsh []byte, fn func(context.Context, interfaces.PeerLease) error) + func (p *PeerSubscription) GossipTx(hsh []byte, fn func(context.Context, interfaces.PeerLease) error) + func (p *PeerSubscription) PeerLease(ctx context.Context) (interfaces.PeerLease, error) + func (p *PeerSubscription) PreventGossipConsensus(addr interfaces.NodeAddr, hsh []byte) + func (p *PeerSubscription) PreventGossipTx(addr interfaces.NodeAddr, hsh []byte) + func (p *PeerSubscription) RequestLease(ctx context.Context, msg []byte) (interfaces.PeerLease, error) + type ServerHandler struct + func NewBootNodeServerHandler(logger *logrus.Logger, addr net.Addr, service interfaces.BootNodeServer) *ServerHandler + func NewDiscoveryServerHandler(logger *logrus.Logger, addr net.Addr, service interfaces.DiscoveryServer) *ServerHandler + func (rpch *ServerHandler) Close() error + func (rpch *ServerHandler) HandleConnection(conn interfaces.P2PConn) error