Documentation ¶
Index ¶
- Constants
- Variables
- func MaddrsToUrl(addrs []multiaddr.Multiaddr) (*url.URL, error)
- func MemoryWatchdog() (cleanup func())
- func RobustGet(url string, dataSize int64, rcf func() *RateCounter) io.ReadCloser
- type CachedQuery
- type CurrentDealInfo
- type CurrentDealInfoAPI
- type CurrentDealInfoManager
- func (mgr *CurrentDealInfoManager) CheckDealEquality(ctx context.Context, tsk types.TipSetKey, p1, p2 market.DealProposal) (bool, error)
- func (mgr *CurrentDealInfoManager) FindCloseMsgTipset(ctx context.Context, tsk types.TipSetKey, publishCid cid.Cid, ...) (types.TipSetKey, error)
- func (mgr *CurrentDealInfoManager) GetCurrentDealInfo(ctx context.Context, tsk types.TipSetKey, proposal *market.DealProposal, ...) (CurrentDealInfo, error)
- type DataCIDSize
- type DataCidWriter
- type DiskKeyStore
- type IpldStoreWrapper
- func (b *IpldStoreWrapper) BlockWriteOpener() linking.BlockWriteOpener
- func (b *IpldStoreWrapper) Get(ctx context.Context, key string) ([]byte, error)
- func (b *IpldStoreWrapper) Has(ctx context.Context, key string) (bool, error)
- func (b *IpldStoreWrapper) Put(ctx context.Context, key string, content []byte) error
- type LocalWallet
- func (w *LocalWallet) GetDefault() (address.Address, error)
- func (w *LocalWallet) SetDefault(a address.Address) error
- func (w *LocalWallet) WalletList(ctx context.Context) ([]address.Address, error)
- func (w *LocalWallet) WalletNew(ctx context.Context, typ types.KeyType) (address.Address, error)
- func (w *LocalWallet) WalletSign(ctx context.Context, addr address.Address, msg []byte, meta api.MsgMeta) (*crypto.Signature, error)
- type RateCounter
- type RateCounters
- type RateEnforcingReader
- type RateEnforcingWriter
- type RateFunc
- type RepairCarLog
- type RetryDB
- func (d *RetryDB) Begin() (*sql.Tx, error)
- func (d *RetryDB) Exec(query string, args ...interface{}) (sql.Result, error)
- func (d *RetryDB) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (d *RetryDB) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (d *RetryDB) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (d *RetryDB) QueryRow(query string, args ...interface{}) *sql.Row
Constants ¶
const ( KNamePrefix = "wallet-" KTrashPrefix = "trash-" KDefault = "default" )
const CommPBuf = abi.UnpaddedPieceSize(commPBufPad - (commPBufPad / 128)) // can't use .Unpadded() for const
Variables ¶
var TotalTransferDivFactor int64 = 4
Functions ¶
func MaddrsToUrl ¶
func MemoryWatchdog ¶
func MemoryWatchdog() (cleanup func())
func RobustGet ¶
func RobustGet(url string, dataSize int64, rcf func() *RateCounter) io.ReadCloser
Types ¶
type CachedQuery ¶
type CachedQuery[T any] struct { // contains filtered or unexported fields }
func NewCachedQuery ¶
func NewCachedQuery[T any](refreshInterval time.Duration, refreshFunc func() (T, error)) *CachedQuery[T]
func (*CachedQuery[T]) Get ¶
func (cq *CachedQuery[T]) Get() (T, error)
type CurrentDealInfo ¶
type CurrentDealInfoAPI ¶
type CurrentDealInfoAPI interface { ChainGetMessage(context.Context, cid.Cid) (*types.Message, error) StateLookupID(context.Context, address.Address, types.TipSetKey) (address.Address, error) StateMarketStorageDeal(context.Context, abi.DealID, types.TipSetKey) (*api.MarketDeal, error) StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*api.MsgLookup, error) StateNetworkVersion(ctx context.Context, tsk types.TipSetKey) (network.Version, error) ChainGetTipSet(ctx context.Context, tsk types.TipSetKey) (*types.TipSet, error) ChainGetTipSetByHeight(ctx context.Context, h abi.ChainEpoch, tsk types.TipSetKey) (*types.TipSet, error) StateGetActor(ctx context.Context, actor address.Address, ts types.TipSetKey) (*types.Actor, error) }
type CurrentDealInfoManager ¶
type CurrentDealInfoManager struct {
CDAPI CurrentDealInfoAPI
}
func (*CurrentDealInfoManager) CheckDealEquality ¶
func (mgr *CurrentDealInfoManager) CheckDealEquality(ctx context.Context, tsk types.TipSetKey, p1, p2 market.DealProposal) (bool, error)
func (*CurrentDealInfoManager) FindCloseMsgTipset ¶
func (mgr *CurrentDealInfoManager) FindCloseMsgTipset(ctx context.Context, tsk types.TipSetKey, publishCid cid.Cid, step abi.ChainEpoch) (types.TipSetKey, error)
func (*CurrentDealInfoManager) GetCurrentDealInfo ¶
func (mgr *CurrentDealInfoManager) GetCurrentDealInfo(ctx context.Context, tsk types.TipSetKey, proposal *market.DealProposal, publishCid cid.Cid) (CurrentDealInfo, error)
GetCurrentDealInfo gets the current deal state and deal ID. Note that the deal ID is assigned when the deal is published, so it may have changed if there was a reorg after the deal was published.
type DataCIDSize ¶
type DataCIDSize struct { PayloadSize int64 PieceSize abi.PaddedPieceSize PieceCID cid.Cid }
type DataCidWriter ¶
type DataCidWriter struct {
// contains filtered or unexported fields
}
func (*DataCidWriter) Sum ¶
func (w *DataCidWriter) Sum() (DataCIDSize, error)
type DiskKeyStore ¶
type DiskKeyStore struct {
// contains filtered or unexported fields
}
func OpenOrInitKeystore ¶
func OpenOrInitKeystore(p string) (*DiskKeyStore, error)
func (*DiskKeyStore) Delete ¶
func (fsr *DiskKeyStore) Delete(name string) error
func (*DiskKeyStore) Get ¶
func (fsr *DiskKeyStore) Get(name string) (types.KeyInfo, error)
Get gets a key out of keystore and returns types.KeyInfo coresponding to named key
func (*DiskKeyStore) List ¶
func (fsr *DiskKeyStore) List() ([]string, error)
List lists all the keys stored in the KeyStore
type IpldStoreWrapper ¶
type IpldStoreWrapper struct {
BS blockstore.Blockstore
}
func (*IpldStoreWrapper) BlockWriteOpener ¶
func (b *IpldStoreWrapper) BlockWriteOpener() linking.BlockWriteOpener
BlockWriteOpener returns a BlockWriteOpener that operates on this storage.
type LocalWallet ¶
type LocalWallet struct {
// contains filtered or unexported fields
}
func OpenWallet ¶
func OpenWallet(path string) (*LocalWallet, error)
func (*LocalWallet) GetDefault ¶
func (w *LocalWallet) GetDefault() (address.Address, error)
func (*LocalWallet) SetDefault ¶
func (w *LocalWallet) SetDefault(a address.Address) error
func (*LocalWallet) WalletList ¶
func (w *LocalWallet) WalletList(ctx context.Context) ([]address.Address, error)
type RateCounter ¶
type RateCounter struct {
// contains filtered or unexported fields
}
func (*RateCounter) Check ¶
func (rc *RateCounter) Check(cb func() error) error
Check allows only single concurrent check per peer - this is to prevent multiple concurrent checks causing all transfers to fail at once. When we drop a peer, we'll reduce rc.transfers, so the next check will require less total bandwidth (assuming that MinAvgGlobalLogPeerRate is used).
func (*RateCounter) Release ¶
func (rc *RateCounter) Release()
type RateCounters ¶
type RateCounters[K comparable] struct { // contains filtered or unexported fields }
func NewRateCounters ¶
func NewRateCounters[K comparable](rateFunc RateFunc) *RateCounters[K]
func (*RateCounters[K]) Get ¶
func (rc *RateCounters[K]) Get(key K) *RateCounter
type RateEnforcingReader ¶
type RateEnforcingReader struct {
// contains filtered or unexported fields
}
func NewRateEnforcingReader ¶
func NewRateEnforcingReader(r io.Reader, rc *RateCounter, windowDuration time.Duration) *RateEnforcingReader
func (*RateEnforcingReader) Done ¶
func (rer *RateEnforcingReader) Done()
func (*RateEnforcingReader) ReadError ¶
func (rer *RateEnforcingReader) ReadError() error
type RateEnforcingWriter ¶
type RateEnforcingWriter struct {
// contains filtered or unexported fields
}
func NewRateEnforcingWriter ¶
func NewRateEnforcingWriter(w io.Writer, rc *RateCounter, windowDuration time.Duration) *RateEnforcingWriter
func (*RateEnforcingWriter) Done ¶
func (rew *RateEnforcingWriter) Done()
func (*RateEnforcingWriter) WriteError ¶
func (rew *RateEnforcingWriter) WriteError() error
type RateFunc ¶
func MinAvgGlobalLogPeerRate ¶
type RepairCarLog ¶
type RepairCarLog struct {
// contains filtered or unexported fields
}
func NewCarRepairReader ¶
type RetryDB ¶
type RetryDB struct {
// contains filtered or unexported fields
}
RetryDB retries 'database is locked' errors
func NewRetryDB ¶
func (*RetryDB) ExecContext ¶
func (d *RetryDB) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
ExecContext