dogenet

package
v0.0.0-...-23a77d0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const CoreNodeListeners = 0
View Source
const DogeNetConnections = 4
View Source
const GobFilePath = "netmap.gob"

Variables

This section is empty.

Functions

func DogeNet

func DogeNet(localNode string)

func NewMapSaver

func NewMapSaver() governor.Service

Types

type MapSaver

type MapSaver struct {
	governor.ServiceCtx
}

func (*MapSaver) Run

func (m *MapSaver) Run()

type NetMap

type NetMap struct {
	// contains filtered or unexported fields
}
var Map NetMap // persistent network map

func NewNetMap

func NewNetMap() NetMap

func (*NetMap) AddNewNode

func (t *NetMap) AddNewNode(address net.IP, port uint16)

func (*NetMap) AddNode

func (t *NetMap) AddNode(address net.IP, port uint16, time uint32, services uint64)

func (*NetMap) ChooseNode

func (t *NetMap) ChooseNode() string

func (*NetMap) Payload

func (t *NetMap) Payload() (res []spec.Payload)

func (*NetMap) ReadGob

func (t *NetMap) ReadGob(path string) error

func (*NetMap) Stats

func (t *NetMap) Stats() (mapSize int, newNodes int)

func (*NetMap) Trim

func (t *NetMap) Trim()

func (*NetMap) UpdateTime

func (t *NetMap) UpdateTime(address string)

func (*NetMap) WriteGob

func (t *NetMap) WriteGob(path string) error

type NetMapState

type NetMapState struct {
	Nodes     NodeAddressMap // node address -> timstamp, services
	NewNodes  []string       // queue of newly discovered nodes (high priority)
	SeedNodes []string       // queue of seed nodes (low priority)
	// contains filtered or unexported fields
}

type NodeAddressMap

type NodeAddressMap map[string]NodeInfo

type NodeInfo

type NodeInfo struct {
	Time     uint32
	Services uint64
}

Jump to

Keyboard shortcuts

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