node

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Active = iota
	Calculate
	Missing
	Recovery
)
View Source
const (
	Cach_prefix_metadata = "metadata:"
	//Cach_prefix_report       = "report:"
	Cach_prefix_idle         = "idle:"
	Cach_prefix_idleSiama    = "sigmaidle:"
	Cach_prefix_serviceSiama = "sigmaservice:"
	// Cach_AggrProof_Reported    = "AggrProofReported"
	Cach_AggrProof_Transfered  = "AggrProofTransfered"
	Cach_IdleChallengeBlock    = "ChallengeIdleBlock"
	Cach_ServiceChallengeBlock = "ChallengeServiceBlock"
	Cach_prefix_MyLost         = "mylost:"
	Cach_prefix_recovery       = "recovery:"
	Cach_prefix_TargetMiner    = "targetminer:"
	Cach_prefix_File           = "file:"
	Cach_prefix_ParseBlock     = "parseblocks"
)
View Source
const MaxReplaceFiles = 30
View Source
const P2PResponseOK uint32 = 200

Variables

This section is empty.

Functions

func RenameDir

func RenameDir(oldDir, newDir string) error

func SelectIdleFiles

func SelectIdleFiles(dir string, count uint32) ([]string, error)

Types

type Bucket

type Bucket interface {
	Run()
}

type Node

type Node struct {
	confile.Confile
	logger.Logger
	cache.Cache
	sdk.SDK
	// contains filtered or unexported fields
}

func New

func New() *Node

New is used to build a node instance

func (*Node) GetAllPeerId

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

func (*Node) GetPeer

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

func (*Node) HasPeer

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

func (*Node) RebuildDirs

func (n *Node) RebuildDirs()

func (*Node) Run

func (n *Node) Run()

func (*Node) SavePeer

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

func (*Node) SetPublickey

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

func (*Node) TaskMgt

func (n *Node) TaskMgt()

type ProofFileType

type ProofFileType struct {
	Names []string `json:"names"`
	Us    []string `json:"us"`
	Mus   []string `json:"mus"`
	Sigma string   `json:"sigma"`
}

type RandomList

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

type T

type T struct {
	Name string   `json:"name"`
	U    string   `json:"u"`
	Phi  []string `json:"phi"`
}

Jump to

Keyboard shortcuts

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