client

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: AGPL-3.0, AGPL-3.0-or-later Imports: 6 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps all the available endpoints of the data abailability committee node server

func New

func New(url string) *Client

New returns a client ready to be used

func (*Client) GetOffChainData

func (c *Client) GetOffChainData(ctx context.Context, hash common.Hash) ([]byte, error)

GetOffChainData returns data based on it's hash

func (*Client) SignSequence

func (c *Client) SignSequence(signedSequence types.SignedSequence) ([]byte, error)

SignSequence sends a request to sign the given sequence by the data committee member if successful returns the signature. The signature should be validated after using this method!

type ClientFactory

type ClientFactory struct{}

ClientFactory is the implementation of the data committee client factory

func (*ClientFactory) New

func (f *ClientFactory) New(url string) ClientInterface

New returns an implementation of the data committee node client

type ClientFactoryInterface

type ClientFactoryInterface interface {
	New(url string) ClientInterface
}

ClientFactoryInterface interface for the client factory

type ClientInterface

type ClientInterface interface {
	GetOffChainData(ctx context.Context, hash common.Hash) ([]byte, error)
	SignSequence(signedSequence types.SignedSequence) ([]byte, error)
}

ClientInterface is the interface that defines the implementation of all the endpoints

Jump to

Keyboard shortcuts

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