Documentation ¶
Index ¶
- Constants
- type CelestiaDA
- func (c *CelestiaDA) Commit(ctx context.Context, daBlobs []da.Blob, ns da.Namespace) ([]da.Commitment, error)
- func (c *CelestiaDA) Get(ctx context.Context, ids []da.ID, ns da.Namespace) ([]da.Blob, error)
- func (c *CelestiaDA) GetIDs(ctx context.Context, height uint64, ns da.Namespace) ([]da.ID, error)
- func (c *CelestiaDA) GetPeerInfo(ctx context.Context) (string, error)
- func (c *CelestiaDA) GetProofs(ctx context.Context, daIDs []da.ID, ns da.Namespace) ([]da.Proof, error)
- func (c *CelestiaDA) MaxBlobSize(ctx context.Context) (uint64, error)
- func (c *CelestiaDA) Submit(ctx context.Context, daBlobs []da.Blob, gasPrice float64, ns da.Namespace) ([]da.ID, error)
- func (c *CelestiaDA) Validate(ctx context.Context, ids []da.ID, daProofs []da.Proof, ns da.Namespace) ([]bool, error)
- type MockBlobAPI
- func (m *MockBlobAPI) Get(ctx context.Context, height uint64, ns share.Namespace, _ blob.Commitment) (*blob.Blob, error)
- func (m *MockBlobAPI) GetAll(ctx context.Context, height uint64, ns []share.Namespace) ([]*blob.Blob, error)
- func (m *MockBlobAPI) GetProof(context.Context, uint64, share.Namespace, blob.Commitment) (*blob.Proof, error)
- func (m *MockBlobAPI) Included(context.Context, uint64, share.Namespace, *blob.Proof, blob.Commitment) (bool, error)
- func (m *MockBlobAPI) Submit(ctx context.Context, blobs []*blob.Blob, gasPrice float64) (uint64, error)
- type MockService
Constants ¶
View Source
const ( // DefaultMaxBytes is the maximum blob size accepted by celestia core // ADR-13 claims worst case padding approaches 2 rows for a full data square: // see: https://github.com/celestiaorg/celestia-app/blob/main/docs/architecture/adr-013-non-interactive-default-rules-for-zero-padding.md // square size (64) * two rows = 128 shares // 128 shares * 512 bytes per share = 65,536 bytes to account for padding // 1,973,786 - 65,536 = 1,908,250 bytes DefaultMaxBytes = 1908250 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CelestiaDA ¶
type CelestiaDA struct {
// contains filtered or unexported fields
}
CelestiaDA implements the celestia backend for the DA interface
func NewCelestiaDA ¶
func NewCelestiaDA(client *rpc.Client, namespace share.Namespace, gasPrice float64, ctx context.Context) *CelestiaDA
NewCelestiaDA returns an instance of CelestiaDA
func (*CelestiaDA) Commit ¶
func (c *CelestiaDA) Commit(ctx context.Context, daBlobs []da.Blob, ns da.Namespace) ([]da.Commitment, error)
Commit creates a Commitment for each given Blob.
func (*CelestiaDA) Get ¶
func (c *CelestiaDA) Get(ctx context.Context, ids []da.ID, ns da.Namespace) ([]da.Blob, error)
Get returns Blob for each given ID, or an error.
func (*CelestiaDA) GetIDs ¶
func (c *CelestiaDA) GetIDs(ctx context.Context, height uint64, ns da.Namespace) ([]da.ID, error)
GetIDs returns IDs of all Blobs located in DA at given height.
func (*CelestiaDA) GetPeerInfo ¶
func (c *CelestiaDA) GetPeerInfo(ctx context.Context) (string, error)
getPeerInfo return the peer info, i.e : node id
func (*CelestiaDA) GetProofs ¶
func (c *CelestiaDA) GetProofs(ctx context.Context, daIDs []da.ID, ns da.Namespace) ([]da.Proof, error)
GetProofs returns the inclusion proofs for the given IDs.
func (*CelestiaDA) MaxBlobSize ¶
func (c *CelestiaDA) MaxBlobSize(ctx context.Context) (uint64, error)
MaxBlobSize returns the max blob size
type MockBlobAPI ¶
type MockBlobAPI struct {
// contains filtered or unexported fields
}
MockBlobAPI mocks the blob API
func (*MockBlobAPI) Get ¶
func (m *MockBlobAPI) Get(ctx context.Context, height uint64, ns share.Namespace, _ blob.Commitment) (*blob.Blob, error)
Get mocks the blob.Get method
func (*MockBlobAPI) GetAll ¶
func (m *MockBlobAPI) GetAll(ctx context.Context, height uint64, ns []share.Namespace) ([]*blob.Blob, error)
GetAll mocks the blob.GetAll method
func (*MockBlobAPI) GetProof ¶
func (m *MockBlobAPI) GetProof(context.Context, uint64, share.Namespace, blob.Commitment) (*blob.Proof, error)
GetProof mocks the blob.GetProof method
type MockService ¶
type MockService struct {
// contains filtered or unexported fields
}
MockService mocks the node RPC service
Click to show internal directories.
Click to hide internal directories.