Versions in this module Expand all Collapse all v1 v1.0.1 Mar 1, 2020 Changes in this version + const DefaultMaxDownloadSpeed + const DefaultMaxMemory + const DefaultMaxUploadSpeed + const DefaultPacketSize + const DownloadFailureCooldown + const DxPathRoot + const MaxConsecutivePenalty + const OnlineCheckFrequency + const PersistDirectory + const PersistFilename + const PersistStorageClientVersion + const WorkerActivateTimeout + var ErrContractRenewing = errors.New("client and host is renewing contract") + var ErrNoContractsWithHost = errors.New("no contract with host which is need to terminate") + var ErrUnableRetrieveHostInfo = errors.New("can't retrieve host info") + var HealthCheckInterval = 30 * time.Minute + var MaxConsecutiveSegmentUploads = 100 + var RemoteRepairDownloadThreshold = 0.125 + var RepairStuckSegmentInterval = 10 * time.Minute + var UploadAndRepairErrorSleepDuration = 15 * time.Minute + var UploadFailureCoolDown = 3 * time.Second + func CalculateProofRanges(actions []storage.UploadAction, oldNumSectors uint64) []merkle.SubTreeLimit + func ModifyLeaves(leafHashes []common.Hash, actions []storage.UploadAction, numSectors uint64) []common.Hash + func ModifyProofRanges(proofRanges []merkle.SubTreeLimit, actions []storage.UploadAction, ...) []merkle.SubTreeLimit + func NewRevision(current types.StorageContractRevision, cost *big.Int) types.StorageContractRevision + type ActiveContractsAPI struct + AbleToRenew bool + AbleToUpload bool + Canceled bool + HostID enode.ID + ID storage.ContractID + type ActiveContractsAPIDisplay struct + AbleToRenew bool + AbleToUpload bool + Canceled bool + ContractID string + HostID string + type ContractMetaDataAPIDisplay struct + Canceled string + ContractBalance string + ContractFee string + DownloadCost string + EndHeight string + EnodeID enode.ID + GasCost string + ID string + LatestContractRevision types.StorageContractRevision + RenewAbility string + StartHeight string + StorageCost string + TotalCost string + UploadAbility string + UploadCost string + type PrivateStorageClientAPI struct + func NewPrivateStorageClientAPI(sc *StorageClient) *PrivateStorageClientAPI + func (api *PrivateStorageClientAPI) PeriodCost() storage.PeriodCost + func (api *PrivateStorageClientAPI) SetConfig(settings map[string]string) (resp string, err error) + func (api *PrivateStorageClientAPI) SetPaymentAddress(addrStr string) bool + type PublicStorageClientAPI struct + func NewPublicStorageClientAPI(sc *StorageClient) *PublicStorageClientAPI + func (api *PublicStorageClientAPI) Config() (setting storage.ClientSettingAPIDisplay) + func (api *PublicStorageClientAPI) Contract(contractID string) (detail ContractMetaDataAPIDisplay, err error) + func (api *PublicStorageClientAPI) Contracts() (activeContracts []ActiveContractsAPIDisplay) + func (api *PublicStorageClientAPI) DownloadSync(remoteFilePath, localPath string) (string, error) + func (api *PublicStorageClientAPI) GetRenewWindow() string + func (api *PublicStorageClientAPI) Host(id string) (host storage.HostInfo, err error) + func (api *PublicStorageClientAPI) HostRank() (evaluation []storagehostmanager.StorageHostRank) + func (api *PublicStorageClientAPI) Hosts() (hosts []storage.HostInfo) + func (api *PublicStorageClientAPI) PaymentAddress() (common.Address, error) + func (api *PublicStorageClientAPI) Upload(source string, dxPath string) (string, error) + type StorageClient struct + PaymentAddress common.Address + func New(persistDir string) (*StorageClient, error) + func (client *StorageClient) AccountManager() *accounts.Manager + func (client *StorageClient) ActiveContracts() (activeContracts []ActiveContractsAPIDisplay) + func (client *StorageClient) Append(sp storage.Peer, data []byte, hostInfo *storage.HostInfo) (common.Hash, error) + func (client *StorageClient) ChainConfig() *params.ChainConfig + func (client *StorageClient) CheckAndUpdateConnection(peerNode *enode.Node) + func (client *StorageClient) Close() error + func (client *StorageClient) ContractDetail(contractID storage.ContractID) (detail storage.ContractMetaData, exists bool) + func (client *StorageClient) CurrentBlock() *types.Block + func (client *StorageClient) DeleteFile(path storage.DxPath) error + func (client *StorageClient) DirInfo(dxPath storage.DxPath) (storage.DirectoryInfo, error) + func (client *StorageClient) DirList(dxPath storage.DxPath) ([]storage.DirectoryInfo, []storage.UploadFileInfo, error) + func (client *StorageClient) Download(sp storage.Peer, root common.Hash, offset, length uint32, ...) ([]byte, error) + func (client *StorageClient) DownloadAsync(p storage.DownloadParameters) error + func (client *StorageClient) DownloadSync(p storage.DownloadParameters) error + func (client *StorageClient) GetFileSystem() filesystem.FileSystem + func (client *StorageClient) GetHostAnnouncementWithBlockHash(blockHash common.Hash) (hostAnnouncements []types.HostAnnouncement, number uint64, errGet error) + func (client *StorageClient) GetPaymentAddress() (common.Address, error) + func (client *StorageClient) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error) + func (client *StorageClient) GetStorageHostManager() *storagehostmanager.StorageHostManager + func (client *StorageClient) GetStorageHostSetting(hostEnodeID enode.ID, hostEnodeURL string, config *storage.HostExtConfig) error + func (client *StorageClient) GetTxByBlockHash(blockHash common.Hash) (types.Transactions, error) + func (client *StorageClient) IsContractSignedWithHost(hostNode *enode.Node) bool + func (client *StorageClient) Online() bool + func (client *StorageClient) Read(sp storage.Peer, w io.Writer, req storage.DownloadRequest, ...) (err error) + func (client *StorageClient) RetrieveClientSetting() (setting storage.ClientSetting) + func (client *StorageClient) RevisionOrRenewingDone(hostID enode.ID) + func (client *StorageClient) SelfEnodeURL() string + func (client *StorageClient) SendStorageContractCreateTx(clientAddr common.Address, input []byte) (common.Hash, error) + func (client *StorageClient) SendTx(ctx context.Context, signedTx *types.Transaction) error + func (client *StorageClient) SetClientSetting(setting storage.ClientSetting) (err error) + func (client *StorageClient) SetupConnection(enodeURL string) (storage.Peer, error) + func (client *StorageClient) Start(b storage.EthBackend, apiBackend ethapi.Backend) (err error) + func (client *StorageClient) SubscribeChainChangeEvent(ch chan<- core.ChainChangeEvent) event.Subscription + func (client *StorageClient) SuggestPrice(ctx context.Context) (*big.Int, error) + func (client *StorageClient) Syncing() bool + func (client *StorageClient) TryToRenewOrRevise(hostID enode.ID) bool + func (client *StorageClient) Upload(up storage.FileUploadParams) error + func (client *StorageClient) Write(sp storage.Peer, actions []storage.UploadAction, hostInfo *storage.HostInfo) (err error)