Documentation ¶
Index ¶
- type Client
- type Handlers
- func (mb *Handlers) Close()
- func (mb *Handlers) Done() <-chan struct{}
- func (mb *Handlers) HandleP2PGossipBlockHeader(ctx context.Context, msg *pb.GossipBlockHeaderMessage) (*pb.GossipBlockHeaderAck, error)
- func (mb *Handlers) HandleP2PGossipNextHeight(ctx context.Context, msg *pb.GossipNextHeightMessage) (*pb.GossipNextHeightAck, error)
- func (mb *Handlers) HandleP2PGossipNextRound(ctx context.Context, msg *pb.GossipNextRoundMessage) (*pb.GossipNextRoundAck, error)
- func (mb *Handlers) HandleP2PGossipPreCommit(ctx context.Context, msg *pb.GossipPreCommitMessage) (*pb.GossipPreCommitAck, error)
- func (mb *Handlers) HandleP2PGossipPreCommitNil(ctx context.Context, msg *pb.GossipPreCommitNilMessage) (*pb.GossipPreCommitNilAck, error)
- func (mb *Handlers) HandleP2PGossipPreVote(ctx context.Context, msg *pb.GossipPreVoteMessage) (*pb.GossipPreVoteAck, error)
- func (mb *Handlers) HandleP2PGossipPreVoteNil(ctx context.Context, msg *pb.GossipPreVoteNilMessage) (*pb.GossipPreVoteNilAck, error)
- func (mb *Handlers) HandleP2PGossipProposal(ctx context.Context, msg *pb.GossipProposalMessage) (*pb.GossipProposalAck, error)
- func (mb *Handlers) HandleP2PGossipTransaction(ctx context.Context, msg *pb.GossipTransactionMessage) (*pb.GossipTransactionAck, error)
- func (mb *Handlers) Init(chainID uint32, database *db.Database, client pb.P2PClient, app appHandler, ...)
- func (mb *Handlers) Start()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client handles outbound gossip.
func (*Client) Close ¶
func (mb *Client) Close()
Close will stop the gossip bus such that it can not be started again.
func (*Client) Done ¶
func (mb *Client) Done() <-chan struct{}
Done blocks until the service has an exit.
type Handlers ¶
type Handlers struct { ReceiveLock chan interfaces.Lockable // contains filtered or unexported fields }
Handlers consumes gossip and updates local state.
func (*Handlers) Close ¶
func (mb *Handlers) Close()
Close will shut down the gossip system such that it can not be restarted.
func (*Handlers) Done ¶
func (mb *Handlers) Done() <-chan struct{}
Done blocks until the service has an exit.
func (*Handlers) HandleP2PGossipBlockHeader ¶
func (mb *Handlers) HandleP2PGossipBlockHeader(ctx context.Context, msg *pb.GossipBlockHeaderMessage) (*pb.GossipBlockHeaderAck, error)
HandleP2PGossipBlockHeader adds a nextHeight to the database This method should be invoked when a remote peer sends this type of object to the local node over the gossip protocol.
func (*Handlers) HandleP2PGossipNextHeight ¶
func (mb *Handlers) HandleP2PGossipNextHeight(ctx context.Context, msg *pb.GossipNextHeightMessage) (*pb.GossipNextHeightAck, error)
HandleP2PGossipNextHeight adds a nextHeight to the database This method should be invoked when a remote peer sends this type of object to the local node over the gossip protocol.
func (*Handlers) HandleP2PGossipNextRound ¶
func (mb *Handlers) HandleP2PGossipNextRound(ctx context.Context, msg *pb.GossipNextRoundMessage) (*pb.GossipNextRoundAck, error)
HandleP2PGossipNextRound adds a nextRound to the database This method should be invoked when a remote peer sends this type of object to the local node over the gossip protocol.
func (*Handlers) HandleP2PGossipPreCommit ¶
func (mb *Handlers) HandleP2PGossipPreCommit(ctx context.Context, msg *pb.GossipPreCommitMessage) (*pb.GossipPreCommitAck, error)
HandleP2PGossipPreCommit adds a preCommit to the database This method should be invoked when a remote peer sends this type of object to the local node over the gossip protocol.
func (*Handlers) HandleP2PGossipPreCommitNil ¶
func (mb *Handlers) HandleP2PGossipPreCommitNil(ctx context.Context, msg *pb.GossipPreCommitNilMessage) (*pb.GossipPreCommitNilAck, error)
HandleP2PGossipPreCommitNil adds a preCommitNil to the database This method should be invoked when a remote peer sends this type of object to the local node over the gossip protocol.
func (*Handlers) HandleP2PGossipPreVote ¶
func (mb *Handlers) HandleP2PGossipPreVote(ctx context.Context, msg *pb.GossipPreVoteMessage) (*pb.GossipPreVoteAck, error)
HandleP2PGossipPreVote adds a preVote to the database This method should be invoked when a remote peer sends this type of object to the local node over the gossip protocol.
func (*Handlers) HandleP2PGossipPreVoteNil ¶
func (mb *Handlers) HandleP2PGossipPreVoteNil(ctx context.Context, msg *pb.GossipPreVoteNilMessage) (*pb.GossipPreVoteNilAck, error)
HandleP2PGossipPreVoteNil adds a preVoteNil to the database This method should be invoked when a remote peer sends this type of object to the local node over the gossip protocol.
func (*Handlers) HandleP2PGossipProposal ¶
func (mb *Handlers) HandleP2PGossipProposal(ctx context.Context, msg *pb.GossipProposalMessage) (*pb.GossipProposalAck, error)
HandleP2PGossipProposal adds a proposal to the database This method should be invoked when a remote peer sends this type of object to the local node over the gossip protocol.
func (*Handlers) HandleP2PGossipTransaction ¶
func (mb *Handlers) HandleP2PGossipTransaction(ctx context.Context, msg *pb.GossipTransactionMessage) (*pb.GossipTransactionAck, error)
HandleP2PGossipTransaction adds a transaction to the database This method should be invoked when a remote peer sends this type of object to the local node over the gossip protocol.
func (*Handlers) Init ¶
func (mb *Handlers) Init(chainID uint32, database *db.Database, client pb.P2PClient, app appHandler, handlers *lstate.Handlers, storage dynamics.StorageGetter)
Init will initialize the gossip consumer it must be run at least once and will have no effect if run more than once.