Documentation ¶
Index ¶
- type Client
- type LightClient
- func (c *LightClient) Block(height int) (*ctypes.ResultBlock, error)
- func (c *LightClient) BlockchainInfo(minHeight, maxHeight int) (*ctypes.ResultBlockchainInfo, error)
- func (c *LightClient) BroadcastTxAsync(tx types.Tx) (*ctypes.ResultBroadcastTx, error)
- func (c *LightClient) BroadcastTxCommit(tx types.Tx) (*ctypes.ResultBroadcastTx, error)
- func (c *LightClient) BroadcastTxSync(tx types.Tx) (*ctypes.ResultBroadcastTx, error)
- func (c *LightClient) DialSeeds(seeds []string) (*ctypes.ResultDialSeeds, error)
- func (c *LightClient) Genesis() (*ctypes.ResultGenesis, error)
- func (c *LightClient) GetEventChannels() (chan json.RawMessage, chan error)
- func (c *LightClient) NetInfo() (*ctypes.ResultNetInfo, error)
- func (c *LightClient) StartWebsocket() error
- func (c *LightClient) Status() (*ctypes.ResultStatus, error)
- func (c *LightClient) StopWebsocket()
- func (c *LightClient) Subscribe(event string) error
- func (c *LightClient) TMSPInfo() (*ctypes.ResultTMSPInfo, error)
- func (c *LightClient) TMSPQuery(query []byte) (*ctypes.ResultTMSPQuery, error)
- func (c *LightClient) Unsubscribe(event string) error
- func (c *LightClient) Validators() (*ctypes.ResultValidators, error)
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)
Click to show internal directories.
Click to hide internal directories.