mesh

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolHttp = "/lpweb/http/1.0.0"
	ProtocolWS   = "/lpweb/ws/1.0.0"
)

Variables

View Source
var (
	BootStrapPeers = []string{
		"/ip4/139.178.91.71/udp/4001/quic/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
		"/ip4/147.75.87.27/udp/4001/quic/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
		"/ip4/145.40.118.135/udp/4001/quic/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
		"/ip4/104.131.131.82/udp/4001/quic/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
		"/ip6/2604:1380:4602:5c00::3/tcp/4001/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
		"/ip4/139.178.91.71/tcp/4001/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
		"/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",

		"/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
		"/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
		"/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
		"/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
		"/dnsaddr/bootstrap.libp2p.io/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
	}
)

Functions

func NewHostWithKey

func NewHostWithKey(privateKey crypto.PrivKey, port int, baseAddrs []string) (hps *holepunch.Service, dhtOut *dht.IpfsDHT, err error)

Types

type Mesh

type Mesh struct {
	Host     host.Host
	DHT      *dht.IpfsDHT
	Port     int
	PublicIp string

	ResourceManager *ResourceManager

	HolePunchService *holepunch.Service
}

func New

func New(keystr string, port int) (*Mesh, error)

func (*Mesh) PublicMultiAddr

func (m *Mesh) PublicMultiAddr() ([]ma.Multiaddr, error)

type ResourceManager

type ResourceManager struct {
	network.ResourceManager
	// contains filtered or unexported fields
}

func NewResourceManager

func NewResourceManager() (*ResourceManager, error)

func (*ResourceManager) OpenStream

func (*ResourceManager) Register

func (r *ResourceManager) Register(pid peer.ID) <-chan struct{}

func (*ResourceManager) Unregister

func (r *ResourceManager) Unregister(pid peer.ID)

type StreamManagementScope

type StreamManagementScope struct {
	network.StreamManagementScope
	// contains filtered or unexported fields
}

func (*StreamManagementScope) SetProtocol

func (s *StreamManagementScope) SetProtocol(proto protocol.ID) error

Jump to

Keyboard shortcuts

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