Documentation ¶
Index ¶
- type FilClient
- func (fc *FilClient) CheckChainDeal(ctx context.Context, dealid int64) (active bool, expiration uint64, slashed bool, err error)
- func (fc *FilClient) CheckDealStatusWithStorageProvider(ctx context.Context, storageProviderID string, dealIdentifier string, ...) (pcid *cid.Cid, ds storagemarket.StorageDealStatus, err error)
- func (fc *FilClient) ExecuteAuctionDeal(ctx context.Context, ad store.AuctionData, aud store.AuctionDeal, ...) (didentifier string, retriable bool, err error)
- func (fc *FilClient) GetChainHeight(ctx context.Context) (height uint64, err error)
- func (fc *FilClient) ResolveDealIDFromMessage(ctx context.Context, publishDealMessage cid.Cid, spID string, pieceCid cid.Cid, ...) (dealID int64, err error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilClient ¶
type FilClient struct {
// contains filtered or unexported fields
}
FilClient provides API to interact with the Filecoin network.
func (*FilClient) CheckChainDeal ¶
func (fc *FilClient) CheckChainDeal( ctx context.Context, dealid int64) (active bool, expiration uint64, slashed bool, err error)
CheckChainDeal checks if a deal is active on-chain. If that's the case, it also returns the deal expiration as a second parameter.
func (*FilClient) CheckDealStatusWithStorageProvider ¶
func (fc *FilClient) CheckDealStatusWithStorageProvider( ctx context.Context, storageProviderID string, dealIdentifier string, rw *store.RemoteWallet, ) (pcid *cid.Cid, ds storagemarket.StorageDealStatus, err error)
CheckDealStatusWithStorageProvider checks a deal proposal status with a storage-provider. The caller should be aware that shouldn't fully trust data from storage-providers. To fully confirm the deal, a call to CheckChainDeal must be made after the storage-provider publishes the deal on-chain.
func (*FilClient) ExecuteAuctionDeal ¶
func (fc *FilClient) ExecuteAuctionDeal( ctx context.Context, ad store.AuctionData, aud store.AuctionDeal, rw *store.RemoteWallet) (didentifier string, retriable bool, err error)
ExecuteAuctionDeal creates a deal with a storage-provider using the data described in an auction deal.
func (*FilClient) GetChainHeight ¶
GetChainHeight returns the current chain height.
func (*FilClient) ResolveDealIDFromMessage ¶
func (fc *FilClient) ResolveDealIDFromMessage( ctx context.Context, publishDealMessage cid.Cid, spID string, pieceCid cid.Cid, startEpoch uint64) (dealID int64, err error)
ResolveDealIDFromMessage looks for a publish deal message by its Cid and resolves the deal-id from the receipt. If the message isn't found, the return parameters are 0,nil. If the message is found, a deal-id is returned which can be trusted to match the original ProposalCid. This method is mostly what Estuary does with some tweaks, kudos to them!
type Option ¶
type Option func(*config) error
Option applies a configuration change.
func WithAllowUnverifiedDeals ¶
WithAllowUnverifiedDeals indicates if unverified deals are allowed.
func WithExportedKey ¶
WithExportedKey configures the wallet address private key used to make deals.
func WithMaxPriceLimits ¶
func WithMaxPriceLimits(maxVerifiedPricePerGiBPerEpoch, maxUnverifiedPricePerGiBPerEpoch int64) Option
WithMaxPriceLimits indicates maximum attoFIL per GiB per epoch in proosals.
func WithRelayAddr ¶
WithRelayAddr configures a relay multiaddr to include while dialing remote wallet.