gossip

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	sync.Mutex
	// contains filtered or unexported fields
}

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.

func (*Client) Init

func (mb *Client) Init(database *db.Database, client pb.P2PClient, app appClient, storage dynamics.StorageGetter)

Init sets ups all subscriptions. This MUST be run at least once. It has no effect if run more than once.

func (*Client) ReGossip

func (mb *Client) ReGossip() error

ReGossip performs the reGossip logic.

func (*Client) Start

func (mb *Client) Start() error

Start will start the service.

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.

func (*Handlers) Start

func (mb *Handlers) Start()

Jump to

Keyboard shortcuts

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