grpc

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(d da.DA, opts ...grpc.ServerOption) *grpc.Server

NewServer creates new gRPC Server configured to serve DA proxy.

Types

type Client

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

Client is a gRPC proxy client for DA interface.

func NewClient

func NewClient() *Client

NewClient returns new Client instance.

func (*Client) Commit

func (c *Client) Commit(ctx context.Context, blobs []da.Blob, namespace da.Namespace) ([]da.Commitment, error)

Commit creates a Commitment for each given Blob.

func (*Client) Get

func (c *Client) Get(ctx context.Context, ids []da.ID, namespace da.Namespace) ([]da.Blob, error)

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

func (*Client) GetIDs

func (c *Client) 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 (*Client) GetProofs

func (c *Client) 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 (*Client) MaxBlobSize

func (c *Client) MaxBlobSize(ctx context.Context) (uint64, error)

MaxBlobSize returns the DA MaxBlobSize

func (*Client) Start

func (c *Client) Start(target string, opts ...grpc.DialOption) (err error)

Start connects Client to target, with given options.

func (*Client) Stop

func (c *Client) Stop() error

Stop gently closes Client connection.

func (*Client) Submit

func (c *Client) Submit(ctx context.Context, blobs []da.Blob, gasPrice float64, namespace da.Namespace) ([]da.ID, error)

Submit submits the Blobs to Data Availability layer.

func (*Client) SubmitWithOptions added in v0.6.1

func (c *Client) SubmitWithOptions(ctx context.Context, blobs []da.Blob, gasPrice float64, namespace da.Namespace, options []byte) ([]da.ID, error)

SubmitWithOptions submits the Blobs to Data Availability layer.

func (*Client) Validate

func (c *Client) Validate(ctx context.Context, ids []da.ID, proofs []da.Proof, namespace da.Namespace) ([]bool, error)

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

Jump to

Keyboard shortcuts

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