api

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

View Source
const (
	PDPRoutePath     = "/pdp"
	PRoofSetRoutPath = "/proof-sets"
	PiecePrefix      = "/piece"
)

Variables

View Source
var PieceSizeLimit = abi.PaddedPieceSize(proof.MaxMemtreeSize).Unpadded()

Functions

func RegisterEchoRoutes

func RegisterEchoRoutes(e *echo.Echo, p *PDP)

Types

type AddRootRequest

type AddRootRequest struct {
	RootCid  string                `json:"rootCid"`
	Subroots []AddRootSubrootEntry `json:"subroots"`
}

type AddRootSubrootEntry

type AddRootSubrootEntry struct {
	SubrootCid string `json:"subrootCid"`
}

type AddRootToProofSetRequest

type AddRootToProofSetRequest []AddRootRequest

type AddRootsPayload

type AddRootsPayload struct {
	Roots     []AddRootRequest `json:"roots"`
	ExtraData *string          `json:"extraData,omitempty"`
}

type CreateProofSetRequest

type CreateProofSetRequest struct {
	RecordKeeper string `json:"recordKeeper"`
}

type CreateProofSetResponse

type CreateProofSetResponse struct {
	TxHash   string `json:"txHash"`
	Location string `json:"location"`
}

CreateProofSetResponse is the JSON output for the CreateProofSet endpoint.

type FindPieceResponse

type FindPieceResponse struct {
	PieceCID string `json:"piece_cid"`
}

type GetProofSetCreationStatusResponse

type GetProofSetCreationStatusResponse struct {
	CreateMessageHash string `json:"createMessageHash"`
	ProofsetCreated   bool   `json:"proofsetCreated"`
	Service           string `json:"service"`
	TxStatus          string `json:"txStatus"`
	OK                bool   `json:"ok"`
	ProofSetId        int64  `json:"proofSetId,omitempty"`
}

type GetProofSetResponse

type GetProofSetResponse struct {
	ID                 int64       `json:"id"`
	NextChallengeEpoch int64       `json:"nextChallengeEpoch"`
	Roots              []RootEntry `json:"roots"`
}

type PDP

type PDP struct {
	Service *service.PDPService
}

type PieceHash

type PieceHash struct {
	// Name of the hash function used
	// sha2-256-trunc254-padded - CommP
	// sha2-256 - Blob sha256
	Name string `json:"name"`

	// hex encoded hash
	Hash string `json:"hash"`

	// Size of the piece in bytes
	Size int64 `json:"size"`
}

type PieceUploadResponse

type PieceUploadResponse struct {
	UploadUUID string `json:"uploadUUID"`
	Status     string `json:"status"`
}

type PreparePieceRequest

type PreparePieceRequest struct {
	Check  PieceHash `json:"check"`
	Notify string    `json:"notify,omitempty"`
}

type PreparePieceResponse

type PreparePieceResponse struct {
	Location string `json:"location,omitempty"`
	PieceCID string `json:"piece_cid,omitempty"`
	Created  bool   `json:"created,omitempty"`
}

type RootEntry

type RootEntry struct {
	RootID        int64  `json:"rootId"`
	RootCID       string `json:"rootCid"`
	SubrootCID    string `json:"subrootCid"`
	SubrootOffset int64  `json:"subrootOffset"`
}

type Server

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

func NewServer

func NewServer(p *PDP) *Server

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

func (*Server) Start

func (s *Server) Start(addr string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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