Documentation ¶
Overview ¶
Package p2p provides the p2p communication layer for the committee.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RebroadcastingInterval = time.Minute
RebroadcastingInterval is the interval at which the crdt will rebroadcast its data.
Functions ¶
This section is empty.
Types ¶
type LibP2PManager ¶
type LibP2PManager interface { // Host returns the host from the manager. Host() host.Host // Expose host from manager // Start starts the libp2p manager. Start(ctx context.Context, bootstrapPeers []string) error // AddValidators adds validators to the manager. AddValidators(ctx context.Context, addr ...common.Address) error // Address returns the address of the node. Address() common.Address // GetSignature gets a signature from the datastore. GetSignature(ctx context.Context, address common.Address, chainID int, entryID common.Hash) ([]byte, error) // PutSignature puts a signature into the datastore. PutSignature(ctx context.Context, chainID int, entryID common.Hash, signature []byte) error }
LibP2PManager is the interface for the libp2p manager.
func NewLibP2PManager ¶
func NewLibP2PManager(ctx context.Context, handler metrics.Handler, auth signer.Signer, store db.Datstores, port int, usePeerID bool) (_ LibP2PManager, err error)
NewLibP2PManager creates a new libp2p manager. listenHost is the host to listen on.
validators should be a list of addresses that are allowed to connect to the host. This should include the address of the node itself. whitelist is the list of addresses that are allowed to write to the datastore.
Click to show internal directories.
Click to hide internal directories.