Documentation ¶
Overview ¶
Package providerutils provides utility functions for the storage provider & provider FSM
Index ¶
- 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 SignFunc
- type VerifyFunc
- type WorkerLookupFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶ added in v0.3.2
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 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