Documentation
¶
Index ¶
- Constants
- Variables
- func CompareSlice(s1, s2 []byte) bool
- type AllProofInfo
- type BucketInfo
- type Chain
- type ChallengeSnapShot
- type EventRecords
- type Event_AlreadyFrozen
- type Event_Balances_Withdraw
- type Event_BuyFile
- type Event_BuySpace
- type Event_CalculateEnd
- type Event_ChallengeProof
- type Event_ClearInvalidFile
- type Event_CreateBucket
- type Event_DeleteBucket
- type Event_DeleteFile
- type Event_Deposit
- type Event_DrawFaucetMoney
- type Event_ExpansionSpace
- type Event_FaucetTopUpMoney
- type Event_FileChangeState
- type Event_FileUpdate
- type Event_FileUpload
- type Event_FillerUpload
- type Event_GenerateChallenge
- type Event_IncreaseCollateral
- type Event_InsertFileSlice
- type Event_LeaseExpireIn24Hours
- type Event_LeaseExpired
- type Event_LessThan24Hours
- type Event_MinerClaim
- type Event_MinerExit
- type Event_OssDestroy
- type Event_OssRegister
- type Event_OssUpdate
- type Event_Purchased
- type Event_Receive
- type Event_ReceiveSpace
- type Event_RecoverFile
- type Event_Registered
- type Event_RegistrationScheduler
- type Event_RenewalSpace
- type Event_ReplaceFiller
- type Event_SignedPhaseStarted
- type Event_SolutionStored
- type Event_SubmitProof
- type Event_TransferReport
- type Event_UnsignedPhaseStarted
- type Event_UpdataBeneficiary
- type Event_UpdataIp
- type Event_UpdateScheduler
- type Event_UploadDeclaration
- type Event_VerifyProof
- type Event_Withdraw
- type FileHash
- type FileMetadata
- type FragmentList
- type IdleMetadata
- type MinerInfo
- type MinerSnapShot
- type MinerTaskList
- type NetSnapShot
- type NodePublickey
- type PeerId
- type ProveInfo
- type Random
- type RewardInfo
- type RewardOrder
- type SegmentInfo
- type SegmentList
- type StorageOrder
- type SysProperties
- type SysSyncState
- type TeePodr2Pk
- type TeeWorkerInfo
- type UserBrief
- type UserSpaceInfo
Constants ¶
View Source
const ( // AUDIT = "Audit" // OSS is a module about DeOSS OSS = "Oss" // FILEBANK is a module about data metadata, bucket info, etc. FILEBANK = "FileBank" // TEEWOEKER is a module about TEE TEEWORKER = "TeeWorker" // SMINER is a module about storage miners SMINER = "Sminer" // SMINER is a module about storage miners STORAGEHANDLER = "StorageHandler" // SYSTEM is a module about the system SYSTEM = "System" )
Pallets
View Source
const ( //AUDIT UNVERIFYPROOF = "UnverifyProof" // OSS // OSS AUTHORITYLIST = "AuthorityList" // SMINER ALLMINER = "AllMiner" MINERITEMS = "MinerItems" // TEEWORKER TEEWORKERMAP = "TeeWorkerMap" TEEPODR2Pk = "TeePodr2Pk" // FILEBANK FILE = "File" BUCKET = "Bucket" BUCKETLIST = "UserBucketList" DEALMAP = "DealMap" PENDINGREPLACE = "PendingReplacements" // STORAGEHANDLER USERSPACEINFO = "UserOwnedSpace" UNITPRICE = "UnitPrice" // NETSNAPSHOT CHALLENGESNAPSHOT = "ChallengeSnapShot" // SYSTEM ACCOUNT = "Account" EVENTS = "Events" )
Chain state
View Source
const ( //AUDIT TX_AUDIT_SUBMITPROOF = AUDIT + DOT + "submit_proof" // OSS TX_OSS_REGISTER = OSS + DOT + "register" TX_OSS_UPDATE = OSS + DOT + "update" TX_OSS_DESTORY = OSS + DOT + "destroy" // SMINER TX_SMINER_REGISTER = SMINER + DOT + "regnstk" TX_SMINER_INCREASESTAKES = SMINER + DOT + "increase_collateral" TX_SMINER_UPDATEPEERID = SMINER + DOT + "update_peer_id" TX_SMINER_UPDATEINCOME = SMINER + DOT + "update_beneficiary" TX_SMINER_CLAIMREWARD = FILEBANK + DOT + "receive_reward" // FILEBANK TX_FILEBANK_PUTBUCKET = FILEBANK + DOT + "create_bucket" TX_FILEBANK_DELBUCKET = FILEBANK + DOT + "delete_bucket" TX_FILEBANK_DELFILE = FILEBANK + DOT + "delete_file" TX_FILEBANK_UPLOADDEC = FILEBANK + DOT + "upload_declaration" TX_FILEBANK_UPLOADFILLER = FILEBANK + DOT + "upload_filler" TX_FILEBANK_FILEREPORT = FILEBANK + DOT + "transfer_report" TX_FILEBANK_REPLACEFILE = FILEBANK + DOT + "replace_file_report" TX_FILEBANK_MINEREXITPREP = FILEBANK + DOT + "miner_exit_prep" TX_FILEBANK_WITHDRAW = FILEBANK + DOT + "withdraw" )
Extrinsics
View Source
const ( // System RPC_SYS_Properties = "system_properties" RPC_SYS_SyncState = "system_syncState" RPC_SYS_Version = "system_version" //Net RPC_NET_Listening = "net_listening" )
RPC Call
View Source
const ( Role_OSS = "OSS" Role_DEOSS = "DEOSS" Role_BUCKET = "BUCKET" )
View Source
const ( Active = iota Calculate Missing Recovery )
View Source
const ( MINER_STATE_POSITIVE = "positive" MINER_STATE_FROZEN = "frozen" MINER_STATE_EXIT = "exit" MINER_STATE_LOCK = "lock" )
View Source
const ( ERR_Failed = "failed" ERR_Timeout = "timeout" ERR_Empty = "empty" )
View Source
const DOT = "."
DOT is "." character
View Source
const TokenPrecision_CESS = "000000000000"
Unit precision of CESS token
Variables ¶
Functions ¶
func CompareSlice ¶ added in v0.0.42
Types ¶
type AllProofInfo ¶ added in v0.0.43
type BucketInfo ¶
type Chain ¶
type Chain interface {
// QueryBlockHeight queries the block height corresponding to the block hash,
// If the blockhash is empty, query the latest block height.
QueryBlockHeight(blockhash string) (uint32, error)
// QueryNodeSynchronizationSt returns the synchronization status of the current node.
QueryNodeSynchronizationSt() (bool, error)
// QueryNodeConnectionSt queries the connection status of the node.
QueryNodeConnectionSt() bool
// QueryDeoss queries deoss information.
QueryDeoss(pubkey []byte) ([]byte, error)
// QuaryAuthorizedAcc queries the account authorized by puk.
QuaryAuthorizedAcc(puk []byte) (types.AccountID, error)
// QueryBucketInfo queries the information of the "bucketname" bucket of the puk.
QueryBucketInfo(puk []byte, bucketname string) (BucketInfo, error)
// QueryBucketList queries all buckets of the puk.
QueryBucketList(puk []byte) ([]types.Bytes, error)
// QueryFileMetaInfo queries the metadata of the roothash file.
QueryFileMetadata(roothash string) (FileMetadata, error)
// QueryStorageMiner queries storage node information.
QueryStorageMiner(puk []byte) (MinerInfo, error)
// QuerySminerList queries the accounts of all storage miners.
QuerySminerList() ([]types.AccountID, error)
// QueryAccountInfo query account information.
QueryAccountInfo(puk []byte) (types.AccountInfo, error)
// QueryStorageOrder query storage order information.
QueryStorageOrder(roothash string) (StorageOrder, error)
// QueryPendingReplacements queries the amount of idle data that can be replaced.
QueryPendingReplacements(puk []byte) (uint32, error)
// QueryUserSpaceInfo queries the space information purchased by the user.
QueryUserSpaceInfo(puk []byte) (UserSpaceInfo, error)
// QuerySpacePricePerGib query space price per GiB.
QuerySpacePricePerGib() (string, error)
// QueryChallengeSnapshot query challenge information snapshot.
QueryChallengeSnapshot() (ChallengeSnapShot, error)
// QueryTeePodr2Puk queries the public key of the TEE.
QueryTeePodr2Puk() ([]byte, error)
// QueryTeePeerID queries the peerid of the Tee worker.
QueryTeePeerID(puk []byte) ([]byte, error)
// QueryTeeInfoList queries the information of all tee workers.
QueryTeeInfoList() ([]TeeWorkerInfo, error)
//
QueryUnverifyProof() ([]AllProofInfo, error)
// Register is used to register OSS or BUCKET roles.
Register(role string, puk []byte, income string, pledge uint64) (string, error)
// UpdateAddress updates the address of oss or sminer.
UpdateAddress(role, multiaddr string) (string, error)
// UpdateIncomeAcc update income account.
UpdateIncomeAcc(puk []byte) (string, error)
// CreateBucket creates a bucket for puk.
CreateBucket(puk []byte, bucketname string) (string, error)
// DeleteBucket deletes buckets for puk.
DeleteBucket(puk []byte, bucketname string) (string, error)
// DeleteFile deletes files for puk.
DeleteFile(puk []byte, roothash []string) (string, []FileHash, error)
// UploadDeclaration creates a storage order.
UploadDeclaration(roothash string, dealinfo []SegmentList, user UserBrief) (string, error)
// SubmitIdleMetadata Submit idle file metadata.
SubmitIdleMetadata(teeAcc []byte, idlefiles []IdleMetadata) (string, error)
// SubmitFileReport submits a stored file report.
SubmitFileReport(roothash []FileHash) (string, []FileHash, error)
// ReplaceIdleFiles replaces idle files.
ReplaceIdleFiles(roothash []FileHash) (string, []FileHash, error)
// IncreaseStakes increase stakes.
IncreaseStakes(tokens *big.Int) (string, error)
// Exit exit the cess network.
Exit(role string) (string, error)
// ClaimRewards is used to claim rewards
ClaimRewards() (string, error)
// Withdraw is used to withdraw staking
Withdraw() (string, error)
//
ReportProof(idlesigma, servicesigma string) (string, error)
// ExtractAccountPuk extracts the public key of the account,
// and returns its own public key if the account is empty.
ExtractAccountPuk(account string) ([]byte, error)
// GetSignatureAcc returns the signature account.
GetSignatureAcc() string
// GetSignatureURI to get the private key of the signing account
GetSignatureURI() string
// GetSubstrateAPI returns Substrate API
GetSubstrateAPI() *gsrpc.SubstrateAPI
// GetChainState returns chain node state
GetChainState() bool
//
SetChainState(state bool)
//
Reconnect() error
//
GetMetadata() *types.Metadata
//
GetKeyEvents() types.StorageKey
//
SysProperties() (SysProperties, error)
//
SyncState() (SysSyncState, error)
//
SysVersion() (string, error)
//
NetListening() (bool, error)
}
type ChallengeSnapShot ¶ added in v0.0.29
type ChallengeSnapShot struct {
NetSnapshot NetSnapShot
MinerSnapShot []MinerSnapShot
}
type EventRecords ¶
type EventRecords struct {
// AUDIT
Audit_VerifyProof []Event_VerifyProof
Audit_SubmitProof []Event_SubmitProof
Audit_GenerateChallenge []Event_GenerateChallenge
// SMINER
Sminer_Registered []Event_Registered
Sminer_DrawFaucetMoney []Event_DrawFaucetMoney
Sminer_FaucetTopUpMoney []Event_FaucetTopUpMoney
Sminer_LessThan24Hours []Event_LessThan24Hours
Sminer_AlreadyFrozen []Event_AlreadyFrozen
Sminer_MinerExit []Event_MinerExit
Sminer_MinerClaim []Event_MinerClaim
Sminer_IncreaseCollateral []Event_IncreaseCollateral
Sminer_Deposit []Event_Deposit
Sminer_UpdataBeneficiary []Event_UpdataBeneficiary
Sminer_UpdataIp []Event_UpdataIp
Sminer_Receive []Event_Receive
Sminer_Withdraw []Event_Withdraw
// FILEBANK
FileBank_DeleteFile []Event_DeleteFile
FileBank_FileUpload []Event_FileUpload
FileBank_FileUpdate []Event_FileUpdate
FileBank_FileChangeState []Event_FileChangeState
FileBank_BuyFile []Event_BuyFile
FileBank_Purchased []Event_Purchased
FileBank_InsertFileSlice []Event_InsertFileSlice
FileBank_FillerUpload []Event_FillerUpload
FileBank_ClearInvalidFile []Event_ClearInvalidFile
FileBank_RecoverFile []Event_RecoverFile
FileBank_ReceiveSpace []Event_ReceiveSpace
FileBank_UploadDeclaration []Event_UploadDeclaration
FileBank_CreateBucket []Event_CreateBucket
FileBank_DeleteBucket []Event_DeleteBucket
FileBank_TransferReport []Event_TransferReport
FileBank_ReplaceFiller []Event_ReplaceFiller
FileBank_CalculateEnd []Event_CalculateEnd
// StorageHandler
StorageHandler_BuySpace []Event_BuySpace
StorageHandler_ExpansionSpace []Event_ExpansionSpace
StorageHandler_RenewalSpace []Event_RenewalSpace
StorageHandler_LeaseExpired []Event_LeaseExpired
StorageHandler_LeaseExpireIn24Hours []Event_LeaseExpireIn24Hours
// TeeWorker
TeeWorker_RegistrationScheduler []Event_RegistrationScheduler
TeeWorker_UpdateScheduler []Event_UpdateScheduler
// OSS
Oss_OssRegister []Event_OssRegister
Oss_OssUpdate []Event_OssUpdate
Oss_OssDestroy []Event_OssDestroy
// System
types.EventRecords
}
Events
type Event_AlreadyFrozen ¶
type Event_Balances_Withdraw ¶
type Event_BuyFile ¶
type Event_BuySpace ¶
type Event_BuySpace struct {
Phase types.Phase
Acc types.AccountID
Storage_capacity types.U128
Spend types.U128
Topics []types.Hash
}
------------------------StorageHandler--------------------------------
type Event_CalculateEnd ¶ added in v0.0.11
type Event_ChallengeProof ¶
type Event_ChallengeProof struct {
Phase types.Phase
Miner types.AccountID
Fileid types.Bytes
Topics []types.Hash
}
------------------------Audit-------------------
type Event_ClearInvalidFile ¶
type Event_CreateBucket ¶
type Event_DeleteBucket ¶
type Event_DeleteFile ¶
type Event_DeleteFile struct {
Phase types.Phase
Operator types.AccountID
Owner types.AccountID
Filehash []FileHash
Topics []types.Hash
}
------------------------FileBank----------------------
type Event_Deposit ¶
type Event_DrawFaucetMoney ¶
type Event_ExpansionSpace ¶
type Event_FaucetTopUpMoney ¶
type Event_FileChangeState ¶
type Event_FileUpdate ¶
type Event_FileUpload ¶
type Event_FillerUpload ¶
type Event_GenerateChallenge ¶ added in v0.0.43
type Event_InsertFileSlice ¶
type Event_LeaseExpired ¶
type Event_LessThan24Hours ¶
type Event_MinerClaim ¶
type Event_MinerExit ¶
type Event_OssDestroy ¶ added in v0.0.24
type Event_OssRegister ¶
type Event_OssRegister struct {
Phase types.Phase
Acc types.AccountID
Endpoint types.Bytes
Topics []types.Hash
}
------------------------Oss---------------------------
type Event_OssUpdate ¶
type Event_Purchased ¶
type Event_Receive ¶ added in v0.0.34
type Event_ReceiveSpace ¶
type Event_RecoverFile ¶
type Event_Registered ¶
type Event_Registered struct {
Phase types.Phase
Acc types.AccountID
StakingVal types.U128
Topics []types.Hash
}
------------------------Sminer------------------------
type Event_RegistrationScheduler ¶
type Event_RegistrationScheduler struct {
Phase types.Phase
Acc types.AccountID
Ip types.Bytes
Topics []types.Hash
}
------------------------TEE Worker--------------------
type Event_RenewalSpace ¶
type Event_ReplaceFiller ¶ added in v0.0.11
type Event_SolutionStored ¶
type Event_SubmitProof ¶ added in v0.0.43
type Event_TransferReport ¶ added in v0.0.11
type Event_UnsignedPhaseStarted ¶
------------------------System------------------------
type Event_UpdataBeneficiary ¶
type Event_UpdataIp ¶
type Event_UpdateScheduler ¶
type Event_UploadDeclaration ¶
type Event_VerifyProof ¶
type Event_Withdraw ¶ added in v0.0.37
type FileMetadata ¶ added in v0.0.29
type FragmentList ¶
type IdleMetadata ¶ added in v0.0.29
type MinerSnapShot ¶ added in v0.0.26
type MinerTaskList ¶
type NetSnapShot ¶ added in v0.0.26
type NodePublickey ¶ added in v0.0.28
type ProveInfo ¶ added in v0.0.43
type ProveInfo struct {
SnapShot MinerSnapShot
IdleProve types.Bytes
ServiceProve types.Bytes
}
type RewardInfo ¶
type RewardOrder ¶ added in v0.0.34
type SegmentInfo ¶
type SegmentInfo struct {
Hash FileHash
FragmentList []FragmentList
}
type SegmentList ¶
type StorageOrder ¶
type StorageOrder struct {
Stage types.U8
Count types.U8
SegmentList []SegmentList
NeededList []SegmentList
User UserBrief
AssignedMiner []MinerTaskList
CompleteList []types.AccountID
}
type SysProperties ¶ added in v0.0.39
type SysSyncState ¶ added in v0.0.39
type TeePodr2Pk ¶ added in v0.0.27
type TeeWorkerInfo ¶ added in v0.0.27
Click to show internal directories.
Click to hide internal directories.