Documentation ¶
Overview ¶
Package providerutils provides utility functions for the storage provider & provider FSM
Index ¶
- func GeneratePieceCommitmentWithMetadata(fileStore filestore.FileStore, commPGenerator CommPGenerator, ...) (cid.Cid, filestore.Path, error)
- func LoadBlockLocations(fs filestore.FileStore, metadataPath filestore.Path) (map[cid.Cid]piecestore.BlockLocation, error)
- func SignMinerData(ctx context.Context, data interface{}, address address.Address, ...) (*crypto.Signature, error)
- func VerifyProposal(ctx context.Context, sdp market.ClientDealProposal, tok shared.TipSetToken, ...) error
- func VerifySignature(ctx context.Context, signature crypto.Signature, signer address.Address, ...) error
- type CommPGenerator
- type SignFunc
- type VerifyFunc
- type WorkerLookupFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePieceCommitmentWithMetadata ¶
func GeneratePieceCommitmentWithMetadata( fileStore filestore.FileStore, commPGenerator CommPGenerator, proofType abi.RegisteredSealProof, payloadCid cid.Cid, selector ipld.Node, storeID *multistore.StoreID) (cid.Cid, filestore.Path, error)
GeneratePieceCommitmentWithMetadata generates a piece commitment along with block metadata
func LoadBlockLocations ¶
func LoadBlockLocations(fs filestore.FileStore, metadataPath filestore.Path) (map[cid.Cid]piecestore.BlockLocation, error)
LoadBlockLocations loads a metadata file then converts it to a map of cid -> blockLocation
func SignMinerData ¶
func SignMinerData(ctx context.Context, data interface{}, address address.Address, tok shared.TipSetToken, workerLookup WorkerLookupFunc, sign SignFunc) (*crypto.Signature, error)
SignMinerData signs the given data structure with a signature for the given address
func VerifyProposal ¶
func VerifyProposal(ctx context.Context, sdp market.ClientDealProposal, tok shared.TipSetToken, verifier VerifyFunc) error
VerifyProposal verifies the signature on the given signed proposal matches the client addres for the proposal, using the given signature verification function
func VerifySignature ¶
func VerifySignature(ctx context.Context, signature crypto.Signature, signer address.Address, buf []byte, tok shared.TipSetToken, verifier VerifyFunc) error
VerifySignature verifies the signature over the given bytes
Types ¶
type CommPGenerator ¶
type CommPGenerator func(abi.RegisteredSealProof, cid.Cid, ipld.Node, *multistore.StoreID, ...car.OnNewCarBlockFunc) (cid.Cid, abi.UnpaddedPieceSize, error)
CommPGenerator is a commP generating function that writes to a file
type VerifyFunc ¶
type VerifyFunc func(context.Context, crypto.Signature, address.Address, []byte, shared.TipSetToken) (bool, error)
VerifyFunc is a function that can validate a signature for a given address and bytes
type WorkerLookupFunc ¶
type WorkerLookupFunc func(context.Context, address.Address, shared.TipSetToken) (address.Address, error)
WorkerLookupFunc is a function that can lookup a miner worker address from a storage miner actor