client

package
v0.0.32 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const PrivatekeyFile = ".private"

Variables

This section is empty.

Functions

func ExtractSegmenthash

func ExtractSegmenthash(segment []SegmentInfo) []string

Types

type ChallengeInfo added in v0.0.26

type ChallengeInfo struct {
	Random []byte
	Start  uint32
}

type ChallengeSnapshot added in v0.0.30

type ChallengeSnapshot struct {
	NetSnapshot   NetSnapshot
	MinerSnapshot []MinerSnapshot
}

type Cli

type Cli struct {
	chain.Chain
	*protocol.Protocol
}

func (*Cli) CheckBucketName added in v0.0.2

func (c *Cli) CheckBucketName(bucketname string) bool

func (*Cli) CheckSpaceUsageAuthorization added in v0.0.30

func (c *Cli) CheckSpaceUsageAuthorization(puk []byte) (bool, error)

func (*Cli) DeleteFiles added in v0.0.30

func (c *Cli) DeleteFiles(owner []byte, roothash string) (string, string, error)

func (*Cli) GenerateStorageOrder

func (c *Cli) GenerateStorageOrder(roothash string, segment []SegmentInfo, owner []byte, filename, buckname string) error

func (*Cli) GetFile added in v0.0.20

func (c *Cli) GetFile(roothash, dir string) (string, error)

func (*Cli) IncreaseSminerStakes added in v0.0.30

func (c *Cli) IncreaseSminerStakes(token string) (string, error)

func (*Cli) ProcessingData

func (c *Cli) ProcessingData(path string) ([]SegmentInfo, string, error)

func (*Cli) PutFile

func (c *Cli) PutFile(owner []byte, segmentInfo []SegmentInfo, roothash, filename, bucketname string) (uint8, error)

func (*Cli) QuaryAuthorizedAcc added in v0.0.30

func (c *Cli) QuaryAuthorizedAcc(puk []byte) (string, error)

func (*Cli) QueryAllBucketName added in v0.0.30

func (c *Cli) QueryAllBucketName(owner []byte) ([]string, error)

func (*Cli) QueryAssignedMiner

func (c *Cli) QueryAssignedMiner(minerTaskList []chain.MinerTaskList) ([]string, error)

func (*Cli) QueryChallenge added in v0.0.26

func (c *Cli) QueryChallenge(pubkey []byte) (ChallengeInfo, error)

func (*Cli) QueryChallengeSt added in v0.0.30

func (c *Cli) QueryChallengeSt() (ChallengeSnapshot, error)

func (*Cli) QueryNodeConnectionSt added in v0.0.30

func (c *Cli) QueryNodeConnectionSt() bool

func (*Cli) QueryNodeSynchronizationSt added in v0.0.30

func (c *Cli) QueryNodeSynchronizationSt() (bool, error)

func (*Cli) QueryTeeWorkerList added in v0.0.27

func (c *Cli) QueryTeeWorkerList() ([]TeeWorkerSt, error)

func (*Cli) QueryTeeWorkerPeerID added in v0.0.27

func (c *Cli) QueryTeeWorkerPeerID(puk []byte) ([]byte, error)

func (*Cli) QueryUserSpaceSt added in v0.0.30

func (c *Cli) QueryUserSpaceSt(puk []byte) (UserSpaceSt, error)

func (*Cli) RegisterRole added in v0.0.30

func (c *Cli) RegisterRole(name string, income string, pledge uint64) (string, error)

func (*Cli) ReplaceFile added in v0.0.17

func (c *Cli) ReplaceFile(roothash []string) (string, []string, error)

func (*Cli) ReportFiles added in v0.0.30

func (c *Cli) ReportFiles(roothash []string) (string, []string, error)

func (*Cli) Sign added in v0.0.31

func (c *Cli) Sign(msg []byte) ([]byte, error)

func (*Cli) StorageData

func (c *Cli) StorageData(roothash string, segment []SegmentInfo, minerTaskList []chain.MinerTaskList) error

func (*Cli) SubmitIdleFile added in v0.0.6

func (c *Cli) SubmitIdleFile(size uint64, blockNum, blocksize, scansize uint32, pubkey []byte, hash string) (string, error)

func (*Cli) UpdateIncomeAccount added in v0.0.24

func (c *Cli) UpdateIncomeAccount(income string) (string, error)

func (*Cli) UpdateRoleAddress added in v0.0.30

func (c *Cli) UpdateRoleAddress(name string) (string, error)

func (*Cli) Workspace added in v0.0.4

func (c *Cli) Workspace() string

type Client

type Client interface {
	Workspace() string
	RegisterRole(name string, income string, pledge uint64) (string, error)
	QueryAllBucketName(owner []byte) ([]string, error)
	CheckSpaceUsageAuthorization(puk []byte) (bool, error)
	QueryUserSpaceSt(puk []byte) (UserSpaceSt, error)
	QueryChallengeSt() (ChallengeSnapshot, error)
	QueryChallenge(puk []byte) (ChallengeInfo, error)
	QueryTeeWorkerPeerID(puk []byte) ([]byte, error)
	QueryTeeWorkerList() ([]TeeWorkerSt, error)
	CheckBucketName(bucketname string) bool
	ProcessingData(path string) ([]SegmentInfo, string, error)
	PutFile(owner []byte, segmentInfo []SegmentInfo, roothash, filename, bucketname string) (uint8, error)
	GetFile(roothash, dir string) (string, error)
	DeleteFiles(owner []byte, roothash string) (string, string, error)
	UpdateRoleAddress(name string) (string, error)
	UpdateIncomeAccount(income string) (string, error)
	SubmitIdleFile(size uint64, blockNum, blocksize, scansize uint32, pubkey []byte, hash string) (string, error)
	ReportFiles(roothash []string) (string, []string, error)
	ReplaceFile(roothash []string) (string, []string, error)
	IncreaseSminerStakes(token string) (string, error)
}

func NewBasicCli

func NewBasicCli(rpc []string, name, phase, workspace, addr string, port int, timeout time.Duration) (Client, error)

type MinerSnapshot added in v0.0.30

type MinerSnapshot struct {
	Miner         string
	Idle_space    string
	Service_space string
}

type NetSnapshot added in v0.0.30

type NetSnapshot struct {
	Start               uint32
	Total_reward        string
	Total_idle_space    string
	Total_service_space string
	Random              []byte
}

type SegmentInfo

type SegmentInfo struct {
	SegmentHash  string
	FragmentHash []string
}

type TeeWorkerSt added in v0.0.30

type TeeWorkerSt struct {
	Controller_account string
	Peer_id            []byte
	Node_key           []byte
	Stash_account      string
}

type UserSpaceSt added in v0.0.30

type UserSpaceSt struct {
	TotalSpace     string
	UsedSpace      string
	LockedSpace    string
	RemainingSpace string
	State          string
	Start          uint32
	Deadline       uint32
}

Jump to

Keyboard shortcuts

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