client

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxCommitWaitTimeSeconds = 10
)

Variables

This section is empty.

Functions

func NewBurrowNodeClient added in v0.16.2

func NewBurrowNodeClient(rpcString string, logger logging_types.InfoTraceLogger) *burrowNodeClient

BurrowKeyClient.New returns a new monax-keys client for provided rpc location Monax-keys connects over http request-responses

Types

type Confirmation

type Confirmation struct {
	BlockHash []byte
	Event     txs.EventData
	Exception error
	Error     error
}

type NodeClient

type NodeClient interface {
	Broadcast(transaction txs.Tx) (*txs.Receipt, error)
	DeriveWebsocketClient() (nodeWsClient NodeWebsocketClient, err error)

	Status() (ChainId []byte, ValidatorPublicKey []byte, LatestBlockHash []byte,
		LatestBlockHeight int, LatestBlockTime int64, err error)
	GetAccount(address []byte) (*acc.Account, error)
	QueryContract(callerAddress, calleeAddress, data []byte) (ret []byte, gasUsed int64, err error)
	QueryContractCode(address, code, data []byte) (ret []byte, gasUsed int64, err error)

	DumpStorage(address []byte) (storage *core_types.Storage, err error)
	GetName(name string) (owner []byte, data string, expirationBlock int, err error)
	ListValidators() (blockHeight int, bondedValidators, unbondingValidators []consensus_types.Validator, err error)

	// Logging context for this NodeClient
	Logger() logging_types.InfoTraceLogger
}

type NodeWebsocketClient

type NodeWebsocketClient interface {
	Subscribe(eventId string) error
	Unsubscribe(eventId string) error

	WaitForConfirmation(tx txs.Tx, chainId string, inputAddr []byte) (chan Confirmation, error)
	Close()
}

type WSClient

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

A websocket client subscribes and unsubscribes to events

func NewWSClient

func NewWSClient(addr string) *WSClient

create a new connection

func (*WSClient) Close

func (this *WSClient) Close()

func (*WSClient) Dial

func (this *WSClient) Dial() (*http.Response, error)

func (*WSClient) StartRead

func (this *WSClient) StartRead() <-chan []byte

returns a channel from which messages can be pulled from a go routine that reads the socket. if the ws returns an error (eg. closes), we return

func (*WSClient) WriteMsg

func (this *WSClient) WriteMsg(msg []byte)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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