tendermint

package
v0.0.0-...-3cf9108 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultWSEndpoint = "/websocket"
	DefaultAddress    = "http://localhost:26657"
)

default client parameters

Variables

This section is empty.

Functions

func StartClient

func StartClient(address string, endpoint string) (client.Client, error)

StartClient connects a client to the given tendermint endpoint

Types

type RobustClient

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

RobustClient is a client that recreates the server connection of a connection failure occurs

func NewRobustClient

func NewRobustClient(factory func() (client.Client, error)) *RobustClient

NewRobustClient returns a new RobustClient instance

func (*RobustClient) BlockResults

func (r *RobustClient) BlockResults(ctx context.Context, height *int64) (results *coretypes.ResultBlockResults, err error)

BlockResults returns the all results of the block of given height

func (*RobustClient) LatestSyncInfo

func (r *RobustClient) LatestSyncInfo(ctx context.Context) (*coretypes.SyncInfo, error)

LatestSyncInfo returns the sync info of the node

func (*RobustClient) Stop

func (r *RobustClient) Stop() error

Stop stops the client and closes the server connection

func (*RobustClient) Subscribe

func (r *RobustClient) Subscribe(ctx context.Context, subscriber, query string, outCapacity ...int) (out <-chan coretypes.ResultEvent, err error)

Subscribe subscribes to the given query

func (*RobustClient) Unsubscribe

func (r *RobustClient) Unsubscribe(ctx context.Context, subscriber, query string) error

Unsubscribe unsubsribes the given query, if a subscription exists

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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