storageadapter

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2021 License: Apache-2.0, MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentDealInfo added in v1.1.3

func GetCurrentDealInfo(ctx context.Context, ts *types.TipSet, api getCurrentDealInfoAPI, dealID abi.DealID, proposal market.DealProposal, publishCid *cid.Cid) (abi.DealID, *api.MarketDeal, error)

GetCurrentDealInfo gets current information on a deal, and corrects the deal ID as needed

func NewClientNodeAdapter

func NewClientNodeAdapter(stateapi full.StateAPI, chain full.ChainAPI, mpool full.MpoolAPI, fundmgr *market.FundManager) storagemarket.StorageClientNode

func OnDealSectorCommitted added in v1.1.3

func OnDealSectorCommitted(ctx context.Context, api getCurrentDealInfoAPI, eventsApi sectorCommittedEventsAPI, provider address.Address, dealID abi.DealID, sectorNumber abi.SectorNumber, proposal market.DealProposal, publishCid *cid.Cid, callback storagemarket.DealSectorCommittedCallback) error

func OnDealSectorPreCommitted added in v1.2.2

func OnDealSectorPreCommitted(ctx context.Context, api getCurrentDealInfoAPI, eventsApi sectorCommittedEventsAPI, provider address.Address, dealID abi.DealID, proposal market.DealProposal, publishCid *cid.Cid, callback storagemarket.DealSectorPreCommittedCallback) error

Types

type ClientNodeAdapter

type ClientNodeAdapter struct {
	full.StateAPI
	full.ChainAPI
	full.MpoolAPI
	// contains filtered or unexported fields
}

func (*ClientNodeAdapter) AddFunds

func (c *ClientNodeAdapter) AddFunds(ctx context.Context, addr address.Address, amount abi.TokenAmount) (cid.Cid, error)

Adds funds with the StorageMinerActor for a storage participant. Used by both providers and clients.

func (*ClientNodeAdapter) DealProviderCollateralBounds added in v0.5.0

func (c *ClientNodeAdapter) DealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, isVerified bool) (abi.TokenAmount, abi.TokenAmount, error)

func (*ClientNodeAdapter) GetBalance

func (c *ClientNodeAdapter) GetBalance(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (storagemarket.Balance, error)

func (*ClientNodeAdapter) GetChainHead added in v0.3.0

func (*ClientNodeAdapter) GetDefaultWalletAddress

func (c *ClientNodeAdapter) GetDefaultWalletAddress(ctx context.Context) (address.Address, error)

func (*ClientNodeAdapter) GetMinerInfo added in v0.4.1

func (c *ClientNodeAdapter) GetMinerInfo(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (*storagemarket.StorageProviderInfo, error)

func (*ClientNodeAdapter) ListStorageProviders

func (c *ClientNodeAdapter) ListStorageProviders(ctx context.Context, encodedTs shared.TipSetToken) ([]*storagemarket.StorageProviderInfo, error)

func (*ClientNodeAdapter) OnDealExpiredOrSlashed added in v0.5.0

func (c *ClientNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID abi.DealID, onDealExpired storagemarket.DealExpiredCallback, onDealSlashed storagemarket.DealSlashedCallback) error

func (*ClientNodeAdapter) OnDealSectorCommitted

func (c *ClientNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, sectorNumber abi.SectorNumber, proposal market2.DealProposal, publishCid *cid.Cid, cb storagemarket.DealSectorCommittedCallback) error

func (*ClientNodeAdapter) OnDealSectorPreCommitted added in v1.2.2

func (c *ClientNodeAdapter) OnDealSectorPreCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, proposal market2.DealProposal, publishCid *cid.Cid, cb storagemarket.DealSectorPreCommittedCallback) error

func (*ClientNodeAdapter) ReleaseFunds added in v1.1.3

func (c *ClientNodeAdapter) ReleaseFunds(ctx context.Context, addr address.Address, amt abi.TokenAmount) error

func (*ClientNodeAdapter) ReserveFunds added in v1.1.3

func (c *ClientNodeAdapter) ReserveFunds(ctx context.Context, wallet, addr address.Address, amt abi.TokenAmount) (cid.Cid, error)

func (*ClientNodeAdapter) SignBytes added in v0.5.0

func (c *ClientNodeAdapter) SignBytes(ctx context.Context, signer address.Address, b []byte) (*crypto.Signature, error)

func (*ClientNodeAdapter) SignProposal

func (c *ClientNodeAdapter) SignProposal(ctx context.Context, signer address.Address, proposal market2.DealProposal) (*market2.ClientDealProposal, error)

func (*ClientNodeAdapter) ValidatePublishedDeal

func (c *ClientNodeAdapter) ValidatePublishedDeal(ctx context.Context, deal storagemarket.ClientDeal) (abi.DealID, error)

ValidatePublishedDeal validates that the provided deal has appeared on chain and references the same ClientDeal returns the Deal id if there is no error

func (*ClientNodeAdapter) VerifySignature added in v0.3.0

func (c *ClientNodeAdapter) VerifySignature(ctx context.Context, sig crypto.Signature, addr address.Address, input []byte, encodedTs shared.TipSetToken) (bool, error)

func (*ClientNodeAdapter) WaitForMessage added in v0.3.0

func (c *ClientNodeAdapter) WaitForMessage(ctx context.Context, mcid cid.Cid, cb func(code exitcode.ExitCode, bytes []byte, finalCid cid.Cid, err error) error) error

type ProviderNodeAdapter

type ProviderNodeAdapter struct {
	api.FullNode
	// contains filtered or unexported fields
}

func (*ProviderNodeAdapter) AddFunds

func (n *ProviderNodeAdapter) AddFunds(ctx context.Context, addr address.Address, amount abi.TokenAmount) (cid.Cid, error)

Adds funds with the StorageMinerActor for a storage participant. Used by both providers and clients.

func (*ProviderNodeAdapter) DealProviderCollateralBounds added in v0.5.0

func (n *ProviderNodeAdapter) DealProviderCollateralBounds(ctx context.Context, size abi.PaddedPieceSize, isVerified bool) (abi.TokenAmount, abi.TokenAmount, error)

func (*ProviderNodeAdapter) GetBalance

func (n *ProviderNodeAdapter) GetBalance(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (storagemarket.Balance, error)

func (*ProviderNodeAdapter) GetChainHead added in v0.3.0

func (*ProviderNodeAdapter) GetDataCap added in v0.5.0

func (n *ProviderNodeAdapter) GetDataCap(ctx context.Context, addr address.Address, encodedTs shared.TipSetToken) (*abi.StoragePower, error)

func (*ProviderNodeAdapter) GetMinerWorkerAddress added in v0.3.0

func (n *ProviderNodeAdapter) GetMinerWorkerAddress(ctx context.Context, miner address.Address, tok shared.TipSetToken) (address.Address, error)

func (*ProviderNodeAdapter) GetProofType added in v1.2.0

func (n *ProviderNodeAdapter) GetProofType(ctx context.Context, miner address.Address, tok shared.TipSetToken) (abi.RegisteredSealProof, error)

func (*ProviderNodeAdapter) LocatePieceForDealWithinSector added in v0.3.0

func (n *ProviderNodeAdapter) LocatePieceForDealWithinSector(ctx context.Context, dealID abi.DealID, encodedTs shared.TipSetToken) (sectorID abi.SectorNumber, offset abi.PaddedPieceSize, length abi.PaddedPieceSize, err error)

TODO: why doesnt this method take in a sector ID?

func (*ProviderNodeAdapter) OnDealComplete

func (*ProviderNodeAdapter) OnDealExpiredOrSlashed added in v0.5.0

func (n *ProviderNodeAdapter) OnDealExpiredOrSlashed(ctx context.Context, dealID abi.DealID, onDealExpired storagemarket.DealExpiredCallback, onDealSlashed storagemarket.DealSlashedCallback) error

func (*ProviderNodeAdapter) OnDealSectorCommitted added in v0.3.0

func (n *ProviderNodeAdapter) OnDealSectorCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, sectorNumber abi.SectorNumber, proposal market2.DealProposal, publishCid *cid.Cid, cb storagemarket.DealSectorCommittedCallback) error

func (*ProviderNodeAdapter) OnDealSectorPreCommitted added in v1.2.2

func (n *ProviderNodeAdapter) OnDealSectorPreCommitted(ctx context.Context, provider address.Address, dealID abi.DealID, proposal market2.DealProposal, publishCid *cid.Cid, cb storagemarket.DealSectorPreCommittedCallback) error

func (*ProviderNodeAdapter) PublishDeals

func (n *ProviderNodeAdapter) PublishDeals(ctx context.Context, deal storagemarket.MinerDeal) (cid.Cid, error)

func (*ProviderNodeAdapter) ReleaseFunds added in v1.1.3

func (n *ProviderNodeAdapter) ReleaseFunds(ctx context.Context, addr address.Address, amt abi.TokenAmount) error

func (*ProviderNodeAdapter) ReserveFunds added in v1.1.3

func (n *ProviderNodeAdapter) ReserveFunds(ctx context.Context, wallet, addr address.Address, amt abi.TokenAmount) (cid.Cid, error)

func (*ProviderNodeAdapter) SignBytes

func (n *ProviderNodeAdapter) SignBytes(ctx context.Context, signer address.Address, b []byte) (*crypto.Signature, error)

func (*ProviderNodeAdapter) VerifySignature added in v0.3.0

func (n *ProviderNodeAdapter) VerifySignature(ctx context.Context, sig crypto.Signature, addr address.Address, input []byte, encodedTs shared.TipSetToken) (bool, error)

func (*ProviderNodeAdapter) WaitForMessage added in v0.3.0

func (n *ProviderNodeAdapter) WaitForMessage(ctx context.Context, mcid cid.Cid, cb func(code exitcode.ExitCode, bytes []byte, finalCid cid.Cid, err error) error) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL