shrexeds

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

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

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

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 is responsible for requesting EDSs for blocksync over the ShrEx/EDS protocol.

func NewClient

func NewClient(params *Parameters, host host.Host) (*Client, error)

NewClient creates a new ShrEx/EDS client.

func (*Client) RequestEDS

func (c *Client) RequestEDS(
	ctx context.Context,
	dataHash share.DataHash,
	peer peer.ID,
) (*rsmt2d.ExtendedDataSquare, error)

RequestEDS requests the ODS from the given peers and returns the EDS upon success.

func (*Client) WithMetrics

func (c *Client) WithMetrics() error

type Parameters

type Parameters struct {
	*p2p.Parameters

	// BufferSize defines the size of the buffer used for writing an ODS over the stream.
	BufferSize uint64
}

Parameters is the set of parameters that must be configured for the shrex/eds protocol.

func DefaultParameters

func DefaultParameters() *Parameters

func (*Parameters) Validate

func (p *Parameters) Validate() error

type Server

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

Server is responsible for serving ODSs for blocksync over the ShrEx/EDS protocol.

func NewServer

func NewServer(params *Parameters, host host.Host, store *eds.Store) (*Server, error)

NewServer creates a new ShrEx/EDS server.

func (*Server) Start

func (s *Server) Start(context.Context) error

func (*Server) Stop

func (s *Server) Stop(context.Context) error

func (*Server) WithMetrics

func (s *Server) WithMetrics() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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