warpnet

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: GPL-2.0, GPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BootstrapOwner = "bootstrap"
	WarpnetName    = "warpnet"
	NoiseID        = noise.ID

	Connected = network.Connected
	Limited   = network.Limited

	P_IP4 = multiaddr.P_IP4
	P_IP6 = multiaddr.P_IP6
	P_TCP = multiaddr.P_TCP

	PermanentAddrTTL = peerstore.PermanentAddrTTL

	ErrNodeIsOffline = WarpError("node is offline")
	ErrUserIsOffline = WarpError("user is offline")

	ReachabilityPublic  WarpReachability = network.ReachabilityPublic
	ReachabilityPrivate WarpReachability = network.ReachabilityPrivate
	ReachabilityUnknown WarpReachability = network.ReachabilityUnknown
)

Variables

View Source
var ErrAllDialsFailed = swarm.ErrAllDialsFailed

Functions

func GetCPUStats

func GetCPUStats() map[string]string

func GetMacAddr

func GetMacAddr() string

func GetMemoryStats

func GetMemoryStats() map[string]string

func GetNetworkIO

func GetNetworkIO() (bytesSent int64, bytesRecv int64)

func IsPublicMultiAddress

func IsPublicMultiAddress(maddr WarpAddress) bool

func IsRelayAddress

func IsRelayAddress(addr string) bool

func IsRelayMultiaddress

func IsRelayMultiaddress(maddr multiaddr.Multiaddr) bool

func NewAutoScaledLimiter

func NewAutoScaledLimiter() rcmgr.Limiter

func NewConnManager

func NewConnManager(limiter rcmgr.Limiter) (*connmgr.BasicConnMgr, error)

func NewMultiaddr

func NewMultiaddr(s string) (a multiaddr.Multiaddr, err error)

func NewNoise

func NewNoise(id protocol.ID, pk p2pCrypto.PrivKey, mxs []tptu.StreamMuxer) (*noise.Transport, error)

func NewResourceManager

func NewResourceManager(limiter rcmgr.Limiter) (network.ResourceManager, error)

func UnmarshalEd25519PublicKey added in v0.2.509

func UnmarshalEd25519PublicKey(data []byte) (p2pCrypto.PubKey, error)

Types

type NodeInfo

type NodeInfo struct {
	OwnerId        string          `json:"owner_id"`
	ID             WarpPeerID      `json:"node_id"`
	Version        *semver.Version `json:"version"`
	Addresses      []string        `json:"addresses"`
	StartTime      time.Time       `json:"start_time"`
	RelayState     string          `json:"relay_state"`
	BootstrapPeers []WarpAddrInfo  `json:"bootstrap_peers"`
}

func (NodeInfo) IsBootstrap

func (ni NodeInfo) IsBootstrap() bool

type NodeStats

type NodeStats struct {
	UserId          string          `json:"user_id"`
	NodeID          WarpPeerID      `json:"node_id"`
	Version         *semver.Version `json:"version"`
	PublicAddresses string          `json:"public_addresses"`
	RelayState      string          `json:"relay_state"`

	StartTime string `json:"start_time"`

	NetworkState string `json:"network_state"`

	DatabaseStats  map[string]string `json:"database_stats"`
	ConsensusStats map[string]string `json:"consensus_stats"`
	MemoryStats    map[string]string `json:"memory_stats"`
	CPUStats       map[string]string `json:"cpu_stats"`

	BytesSent     int64 `json:"bytes_sent"`
	BytesReceived int64 `json:"bytes_received"`

	PeersOnline int `json:"peers_online"`
	PeersStored int `json:"peers_stored"`
}

type P2PNode

type P2PNode = host.Host

func NewP2PNode

func NewP2PNode(opts ...libp2p.Option) (P2PNode, error)

type PSK

type PSK = pnet.PSK

type Swarm

type Swarm = swarm.Swarm

type SwarmOption

type SwarmOption = swarm.Option

type TCPOption

type TCPOption = tcp.Option

type TCPTransport

type TCPTransport = tcp.TcpTransport

type WarpAddrInfo

type WarpAddrInfo = peer.AddrInfo

func AddrInfoFromP2pAddr

func AddrInfoFromP2pAddr(m multiaddr.Multiaddr) (*WarpAddrInfo, error)

func AddrInfoFromString

func AddrInfoFromString(s string) (*WarpAddrInfo, error)

type WarpAddress

type WarpAddress = multiaddr.Multiaddr

type WarpAutoNAT added in v0.2.494

type WarpAutoNAT = autonat.AutoNAT

type WarpBatching

type WarpBatching = datastore.Batching

type WarpConnManager added in v0.2.494

type WarpConnManager = coreconnmgr.ConnManager

type WarpDHT

type WarpDHT = dht.IpfsDHT

type WarpError

type WarpError string

func (WarpError) Error

func (e WarpError) Error() string

type WarpEventBus added in v0.2.494

type WarpEventBus = event.Bus

type WarpGossiper

type WarpGossiper interface {
	Close() error
}

interfaces

type WarpIDService added in v0.2.494

type WarpIDService = identify.IDService

type WarpMDNS

type WarpMDNS mdns.Service

types

type WarpNetwork

type WarpNetwork = network.Network

type WarpPeerID

type WarpPeerID = peer.ID

func FromBytesToPeerID

func FromBytesToPeerID(b []byte) WarpPeerID

func FromStringToPeerID

func FromStringToPeerID(s string) WarpPeerID

func IDFromPublicKey added in v0.2.499

func IDFromPublicKey(pk ed25519.PublicKey) (WarpPeerID, error)

type WarpPeerRouting

type WarpPeerRouting = routing.PeerRouting

type WarpPeerstore

type WarpPeerstore = peerstore.Peerstore

func NewPeerstore

func NewPeerstore(ctx context.Context, db datastore.Batching) (WarpPeerstore, error)

type WarpPrivateKey

type WarpPrivateKey p2pCrypto.PrivKey

type WarpProtocolID

type WarpProtocolID = protocol.ID

type WarpProtocolSwitch

type WarpProtocolSwitch = protocol.Switch

type WarpProviderStore

type WarpProviderStore = providers.ProviderStore

type WarpPubInfo added in v0.2.494

type WarpPubInfo struct {
	ID    WarpPeerID `json:"peer_id"`
	Addrs []string   `json:"addrs"`
}

structures

type WarpReachability added in v0.2.494

type WarpReachability = network.Reachability

aliases

type WarpRelayCloser

type WarpRelayCloser interface {
	Close() error
}

interfaces

type WarpRoutingFunc

type WarpRoutingFunc func(node P2PNode) (WarpPeerRouting, error)

type WarpStream

type WarpStream = network.Stream

type WarpStreamHandler

type WarpStreamHandler = network.StreamHandler

type WarpStreamStats

type WarpStreamStats = network.Stats

Jump to

Keyboard shortcuts

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