celestianodefiber

package module
v0.0.0-...-08e997f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

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

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

func FromModules(fibre fibreapi.Module, blob blobapi.Module, listenChannelSize int) *Adapter

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

func New(ctx context.Context, cfg Config, kr keyring.Keyring) (*Adapter, error)

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) Close

func (a *Adapter) Close() error

Close tears down the underlying client, if the Adapter owns one.

func (*Adapter) Download

func (a *Adapter) Download(ctx context.Context, blobID block.FiberBlobID) ([]byte, error)

Download implements fiber.DA.Download. Reads go directly to FSPs via the appfibre client embedded in client.Fibre — no bridge hop.

func (*Adapter) Head

func (a *Adapter) Head(ctx context.Context) (uint64, error)

Head returns the bridge node's current local-head height. Returns 0 if the underlying client was constructed via FromModules without a Header module.

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.

Directories

Path Synopsis
cmd
evnode-fibre command
Command evnode-fibre runs a long-lived ev-node aggregator wired to a celestia-node-fiber adapter.
Command evnode-fibre runs a long-lived ev-node aggregator wired to a celestia-node-fiber adapter.
fiber-bench command
Package main is the fiber-bench tool: a single-sequencer ev-node wired to a remote Fibre network for throughput measurement.
Package main is the fiber-bench tool: a single-sequencer ev-node wired to a remote Fibre network for throughput measurement.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL