client

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// 503 error type informing rollup to failover to other DA location
	ErrServiceUnavailable = fmt.Errorf("eigenda service is temporarily unavailable")
)

Functions

This section is empty.

Types

type Client

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

Client implements a standard client for the eigenda-proxy that can put/get standard commitment data and query the health endpoint. Currently it is meant to be used by Arbitrum nitro integrations but can be extended to others in the future. Optimism has its own client: https://github.com/ethereum-optimism/optimism/blob/develop/op-alt-da/daclient.go so clients wanting to send op commitment mode data should use that client.

func New

func New(cfg *Config, opts ...ClientOption) *Client

New ... constructor

func (*Client) GetData

func (c *Client) GetData(ctx context.Context, comm []byte) ([]byte, error)

GetData fetches blob data associated with a DA certificate

func (*Client) Health

func (c *Client) Health() error

Health indicates if the server is operational; useful for event based awaits when integration testing

func (*Client) SetData

func (c *Client) SetData(ctx context.Context, b []byte) ([]byte, error)

SetData writes raw byte data to DA and returns the associated certificate which should be verified within the proxy

type ClientOption

type ClientOption func(c *Client)

func WithHTTPClient

func WithHTTPClient(client HTTPClient) ClientOption

WithHTTPClient ... Embeds custom http client type

type Config

type Config struct {
	URL string // EigenDA proxy REST API URL
}

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

Jump to

Keyboard shortcuts

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