local

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Local

type Local struct {
	// *types.EventBus
	Logger log.Logger
	// contains filtered or unexported fields
}

Local is a Client implementation that directly executes the rpc functions on a given node, without going through HTTP or GRPC.

This implementation is useful for:

* Running tests against a node in-process without the overhead of going through an http server * Communication between an AVSI app and PellDVS when they are compiled in process.

For real clients, you probably want to use client.HTTP. For more powerful control during testing, you probably want the "client/mock" package.

You can subscribe for any event published by PellDVS using Subscribe method. Note delivery is best-effort. If you don't read events fast enough, PellDVS might cancel the subscription. The client will attempt to resubscribe (you don't need to do anything). It will keep trying indefinitely with exponential backoff (10ms -> 20ms -> 40ms) until successful.

func New

func New(node *nm.Node) *Local

NewLocal configures a client that calls the Node directly.

func (*Local) DialPeers

func (c *Local) DialPeers(
	_ context.Context,
	peers []string,
	persistent,
	unconditional,
	private bool,
) (*ctypes.ResultDialPeers, error)

func (*Local) DialSeeds

func (c *Local) DialSeeds(_ context.Context, seeds []string) (*ctypes.ResultDialSeeds, error)

func (*Local) GenesisChunked

func (c *Local) GenesisChunked(_ context.Context, id uint) (*ctypes.ResultGenesisChunk, error)

func (*Local) Health

func (c *Local) Health(context.Context) (*ctypes.ResultHealth, error)

func (*Local) IsRunning

func (c *Local) IsRunning() bool

func (*Local) NetInfo

func (c *Local) NetInfo(context.Context) (*ctypes.ResultNetInfo, error)

func (*Local) QueryRequest

func (c *Local) QueryRequest(hash string) (*ctypes.ResultDvsRequest, error)

func (*Local) RequestDVS

func (c *Local) RequestDVS(
	_ context.Context,
	data []byte,
	height int64,
	chainid int64,
	groupNumbers []uint32,
	groupThresholdPercentages []uint32,
) (*ctypes.ResultRequest, error)

func (*Local) RequestDVSAsync

func (c *Local) RequestDVSAsync(
	_ context.Context,
	data []byte,
	height int64,
	chainid int64,
	groupNumbers []uint32,
	groupThresholdPercentages []uint32,
) (*ctypes.ResultRequestDvsAsync, error)

func (*Local) SetLogger

func (c *Local) SetLogger(l log.Logger)

SetLogger allows to set a logger on the client.

Jump to

Keyboard shortcuts

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