p2p

package
v0.0.0-...-103dbe2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const DiscoveryInterval = time.Minute

Variables

This section is empty.

Functions

func GetCPUStats

func GetCPUStats()

func GetLoadAverage

func GetLoadAverage() float64

func InitNetwork

func InitNetwork()

Types

type Bootstrapping

type Bootstrapping struct {
	Host host.Host
	// contains filtered or unexported fields
}

type MappedNodes

type MappedNodes struct {
	Active   map[string]*MasterNode
	Inactive map[string]*MasterNode
	Invalid  map[string]*MasterNode
}

type MasterNode

type MasterNode struct {
	ID           peer.ID
	Addrs        []ma.Multiaddr
	Bootstrapper *Bootstrapping

	Context        context.Context
	PubSub         *pubsub.PubSub
	NetworkID      string
	MasterName     string
	MasterServices map[string]bool
	Host           string
	Port           string
	HostID         string
	HostAddrs      []string
	DHT            *dht.IpfsDHT
	ChildrenNodes  []*peer.AddrInfo
	Neighbors      []*MasterNode
	NodeState      *core.State
	// contains filtered or unexported fields
}

func NewMasterNode

func NewMasterNode() *MasterNode

type Network

type Network struct {
	ID string

	Configuration              map[string]string
	MinMasterNodesNeededToBoot int
	MaxConcurrentMasterNodes   int
	CurrentSpeedMBPS           float64
	MasterNodes                MappedNodes
	// contains filtered or unexported fields
}

func (*Network) Bootstrap

func (n *Network) Bootstrap()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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