Documentation ¶
Index ¶
- Constants
- func AddrInfoToPeerIDs(ai []peer.AddrInfo) []peer.ID
- func FilecoinDHT(network string) protocol.ID
- func ParseAddresses(ctx context.Context, addrs []string) ([]peer.AddrInfo, error)
- func PeerAddrsToAddrInfo(addrs []string) ([]peer.AddrInfo, error)
- type IPeerMgr
- type MockPeerMgr
- func (m MockPeerMgr) AddFilecoinPeer(p peer.ID)
- func (m MockPeerMgr) Disconnect(p peer.ID)
- func (m MockPeerMgr) GetPeerLatency(p peer.ID) (time.Duration, bool)
- func (m MockPeerMgr) Run(ctx context.Context)
- func (m MockPeerMgr) SetPeerLatency(p peer.ID, latency time.Duration)
- func (m MockPeerMgr) Stop(ctx context.Context) error
- type Network
- func (network *Network) Connect(ctx context.Context, addrs []string) (<-chan types.ConnectionResult, error)
- func (network *Network) GetBandwidthStats() metrics.Stats
- func (network *Network) GetPeerAddresses() []ma.Multiaddr
- func (network *Network) GetPeerID() peer.ID
- func (network *Network) Peers(ctx context.Context, verbose, latency, streams bool) (*types.SwarmConnInfos, error)
- type NewFilPeer
- type PeerMgr
- func (pmgr *PeerMgr) AddFilecoinPeer(p peer.ID)
- func (pmgr *PeerMgr) Disconnect(p peer.ID)
- func (pmgr *PeerMgr) GetPeerLatency(p peer.ID) (time.Duration, bool)
- func (pmgr *PeerMgr) Run(ctx context.Context)
- func (pmgr *PeerMgr) SetPeerLatency(p peer.ID, latency time.Duration)
- func (pmgr *PeerMgr) Stop(ctx context.Context) error
- type Router
Constants ¶
View Source
const ( MaxFilPeers = 320 MinFilPeers = 128 )
Variables ¶
This section is empty.
Functions ¶
func AddrInfoToPeerIDs ¶
AddrInfoToPeerIDs converts a slice of AddrInfo to a slice of peerID's.
func FilecoinDHT ¶
FilecoinDHT is creates a protocol for the filecoin DHT.
func ParseAddresses ¶
ParseAddresses is a function that takes in a slice of string peer addresses (multiaddr + peerid) and returns a slice of properly constructed peers
Types ¶
type MockPeerMgr ¶
type MockPeerMgr struct { }
func (MockPeerMgr) AddFilecoinPeer ¶
func (m MockPeerMgr) AddFilecoinPeer(p peer.ID)
func (MockPeerMgr) Disconnect ¶
func (m MockPeerMgr) Disconnect(p peer.ID)
func (MockPeerMgr) GetPeerLatency ¶
func (MockPeerMgr) Run ¶
func (m MockPeerMgr) Run(ctx context.Context)
func (MockPeerMgr) SetPeerLatency ¶
func (m MockPeerMgr) SetPeerLatency(p peer.ID, latency time.Duration)
type Network ¶
Network is a unified interface for dealing with libp2p
func (*Network) Connect ¶
func (network *Network) Connect(ctx context.Context, addrs []string) (<-chan types.ConnectionResult, error)
Connect connects to peers at the given addresses. Does not retry.
func (*Network) GetBandwidthStats ¶
GetBandwidthStats gets stats on the current bandwidth usage of the network
func (*Network) GetPeerAddresses ¶
GetPeerAddresses gets the current addresses of the node
type NewFilPeer ¶
type PeerMgr ¶
type PeerMgr struct {
// contains filtered or unexported fields
}
func NewPeerMgr ¶
func (*PeerMgr) AddFilecoinPeer ¶
func (*PeerMgr) Disconnect ¶
func (*PeerMgr) GetPeerLatency ¶
func (*PeerMgr) SetPeerLatency ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router exposes the methods on the internal filecoin router that are needed by the system plumbing API.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.