node

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Active = iota
	Calculate
	Missing
	Recovery
)
View Source
const (
	// Record the fid of stored files
	Cach_prefix_File = "file:"
	// Record the block of reported tags
	Cach_prefix_Tag = "tag:"

	Cach_prefix_MyLost      = "mylost:"
	Cach_prefix_recovery    = "recovery:"
	Cach_prefix_TargetMiner = "targetminer:"
	Cach_prefix_ParseBlock  = "parseblocks"
)
View Source
const (
	Unregistered = iota
	UnregisteredPoisKey
	Registered
)
View Source
const (
	Success            = 200
	Error              = 201
	ErrorParam         = 202
	ErrorParamNotFound = 203
	ErrorInternal      = 204
)

Variables

This section is empty.

Functions

func DownloadFragmentFromGW added in v0.8.2

func DownloadFragmentFromGW(url, fpath, account, message, signature string) error

func GetLocalIP added in v0.8.1

func GetLocalIP() (string, error)

func InitMiddlewares added in v0.8.1

func InitMiddlewares() []gin.HandlerFunc

func NewPoisProver added in v0.8.1

func NewPoisProver(expendersInfo chain.ExpendersInfo, freeSpace, count int64, signAccPulickey []byte) (*pois.Prover, error)

func ProcessTeeEndpoint

func ProcessTeeEndpoint(endPoint string) string

func SplitByN

func SplitByN(filePath string, N int64) (Data [][]byte, sep int64, err error)

func WatchMem

func WatchMem()

Types

type DataDir

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

type GenProofResponse

type GenProofResponse struct {
	Sigma     string    `json:"sigma"`
	MU        string    `json:"mu"`
	StatueMsg StatueMsg `json:"statue_msg"`
}

type HashSelf

type HashSelf interface {
	New() *HashSelf
	LoadField(d []byte) error
	CHash() ([]byte, crypto.Hash)
}

type Node

func NewEmptyNode added in v0.8.1

func NewEmptyNode() *Node

func NewNodeWithConfig added in v0.8.1

func NewNodeWithConfig(cfg confile.Confiler) *Node

func (*Node) CalcTag added in v0.8.1

func (n *Node) CalcTag(ch chan<- bool)

func (*Node) CertIdle added in v0.8.1

func (n *Node) CertIdle(ch chan<- bool)

func (*Node) ChallengeMgt added in v0.8.1

func (n *Node) ChallengeMgt(idleChallTaskCh chan bool, serviceChallTaskCh chan bool)

func (*Node) CheckPois added in v0.8.1

func (n *Node) CheckPois(cpus int)

func (*Node) DownloadFragment added in v0.8.2

func (n *Node) DownloadFragment(fid, fragment_hash, savepath string) error

func (*Node) GenIdle added in v0.8.1

func (n *Node) GenIdle(ch chan<- bool)

func (*Node) InitAccRsaKey added in v0.8.1

func (n *Node) InitAccRsaKey(key *acc.RsaKey)

func (*Node) InitCache added in v0.8.1

func (n *Node) InitCache()

func (*Node) InitCacher added in v0.8.1

func (n *Node) InitCacher(cace cache.Cache)

func (*Node) InitChainClient added in v0.8.1

func (n *Node) InitChainClient()

func (*Node) InitChainclient added in v0.8.1

func (n *Node) InitChainclient(cli chain.Chainer)

func (*Node) InitLogger added in v0.8.1

func (n *Node) InitLogger(lg logger.Logger)

func (*Node) InitLogs added in v0.8.1

func (n *Node) InitLogs()

func (*Node) InitMinerPoisInfo added in v0.8.1

func (n *Node) InitMinerPoisInfo(poisInfo *pb.MinerPoisInfo)

func (*Node) InitNode added in v0.8.1

func (n *Node) InitNode() *Node

func (*Node) InitPoisProver added in v0.8.1

func (n *Node) InitPoisProver(p *pois.Prover)

func (*Node) InitRSAKeyPair added in v0.8.1

func (n *Node) InitRSAKeyPair(key *RSAKeyPair)

func (*Node) InitRunStatus added in v0.8.1

func (n *Node) InitRunStatus(st types.Bytes, apiEndpoint string, t string, register bool)

func (*Node) InitRunstatus added in v0.8.1

func (n *Node) InitRunstatus(rt runstatus.Runstatus)

func (*Node) InitTeeRecord added in v0.8.1

func (n *Node) InitTeeRecord(tees record.TeeRecorder)

func (*Node) InitWebServer added in v0.8.1

func (n *Node) InitWebServer(mdls []gin.HandlerFunc, hdl *web.Handler)

func (*Node) InitWorkspace added in v0.8.1

func (n *Node) InitWorkspace(ws string)

func (*Node) Reconnectrpc added in v0.8.1

func (n *Node) Reconnectrpc()

func (*Node) ReplaceIdle added in v0.8.1

func (n *Node) ReplaceIdle(ch chan<- bool)

func (*Node) ReportFiles added in v0.8.1

func (n *Node) ReportFiles(ch chan<- bool)

func (*Node) RestoreFiles added in v0.8.1

func (n *Node) RestoreFiles(ch chan bool)

func (*Node) RestoreLocalFiles added in v0.8.1

func (n *Node) RestoreLocalFiles() error

func (*Node) RestoreOtherFiles added in v0.8.1

func (n *Node) RestoreOtherFiles() error

func (*Node) Start added in v0.8.1

func (n *Node) Start()

func (*Node) SyncTeeInfo added in v0.8.1

func (n *Node) SyncTeeInfo(ch chan<- bool)

type QElement

type QElement struct {
	I int64  `json:"i"`
	V string `json:"v"`
}

type RSAKeyPair

type RSAKeyPair struct {
	Spk *rsa.PublicKey
}

func NewRsaKey

func NewRsaKey(pubkey []byte) (*RSAKeyPair, error)

func (RSAKeyPair) AggrAppendProof

func (keyPair RSAKeyPair) AggrAppendProof(AggrSigma string, aSigma string) (string, bool)

func (RSAKeyPair) AggrGenProof

func (keyPair RSAKeyPair) AggrGenProof(QSlice []QElement, Tag []Tag) string

func (RSAKeyPair) GenProof

func (keyPair RSAKeyPair) GenProof(QSlice []QElement, h HashSelf, Phi []string, Matrix [][]byte) <-chan GenProofResponse

func (*RSAKeyPair) VerifyAttest

func (r *RSAKeyPair) VerifyAttest(name, u, phiHash, attest, customData string) (bool, error)

type StatueMsg

type StatueMsg struct {
	StatusCode int    `json:"status"`
	Msg        string `json:"msg"`
}

type T

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

type Tag

type Tag struct {
	T       T      `json:"t"`
	PhiHash string `json:"phi_hash"`
	Attest  string `json:"attest"`
}

type TagfileType

type TagfileType struct {
	Tag          *pb.Tag `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
	USig         []byte  `protobuf:"bytes,2,opt,name=u_sig,json=uSig,proto3" json:"u_sig,omitempty"`
	Signature    []byte  `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
	FragmentName []byte  `protobuf:"bytes,4,opt,name=fragment_name,json=fragmentName,proto3" json:"fragment_name,omitempty"`
	TeeAccountId []byte  `protobuf:"bytes,5,opt,name=tee_account_id,json=teeAccountId,proto3" json:"tee_account_id,omitempty"`
	Index        uint16  `protobuf:"bytes,6,opt,name=index,json=index,proto3" json:"index,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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