Documentation ¶
Index ¶
- Constants
- func ClearFiller(api *gsrpc.SubstrateAPI, signaturePrk string) (int, error)
- func ClearInvalidFiles(fid FileHash) (string, error)
- func ExitMining(api *gsrpc.SubstrateAPI, identifyAccountPhrase, TransactionName string) (string, error)
- func Free()
- func GetAccountInfo(puk []byte) (types.AccountInfo, error)
- func GetBlockHeight(api *gsrpc.SubstrateAPI) (types.U32, error)
- func GetBlockHeightExited(api *gsrpc.SubstrateAPI) (types.U32, error)
- func GetGenesisHash(api *gsrpc.SubstrateAPI) (types.Hash, error)
- func GetKeyEvents() (types.StorageKey, error)
- func GetKeyring(prk string) (signature.KeyringPair, error)
- func GetMetadata(api *gsrpc.SubstrateAPI) (*types.Metadata, error)
- func GetRpcClient_Safe(rpcaddr string) (*gsrpc.SubstrateAPI, error)
- func GetRuntimeVersion(api *gsrpc.SubstrateAPI) (*types.RuntimeVersion, error)
- func GetSelfPublicKey(privatekey string) ([]byte, error)
- func Increase(api *gsrpc.SubstrateAPI, identifyAccountPhrase, TransactionName string, ...) (string, error)
- func NewRpcClient(rpcaddr string) (*gsrpc.SubstrateAPI, error)
- func Register(api *gsrpc.SubstrateAPI, incomeAcc, ip string, port uint16, ...) (string, error)
- func SubmitProofs(data []ProveInfo) (string, error)
- func UpdateAddress(transactionPrK, ip, port string) (string, error)
- func UpdateIncome(transactionPrK string, acc types.AccountID) (string, error)
- func Withdraw(api *gsrpc.SubstrateAPI, identifyAccountPhrase, TransactionName string) (string, error)
- type Chain_SchedulerPuk
- type ChallengesInfo
- type Event_AlreadyFrozen
- type Event_Balances_Withdraw
- type Event_BuyFile
- type Event_BuyPackage
- type Event_BuySpace
- type Event_ChallengeProof
- type Event_Claimed
- type Event_ClearInvalidFile
- type Event_DeleteFile
- type Event_Deposit
- type Event_DrawFaucetMoney
- type Event_EndOfBufferPeriod
- type Event_FaucetTopUpMoney
- type Event_FileChangeState
- type Event_FileUpdate
- type Event_FileUpload
- type Event_FillerUpload
- type Event_IncreaseCollateral
- type Event_InsertFileSlice
- type Event_LeaseExpireIn24Hours
- type Event_LeaseExpired
- type Event_LessThan24Hours
- type Event_MinerClaim
- type Event_MinerExit
- type Event_OutstandingChallenges
- type Event_PPBNoOnTimeSubmit
- type Event_PPDNoOnTimeSubmit
- type Event_PackageRenewal
- type Event_PackageUpgrade
- type Event_Purchased
- type Event_ReceiveSpace
- type Event_RecoverFile
- type Event_Redeemed
- type Event_Registered
- type Event_RegistrationScheduler
- type Event_SignedPhaseStarted
- type Event_SolutionStored
- type Event_StartOfBufferPeriod
- type Event_TimedTask
- type Event_TimingStorageSpace
- type Event_UnsignedPhaseStarted
- type Event_UpdataBeneficiary
- type Event_UpdataIp
- type Event_UpdateScheduler
- type Event_UploadDeclaration
- type Event_VerifyProof
- type FileBlockId
- type FileHash
- type IpAddress
- type Ipv4Type
- type Ipv4Type_Query
- type Ipv6Type
- type MinerInfo
- type MyEventRecords
- type ProveInfo
- type RewardInfo
- type SchedulerInfo
Constants ¶
const ( State_Sminer = "Sminer" State_SegmentBook = "SegmentBook" State_FileMap = "FileMap" State_FileBank = "FileBank" )
Pallert
const ( Sminer_MinerItems = "MinerItems" Sminer_MinerDetails = "MinerDetails" SegmentBook_MinerHoldSlice = "MinerHoldSlice" SegmentBook_ChallengeMap = "ChallengeMap" FileMap_SchedulerPuk = "SchedulerPuk" FileBank_FillerMap = "FillerMap" FileMap_SchedulerInfo = "SchedulerMap" FileBank_InvalidFile = "InvalidFile" Sminer_MinerLockIn = "MinerLockIn" )
Chain state
const ( ChainTx_Sminer_Register = "Sminer.regnstk" ChainTx_SegmentBook_IntentSubmit = "SegmentBook.intent_submit" ChainTx_Sminer_ExitMining = "Sminer.exit_miner" ChainTx_Sminer_Withdraw = "Sminer.withdraw" ChainTx_Sminer_UpdateIp = "Sminer.update_ip" ChainTx_Sminer_UpdateBeneficiary = "Sminer.update_beneficiary" ChainTx_Sminer_Increase = "Sminer.increase_collateral" SegmentBook_SubmitProve = "SegmentBook.submit_challenge_prove" FileBank_ClearInvalidFile = "FileBank.clear_invalid_file" FileBank_ClearFiller = "FileBank.clear_all_filler" )
Extrinsics
const ( ERR_Failed = "Failed" ERR_Timeout = "Timeout" ERR_Empty = "Empty" )
Variables ¶
This section is empty.
Functions ¶
func ClearFiller ¶
func ClearFiller(api *gsrpc.SubstrateAPI, signaturePrk string) (int, error)
Clear all filler files
func ExitMining ¶
func ExitMining(api *gsrpc.SubstrateAPI, identifyAccountPhrase, TransactionName string) (string, error)
Storage miner exits the mining function
func GetAccountInfo ¶
func GetAccountInfo(puk []byte) (types.AccountInfo, error)
func GetBlockHeight ¶
func GetBlockHeight(api *gsrpc.SubstrateAPI) (types.U32, error)
Get the current block height
func GetBlockHeightExited ¶
func GetBlockHeightExited(api *gsrpc.SubstrateAPI) (types.U32, error)
Get the block height when the miner exits
func GetGenesisHash ¶
func GetGenesisHash(api *gsrpc.SubstrateAPI) (types.Hash, error)
func GetKeyEvents ¶
func GetKeyEvents() (types.StorageKey, error)
func GetKeyring ¶
func GetKeyring(prk string) (signature.KeyringPair, error)
func GetMetadata ¶
func GetMetadata(api *gsrpc.SubstrateAPI) (*types.Metadata, error)
func GetRpcClient_Safe ¶
func GetRpcClient_Safe(rpcaddr string) (*gsrpc.SubstrateAPI, error)
func GetRuntimeVersion ¶
func GetRuntimeVersion(api *gsrpc.SubstrateAPI) (*types.RuntimeVersion, error)
func GetSelfPublicKey ¶
func Increase ¶
func Increase(api *gsrpc.SubstrateAPI, identifyAccountPhrase, TransactionName string, tokens *big.Int) (string, error)
Storage miners increase deposit function
func NewRpcClient ¶
func NewRpcClient(rpcaddr string) (*gsrpc.SubstrateAPI, error)
func Register ¶
func Register(api *gsrpc.SubstrateAPI, incomeAcc, ip string, port uint16, pledgeTokens uint64) (string, error)
Storage Miner Registration Function
func UpdateAddress ¶
Types ¶
type Chain_SchedulerPuk ¶
Scheduling node public key information structure
func GetSchedulerPublicKey ¶
func GetSchedulerPublicKey() (Chain_SchedulerPuk, error)
get public key
type ChallengesInfo ¶
type ChallengesInfo struct { File_size types.U64 File_type types.U8 Block_list types.Bytes File_id FileHash Shard_id FileBlockId Random []types.Bytes }
Challenge information structure
type Event_AlreadyFrozen ¶
type Event_Balances_Withdraw ¶
type Event_BuyFile ¶
type Event_BuyPackage ¶
type Event_BuySpace ¶
type Event_ChallengeProof ¶
type Event_Claimed ¶
type Event_ClearInvalidFile ¶
type Event_DeleteFile ¶
type Event_DeleteFile struct { Phase types.Phase Acc types.AccountID Fileid FileHash Topics []types.Hash }
------------------------FileBank-------------------------------
type Event_Deposit ¶
type Event_DrawFaucetMoney ¶
type Event_EndOfBufferPeriod ¶
type Event_FaucetTopUpMoney ¶
type Event_FileChangeState ¶
type Event_FileUpdate ¶
type Event_FileUpload ¶
type Event_FillerUpload ¶
type Event_InsertFileSlice ¶
type Event_LeaseExpired ¶
type Event_LessThan24Hours ¶
type Event_MinerClaim ¶
type Event_MinerExit ¶
type Event_PPBNoOnTimeSubmit ¶
type Event_PPBNoOnTimeSubmit struct { Phase types.Phase Acc types.AccountID SegmentId types.U64 Topics []types.Hash }
------------------------SegmentBook----------------------------
type Event_PPDNoOnTimeSubmit ¶
type Event_PackageRenewal ¶
type Event_PackageUpgrade ¶
type Event_Purchased ¶
type Event_ReceiveSpace ¶
type Event_RecoverFile ¶
type Event_Redeemed ¶
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 }
------------------------FileMap--------------------------------
type Event_SolutionStored ¶
type Event_UnsignedPhaseStarted ¶
------------------------other system---------------------------
type Event_UpdataBeneficiary ¶
type Event_UpdataIp ¶
type Event_UpdateScheduler ¶
type Event_UploadDeclaration ¶
type Event_VerifyProof ¶
type FileBlockId ¶
type Ipv4Type_Query ¶
type MinerInfo ¶
type MinerInfo struct { PeerId types.U64 IncomeAcc types.AccountID Ip Ipv4Type Collaterals types.U128 State types.Bytes Power types.U128 Space types.U128 RewardInfo RewardInfo }
Storage Miner Information Structure
func GetMinerInfo ¶
func GetMinerInfo(api *gsrpc.SubstrateAPI) (MinerInfo, error)
Get storage miner information
type MyEventRecords ¶
type MyEventRecords struct { //system types.EventRecords //SegmentBook SegmentBook_PPBNoOnTimeSubmit []Event_PPBNoOnTimeSubmit SegmentBook_PPDNoOnTimeSubmit []Event_PPDNoOnTimeSubmit SegmentBook_ChallengeProof []Event_ChallengeProof SegmentBook_VerifyProof []Event_VerifyProof SegmentBook_OutstandingChallenges []Event_OutstandingChallenges //Sminer Sminer_Registered []Event_Registered Sminer_TimedTask []Event_TimedTask 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_Redeemed []Event_Redeemed Sminer_Claimed []Event_Claimed Sminer_TimingStorageSpace []Event_TimingStorageSpace Sminer_UpdataBeneficiary []Event_UpdataBeneficiary Sminer_UpdataIp []Event_UpdataIp Sminer_StartOfBufferPeriod []Event_StartOfBufferPeriod Sminer_EndOfBufferPeriod []Event_EndOfBufferPeriod //FileBank FileBank_DeleteFile []Event_DeleteFile FileBank_BuySpace []Event_BuySpace FileBank_FileUpload []Event_FileUpload FileBank_FileUpdate []Event_FileUpdate FileBank_LeaseExpireIn24Hours []Event_LeaseExpireIn24Hours FileBank_FileChangeState []Event_FileChangeState FileBank_BuyFile []Event_BuyFile FileBank_Purchased []Event_Purchased FileBank_InsertFileSlice []Event_InsertFileSlice FileBank_LeaseExpired []Event_LeaseExpired FileBank_FillerUpload []Event_FillerUpload FileBank_ClearInvalidFile []Event_ClearInvalidFile FileBank_RecoverFile []Event_RecoverFile FileBank_ReceiveSpace []Event_ReceiveSpace FileBank_UploadDeclaration []Event_UploadDeclaration FileBank_BuyPackage []Event_BuyPackage FileBank_PackageUpgrade []Event_PackageUpgrade FileBank_PackageRenewal []Event_PackageRenewal //FileMap FileMap_RegistrationScheduler []Event_RegistrationScheduler FileMap_UpdateScheduler []Event_UpdateScheduler //other system ElectionProviderMultiPhase_UnsignedPhaseStarted []Event_UnsignedPhaseStarted ElectionProviderMultiPhase_SignedPhaseStarted []Event_SignedPhaseStarted ElectionProviderMultiPhase_SolutionStored []Event_SolutionStored Balances_Withdraw []Event_Balances_Withdraw }
All event types
type ProveInfo ¶
type ProveInfo struct { FileId FileHash MinerAcc types.AccountID Cinfo ChallengesInfo Mu []types.Bytes Sigma types.Bytes Name types.Bytes U []types.Bytes }
Proof information structure
type RewardInfo ¶
type SchedulerInfo ¶
type SchedulerInfo struct { Ip Ipv4Type Stash_user types.AccountID Controller_user types.AccountID }
Scheduling Node Information Structure
func GetSchedulingNodes ¶
func GetSchedulingNodes() ([]SchedulerInfo, error)
Get all scheduling nodes