celestia

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToNamespaceV0

func BytesToNamespaceV0(bytes []byte) (share.Namespace, error)

func HexToNamespaceV0

func HexToNamespaceV0(namespaceId string) (share.Namespace, error)

Convert hex namespace ID to blob namespace

Types

type BlobStore

type BlobStore interface {
	Store(ctx context.Context, msg []byte) (commitment []byte, height uint64, err error)
	StoreBatch(ctx context.Context, msgs [][]byte) (commitments [][]byte, height uint64, err error)
	Has(ctx context.Context, height uint64, commitment []byte) (bool, error)
	Read(ctx context.Context, height uint64, commitment []byte) ([]byte, error)
	GetBlobs(ctx context.Context, height uint64) ([]*blob.Blob, error)
	LatestHeight(ctx context.Context) (uint64, error)
	GetHeader(ctx context.Context, height uint64) (*header.ExtendedHeader, error)
	SubscribeToNewHeaders(ctx context.Context) (<-chan CompactHeader, error)

	Namespace() share.Namespace
	Cfg() DAConfig
}

type CelestiaDA

type CelestiaDA struct {
	// contains filtered or unexported fields
}

Client for interacting with Celestia

func NewCelestiaDA

func NewCelestiaDA(cfg DAConfig) (*CelestiaDA, error)

Create a new Celestia DA client

func (*CelestiaDA) Cfg

func (c *CelestiaDA) Cfg() DAConfig

func (*CelestiaDA) GetBlobs

func (c *CelestiaDA) GetBlobs(ctx context.Context, height uint64) ([]*blob.Blob, error)

func (*CelestiaDA) GetHeader

func (c *CelestiaDA) GetHeader(ctx context.Context, height uint64) (*header.ExtendedHeader, error)

func (*CelestiaDA) Has

func (c *CelestiaDA) Has(ctx context.Context, height uint64, commitment []byte) (bool, error)

func (*CelestiaDA) LatestHeight

func (c *CelestiaDA) LatestHeight(ctx context.Context) (uint64, error)

func (*CelestiaDA) Namespace

func (c *CelestiaDA) Namespace() share.Namespace

func (*CelestiaDA) Read

func (c *CelestiaDA) Read(ctx context.Context, height uint64, commitment []byte) ([]byte, error)

func (*CelestiaDA) Store

func (c *CelestiaDA) Store(ctx context.Context, message []byte) ([]byte, uint64, error)

func (*CelestiaDA) StoreBatch

func (c *CelestiaDA) StoreBatch(ctx context.Context, messages [][]byte) ([][]byte, uint64, error)

func (*CelestiaDA) SubscribeToNewHeaders

func (c *CelestiaDA) SubscribeToNewHeaders(ctx context.Context) (<-chan CompactHeader, error)

type CompactHeader

type CompactHeader struct {
	Height uint64
	Time   time.Time
}

type DAConfig

type DAConfig struct {
	Rpc         string
	NamespaceId string
	AuthToken   string
	MaxTxSize   int
}

Configuration for connecting to Celestia DA

type NoopDA

type NoopDA struct {
	// contains filtered or unexported fields
}

func NewNoopDA

func NewNoopDA() (*NoopDA, error)

func (*NoopDA) Cfg

func (d *NoopDA) Cfg() DAConfig

func (*NoopDA) GetBlobs

func (d *NoopDA) GetBlobs(_ context.Context, height uint64) ([]*blob.Blob, error)

func (*NoopDA) GetHeader

func (d *NoopDA) GetHeader(_ context.Context, height uint64) (*header.ExtendedHeader, error)

func (*NoopDA) Has

func (d *NoopDA) Has(_ context.Context, height uint64, _ []byte) (bool, error)

func (*NoopDA) LatestHeight

func (d *NoopDA) LatestHeight(_ context.Context) (uint64, error)

func (*NoopDA) Namespace

func (d *NoopDA) Namespace() share.Namespace

func (*NoopDA) Read

func (d *NoopDA) Read(_ context.Context, height uint64, _ []byte) ([]byte, error)

func (*NoopDA) Store

func (d *NoopDA) Store(_ context.Context, msg []byte) ([]byte, uint64, error)

func (*NoopDA) StoreBatch

func (d *NoopDA) StoreBatch(_ context.Context, msgs [][]byte) ([][]byte, uint64, error)

func (*NoopDA) SubscribeToNewHeaders

func (d *NoopDA) SubscribeToNewHeaders(_ context.Context) (<-chan CompactHeader, error)

Jump to

Keyboard shortcuts

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