blob

package
v0.0.0-...-4ef5390 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBlobNotFound = errors.New("blob: not found")
	ErrInvalidProof = errors.New("blob: invalid proof")
)

Functions

func BlobsToShares

func BlobsToShares(blobs ...*Blob) ([]share.Share, error)

BlobsToShares accepts blobs and convert them to the Shares.

Types

type Blob

type Blob struct {
	types.Blob `json:"blob"`

	Commitment Commitment `json:"commitment"`
	// contains filtered or unexported fields
}

Blob represents any application-specific binary data that anyone can submit to Celestia.

func NewBlob

func NewBlob(shareVersion uint8, namespace share.Namespace, data []byte) (*Blob, error)

NewBlob constructs a new blob from the provided Namespace, data and share version.

func NewBlobV0

func NewBlobV0(namespace share.Namespace, data []byte) (*Blob, error)

NewBlobV0 constructs a new blob from the provided Namespace and data. The blob will be formatted as v0 shares.

func (*Blob) Index

func (b *Blob) Index() int

Index returns the blob's first share index in the EDS. Only retrieved, on-chain blobs will have the index set. Default is -1.

func (*Blob) MarshalJSON

func (b *Blob) MarshalJSON() ([]byte, error)

func (*Blob) Namespace

func (b *Blob) Namespace() share.Namespace

Namespace returns blob's namespace.

func (*Blob) UnmarshalJSON

func (b *Blob) UnmarshalJSON(data []byte) error

type Commitment

type Commitment []byte

Commitment is a Merkle Root of the subtree built from shares of the Blob. It is computed by splitting the blob into shares and building the Merkle subtree to be included after Submit.

func (Commitment) Equal

func (com Commitment) Equal(c Commitment) bool

Equal ensures that commitments are the same

func (Commitment) String

func (com Commitment) String() string

type GasPrice

type GasPrice float64

GasPrice represents the amount to be paid per gas unit. Fee is set by multiplying GasPrice by GasLimit, which is determined by the blob sizes.

func DefaultGasPrice

func DefaultGasPrice() GasPrice

DefaultGasPrice returns the default gas price, letting node automatically determine the Fee based on the passed blob sizes.

type Proof

type Proof []*nmt.Proof

Proof is a collection of nmt.Proofs that verifies the inclusion of the data. Proof proves the WHOLE namespaced data for the particular row. TODO (@vgonkivs): rework `Proof` in order to prove a particular blob. https://github.com/celestiaorg/celestia-node/issues/2303

func (Proof) Len

func (p Proof) Len() int

Jump to

Keyboard shortcuts

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