node

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Active = iota
	Calculate
	Missing
	Recovery
)
View Source
const (
	Cach_prefix_metadata    = "metadata:"
	Cach_prefix_MyLost      = "mylost:"
	Cach_prefix_recovery    = "recovery:"
	Cach_prefix_TargetMiner = "targetminer:"
	Cach_prefix_File        = "file:"
	Cach_prefix_ParseBlock  = "parseblocks"
)

Variables

This section is empty.

Functions

func RenameDir

func RenameDir(oldDir, newDir string) error

Types

type DataDir added in v0.7.0

type DataDir struct {
	DbDir     string
	LogDir    string
	SpaceDir  string
	PoisDir   string
	AccDir    string
	RandomDir string
}

type Node

type Node struct {
	DataDir *DataDir

	sdk.SDK
	confile.Confile
	logger.Logger
	cache.Cache
	*Pois
	// contains filtered or unexported fields
}

func New

func New() *Node

New is used to build a node instance

func (*Node) GetAllPeerID added in v0.7.0

func (n *Node) GetAllPeerID() []peer.ID

func (*Node) GetAllPeerIDMap added in v0.7.0

func (n *Node) GetAllPeerIDMap() map[string]peer.AddrInfo

func (*Node) GetAllPeerIdString added in v0.7.0

func (n *Node) GetAllPeerIdString() []string

func (*Node) GetAllTeeWorkAccount added in v0.6.2

func (n *Node) GetAllTeeWorkAccount() []string

func (*Node) GetAllTeeWorkPeerId added in v0.6.2

func (n *Node) GetAllTeeWorkPeerId() [][]byte

func (*Node) GetAllTeeWorkPeerIdString added in v0.7.0

func (n *Node) GetAllTeeWorkPeerIdString() []string

func (*Node) GetPeer

func (n *Node) GetPeer(peerid string) (peer.AddrInfo, bool)

func (*Node) GetTeeWork added in v0.6.2

func (n *Node) GetTeeWork(account string) ([]byte, bool)

func (*Node) HasPeer

func (n *Node) HasPeer(peerid string) bool

func (*Node) InitPois added in v0.7.0

func (n *Node) InitPois(front, rear, freeSpace, count int64, key_n, key_g big.Int) error

func (*Node) LoadPeersFromDisk added in v0.6.3

func (n *Node) LoadPeersFromDisk(path string) error

func (*Node) RebuildDirs

func (n *Node) RebuildDirs()

func (*Node) RemovePeerIntranetAddr added in v0.6.3

func (n *Node) RemovePeerIntranetAddr()

func (*Node) Run

func (n *Node) Run()

func (*Node) SaveOrUpdatePeerUnSafe added in v0.6.3

func (n *Node) SaveOrUpdatePeerUnSafe(peerid string, addr peer.AddrInfo)

func (*Node) SavePeer

func (n *Node) SavePeer(peerid string, addr peer.AddrInfo)

func (*Node) SavePeersToDisk added in v0.6.3

func (n *Node) SavePeersToDisk(path string) error

func (*Node) SaveTeeWork added in v0.6.2

func (n *Node) SaveTeeWork(account string, peerid []byte)

func (*Node) SetPublickey

func (n *Node) SetPublickey(pubkey []byte) error

type Pois added in v0.7.0

type Pois struct {
	*pois.Prover
	*acc.RsaKey
	pattern.ExpendersInfo
	// contains filtered or unexported fields
}

type RandomList

type RandomList struct {
	Index  []uint32 `json:"index"`
	Random [][]byte `json:"random"`
}

Jump to

Keyboard shortcuts

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