host

package
v0.0.0-...-2e0d377 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectPeers

func ConnectPeers(ctx context.Context, h host.Host, infos []peer.AddrInfo, concurrency int, timeout time.Duration) (int, error)

func LoadOrCreateIdentity

func LoadOrCreateIdentity(path string) (crypto.PrivKey, error)

func MergeTargets

func MergeTargets(bootstrap []peer.AddrInfo, remembered []peer.AddrInfo) []peer.AddrInfo

func New

func New(cfg *config.Config, priv crypto.PrivKey, psk []byte) (host.Host, error)

func NewDHT

func NewDHT(ctx context.Context, h host.Host, prefix string) (*dht.IpfsDHT, error)

func ParsePeerAddrs

func ParsePeerAddrs(addrs []string) ([]peer.AddrInfo, error)

Types

type PeerMemory

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

func LoadPeerMemory

func LoadPeerMemory(path string, maxPeers, maxAddrs int, ttl time.Duration) *PeerMemory

func (*PeerMemory) DialTargets

func (pm *PeerMemory) DialTargets(self peer.ID) []peer.AddrInfo

func (*PeerMemory) Save

func (pm *PeerMemory) Save()

func (*PeerMemory) Snapshot

func (pm *PeerMemory) Snapshot(h host.Host)

Jump to

Keyboard shortcuts

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