Documentation
¶
Overview ¶
Package celestianodefiber implements the ev-node fiber.DA interface by delegating to a celestia-node api/client.Client.
Upload and Download run locally against a Celestia consensus node (over gRPC) and Fibre Storage Providers (over Fibre gRPC), without a bridge-node hop, using the self-sufficient client introduced in celestia-node #4961. Listen subscribes to a bridge node's blob stream (JSON-RPC/HTTP) and forwards only share-version-2 blobs — the ones settled on-chain through MsgPayForFibre.
This package is a separate Go sub-module from the parent ev-node repository so that ev-node core does not pick up the celestia-app / cosmos-sdk replace-directive soup that celestia-node requires.
Index ¶
- type Adapter
- func (a *Adapter) Close() error
- func (a *Adapter) Download(ctx context.Context, blobID block.FiberBlobID) ([]byte, error)
- func (a *Adapter) Listen(ctx context.Context, namespace []byte, fromHeight uint64) (<-chan block.FiberBlobEvent, error)
- func (a *Adapter) Upload(ctx context.Context, namespace []byte, data []byte) (block.FiberUploadResult, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter implements the ev-node fiber.DA interface on top of a celestia-node api/client.Client. Upload and Download run locally against consensus gRPC + FSPs; Listen forwards share-version-2 blobs from the bridge node's subscription stream.
func FromModules ¶
FromModules wraps existing Fibre and Blob module implementations. It is intended for tests and for callers that already own a *client.Client and want to pass its Fibre + Blob fields directly. The caller retains responsibility for the underlying client's lifecycle; Close is a no-op.
func New ¶
New constructs a celestia-node api/client.Client from cfg and wraps it as an Adapter. The returned Adapter owns the client and must be closed via Close to release its gRPC connections.
func (*Adapter) Download ¶
Download implements fiber.DA.Download. Reads go directly to FSPs via the appfibre client embedded in client.Fibre — no bridge hop.
func (*Adapter) Listen ¶
func (a *Adapter) Listen(ctx context.Context, namespace []byte, fromHeight uint64) (<-chan block.FiberBlobEvent, error)
Listen implements fiber.DA.Listen. It subscribes to blob.Subscribe on the bridge node starting at fromHeight and forwards only share-version-2 (Fibre) blobs as BlobEvents. PFB blobs (v0/v1) sharing the namespace are dropped so consumers see a pure Fibre event stream.
fromHeight == 0 starts the stream at the chain head (live follow). fromHeight > 0 replays from that block forward via the node's WaitForHeight loop so a subscriber can resume after a restart without missing blobs.
DataSize on emitted events is the original payload byte length — matching the fibermock contract ev-node consumers code against. The v2 share only carries (fibre_blob_version + commitment), so the real size isn't derivable from the subscription alone; Listen therefore performs a Download per event to recover the size before forwarding. This adds one FSP round-trip per blob. If that cost becomes material we can expose an opt-out mode, but for now correctness over latency.
func (*Adapter) Upload ¶
func (a *Adapter) Upload( ctx context.Context, namespace []byte, data []byte, ) (block.FiberUploadResult, error)
Upload implements fiber.DA.Upload. client.Fibre.Upload does off-chain row upload plus validator-sig aggregation and spawns a background MsgPayForFibre broadcast; this call returns as soon as the off-chain stages finish.
type Config ¶
type Config struct {
// Client is the full celestia-node api/client.Config. See that package
// for field semantics (ReadConfig.BridgeDAAddr, SubmitConfig.DefaultKeyName,
// SubmitConfig.CoreGRPCConfig, SubmitConfig.Fibre, etc.).
Client client.Config
// ListenChannelSize bounds the buffered BlobEvent channel returned by
// Listen. 0 selects the default (16), matching the upstream
// blob.Subscribe buffer so backpressure behaves consistently.
ListenChannelSize int
}
Config configures the celestia-node-backed Fibre adapter.