filecoin

package
v0.0.0-...-d1ce744 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CalibnetDHTPrefix = "/fil/kad/calibrationnet"
View Source
const MainnetDHTPrefix = "/fil/kad/testnetnet"

Variables

View Source
var CalibnetPeers []peer.AddrInfo
View Source
var MainnetPeers []peer.AddrInfo

Functions

This section is empty.

Types

type Config

type Config struct {
	Bootstrap         []peer.AddrInfo
	Datastore         datastore.Batching
	DHTProtocolPrefix protocol.ID
}

type Peer

type Peer struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, cfg Config, opts ...core.ConfigOpt) (*Peer, error)

func (*Peer) Bootstrap

func (p *Peer) Bootstrap(ctx context.Context) error

func (*Peer) FindAllPeers

func (p *Peer) FindAllPeers(ctx context.Context, whos []peer.ID, by time.Duration, workers int) chan peer.AddrInfo

FindAllPeers queries the DHT for all peers in `whos` using `workers` goroutines, each peer has a find timeout of `by`. FindAllPeers will close the returned channel when all find operations have completed. Errors for finding peers are ignored.

func (*Peer) FindPeer

func (p *Peer) FindPeer(ctx context.Context, who peer.ID) (peer.AddrInfo, error)

func (*Peer) FindPeerWithTimeout

func (p *Peer) FindPeerWithTimeout(ctx context.Context, who peer.ID, by time.Duration) (peer.AddrInfo, error)

func (*Peer) GetAllPeerAgentProtocols

func (p *Peer) GetAllPeerAgentProtocols(ctx context.Context, whos []peer.AddrInfo, by time.Duration, workers int) chan *PeerAgentProtocols

func (*Peer) GetPeerAgentProtocols

func (p *Peer) GetPeerAgentProtocols(ctx context.Context, who peer.AddrInfo) (*PeerAgentProtocols, error)

func (*Peer) GetPeerAgentProtocolsWithTimeout

func (p *Peer) GetPeerAgentProtocolsWithTimeout(ctx context.Context, who peer.AddrInfo, by time.Duration) (*PeerAgentProtocols, error)

type PeerAgentProtocols

type PeerAgentProtocols struct {
	Peer      peer.AddrInfo
	Agent     string
	Protocols []string
}

Jump to

Keyboard shortcuts

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