da

package
v0.18.0-rc22 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructModule

func ConstructModule() fx.Option

func MakeID

func MakeID(height uint64, commitment da.Commitment) da.ID

func SplitID

func SplitID(id da.ID) (uint64, da.Commitment)

Types

type API

type API struct {
	Internal struct {
		MaxBlobSize       func(ctx context.Context) (uint64, error)                                            `perm:"read"`
		Get               func(ctx context.Context, ids []da.ID, ns da.Namespace) ([]da.Blob, error)           `perm:"read"`
		GetIDs            func(ctx context.Context, height uint64, ns da.Namespace) (*da.GetIDsResult, error)  `perm:"read"`
		GetProofs         func(ctx context.Context, ids []da.ID, ns da.Namespace) ([]da.Proof, error)          `perm:"read"`
		Commit            func(ctx context.Context, blobs []da.Blob, ns da.Namespace) ([]da.Commitment, error) `perm:"read"`
		Validate          func(context.Context, []da.ID, []da.Proof, da.Namespace) ([]bool, error)             `perm:"read"`
		Submit            func(context.Context, []da.Blob, float64, da.Namespace) ([]da.ID, error)             `perm:"write"`
		SubmitWithOptions func(context.Context, []da.Blob, float64, da.Namespace, []byte) ([]da.ID, error)     `perm:"write"`
	}
}

API is a wrapper around Module for the RPC. TODO(@distractedm1nd): These structs need to be autogenerated.

func (*API) Commit

func (api *API) Commit(ctx context.Context, blobs []da.Blob, ns da.Namespace) ([]da.Commitment, error)

func (*API) Get

func (api *API) Get(ctx context.Context, ids []da.ID, ns da.Namespace) ([]da.Blob, error)

func (*API) GetIDs

func (api *API) GetIDs(ctx context.Context, height uint64, ns da.Namespace) (*da.GetIDsResult, error)

func (*API) GetProofs

func (api *API) GetProofs(ctx context.Context, ids []da.ID, ns da.Namespace) ([]da.Proof, error)

func (*API) MaxBlobSize

func (api *API) MaxBlobSize(ctx context.Context) (uint64, error)

func (*API) Submit

func (api *API) Submit(ctx context.Context, blobs []da.Blob, gasPrice float64, ns da.Namespace) ([]da.ID, error)

func (*API) SubmitWithOptions added in v0.17.1

func (api *API) SubmitWithOptions(
	ctx context.Context,
	blobs []da.Blob,
	gasPrice float64,
	ns da.Namespace,
	options []byte,
) ([]da.ID, error)

func (*API) Validate

func (api *API) Validate(ctx context.Context, ids []da.ID, proofs []da.Proof, ns da.Namespace) ([]bool, error)

type Module

type Module interface {
	da.DA
}

type Service

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

func NewService

func NewService(
	blobMod nodeblob.Module,
	headerGetter func(context.Context, uint64) (*header.ExtendedHeader, error),
) *Service

func (*Service) Commit

func (s *Service) Commit(_ context.Context, daBlobs []da.Blob, namespace da.Namespace) ([]da.Commitment, error)

Commit creates a Commitment for each given Blob.

func (*Service) Get

func (s *Service) Get(ctx context.Context, ids []da.ID, ns da.Namespace) ([]da.Blob, error)

Get returns Blob for each given ID, or an error.

func (*Service) GetIDs

func (s *Service) GetIDs(ctx context.Context, height uint64, namespace da.Namespace) (*da.GetIDsResult, error)

GetIDs returns IDs of all Blobs located in DA at given height.

func (*Service) GetProofs

func (s *Service) GetProofs(ctx context.Context, ids []da.ID, namespace da.Namespace) ([]da.Proof, error)

GetProofs returns inclusion Proofs for all Blobs located in DA at given height.

func (*Service) MaxBlobSize

func (s *Service) MaxBlobSize(context.Context) (uint64, error)

MaxBlobSize returns the max blob size

func (*Service) Submit

func (s *Service) Submit(
	ctx context.Context,
	daBlobs []da.Blob,
	gasPrice float64,
	namespace da.Namespace,
) ([]da.ID, error)

Submit submits the Blobs to Data Availability layer.

func (*Service) SubmitWithOptions added in v0.17.1

func (s *Service) SubmitWithOptions(
	ctx context.Context,
	daBlobs []da.Blob,
	gasPrice float64,
	namespace da.Namespace,
	options []byte,
) ([]da.ID, error)

SubmitWithOptions submits the Blobs to Data Availability layer.

func (*Service) Validate

func (s *Service) Validate(
	ctx context.Context,
	ids []da.ID,
	daProofs []da.Proof,
	namespace da.Namespace,
) ([]bool, error)

Validate validates Commitments against the corresponding Proofs. This should be possible without retrieving the Blobs.

type SubmitOptions added in v0.17.1

type SubmitOptions struct {
	// KeyName is the name of key from the keystore used to sign transactions.
	KeyName string `json:"key_name,omitempty"`

	// SignerAddress is the address that signs the transaction.
	// This address must be stored locally in the key store.
	SignerAddress string `json:"signer_address,omitempty"`

	// FeeGranterAddress specifies the account that will pay for the transaction fee.
	FeeGranterAddress string `json:"fee_granter_address,omitempty"`
}

SubmitOptions defines options for blob submission using SubmitWithOptions.

SubmitWithOptions expects JSON serialized version of this struct; all fields are optional.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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