client

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: Apache-2.0, MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIncorrectCapability = errors.New("did not receive expected capability")
View Source
var ErrNoReceipt = errors.New("no error for invocation")

Functions

This section is empty.

Types

type BlobAcceptResult

type BlobAcceptResult struct {
	LocationCommitment assert.LocationCaveats
	PDPAccept          *pdp.AcceptCaveats
}

Blob sends a blob/accept invocation to the storage node and returns the location commitment and piece/accept invocation

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client simulates actions taken by the upload service in response to client invocations.

func NewClient

func NewClient(cfg Config) (*Client, error)

func (*Client) BlobAccept

func (s *Client) BlobAccept(space did.DID, digest multihash.Multihash, size uint64, putInv datamodel.Link) (*BlobAcceptResult, error)

func (*Client) BlobAllocate

func (s *Client) BlobAllocate(space did.DID, digest multihash.Multihash, size uint64, cause datamodel.Link) (*blob.Address, error)

BlobAllocate sends a blob/allocate invocation to the storage node and returns the upload address if required (i.e. it may be nil if the storage node already has the blob).

func (*Client) PDPInfo

func (s *Client) PDPInfo(pieceLink piece.PieceLink) (pdp.InfoOk, error)

type Config

type Config struct {
	ID principal.Signer
	// StorageNodeID is the DID of the storage node.
	StorageNodeID ucan.Principal
	// StorageNodeURL is the URL of the storage node UCAN endpoint.
	StorageNodeURL url.URL
	// StorageProof is a delegation allowing the upload service to invoke
	// blob/allocate and blob/accept on the storage node.
	StorageProof delegation.Proof
}

Jump to

Keyboard shortcuts

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