This section describes the definition of cess chain data types.
const (
// unit precision of CESS token
TokenPrecision_CESS = "000000000000000000"
// the minimum account balance required for transaction
MinTransactionBalance = "1000000000000000000"
// staking per TiB of space for storage miner, the unit is CESS
StakingStakePerTiB = 4000
// block packing interval, the unit is second
BlockIntervalSec = 6
// treasury account
TreasuryAccount = "cXhT9Xh3DhrBMDmXcGeMPDmTzDm1J8vDxBtKvogV33pPshnWS"
// number of data slices after redundancy
DataShards = 4
// number of redundant slices after redundancy
ParShards = 8
// maximum length of gateway domain names
MaxDomainNameLength = 100
// maximum number of segments in a file
MaxSegmentNum = 1000
// sdk default name
CharacterName_Default = "cess-sdk-go"
// offcial gateway address
PublicGatewayAddr = "http://deoss-pub-gateway.cess.network/"
// offcial gateway account
PublicGatewayAccount = "cXhwBytXqrZLr1qM5NHJhCzEMckSTzNKw17ci2aHft6ETSQm9"
)const (
FileHashLen = 64
RandomLen = 20
PeerIdPublicKeyLen = 38
PoISKeyLen = 256
TeeSignatureLen = 256
AccumulatorLen = 256
SpaceChallengeParamLen = 8
BloomFilterLen = 256
WorkerPublicKeyLen = 32
MasterPublicKeyLen = 32
EcdhPublicKeyLen = 32
TeeSigLen = 64
RrscAppPublicLen = 32
)type FileHash [FileHashLen]types.U8
type Random [RandomLen]types.U8
type PeerId [PeerIdPublicKeyLen]types.U8
type PoISKey_G [PoISKeyLen]types.U8
type PoISKey_N [PoISKeyLen]types.U8
type TeeSignature [TeeSignatureLen]types.U8
type Accumulator [AccumulatorLen]types.U8
type SpaceChallengeParam [SpaceChallengeParamLen]types.U64
type BloomFilter [BloomFilterLen]types.U64
type WorkerPublicKey [WorkerPublicKeyLen]types.U8
type MasterPublicKey [MasterPublicKeyLen]types.U8
type EcdhPublicKey [EcdhPublicKeyLen]types.U8
type TeeSig [TeeSigLen]types.U8
type RrscAppPublic [RrscAppPublicLen]types.U8
type AppPublicType [4]types.U8var RrscAppPublicType = AppPublicType{'r', 'r', 's', 'c'}
var AudiAppPublicType = AppPublicType{'a', 'u', 'd', 'i'}
var GranAppPublicType = AppPublicType{'g', 'r', 'a', 'n'}
var ImonAppPublicType = AppPublicType{'i', 'm', 'o', 'n'}type ChallengeInfo struct {
MinerSnapshot MinerSnapShot
ChallengeElement ChallengeElement
ProveInfo ProveInfo
}
type MinerSnapShot struct {
IdleSpace types.U128
ServiceSpace types.U128
ServiceBloomFilter BloomFilter
SpaceProofInfo SpaceProofInfo
TeeSig TeeSig
}
type ChallengeElement struct {
Start types.U32
IdleSlip types.U32
ServiceSlip types.U32
VerifySlip types.U32
SpaceParam SpaceChallengeParam
ServiceParam QElement
}
type ProveInfo struct {
Assign types.U8
IdleProve types.Option[IdleProveInfo]
ServiceProve types.Option[ServiceProveInfo]
}
type QElement struct {
Index []types.U32
Value []Random
}
type IdleProveInfo struct {
TeePubkey WorkerPublicKey
IdleProve types.Bytes
VerifyResult types.Option[bool]
}
type ServiceProveInfo struct {
TeePubkey WorkerPublicKey
ServiceProve types.Bytes
VerifyResult types.Option[bool]
}type PoISKeyInfo struct {
G PoISKey_G
N PoISKey_N
}type SpaceProofInfo struct {
Miner types.AccountID
Front types.U64
Rear types.U64
PoisKey PoISKeyInfo
Accumulator Accumulator
}type ConsensusRrscAppPublic struct {
Public RrscAppPublic
Unknown types.U64
}type OssInfo struct {
Peerid PeerId
Domain types.Bytes
}type StorageOrder struct {
FileSize types.U128
SegmentList []SegmentList
User UserBrief
CompleteList []CompleteInfo
}
type CompleteInfo struct {
Index types.U8
Miner types.AccountID
}type SegmentList struct {
SegmentHash FileHash
FragmentHash []FileHash
}type FileMetadata struct {
SegmentList []SegmentInfo
Owner []UserBrief
FileSize types.U128
Completion types.U32
State types.U8
}
type FragmentInfo struct {
Hash FileHash
Avail types.Bool
Tag types.Option[types.U32]
Miner types.AccountID
}type SegmentInfo struct {
Hash FileHash
FragmentList []FragmentInfo
}type UserBrief struct {
User types.AccountID
FileName types.Bytes
TerriortyName types.Bytes
}type RestoralOrderInfo struct {
Count types.U32
Miner types.AccountID
OriginMiner types.AccountID
FragmentHash FileHash
FileHash FileHash
GenBlock types.U32
Deadline types.U32
}type TagSigInfo struct {
Miner types.AccountID
Digest []DigestInfo
Filehash FileHash
}type SchedulerCounterEntry struct {
ProceedBlockSize uint64
PunishmentCount uint32
}type ExpendersInfo struct {
K types.U64
N types.U64
D types.U64
}type MinerInfo struct {
BeneficiaryAccount types.AccountID
StakingAccount types.AccountID
Endpoint types.Bytes
Collaterals types.U128
Debt types.U128
State types.Bytes // positive, exit, frozen, lock
DeclarationSpace types.U128
IdleSpace types.U128
ServiceSpace types.U128
LockSpace types.U128
SpaceProofInfo types.Option[SpaceProofInfo]
ServiceBloomFilter BloomFilter
TeeSig TeeSig
}type MinerReward struct {
TotalReward types.U128
RewardIssued types.U128
OrderList []RewardOrder
}type RestoralTargetInfo struct {
Miner types.AccountID
ServiceSpace types.U128
RestoredSpace types.U128
CoolingBlock types.U32
}type StakingEraRewardPoints struct {
Total types.U32
Individual []Individual
}type StakingNominations struct {
Targets []types.AccountID
SubmittedIn types.U32
Suppressed types.Bool
}type StakingLedger struct {
Stash types.AccountID
Total types.UCompact
Active types.UCompact
Unlocking []UnlockChunk
ClaimedRewards []types.U32
}type StakingExposure struct {
Total types.UCompact
Own types.UCompact
Others []OtherStakingExposure
}type UserFileSliceInfo struct {
TerritoryName types.Bytes
Filehash FileHash
FileSize types.U128
}type KeyOwnerParam struct {
PublicType AppPublicType
Public types.Bytes
}type RewardOrder struct {
ReceiveCount types.U8
MaxCount types.U8
Atonce types.Bool
OrderReward types.U128
EachAmount types.U128
LastReceiveBlock types.U32
}type UserSpaceInfo struct {
TotalSpace types.U128
UsedSpace types.U128
LockedSpace types.U128
RemainingSpace types.U128
Start types.U32
Deadline types.U32
State types.Bytes
}type TerritoryInfo struct {
Token types.H256
TotalSpace types.U128
UsedSpace types.U128
LockedSpace types.U128
RemainingSpace types.U128
Start types.U32
Deadline types.U32
State types.U8 //0: Active 1: Frozen 2: Expired 3: OnConsignment
}type ConsignmentInfo struct {
User types.AccountID
Price types.U128
Buyers types.OptionAccountID
Exec types.OptionU32
Locked types.Bool
}type Individual struct {
Acc types.AccountID
Reward types.U32
}type UnlockChunk struct {
Value types.UCompact
Era types.BlockNumber
}type SysProperties struct {
Ss58Format types.Bytes
TokenDecimals types.U8
TokenSymbol types.Text
SS58Prefix types.U32
}type SysSyncState struct {
StartingBlock types.U32
CurrentBlock types.U32
HighestBlock types.U32
}type WorkerInfo struct {
Pubkey WorkerPublicKey
EcdhPubkey EcdhPublicKey
Version types.U32
LastUpdated types.U64
StashAccount types.Option[types.AccountID]
AttestationProvider types.Option[types.U8]
ConfidenceLevel types.U8
Features []types.U32
Role types.U8 // 0:Full 1:Verifier 2:Marker
}type IdleSignInfo struct {
Miner types.AccountID
Rear types.U64
Front types.U64
Accumulator Accumulator
LastOperationBlock types.U32
PoisKey PoISKeyInfo
}type DigestInfo struct {
Fragment FileHash
TeePubkey WorkerPublicKey
}type OtherStakingExposure struct {
Who types.AccountID
Value types.UCompact
}type StakingValidatorPrefs struct {
Commission types.U32
Blocked types.Bool
}type CompleteSnapShotType struct {
MinerCount types.U32
TotalPower types.U128
}type MinerCompleteInfo struct {
EraIndex types.U32
Issued types.Bool
FinishBlock types.U32
Power types.U128
}
type RoundRewardType struct {
TotalReward types.U128
OtherReward types.U128
}