Documentation
¶
Index ¶
- type API
- func (api *API) Commit(ctx context.Context, blobs []da.Blob, ns []byte) ([]da.Commitment, error)
- func (api *API) Get(ctx context.Context, ids []da.ID, ns []byte) ([]da.Blob, error)
- func (api *API) GetIDs(ctx context.Context, height uint64, ns []byte) (*da.GetIDsResult, error)
- func (api *API) GetProofs(ctx context.Context, ids []da.ID, ns []byte) ([]da.Proof, error)
- func (api *API) Submit(ctx context.Context, blobs []da.Blob, gasPrice float64, ns []byte) ([]da.ID, error)
- func (api *API) SubmitWithOptions(ctx context.Context, inputBlobs []da.Blob, gasPrice float64, ns []byte, ...) ([]da.ID, error)
- func (api *API) Validate(ctx context.Context, ids []da.ID, proofs []da.Proof, ns []byte) ([]bool, error)
- type Client
- type Module
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
Logger zerolog.Logger
MaxBlobSize uint64
Internal struct {
Get func(ctx context.Context, ids []da.ID, ns []byte) ([]da.Blob, error) `perm:"read"`
GetIDs func(ctx context.Context, height uint64, ns []byte) (*da.GetIDsResult, error) `perm:"read"`
GetProofs func(ctx context.Context, ids []da.ID, ns []byte) ([]da.Proof, error) `perm:"read"`
Commit func(ctx context.Context, blobs []da.Blob, ns []byte) ([]da.Commitment, error) `perm:"read"`
Validate func(context.Context, []da.ID, []da.Proof, []byte) ([]bool, error) `perm:"read"`
Submit func(context.Context, []da.Blob, float64, []byte) ([]da.ID, error) `perm:"write"`
SubmitWithOptions func(context.Context, []da.Blob, float64, []byte, []byte) ([]da.ID, error) `perm:"write"`
}
}
API defines the jsonrpc service module API
func (*API) Submit ¶
func (api *API) Submit(ctx context.Context, blobs []da.Blob, gasPrice float64, ns []byte) ([]da.ID, error)
Submit submits the Blobs to Data Availability layer.
func (*API) SubmitWithOptions ¶
func (api *API) SubmitWithOptions(ctx context.Context, inputBlobs []da.Blob, gasPrice float64, ns []byte, options []byte) ([]da.ID, error)
SubmitWithOptions submits the Blobs to Data Availability layer with additional options. It validates the entire batch against MaxBlobSize before submission. If any blob or the total batch size exceeds limits, it returns ErrBlobSizeOverLimit.
type Client ¶
type Client struct {
DA API
// contains filtered or unexported fields
}
Client is the jsonrpc client
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a jsonrpc service that can serve the DA interface
func NewServer ¶
NewServer accepts the host address port and the DA implementation to serve as a jsonrpc service
Click to show internal directories.
Click to hide internal directories.