Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateReceipts(ctx context.Context, issuer ucan.Signer, aggregate types.Aggregate, ...) ([]receipt.AnyReceipt, error)
- func GenerateReceiptsForAggregates(ctx context.Context, issuer ucan.Signer, aggregates []types.Aggregate, ...) ([]receipt.AnyReceipt, error)
- func NewAddRootsTaskHandler(api pdptypes.ProofSetAPI, proofSet pdptypes.ProofSetIDProvider, ...) jobqueue.TaskHandler[[]datamodel.Link]
- func NewQueue(params QueueParams) (jobqueue.Service[[]datamodel.Link], error)
- type AddRootsTaskHandler
- type Aggregation
- type BufferStore
- type Manager
- type ManagerOption
- type ManagerParams
- type PieceAcceptor
- type QueueParams
- type SubmissionWorkspaceParams
Constants ¶
View Source
const ( QueueName = "manager" HandlerName = "add_roots" )
View Source
const ( // DefaultMaxBatchSizeBytes is the maximum number of pieces that may be submitted to be added as roots in a single operation DefaultMaxBatchSizeBytes = 10 // DefaultPollInterval is the frequency the manager will flush its buffer to submit roots DefaultPollInterval = 30 * time.Second )
DefaultMaxBatchSizeBytes is the maximum size of batch.
View Source
const ManagerKey = "manager/"
Variables ¶
View Source
var Module = fx.Module("aggregation/manager", fx.Provide( NewManager, NewSubmissionWorkspace, NewAddRootsTaskHandler, NewPieceAccepter, NewQueue, ), )
Functions ¶
func GenerateReceipts ¶
func NewAddRootsTaskHandler ¶
func NewAddRootsTaskHandler( api pdptypes.ProofSetAPI, proofSet pdptypes.ProofSetIDProvider, store types.Store, accepter *PieceAcceptor, ) jobqueue.TaskHandler[[]datamodel.Link]
NewAddRootsTaskHandler creates a TaskHandler that submits aggregate roots to the PDP Service
Types ¶
type AddRootsTaskHandler ¶
type AddRootsTaskHandler struct {
// contains filtered or unexported fields
}
func (*AddRootsTaskHandler) Name ¶
func (a *AddRootsTaskHandler) Name() string
type Aggregation ¶
type BufferStore ¶
type BufferStore interface {
// Aggregation retrieves the pending pieces aggregation.
Aggregation(context.Context) (Aggregation, error)
// AppendRoots adds roots to the pending aggregation
AppendRoots(context.Context, []datamodel.Link) error
// ClearRoots removes all roots from the current aggregation.
ClearRoots(context.Context) error
}
BufferStore provides persistent storage for submission state
func NewSubmissionWorkspace ¶
func NewSubmissionWorkspace(params SubmissionWorkspaceParams) (BufferStore, error)
NewSubmissionWorkspace creates a new submission workspace backed by the provided store
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles batched submission of aggregates to the blockchain
func NewManager ¶
func NewManager(lc fx.Lifecycle, params ManagerParams) (*Manager, error)
NewManager creates a new submission manager
type ManagerOption ¶
type ManagerOption func(*Manager)
func WithClock ¶
func WithClock(clock clock.Clock) ManagerOption
func WithMaxBatchSize ¶
func WithMaxBatchSize(maxBatchSize int) ManagerOption
func WithPollInterval ¶
func WithPollInterval(pollInterval time.Duration) ManagerOption
type ManagerParams ¶
type ManagerParams struct {
fx.In
Queue jobqueue.Service[[]datamodel.Link]
TaskHandler jobqueue.TaskHandler[[]datamodel.Link]
Buffer BufferStore
Options []ManagerOption `optional:"true"`
}
type PieceAcceptor ¶
type PieceAcceptor struct {
// contains filtered or unexported fields
}
func NewPieceAccepter ¶
func NewPieceAccepter(issuer principal.Signer, aggregateStore types.Store, receiptStore receiptstore.ReceiptStore, resolver apitypes.PieceResolverAPI) *PieceAcceptor
func (*PieceAcceptor) AcceptPieces ¶
Click to show internal directories.
Click to hide internal directories.