Documentation
¶
Index ¶
- Variables
- type BlobAcceptResult
- type Client
- func (s *Client) BlobAccept(ctx context.Context, space did.DID, digest multihash.Multihash, size uint64, ...) (*BlobAcceptResult, error)
- func (s *Client) BlobAllocate(ctx context.Context, space did.DID, digest multihash.Multihash, size uint64, ...) (*blob.Address, error)
- func (s *Client) PDPInfo(ctx context.Context, blob multihash.Multihash) (pdp.InfoOk, error)
- type Config
- type NodeStatus
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 (*Client) BlobAccept ¶
func (*Client) BlobAllocate ¶
func (s *Client) BlobAllocate(ctx context.Context, 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).
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
}
type NodeStatus ¶ added in v0.0.15
type NodeStatus struct {
Healthy bool `json:"healthy"`
IsProving bool `json:"is_proving"`
InChallengeWindow bool `json:"in_challenge_window"`
HasProven bool `json:"has_proven"`
InFaultState bool `json:"in_fault_state"`
UpgradeSafe bool `json:"upgrade_safe"`
NextChallenge *time.Time `json:"next_challenge,omitempty"`
}
NodeStatus represents the current state of a piri node
func GetNodeStatus ¶ added in v0.0.15
func GetNodeStatus(ctx context.Context) (*NodeStatus, error)
GetNodeStatus connects to a running piri node and checks its status
Click to show internal directories.
Click to hide internal directories.