Documentation ¶
Index ¶
Constants ¶
const ( // DefaultConnMgrHighWater is the default value for the connection managers // 'high water' mark DefaultConnMgrHighWater = 900 // DefaultConnMgrLowWater is the default value for the connection managers 'low // water' mark DefaultConnMgrLowWater = 600 // DefaultConnMgrGracePeriod is the default value for the connection managers // grace period DefaultConnMgrGracePeriod = time.Second * 20 )
Defaults from ipfs
const ( // FirewallCheckTick is the amount of time between periodic checks of all // firewall rules against all peers connected to this one. FirewallCheckTick = time.Minute * 10 // ConnectedPeersCheckTick is the amount of time between periodic checks of // the number of connected peers. ConnectedPeersCheckTick = time.Minute * 1 )
watchtower constants
const ( ProtocolBeacon = "keep-beacon" ProtocolECDSA = "keep-ecdsa" )
Keep Network protocol identifiers
const MaximumDisseminationTime = 90
MaximumDisseminationTime is the maximum dissemination time of messages in topics we are not subscribed to. By default courteous dissemination is disabled and it should be enabled only on selected fast bootstrap nodes. This value should never be higher than the lifetime of libp2p cache (120 sec) to prevent uncontrolled message propagation.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
func Connect( ctx context.Context, config Config, staticKey *key.NetworkPrivate, protocol string, firewall net.Firewall, ticker *retransmission.Ticker, options ...ConnectOption, ) (net.Provider, error)
Connect connects to a libp2p network based on the provided config. The connection is managed in part by the passed context, and provides access to the functionality specified in the net.Provider interface.
An error is returned if any part of the connection or bootstrap process fails.
Types ¶
type ConnectOption ¶
type ConnectOption func(options *ConnectOptions)
ConnectOption allows to set an options used by libp2p.
func WithRoutingTableRefreshPeriod ¶
func WithRoutingTableRefreshPeriod(period time.Duration) ConnectOption
WithRoutingTableRefreshPeriod set a refresh period of the routing table.
type ConnectOptions ¶
ConnectOptions allows to set various options used by libp2p.