client

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultABCIQueryOptions = ABCIQueryOptions{Height: 0, Prove: false}

DefaultABCIQueryOptions are latest height (0) and prove false.

Functions

func DefaultWaitStrategy

func DefaultWaitStrategy(delta int64) (abort error)

DefaultWaitStrategy is the standard backoff algorithm, but you can plug in another one

Types

type ABCIQueryOptions

type ABCIQueryOptions struct {
	Height int64
	Prove  bool
}

ABCIQueryOptions can be used to provide options for AVSIQuery call other than the DefaultABCIQueryOptions.

type Client

type Client interface {
	service.Service
}

Client wraps most important rpc calls a client would make if you want to listen for events, test if it also implements events.EventSwitch.

type DVSClient

type DVSClient interface {
	RequestDVS(
		ctx context.Context,
		data []byte,
		height int64,
		chainid int64,
		groupNumbers []uint32,
		groupThresholdPercentages []uint32,
	) (*ctypes.ResultRequest, error)

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

	QueryRequest(ctx context.Context, hash string) (*ctypes.ResultDvsRequest, error)
	SearchRequest(ctx context.Context, query string, pagePtr, perPagePtr *int) (*ctypes.ResultDvsRequestSearch, error)
}

DVSClient

type EventsClient

type EventsClient interface {
	// Subscribe subscribes given subscriber to query. Returns a channel with
	// cap=1 onto which events are published. An error is returned if it fails to
	// subscribe. outCapacity can be used optionally to set capacity for the
	// channel. Channel is never closed to prevent accidental reads.
	//
	// ctx cannot be used to unsubscribe. To unsubscribe, use either Unsubscribe
	// or UnsubscribeAll.
	//Subscribe(ctx context.Context, subscriber, query string, outCapacity ...int) (out <-chan ctypes.ResultEvent, err error)
	// Unsubscribe unsubscribes given subscriber from query.
	Unsubscribe(ctx context.Context, subscriber, query string) error
	// UnsubscribeAll unsubscribes given subscriber from all the queries.
	UnsubscribeAll(ctx context.Context, subscriber string) error
}

EventsClient is reactive, you can subscribe to any message, given the proper string. see pelldvs/types/events.go

type HistoryClient

type HistoryClient interface {
	// Genesis(context.Context) (*ctypes.ResultGenesis, error)
	GenesisChunked(context.Context, uint) (*ctypes.ResultGenesisChunk, error)
}

HistoryClient provides access to data from genesis to now in large chunks.

type NetworkClient

type NetworkClient interface {
	NetInfo(context.Context) (*ctypes.ResultNetInfo, error)
	//ConsensusState(context.Context) (*ctypes.ResultConsensusState, error)
	//ConsensusParams(ctx context.Context, height *int64) (*ctypes.ResultConsensusParams, error)
	Health(context.Context) (*ctypes.ResultHealth, error)
}

NetworkClient is general info about the network state. May not be needed usually.

type RemoteClient

type RemoteClient interface {
	Client

	// Remote returns the remote network address in a string form.
	Remote() string
}

RemoteClient is a Client, which can also return the remote network address.

type Waiter

type Waiter func(delta int64) (abort error)

Waiter is informed of current height, decided whether to quit early

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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