Documentation
¶
Index ¶
- func ConstructModule(tp node.Type, cfg *Config, options ...fx.Option) fx.Option
- func WithDiscoveryMetrics(discs []*discovery.Discovery) error
- func WithPeerManagerMetrics(managers map[string]*peers.Manager) error
- func WithShrexClientMetrics(edsClient *shrexeds.Client, ndClient *shrexnd.Client) error
- func WithShrexGetterMetrics(sg *shrex_getter.Getter) error
- func WithShrexServerMetrics(edsServer *shrexeds.Server, ndServer *shrexnd.Server) error
- func WithStoreMetrics(s *store.Store) error
- type API
- func (api *API) GetEDS(ctx context.Context, height uint64) (*rsmt2d.ExtendedDataSquare, error)
- func (api *API) GetNamespaceData(ctx context.Context, height uint64, namespace libshare.Namespace) (shwap.NamespaceData, error)
- func (api *API) GetRange(ctx context.Context, height uint64, start, end int) (*GetRangeResult, error)
- func (api *API) GetShare(ctx context.Context, height uint64, row, col int) (libshare.Share, error)
- func (api *API) SharesAvailable(ctx context.Context, height uint64) error
- type Config
- type GetRangeResult
- type Module
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConstructModule ¶
func WithDiscoveryMetrics ¶ added in v0.9.4
WithDiscoveryMetrics is a utility function to turn on discovery metrics and that is expected to be "invoked" by the fx lifecycle.
func WithPeerManagerMetrics ¶ added in v0.9.2
WithPeerManagerMetrics is a utility function to turn on peer manager metrics and that is expected to be "invoked" by the fx lifecycle.
func WithShrexClientMetrics ¶ added in v0.9.2
func WithShrexGetterMetrics ¶ added in v0.9.2
func WithShrexGetterMetrics(sg *shrex_getter.Getter) error
func WithShrexServerMetrics ¶ added in v0.9.2
func WithStoreMetrics ¶ added in v0.11.0
Types ¶
type API ¶ added in v0.5.0
type API struct {
Internal struct {
SharesAvailable func(ctx context.Context, height uint64) error `perm:"read"`
GetShare func(
ctx context.Context,
height uint64,
row, col int,
) (libshare.Share, error) `perm:"read"`
GetEDS func(
ctx context.Context,
height uint64,
) (*rsmt2d.ExtendedDataSquare, error) `perm:"read"`
GetNamespaceData func(
ctx context.Context,
height uint64,
namespace libshare.Namespace,
) (shwap.NamespaceData, error) `perm:"read"`
GetRange func(
ctx context.Context,
height uint64,
start, end int,
) (*GetRangeResult, error) `perm:"read"`
}
}
API is a wrapper around Module for the RPC.
func (*API) GetNamespaceData ¶ added in v0.20.2
type Config ¶
type Config struct {
// EDSStoreParams sets eds store configuration parameters
EDSStoreParams *store.Parameters
BlockStoreCacheSize uint
// ShrExEDSParams sets shrexeds client and server configuration parameters
ShrExEDSParams *shrexeds.Parameters
// ShrExNDParams sets shrexnd client and server configuration parameters
ShrExNDParams *shrexnd.Parameters
// PeerManagerParams sets peer-manager configuration parameters
PeerManagerParams *peers.Parameters
LightAvailability *light.Parameters `toml:",omitempty"`
Discovery *discovery.Parameters
}
func DefaultConfig ¶
type GetRangeResult ¶ added in v0.15.0
type GetRangeResult struct {
Proof *types.ShareProof
}
GetRangeResult wraps the return value of the GetRange endpoint because Json-RPC doesn't support more than two return values.
type Module ¶
type Module interface {
// ExtendedHeader are available on the Network.
SharesAvailable(ctx context.Context, height uint64) error
GetShare(ctx context.Context, height uint64, row, col int) (libshare.Share, error)
// GetEDS gets the full EDS identified by the given extended header.
GetEDS(ctx context.Context, height uint64) (*rsmt2d.ExtendedDataSquare, error)
// GetNamespaceData gets all shares from an EDS within the given namespace.
// Shares are returned in a row-by-row order if the namespace spans multiple rows.
GetNamespaceData(
ctx context.Context, height uint64, namespace libshare.Namespace,
) (shwap.NamespaceData, error)
// GetRange gets a list of shares and their corresponding proof.
GetRange(ctx context.Context, height uint64, start, end int) (*GetRangeResult, error)
}
Module provides access to any data square or block share on the network.
All Get methods provided on Module follow the following flow:
- Check local storage for the requested share.
- If exists * Load from disk * Return
- If not * Find provider on the network * Fetch the Share from the provider * Store the Share * Return
Any method signature changed here needs to also be changed in the API struct.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.