Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Code ¶ added in v0.9.0
type Code int
Code defines error codes for JSON-RPC.
They are reused for gRPC
const ( CodeBlobNotFound Code = 32001 CodeBlobSizeOverLimit Code = 32002 CodeTxTimedOut Code = 32003 CodeTxAlreadyInMempool Code = 32004 CodeTxIncorrectAccountSequence Code = 32005 CodeTxTooLarge Code = 32006 CodeContextDeadline Code = 32007 CodeFutureHeight Code = 32008 )
Codes are used by JSON-RPC client and server
type Commitment ¶
type Commitment = []byte
Commitment should contain serialized cryptographic commitment to Blob value.
type DA ¶
type DA interface { // MaxBlobSize returns the max blob size MaxBlobSize(ctx context.Context) (uint64, error) // Get returns Blob for each given ID, or an error. // // Error should be returned if ID is not formatted properly, there is no Blob for given ID or any other client-level // error occurred (dropped connection, timeout, etc). Get(ctx context.Context, ids []ID, namespace Namespace) ([]Blob, error) // GetIDs returns IDs of all Blobs located in DA at given height. GetIDs(ctx context.Context, height uint64, namespace Namespace) (*GetIDsResult, error) // GetProofs returns inclusion Proofs for Blobs specified by their IDs. GetProofs(ctx context.Context, ids []ID, namespace Namespace) ([]Proof, error) // Commit creates a Commitment for each given Blob. Commit(ctx context.Context, blobs []Blob, namespace Namespace) ([]Commitment, error) // Submit submits the Blobs to Data Availability layer. // // This method is synchronous. Upon successful submission to Data Availability layer, it returns the IDs identifying blobs // in DA. Submit(ctx context.Context, blobs []Blob, gasPrice float64, namespace Namespace) ([]ID, error) // SubmitWithOptions submits the Blobs to Data Availability layer. // // This method is synchronous. Upon successful submission to Data Availability layer, it returns the IDs identifying blobs // in DA. SubmitWithOptions(ctx context.Context, blobs []Blob, gasPrice float64, namespace Namespace, options []byte) ([]ID, error) // Validate validates Commitments against the corresponding Proofs. This should be possible without retrieving the Blobs. Validate(ctx context.Context, ids []ID, proofs []Proof, namespace Namespace) ([]bool, error) }
DA defines very generic interface for interaction with Data Availability layers.
type ErrBlobNotFound ¶ added in v0.9.0
type ErrBlobNotFound struct{}
ErrBlobNotFound is used to indicate that the blob was not found.
func (*ErrBlobNotFound) Error ¶ added in v0.9.0
func (e *ErrBlobNotFound) Error() string
func (*ErrBlobNotFound) GRPCStatus ¶ added in v0.9.0
func (e *ErrBlobNotFound) GRPCStatus() *status.Status
GRPCStatus returns the gRPC status with details for an ErrBlobNotFound error.
type ErrBlobSizeOverLimit ¶ added in v0.9.0
type ErrBlobSizeOverLimit struct{}
ErrBlobSizeOverLimit is used to indicate that the blob size is over limit.
func (*ErrBlobSizeOverLimit) Error ¶ added in v0.9.0
func (e *ErrBlobSizeOverLimit) Error() string
func (*ErrBlobSizeOverLimit) GRPCStatus ¶ added in v0.9.0
func (e *ErrBlobSizeOverLimit) GRPCStatus() *status.Status
GRPCStatus returns the gRPC status with details for an ErrBlobSizeOverLimit error.
type ErrContextDeadline ¶ added in v0.9.0
type ErrContextDeadline struct{}
ErrContextDeadline is the error message returned by the DA when context deadline exceeds.
func (*ErrContextDeadline) Error ¶ added in v0.9.0
func (e *ErrContextDeadline) Error() string
func (*ErrContextDeadline) GRPCStatus ¶ added in v0.9.0
func (e *ErrContextDeadline) GRPCStatus() *status.Status
GRPCStatus returns the gRPC status with details for an ErrContextDeadline error.
type ErrFutureHeight ¶ added in v0.9.0
type ErrFutureHeight struct{}
ErrFutureHeight is returned when requested height is from the future
func (*ErrFutureHeight) Error ¶ added in v0.9.0
func (e *ErrFutureHeight) Error() string
func (*ErrFutureHeight) GRPCStatus ¶ added in v0.9.0
func (e *ErrFutureHeight) GRPCStatus() *status.Status
GRPCStatus returns the gRPC status with details for an ErrFutureHeight error.
type ErrTxAlreadyInMempool ¶ added in v0.9.0
type ErrTxAlreadyInMempool struct{}
ErrTxAlreadyInMempool is the error message returned by the DA when tx is already in mempool.
func (*ErrTxAlreadyInMempool) Error ¶ added in v0.9.0
func (e *ErrTxAlreadyInMempool) Error() string
func (*ErrTxAlreadyInMempool) GRPCStatus ¶ added in v0.9.0
func (e *ErrTxAlreadyInMempool) GRPCStatus() *status.Status
GRPCStatus returns the gRPC status with details for an ErrTxAlreadyInMempool error.
type ErrTxIncorrectAccountSequence ¶ added in v0.9.0
type ErrTxIncorrectAccountSequence struct{}
ErrTxIncorrectAccountSequence is the error message returned by the DA when tx has incorrect sequence.
func (*ErrTxIncorrectAccountSequence) Error ¶ added in v0.9.0
func (e *ErrTxIncorrectAccountSequence) Error() string
func (*ErrTxIncorrectAccountSequence) GRPCStatus ¶ added in v0.9.0
func (e *ErrTxIncorrectAccountSequence) GRPCStatus() *status.Status
GRPCStatus returns the gRPC status with details for an ErrTxIncorrectAccountSequence error.
type ErrTxTimedOut ¶ added in v0.9.0
type ErrTxTimedOut struct{}
ErrTxTimedOut is the error message returned by the DA when mempool is congested.
func (*ErrTxTimedOut) Error ¶ added in v0.9.0
func (e *ErrTxTimedOut) Error() string
func (*ErrTxTimedOut) GRPCStatus ¶ added in v0.9.0
func (e *ErrTxTimedOut) GRPCStatus() *status.Status
GRPCStatus returns the gRPC status with details for an ErrTxTimedOut error.
type ErrTxTooLarge ¶ added in v0.9.0
type ErrTxTooLarge struct{}
ErrTxTooLarge is the err message returned by the DA when tx size is too large.
func (*ErrTxTooLarge) Error ¶ added in v0.9.0
func (e *ErrTxTooLarge) Error() string
func (*ErrTxTooLarge) GRPCStatus ¶ added in v0.9.0
func (e *ErrTxTooLarge) GRPCStatus() *status.Status
GRPCStatus returns the gRPC status with details for an ErrTxTooLarge error.
type GetIDsResult ¶ added in v0.6.1
GetIDsResult holds the result of GetIDs call: IDs and timestamp of corresponding block.
type ID ¶
type ID = []byte
ID should contain serialized data required by the implementation to find blob in Data Availability layer.