client

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2016 License: Apache-2.0 Imports: 4 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Status() (*ctypes.ResultStatus, error)
	NetInfo() (*ctypes.ResultNetInfo, error)
	DialSeeds(seeds []string) (*ctypes.ResultDialSeeds, error)
	BlockchainInfo(minHeight, maxHeight int) (*ctypes.ResultBlockchainInfo, error)
	Genesis() (*ctypes.ResultGenesis, error)
	Block(height int) (*ctypes.ResultBlock, error)
	Validators() (*ctypes.ResultValidators, error)

	BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTx, error)
	BroadcastTxAsync(tx types.Tx) (*ctypes.ResultBroadcastTx, error)
	BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error)

	TMSPQuery(query []byte) (*ctypes.ResultTMSPQuery, error)
	TMSPInfo() (*ctypes.ResultTMSPInfo, error)

	// subscribe to events (how to read them depends on implementation...)
	Subscribe(event string) error
	Unsubscribe(event string) error
}

Client is a generic interface used to access an tendermint node you can use this interface to allow easy mocking for tests without a full node

type LightClient

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

func New

func New(remote, wsEndpoint string) *LightClient

func (*LightClient) Block

func (c *LightClient) Block(height int) (*ctypes.ResultBlock, error)

func (*LightClient) BlockchainInfo

func (c *LightClient) BlockchainInfo(minHeight, maxHeight int) (*ctypes.ResultBlockchainInfo, error)

func (*LightClient) BroadcastTxAsync

func (c *LightClient) BroadcastTxAsync(tx types.Tx) (*ctypes.ResultBroadcastTx, error)

func (*LightClient) BroadcastTxCommit

func (c *LightClient) BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTx, error)

func (*LightClient) BroadcastTxSync

func (c *LightClient) BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error)

func (*LightClient) DialSeeds

func (c *LightClient) DialSeeds(seeds []string) (*ctypes.ResultDialSeeds, error)

func (*LightClient) Genesis

func (c *LightClient) Genesis() (*ctypes.ResultGenesis, error)

func (*LightClient) GetEventChannels

func (c *LightClient) GetEventChannels() (chan json.RawMessage, chan error)

GetEventChannels returns the results and error channel from the websocket

func (*LightClient) NetInfo

func (c *LightClient) NetInfo() (*ctypes.ResultNetInfo, error)

func (*LightClient) StartWebsocket

func (c *LightClient) StartWebsocket() error

StartWebsocket starts up a websocket and a listener goroutine if already started, do nothing

func (*LightClient) Status

func (c *LightClient) Status() (*ctypes.ResultStatus, error)

func (*LightClient) StopWebsocket

func (c *LightClient) StopWebsocket()

StopWebsocket stops the websocket connection

func (*LightClient) Subscribe

func (c *LightClient) Subscribe(event string) error

func (*LightClient) TMSPInfo

func (c *LightClient) TMSPInfo() (*ctypes.ResultTMSPInfo, error)

func (*LightClient) TMSPQuery

func (c *LightClient) TMSPQuery(query []byte) (*ctypes.ResultTMSPQuery, error)

func (*LightClient) Unsubscribe

func (c *LightClient) Unsubscribe(event string) error

func (*LightClient) Validators

func (c *LightClient) Validators() (*ctypes.ResultValidators, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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