Documentation ¶
Index ¶
- Constants
- Variables
- func AddBlockDownloadReq(req *BlockDownloadRequest)
- func AddCommitRequest(req *CommitRequest)
- func AddCurator(curatorId, allocationId string) (string, error)
- func AddFreeStorageAssigner(name, publicKey string, individualLimit, totalLimit float64) error
- func CancelAllocation(allocID string) (hash string, err error)
- func CommitToFabric(metaTxnData, fabricConfigJSON string) (string, error)
- func CreateAllocation(datashards, parityshards int, size, expiry int64, ...) (string, error)
- func CreateAllocationForOwner(owner, ownerpublickey string, datashards, parityshards int, size, expiry int64, ...) (hash string, err error)
- func CreateFreeAllocation(marker string, value int64) (string, error)
- func CreateFreeUpdateAllocation(marker, allocationId string, value int64) (string, error)
- func CreateReadPool() (err error)
- func CuratorTransferAllocation(allocationId, newOwner, newOwnerPublicKey string) (string, error)
- func FinalizeAllocation(allocID string) (hash string, err error)
- func GetAllocationMinLock(datashards, parityshards int, size, expiry int64, ...) (int64, error)
- func GetClientEncryptedPublicKey() (string, error)
- func GetLogger() *logger.Logger
- func GetVersion() string
- func InitBlockDownloader(blobbers []*blockchain.StorageNode)
- func InitCommitWorker(blobbers []*blockchain.StorageNode)
- func InitStorageSDK(clientJson string, blockWorker string, chainID string, signatureScheme string, ...) error
- func ReadPoolLock(dur time.Duration, allocID, blobberID string, tokens, fee int64) (err error)
- func ReadPoolUnlock(poolID string, fee int64) (err error)
- func SetLogFile(logFile string, verbose bool)
- func SetLogLevel(lvl int)
- func SetMaxTxnQuery(num int)
- func SetMinConfirmation(num int)
- func SetMinSubmit(num int)
- func SetNetwork(miners []string, sharders []string)
- func SetNumBlockDownloads(num int)
- func SetQuerySleepTime(time int)
- func StakePoolLock(blobberID string, value, fee int64) (poolID string, err error)
- func StakePoolPayInterests(bloberID string) (err error)
- func StakePoolUnlock(blobberID, poolID string, fee int64) (unstake common.Timestamp, err error)
- func UpdateAllocation(size int64, expiry int64, allocationID string, lock int64, setImmutable bool) (hash string, err error)
- func UpdateBlobberSettings(blob *Blobber) (resp string, err error)
- func UpdateNetworkDetails() error
- func UpdateNetworkDetailsWorker(ctx context.Context)
- func UpdateRequired(networkDetails *Network) bool
- func WritePoolLock(dur time.Duration, allocID, blobberID string, tokens, fee int64) (err error)
- func WritePoolUnlock(poolID string, fee int64) (err error)
- type Allocation
- func (a *Allocation) AddCollaborator(filePath, collaboratorID string) error
- func (a *Allocation) CancelDownload(remotepath string) error
- func (a *Allocation) CancelRepair() error
- func (a *Allocation) CancelUpload(localpath string) error
- func (a *Allocation) CommitFolderChange(operation, preValue, currValue string) (string, error)
- func (a *Allocation) CommitMetaTransaction(path, crudOperation, authTicket, lookupHash string, ...) (err error)
- func (a *Allocation) CopyObject(path string, destPath string) error
- func (a *Allocation) CreateDir(dirName string) error
- func (a *Allocation) DeleteFile(path string) error
- func (a *Allocation) DownloadFile(localPath string, remotePath string, status StatusCallback) error
- func (a *Allocation) DownloadFileByBlock(localPath string, remotePath string, startBlock int64, endBlock int64, ...) error
- func (a *Allocation) DownloadFromAuthTicket(localPath string, authTicket string, remoteLookupHash string, ...) error
- func (a *Allocation) DownloadFromAuthTicketByBlocks(localPath string, authTicket string, startBlock int64, endBlock int64, ...) error
- func (a *Allocation) DownloadThumbnail(localPath string, remotePath string, status StatusCallback) error
- func (a *Allocation) DownloadThumbnailFromAuthTicket(localPath string, authTicket string, remoteLookupHash string, ...) error
- func (a *Allocation) EncryptAndUpdateFile(localpath string, remotepath string, attrs fileref.Attributes, ...) error
- func (a *Allocation) EncryptAndUpdateFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, ...) error
- func (a *Allocation) EncryptAndUploadFile(localpath string, remotepath string, attrs fileref.Attributes, ...) error
- func (a *Allocation) EncryptAndUploadFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, ...) error
- func (a *Allocation) GetAllocationDiff(lastSyncCachePath string, localRootPath string, localFileFilters []string, ...) ([]FileDiff, error)
- func (a *Allocation) GetAuthTicket(path string, filename string, referenceType string, refereeClientID string, ...) (string, error)
- func (a *Allocation) GetAuthTicketForShare(path string, filename string, referenceType string, refereeClientID string) (string, error)
- func (a *Allocation) GetBlobberStats() map[string]*BlobberAllocationStats
- func (a *Allocation) GetFileMeta(path string) (*ConsolidatedFileMeta, error)
- func (a *Allocation) GetFileMetaFromAuthTicket(authTicket string, lookupHash string) (*ConsolidatedFileMeta, error)
- func (a *Allocation) GetFileStats(path string) (map[string]*FileStats, error)
- func (a *Allocation) GetMaxStorageCost(size int64) (float64, error)
- func (a *Allocation) GetMaxWriteRead() (maxW float64, maxR float64, err error)
- func (a *Allocation) GetMinStorageCost(size int64) (common.Balance, error)
- func (a *Allocation) GetMinWriteRead() (minW float64, minR float64, err error)
- func (a *Allocation) GetRemoteFileMap(exclMap map[string]int) (map[string]fileInfo, error)
- func (a *Allocation) GetStats() *AllocationStats
- func (a *Allocation) InitAllocation()
- func (a *Allocation) ListDir(path string) (*ListResult, error)
- func (a *Allocation) ListDirFromAuthTicket(authTicket string, lookupHash string) (*ListResult, error)
- func (a *Allocation) MoveObject(path string, destPath string) error
- func (a *Allocation) RemoveCollaborator(filePath, collaboratorID string) error
- func (a *Allocation) RenameObject(path string, destName string) error
- func (a *Allocation) RepairFile(localpath string, remotepath string, status StatusCallback) error
- func (a *Allocation) RepairRequired(remotepath string) (zboxutil.Uint128, bool, *fileref.FileRef, error)
- func (a *Allocation) RevokeShare(path string, refereeClientID string) error
- func (a *Allocation) SaveRemoteSnapshot(pathToSave string, remoteExcludePath []string) error
- func (a *Allocation) StartRepair(localRootPath, pathToRepair string, statusCB StatusCallback) error
- func (a *Allocation) UpdateFile(localpath string, remotepath string, attrs fileref.Attributes, ...) error
- func (a *Allocation) UpdateFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, ...) error
- func (a *Allocation) UpdateObjectAttributes(path string, attrs fileref.Attributes) (err error)
- func (a *Allocation) UploadAuthTicketToBlobber(authticketB64 string, clientEncPubKey string) error
- func (a *Allocation) UploadFile(localpath string, remotepath string, attrs fileref.Attributes, ...) error
- func (a *Allocation) UploadFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, ...) error
- type AllocationPoolStat
- type AllocationPoolStats
- type AllocationStats
- type AttributesRequest
- type AuthTicket
- type BackPool
- type Blobber
- type BlobberAllocation
- type BlobberAllocationStats
- type BlobberPoolStat
- type BlockDownloadRequest
- type ChallengePoolInfo
- type CollaboratorRequest
- type CommitFolderData
- type CommitFolderResponse
- type CommitMetaData
- type CommitMetaRequest
- type CommitMetaResponse
- type CommitRequest
- type CommitResult
- type Consensus
- type ConsolidatedFileMeta
- type CopyRequest
- type DeleteRequest
- type DirRequest
- type DownloadRequest
- type FileDiff
- type FileStats
- type ListRequest
- type ListResult
- type Network
- type PriceRange
- type ReferencePathResult
- type RenameRequest
- type RepairRequest
- type RepairStatusCB
- func (cb *RepairStatusCB) CommitMetaCompleted(request, response string, err error)
- func (cb *RepairStatusCB) Completed(allocationId, filePath string, filename string, mimetype string, size int, ...)
- func (cb *RepairStatusCB) Error(allocationID string, filePath string, op int, err error)
- func (cb *RepairStatusCB) InProgress(allocationId, filePath string, op int, completedBytes int, data []byte)
- func (cb *RepairStatusCB) RepairCompleted(filesRepaired int)
- func (cb *RepairStatusCB) Started(allocationId, filePath string, op int, totalBytes int)
- type ShareRequest
- type StakePoolDelegatePoolInfo
- type StakePoolInfo
- type StakePoolOfferInfo
- type StakePoolRewardsInfo
- type StakePoolSettings
- type StakePoolUnlockUnstake
- type StakePoolUserInfo
- type StatusCallback
- type StorageReadPoolConfig
- type StorageSCConfig
- type StorageStakePoolConfig
- type StorageWritePoolConfig
- type Terms
- type UploadFileMeta
- type UploadRequest
Constants ¶
const ( KB = 1024 MB = 1024 * KB GB = 1024 * MB )
const ( DOWNLOAD_CONTENT_FULL = "full" DOWNLOAD_CONTENT_THUMB = "thumbnail" )
const ( OpUpload int = 0 OpDownload int = 1 OpRepair int = 2 OpUpdate int = 3 )
const ( Upload = "Upload" Download = "Download" Update = "Update" Delete = "Delete" Conflict = "Conflict" LocalDelete = "LocalDelete" )
For sync app
const CHUNK_SIZE = 64 * 1024
const NETWORK_ENDPOINT = "/network"
const STORAGE_SCADDRESS = "6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712d7"
Variables ¶
Functions ¶
func AddBlockDownloadReq ¶
func AddBlockDownloadReq(req *BlockDownloadRequest)
func AddCommitRequest ¶
func AddCommitRequest(req *CommitRequest)
func AddCurator ¶
func AddFreeStorageAssigner ¶
func CancelAllocation ¶
func CommitToFabric ¶
func CreateAllocation ¶
func CreateReadPool ¶
func CreateReadPool() (err error)
func FinalizeAllocation ¶
func GetAllocationMinLock ¶
func InitBlockDownloader ¶
func InitBlockDownloader(blobbers []*blockchain.StorageNode)
func InitCommitWorker ¶
func InitCommitWorker(blobbers []*blockchain.StorageNode)
func InitStorageSDK ¶
func ReadPoolLock ¶
ReadPoolLock locks given number of tokes for given duration in read pool.
func ReadPoolUnlock ¶
ReadPoolUnlock unlocks tokens in expired read pool
func SetLogFile ¶
SetLogFile logFile - Log file verbose - true - console output; false - no console output
func SetLogLevel ¶
func SetLogLevel(lvl int)
SetLogLevel set the log level. lvl - 0 disabled; higher number (upto 4) more verbosity
func SetMaxTxnQuery ¶
func SetMaxTxnQuery(num int)
func SetMinConfirmation ¶
func SetMinConfirmation(num int)
func SetMinSubmit ¶
func SetMinSubmit(num int)
func SetNetwork ¶
func SetNumBlockDownloads ¶
func SetNumBlockDownloads(num int)
func SetQuerySleepTime ¶
func SetQuerySleepTime(time int)
func StakePoolLock ¶
StakePoolLock locks tokens lack in stake pool
func StakePoolPayInterests ¶
StakePoolPayInterests unlocks a stake pool rewards.
func StakePoolUnlock ¶
StakePoolUnlock unlocks a stake pool tokens. If tokens can't be unlocked due to opened offers, then it returns time where the tokens can be unlocked, marking the pool as 'want to unlock' to avoid its usage in offers in the future. The time is maximal time that can be lesser in some cases. To unlock tokens can't be unlocked now, wait the time and unlock them (call this function again).
func UpdateAllocation ¶
func UpdateBlobberSettings ¶
func UpdateNetworkDetails ¶
func UpdateNetworkDetails() error
func UpdateRequired ¶
func WritePoolLock ¶
WritePoolLock locks given number of tokes for given duration in read pool.
func WritePoolUnlock ¶
WritePoolUnlock unlocks tokens in expired read pool
Types ¶
type Allocation ¶
type Allocation struct { ID string `json:"id"` Tx string `json:"tx"` DataShards int `json:"data_shards"` ParityShards int `json:"parity_shards"` Size int64 `json:"size"` Expiration int64 `json:"expiration_date"` Owner string `json:"owner_id"` OwnerPublicKey string `json:"owner_public_key"` Payer string `json:"payer_id"` Blobbers []*blockchain.StorageNode `json:"blobbers"` Stats *AllocationStats `json:"stats"` TimeUnit time.Duration `json:"time_unit"` IsImmutable bool `json:"is_immutable"` // BlobberDetails contains real terms used for the allocation. // If the allocation has updated, then terms calculated using // weighted average values. BlobberDetails []*BlobberAllocation `json:"blobber_details"` // ReadPriceRange is requested reading prices range. ReadPriceRange PriceRange `json:"read_price_range"` // WritePriceRange is requested writing prices range. WritePriceRange PriceRange `json:"write_price_range"` ChallengeCompletionTime time.Duration `json:"challenge_completion_time"` StartTime common.Timestamp `json:"start_time"` Finalized bool `json:"finalized,omitempty"` Canceled bool `json:"canceled,omitempty"` MovedToChallenge common.Balance `json:"moved_to_challenge,omitempty"` MovedBack common.Balance `json:"moved_back,omitempty"` MovedToValidators common.Balance `json:"moved_to_validators,omitempty"` Curators []string `json:"curators"` // contains filtered or unexported fields }
func GetAllocation ¶
func GetAllocation(allocationID string) (*Allocation, error)
func GetAllocationFromAuthTicket ¶
func GetAllocationFromAuthTicket(authTicket string) (*Allocation, error)
func GetAllocations ¶
func GetAllocations() ([]*Allocation, error)
func GetAllocationsForClient ¶
func GetAllocationsForClient(clientID string) ([]*Allocation, error)
func (*Allocation) AddCollaborator ¶
func (a *Allocation) AddCollaborator(filePath, collaboratorID string) error
func (*Allocation) CancelDownload ¶
func (a *Allocation) CancelDownload(remotepath string) error
func (*Allocation) CancelRepair ¶
func (a *Allocation) CancelRepair() error
func (*Allocation) CancelUpload ¶
func (a *Allocation) CancelUpload(localpath string) error
func (*Allocation) CommitFolderChange ¶
func (a *Allocation) CommitFolderChange(operation, preValue, currValue string) (string, error)
func (*Allocation) CommitMetaTransaction ¶
func (a *Allocation) CommitMetaTransaction(path, crudOperation, authTicket, lookupHash string, fileMeta *ConsolidatedFileMeta, status StatusCallback) (err error)
func (*Allocation) CopyObject ¶
func (a *Allocation) CopyObject(path string, destPath string) error
func (*Allocation) CreateDir ¶
func (a *Allocation) CreateDir(dirName string) error
func (*Allocation) DeleteFile ¶
func (a *Allocation) DeleteFile(path string) error
func (*Allocation) DownloadFile ¶
func (a *Allocation) DownloadFile(localPath string, remotePath string, status StatusCallback) error
func (*Allocation) DownloadFileByBlock ¶
func (a *Allocation) DownloadFileByBlock(localPath string, remotePath string, startBlock int64, endBlock int64, numBlocks int, status StatusCallback) error
func (*Allocation) DownloadFromAuthTicket ¶
func (a *Allocation) DownloadFromAuthTicket(localPath string, authTicket string, remoteLookupHash string, remoteFilename string, rxPay bool, status StatusCallback) error
func (*Allocation) DownloadFromAuthTicketByBlocks ¶
func (*Allocation) DownloadThumbnail ¶
func (a *Allocation) DownloadThumbnail(localPath string, remotePath string, status StatusCallback) error
func (*Allocation) DownloadThumbnailFromAuthTicket ¶
func (a *Allocation) DownloadThumbnailFromAuthTicket(localPath string, authTicket string, remoteLookupHash string, remoteFilename string, rxPay bool, status StatusCallback) error
func (*Allocation) EncryptAndUpdateFile ¶
func (a *Allocation) EncryptAndUpdateFile(localpath string, remotepath string, attrs fileref.Attributes, status StatusCallback) error
func (*Allocation) EncryptAndUpdateFileWithThumbnail ¶
func (a *Allocation) EncryptAndUpdateFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, attrs fileref.Attributes, status StatusCallback) error
func (*Allocation) EncryptAndUploadFile ¶
func (a *Allocation) EncryptAndUploadFile(localpath string, remotepath string, attrs fileref.Attributes, status StatusCallback) error
func (*Allocation) EncryptAndUploadFileWithThumbnail ¶
func (a *Allocation) EncryptAndUploadFileWithThumbnail( localpath string, remotepath string, thumbnailpath string, attrs fileref.Attributes, status StatusCallback, ) error
func (*Allocation) GetAllocationDiff ¶
func (*Allocation) GetAuthTicket ¶
func (*Allocation) GetAuthTicketForShare ¶
func (*Allocation) GetBlobberStats ¶
func (a *Allocation) GetBlobberStats() map[string]*BlobberAllocationStats
func (*Allocation) GetFileMeta ¶
func (a *Allocation) GetFileMeta(path string) (*ConsolidatedFileMeta, error)
func (*Allocation) GetFileMetaFromAuthTicket ¶
func (a *Allocation) GetFileMetaFromAuthTicket(authTicket string, lookupHash string) (*ConsolidatedFileMeta, error)
func (*Allocation) GetFileStats ¶
func (a *Allocation) GetFileStats(path string) (map[string]*FileStats, error)
func (*Allocation) GetMaxStorageCost ¶
func (a *Allocation) GetMaxStorageCost(size int64) (float64, error)
func (*Allocation) GetMaxWriteRead ¶
func (a *Allocation) GetMaxWriteRead() (maxW float64, maxR float64, err error)
func (*Allocation) GetMinStorageCost ¶
func (a *Allocation) GetMinStorageCost(size int64) (common.Balance, error)
func (*Allocation) GetMinWriteRead ¶
func (a *Allocation) GetMinWriteRead() (minW float64, minR float64, err error)
func (*Allocation) GetRemoteFileMap ¶
func (a *Allocation) GetRemoteFileMap(exclMap map[string]int) (map[string]fileInfo, error)
func (*Allocation) GetStats ¶
func (a *Allocation) GetStats() *AllocationStats
func (*Allocation) InitAllocation ¶
func (a *Allocation) InitAllocation()
func (*Allocation) ListDir ¶
func (a *Allocation) ListDir(path string) (*ListResult, error)
func (*Allocation) ListDirFromAuthTicket ¶
func (a *Allocation) ListDirFromAuthTicket(authTicket string, lookupHash string) (*ListResult, error)
func (*Allocation) MoveObject ¶
func (a *Allocation) MoveObject(path string, destPath string) error
func (*Allocation) RemoveCollaborator ¶
func (a *Allocation) RemoveCollaborator(filePath, collaboratorID string) error
func (*Allocation) RenameObject ¶
func (a *Allocation) RenameObject(path string, destName string) error
func (*Allocation) RepairFile ¶
func (a *Allocation) RepairFile(localpath string, remotepath string, status StatusCallback) error
func (*Allocation) RepairRequired ¶
func (*Allocation) RevokeShare ¶
func (a *Allocation) RevokeShare(path string, refereeClientID string) error
func (*Allocation) SaveRemoteSnapshot ¶
func (a *Allocation) SaveRemoteSnapshot(pathToSave string, remoteExcludePath []string) error
SaveRemoteSnapShot - Saves the remote current information to the given file This file can be passed to GetAllocationDiff to exactly find the previous sync state to current.
func (*Allocation) StartRepair ¶
func (a *Allocation) StartRepair(localRootPath, pathToRepair string, statusCB StatusCallback) error
func (*Allocation) UpdateFile ¶
func (a *Allocation) UpdateFile(localpath string, remotepath string, attrs fileref.Attributes, status StatusCallback) error
func (*Allocation) UpdateFileWithThumbnail ¶
func (a *Allocation) UpdateFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, attrs fileref.Attributes, status StatusCallback) error
func (*Allocation) UpdateObjectAttributes ¶
func (a *Allocation) UpdateObjectAttributes(path string, attrs fileref.Attributes) (err error)
func (*Allocation) UploadAuthTicketToBlobber ¶
func (a *Allocation) UploadAuthTicketToBlobber(authticketB64 string, clientEncPubKey string) error
func (*Allocation) UploadFile ¶
func (a *Allocation) UploadFile(localpath string, remotepath string, attrs fileref.Attributes, status StatusCallback) error
func (*Allocation) UploadFileWithThumbnail ¶
func (a *Allocation) UploadFileWithThumbnail(localpath string, remotepath string, thumbnailpath string, attrs fileref.Attributes, status StatusCallback) error
type AllocationPoolStat ¶
type AllocationPoolStats ¶
type AllocationPoolStats struct { Pools []*AllocationPoolStat `json:"pools"` Back *BackPool `json:"back,omitempty"` }
AllocationPoolsStat represents read or write pool statistic.
func GetReadPoolInfo ¶
func GetReadPoolInfo(clientID string) (info *AllocationPoolStats, err error)
GetReadPoolInfo for given client, or, if the given clientID is empty, for current client of the sdk.
func GetWritePoolInfo ¶
func GetWritePoolInfo(clientID string) (info *AllocationPoolStats, err error)
GetWritePoolInfo for given client, or, if the given clientID is empty, for current client of the sdk.
func (*AllocationPoolStats) AllocFilter ¶
func (aps *AllocationPoolStats) AllocFilter(allocID string)
type AllocationStats ¶
type AllocationStats struct { UsedSize int64 `json:"used_size"` NumWrites int64 `json:"num_of_writes"` NumReads int64 `json:"num_of_reads"` TotalChallenges int64 `json:"total_challenges"` OpenChallenges int64 `json:"num_open_challenges"` SuccessChallenges int64 `json:"num_success_challenges"` FailedChallenges int64 `json:"num_failed_challenges"` LastestClosedChallengeTxn string `json:"latest_closed_challenge"` }
type AttributesRequest ¶
type AttributesRequest struct { Attributes fileref.Attributes // new attributes Consensus // // contains filtered or unexported fields }
func (*AttributesRequest) ProcessAttributes ¶
func (ar *AttributesRequest) ProcessAttributes() (err error)
type AuthTicket ¶
type AuthTicket struct {
// contains filtered or unexported fields
}
func InitAuthTicket ¶
func InitAuthTicket(authTicket string) *AuthTicket
func (*AuthTicket) GetFileName ¶
func (at *AuthTicket) GetFileName() (string, error)
func (*AuthTicket) GetLookupHash ¶
func (at *AuthTicket) GetLookupHash() (string, error)
func (*AuthTicket) IsDir ¶
func (at *AuthTicket) IsDir() (bool, error)
func (*AuthTicket) Unmarshall ¶
func (at *AuthTicket) Unmarshall() (*marker.AuthTicket, error)
type Blobber ¶
type Blobber struct { ID common.Key `json:"id"` BaseURL string `json:"url"` Terms Terms `json:"terms"` Capacity common.Size `json:"capacity"` Used common.Size `json:"used"` LastHealthCheck common.Timestamp `json:"last_health_check"` PublicKey string `json:"-"` StakePoolSettings StakePoolSettings `json:"stake_pool_settings"` }
func GetBlobbers ¶
type BlobberAllocation ¶
type BlobberAllocation struct { BlobberID string `json:"blobber_id"` Size int64 `json:"size"` Terms Terms `json:"terms"` MinLockDemand common.Balance `json:"min_lock_demand"` Spent common.Balance `json:"spent"` Penalty common.Balance `json:"penalty"` ReadReward common.Balance `json:"read_reward"` Returned common.Balance `json:"returned"` ChallengeReward common.Balance `json:"challenge_reward"` FinalReward common.Balance `json:"final_reward"` }
type BlobberAllocationStats ¶
type BlobberAllocationStats struct { BlobberID string BlobberURL string ID string `json:"ID"` Tx string `json:"Tx"` TotalSize int64 `json:"TotalSize"` UsedSize int `json:"UsedSize"` OwnerID string `json:"OwnerID"` OwnerPublicKey string `json:"OwnerPublicKey"` Expiration int `json:"Expiration"` AllocationRoot string `json:"AllocationRoot"` BlobberSize int `json:"BlobberSize"` BlobberSizeUsed int `json:"BlobberSizeUsed"` LatestRedeemedWM string `json:"LatestRedeemedWM"` IsRedeemRequired bool `json:"IsRedeemRequired"` CleanedUp bool `json:"CleanedUp"` Finalized bool `json:"Finalized"` Terms []struct { ID int `json:"ID"` BlobberID string `json:"BlobberID"` AllocationID string `json:"AllocationID"` ReadPrice int `json:"ReadPrice"` WritePrice int `json:"WritePrice"` } `json:"Terms"` }
type BlobberPoolStat ¶
type BlockDownloadRequest ¶
type BlockDownloadRequest struct {
// contains filtered or unexported fields
}
type ChallengePoolInfo ¶
type ChallengePoolInfo struct { ID string `json:"id"` Balance common.Balance `json:"balance"` StartTime common.Timestamp `json:"start_time"` Expiration common.Timestamp `json:"expiration"` Finalized bool `json:"finalized"` }
ChallengePoolInfo represents a challenge pool stat.
func GetChallengePoolInfo ¶
func GetChallengePoolInfo(allocID string) (info *ChallengePoolInfo, err error)
GetChallengePoolInfo for given allocation.
type CollaboratorRequest ¶
type CollaboratorRequest struct {
// contains filtered or unexported fields
}
func (*CollaboratorRequest) RemoveCollaboratorFromBlobbers ¶
func (req *CollaboratorRequest) RemoveCollaboratorFromBlobbers() bool
func (*CollaboratorRequest) UpdateCollaboratorToBlobbers ¶
func (req *CollaboratorRequest) UpdateCollaboratorToBlobbers() bool
type CommitFolderData ¶
type CommitFolderResponse ¶
type CommitFolderResponse struct { TxnID string Data *CommitFolderData }
type CommitMetaData ¶
type CommitMetaData struct { CrudType string MetaData *ConsolidatedFileMeta }
type CommitMetaRequest ¶
type CommitMetaRequest struct { CommitMetaData // contains filtered or unexported fields }
type CommitMetaResponse ¶
type CommitMetaResponse struct { TxnID string MetaData *ConsolidatedFileMeta }
type CommitRequest ¶
type CommitRequest struct {
// contains filtered or unexported fields
}
type CommitResult ¶
type CommitResult struct { Success bool `json:"success"` ErrorMessage string `json:"error_msg,omitempty"` }
func ErrorCommitResult ¶
func ErrorCommitResult(errMsg string) *CommitResult
func SuccessCommitResult ¶
func SuccessCommitResult() *CommitResult
type ConsolidatedFileMeta ¶
type CopyRequest ¶
type CopyRequest struct { Consensus // contains filtered or unexported fields }
func (*CopyRequest) ProcessCopy ¶
func (req *CopyRequest) ProcessCopy() error
type DeleteRequest ¶
type DeleteRequest struct { Consensus // contains filtered or unexported fields }
func (*DeleteRequest) ProcessDelete ¶
func (req *DeleteRequest) ProcessDelete() error
type DirRequest ¶
type DirRequest struct { Consensus // contains filtered or unexported fields }
func (*DirRequest) ProcessDir ¶
func (req *DirRequest) ProcessDir(a *Allocation) error
type DownloadRequest ¶
type DownloadRequest struct { Consensus // contains filtered or unexported fields }
type FileStats ¶
type FileStats struct { Name string `json:"name"` Size int64 `json:"size"` PathHash string `json:"path_hash"` Path string `json:"path"` NumBlocks int64 `json:"num_of_blocks"` NumUpdates int64 `json:"num_of_updates"` NumBlockDownloads int64 `json:"num_of_block_downloads"` SuccessChallenges int64 `json:"num_of_challenges"` FailedChallenges int64 `json:"num_of_failed_challenges"` LastChallengeResponseTxn string `json:"last_challenge_txn"` WriteMarkerRedeemTxn string `json:"write_marker_txn"` BlobberID string `json:"blobber_id"` BlobberURL string `json:"blobber_url"` BlockchainAware bool `json:"blockchain_aware"` CreatedAt time.Time `json:"CreatedAt"` }
type ListRequest ¶
type ListRequest struct { Consensus // contains filtered or unexported fields }
func (*ListRequest) GetListFromBlobbers ¶
func (req *ListRequest) GetListFromBlobbers() *ListResult
type ListResult ¶
type ListResult struct { Name string `json:"name"` Path string `json:"path,omitempty"` Type string `json:"type"` Size int64 `json:"size"` Hash string `json:"hash,omitempty"` MimeType string `json:"mimetype,omitempty"` NumBlocks int64 `json:"num_blocks"` LookupHash string `json:"lookup_hash"` EncryptionKey string `json:"encryption_key"` Attributes fileref.Attributes `json:"attributes"` ActualSize int64 `json:"actual_size"` ActualNumBlocks int64 `json:"actual_num_blocks"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` Children []*ListResult `json:"list"` Consensus `json:"-"` }
type PriceRange ¶
PriceRange represents a price range allowed by user to filter blobbers.
type ReferencePathResult ¶
type ReferencePathResult struct { *fileref.ReferencePath LatestWM *marker.WriteMarker `json:"latest_write_marker"` }
type RenameRequest ¶
type RenameRequest struct { Consensus // contains filtered or unexported fields }
func (*RenameRequest) ProcessRename ¶
func (req *RenameRequest) ProcessRename() error
type RepairRequest ¶
type RepairRequest struct {
// contains filtered or unexported fields
}
type RepairStatusCB ¶
type RepairStatusCB struct {
// contains filtered or unexported fields
}
func (*RepairStatusCB) CommitMetaCompleted ¶
func (cb *RepairStatusCB) CommitMetaCompleted(request, response string, err error)
func (*RepairStatusCB) Error ¶
func (cb *RepairStatusCB) Error(allocationID string, filePath string, op int, err error)
func (*RepairStatusCB) InProgress ¶
func (cb *RepairStatusCB) InProgress(allocationId, filePath string, op int, completedBytes int, data []byte)
func (*RepairStatusCB) RepairCompleted ¶
func (cb *RepairStatusCB) RepairCompleted(filesRepaired int)
type ShareRequest ¶
type ShareRequest struct {
// contains filtered or unexported fields
}
func (*ShareRequest) GetAuthTicket ¶
func (req *ShareRequest) GetAuthTicket(clientID string) (string, error)
func (*ShareRequest) GetAuthTicketForEncryptedFile ¶
func (req *ShareRequest) GetAuthTicketForEncryptedFile(clientID string, encPublicKey string) (string, error)
func (*ShareRequest) GetFileRef ¶
func (req *ShareRequest) GetFileRef() (*fileref.FileRef, error)
type StakePoolDelegatePoolInfo ¶
type StakePoolDelegatePoolInfo struct { ID common.Key `json:"id"` // pool ID Balance common.Balance `json:"balance"` // current balance DelegateID common.Key `json:"delegate_id"` // wallet Rewards common.Balance `json:"rewards"` // total for all time Interests common.Balance `json:"interests"` // total for all time Penalty common.Balance `json:"penalty"` // total for all time PendingInterests common.Balance `json:"pending_interests"` // total for all time // Unstake > 0, then the pool wants to unstake. And the Unstake is maximal // time it can't be unstaked. Unstake common.Timestamp `json:"unstake"` }
StakePoolDelegatePoolInfo represents delegate pool of a stake pool info.
type StakePoolInfo ¶
type StakePoolInfo struct { ID common.Key `json:"pool_id"` // blobber ID Balance common.Balance `json:"balance"` // total stake Unstake common.Balance `json:"unstake"` // total unstake amount Free common.Size `json:"free"` // free staked space Capacity common.Size `json:"capacity"` // blobber bid WritePrice common.Balance `json:"write_price"` // its write price Offers []*StakePoolOfferInfo `json:"offers"` // OffersTotal common.Balance `json:"offers_total"` // // delegate pools Delegate []*StakePoolDelegatePoolInfo `json:"delegate"` Earnings common.Balance `json:"interests"` // total for all Penalty common.Balance `json:"penalty"` // total for all // rewards Rewards StakePoolRewardsInfo `json:"rewards"` // settings Settings StakePoolSettings `json:"settings"` }
StakePool full info.
func GetStakePoolInfo ¶
func GetStakePoolInfo(blobberID string) (info *StakePoolInfo, err error)
GetStakePoolInfo for given client, or, if the given clientID is empty, for current client of the sdk.
type StakePoolOfferInfo ¶
type StakePoolOfferInfo struct { Lock common.Balance `json:"lock"` Expire common.Timestamp `json:"expire"` AllocationID common.Key `json:"allocation_id"` IsExpired bool `json:"is_expired"` }
StakePoolOfferInfo represents stake pool offer information.
type StakePoolRewardsInfo ¶
type StakePoolRewardsInfo struct { Charge common.Balance `json:"charge"` // total for all time Blobber common.Balance `json:"blobber"` // total for all time Validator common.Balance `json:"validator"` // total for all time }
StakePoolRewardsInfo represents stake pool rewards.
type StakePoolSettings ¶
type StakePoolSettings struct { // DelegateWallet for pool owner. DelegateWallet string `json:"delegate_wallet"` // MinStake allowed. MinStake common.Balance `json:"min_stake"` // MaxStake allowed. MaxStake common.Balance `json:"max_stake"` // NumDelegates maximum allowed. NumDelegates int `json:"num_delegates"` // ServiceCharge is blobber service charge. ServiceCharge float64 `json:"service_charge"` }
StakePoolSettings information.
type StakePoolUnlockUnstake ¶
StakePoolUnlockUnstake is stake pool unlock response in case where tokens can't be unlocked due to opened offers. In this case it returns the maximal time to wait to be able to unlock the tokens. The real time can be lesser if someone cancels an allocation, or someone else stake more tokens, etc.
type StakePoolUserInfo ¶
type StakePoolUserInfo struct {
Pools map[common.Key][]*StakePoolDelegatePoolInfo `json:"pools"`
}
StakePoolUserInfo represents user stake pools statistic.
func GetStakePoolUserInfo ¶
func GetStakePoolUserInfo(clientID string) (info *StakePoolUserInfo, err error)
GetStakePoolUserInfo obtains blobbers/validators delegate pools statistic for a user. If given clientID is empty string, then current client used.
type StatusCallback ¶
type StatusCallback interface { Started(allocationId, filePath string, op int, totalBytes int) InProgress(allocationId, filePath string, op int, completedBytes int, data []byte) Error(allocationID string, filePath string, op int, err error) Completed(allocationId, filePath string, filename string, mimetype string, size int, op int) CommitMetaCompleted(request, response string, err error) RepairCompleted(filesRepaired int) }
type StorageReadPoolConfig ¶
type StorageSCConfig ¶
type StorageSCConfig struct { MinAllocSize common.Size `json:"min_alloc_size"` MinAllocDuration time.Duration `json:"min_alloc_duration"` MaxChallengeCompletionTime time.Duration `json:"max_challenge_completion_time"` MinOfferDuration time.Duration `json:"min_offer_duration"` MinBlobberCapacity common.Size `json:"min_blobber_capacity"` ReadPool *StorageReadPoolConfig `json:"readpool"` WritePool *StorageWritePoolConfig `json:"writepool"` StakePool *StorageStakePoolConfig `json:"stakepool"` ValidatorReward float64 `json:"validator_reward"` BlobberSlash float64 `json:"blobber_slash"` MaxReadPrice common.Balance `json:"max_read_price"` MaxWritePrice common.Balance `json:"max_write_price"` FailedChallengesToCancel int `json:"failed_challenges_to_cancel"` FailedChallengesToRevokeMinLock int `json:"failed_challenges_to_revoke_min_lock"` ChallengeEnabled bool `json:"challenge_enabled"` MaxChallengesPerGeneration int `json:"max_challenges_per_generation"` ChallengeGenerationRate float64 `json:"challenge_rate_per_mb_min"` MaxDelegates int `json:"max_delegates"` MaxCharge float64 `json:"max_charge"` TimeUnit time.Duration `json:"time_unit"` }
func GetStorageSCConfig ¶
func GetStorageSCConfig() (conf *StorageSCConfig, err error)
type StorageStakePoolConfig ¶
type StorageWritePoolConfig ¶
type Terms ¶
type Terms struct { ReadPrice common.Balance `json:"read_price"` // tokens / GB WritePrice common.Balance `json:"write_price"` // tokens / GB MinLockDemand float64 `json:"min_lock_demand"` MaxOfferDuration time.Duration `json:"max_offer_duration"` ChallengeCompletionTime time.Duration `json:"challenge_completion_time"` }
Terms represents Blobber terms. A Blobber can update its terms, but any existing offer will use terms of offer signing time.
type UploadFileMeta ¶
type UploadRequest ¶
type UploadRequest struct { Consensus // contains filtered or unexported fields }
func (*UploadRequest) GetMaxBlobbersSupported ¶
func (req *UploadRequest) GetMaxBlobbersSupported() int
func (*UploadRequest) IsFullConsensusSupported ¶
func (req *UploadRequest) IsFullConsensusSupported() bool
Source Files ¶
- allocation.go
- attributesworker.go
- authticket.go
- blockdownloadworker.go
- collaboratorworker.go
- commitmetaworker.go
- commitworker.go
- common.go
- consensus.go
- copyworker.go
- deleteworker.go
- dirworker.go
- downloadworker.go
- filemetaworker.go
- filestatsworker.go
- listworker.go
- networkworker.go
- renameworker.go
- repairworker.go
- sdk.go
- sharerequest.go
- sync.go
- thumbnailupload.go
- uploadworker.go