p2pverse

package module
v0.0.0-...-457732c Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 19 Imported by: 8

README

p2p-verse

go-libp2p packages consist of PubSub, CRDT, IPFS, etc.

Any kind of go-libp2p Host is available, such as tcp, udp, tor, and i2p.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrInfo

func AddrInfo(pid peer.ID, maddrs ...ma.Multiaddr) peer.AddrInfo

func AddrInfoFromString

func AddrInfoFromString(aiStr string) peer.AddrInfo

func AddrInfoSliceToMap

func AddrInfoSliceToMap(slc []peer.AddrInfo) map[peer.ID]peer.AddrInfo

func AddrInfoToString

func AddrInfoToString(ai peer.AddrInfo) string

func AddrInfosFromString

func AddrInfosFromString(sais string) []peer.AddrInfo

func AddrInfosToString

func AddrInfosToString(ais ...peer.AddrInfo) string

func Discovery

func Discovery(h host.Host, keyword string, bootstraps []peer.AddrInfo) error

func HostImporter

func HostImporter(h host.Host) func(...io.Reader) (host.Host, error)

func HostToAddrInfo

func HostToAddrInfo(h host.Host) peer.AddrInfo

func RandBytes

func RandBytes(bSize int) []byte

func RandString

func RandString(bSize int) string

func SampleHost

func SampleHost(seeds ...io.Reader) (host.Host, error)

Types

type DiscoveryDHT

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

func NewDHT

func NewDHT(h host.Host) (*DiscoveryDHT, error)

func (*DiscoveryDHT) Bootstrap

func (d *DiscoveryDHT) Bootstrap(keyword string, bootstraps []peer.AddrInfo) error

func (*DiscoveryDHT) Close

func (d *DiscoveryDHT) Close()

func (*DiscoveryDHT) DHT

func (d *DiscoveryDHT) DHT() *kad.IpfsDHT

func (*DiscoveryDHT) Discovery

func (d *DiscoveryDHT) Discovery() discovery.Discovery

type HostGenerator

type HostGenerator func(seeds ...io.Reader) (host.Host, error)

type IBootstrap

type IBootstrap interface {
	Close()
	AddrInfo() peer.AddrInfo
	ConnectedPeers() []peer.AddrInfo
}

func NewBootstrap

func NewBootstrap(hGen HostGenerator, others ...peer.AddrInfo) (IBootstrap, error)

Directories

Path Synopsis
pb
pb
pb

Jump to

Keyboard shortcuts

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