Versions in this module Expand all Collapse all v1 v1.0.1 Mar 1, 2020 Changes in this version + const SectorSize + type Contract struct + func (c *Contract) CommitDownload(t *writeaheadlog.Transaction, signedRev types.StorageContractRevision, ...) (err error) + func (c *Contract) CommitRevision(signedRevision types.StorageContractRevision, costs ...common.BigInt) (err error) + func (c *Contract) CommitTxns() (err error) + func (c *Contract) CommitUpload(t *writeaheadlog.Transaction, signedRev types.StorageContractRevision, ...) (err error) + func (c *Contract) Header() ContractHeader + func (c *Contract) LatestRevisionValidation(rev types.StorageContractRevision) (err error) + func (c *Contract) MerkleRoots() ([]common.Hash, error) + func (c *Contract) Metadata() (meta storage.ContractMetaData) + func (c *Contract) RollbackUndoMem(undoHeader ContractHeader) (err error) + func (c *Contract) RollbackUndoWal(t *writeaheadlog.Transaction) (err error) + func (c *Contract) Status() (stats storage.ContractStatus) + func (c *Contract) UndoRevisionLog(contractHeader ContractHeader) (t *writeaheadlog.Transaction, err error) + func (c *Contract) UpdateStatus(status storage.ContractStatus) (err error) + type ContractHeader struct + ContractFee common.BigInt + DownloadCost common.BigInt + EnodeID enode.ID + GasFee common.BigInt + ID storage.ContractID + LatestContractRevision types.StorageContractRevision + PrivateKey string + StartHeight uint64 + Status storage.ContractStatus + StorageCost common.BigInt + TotalCost common.BigInt + UploadCost common.BigInt + type DB struct + func OpenDB(path string) (db *DB, err error) + func (db *DB) Close() + func (db *DB) DeleteContractHeader(id storage.ContractID) (err error) + func (db *DB) DeleteHeaderAndRoots(id storage.ContractID) (err error) + func (db *DB) DeleteMerkleRoots(id storage.ContractID) (err error) + func (db *DB) EmptyDB() (err error) + func (db *DB) FetchAll() (chs []ContractHeader, allRoots [][]common.Hash, err error) + func (db *DB) FetchAllContractID() (ids []storage.ContractID) + func (db *DB) FetchAllHeader() (chs []ContractHeader, err error) + func (db *DB) FetchAllRoots() (allRoots [][]common.Hash, err error) + func (db *DB) FetchContractHeader(id storage.ContractID) (ch ContractHeader, err error) + func (db *DB) FetchHeaderAndRoots(id storage.ContractID) (ch ContractHeader, roots []common.Hash, err error) + func (db *DB) FetchMerkleRoots(id storage.ContractID) (roots []common.Hash, err error) + func (db *DB) StoreContractHeader(ch ContractHeader) (err error) + func (db *DB) StoreHeaderAndRoots(ch ContractHeader, roots []common.Hash) (err error) + func (db *DB) StoreMerkleRoots(id storage.ContractID, roots []common.Hash) (err error) + func (db *DB) StoreSingleRoot(id storage.ContractID, root common.Hash) (err error) + type RateLimit struct + func NewRateLimit(readBPS, writeBPS int64, packetSize uint64) (rt *RateLimit) + func (rl *RateLimit) RetrieveRateLimit() (readBPS, writeBPS int64, packetSize uint64) + func (rl *RateLimit) SetRateLimit(readBPS, writeBPS int64, packetSize uint64) + type StorageContractSet struct + func New(persistDir string) (scs *StorageContractSet, err error) + func (scs *StorageContractSet) Acquire(id storage.ContractID) (c *Contract, exists bool) + func (scs *StorageContractSet) Close() (err error) + func (scs *StorageContractSet) Contracts() map[storage.ContractID]*Contract + func (scs *StorageContractSet) Delete(c *Contract) (err error) + func (scs *StorageContractSet) EmptyDB() (err error) + func (scs *StorageContractSet) GetContractIDByHostID(hostID enode.ID) storage.ContractID + func (scs *StorageContractSet) IDs() (ids []storage.ContractID) + func (scs *StorageContractSet) InsertContract(ch ContractHeader, roots []common.Hash) (cm storage.ContractMetaData, err error) + func (scs *StorageContractSet) RetrieveAllContractsMetaData() (cms []storage.ContractMetaData) + func (scs *StorageContractSet) RetrieveContractMetaData(id storage.ContractID) (cm storage.ContractMetaData, exist bool) + func (scs *StorageContractSet) RetrieveRateLimit() (readBPS, writeBPS int64, packetSize uint64) + func (scs *StorageContractSet) Return(c *Contract) (err error) + func (scs *StorageContractSet) SetRateLimit(readBPS, writeBPS int64, packetSize uint64)