clientutils

package
v0.0.0-...-75360cb Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0, MIT Imports: 16 Imported by: 0

Documentation

Overview

Package clientutils provides utility functions for the storage client & client FSM

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommP

func CommP(ctx context.Context, bs bstore.Blockstore, data *storagemarket.DataRef, maxTraversalLinks uint64) (cid.Cid, abi.UnpaddedPieceSize, error)

CommP calculates the commP for a given dataref In Markets, CommP = PieceCid. We can't rely on the CARv1 payload in the given CARv2 file being deterministic as the client could have written a "non-deterministic/unordered" CARv2 file. So, we need to do a CARv1 traversal here by giving the traverser a random access CARv2 blockstore that wraps the given CARv2 file.

func LabelField

func LabelField(payloadCID cid.Cid) (market.DealLabel, error)

LabelField makes a label field for a deal proposal as a multibase encoding of the payload CID (B58BTC for V0, B64 for V1)

func VerifyResponse

func VerifyResponse(ctx context.Context, resp network.SignedResponse, minerAddr address.Address, tok shared.TipSetToken, verifier VerifyFunc) error

VerifyResponse verifies the signature on the given signed response matches the given miner address, using the given signature verification function

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

Jump to

Keyboard shortcuts

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