client

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2018 License: Apache-2.0 Imports: 17 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.Logger) *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
	EventDataTx *exeEvents.EventDataTx
	Exception   error
	Error       error
}

type Do added in v0.18.0

type Do struct {
	// Persistent flags not reflected in the configuration files
	// only set through command line flags or environment variables
	Debug   bool // BURROW_DEBUG
	Verbose bool // BURROW_VERBOSE

	// Following parameters are global flags for burrow-client tx
	SignAddrFlag string
	NodeAddrFlag string
	PubkeyFlag   string
	AddrFlag     string

	// signFlag      bool // TODO: remove; unsafe signing without monax-keys
	BroadcastFlag bool
	WaitFlag      bool

	// Following parameters are vary for different Transaction subcommands
	// some of these are strings rather than flags because the `core`
	// functions have a pure string interface so they work nicely from http
	AmtFlag      string
	NonceFlag    string
	NameFlag     string
	DataFlag     string
	DataFileFlag string
	ToFlag       string
	FeeFlag      string
	GasFlag      string
	UnbondtoFlag string
	HeightFlag   string
}

func NewClientDo added in v0.18.0

func NewClientDo() *Do

type NodeClient

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

	Status() (ChainId []byte, ValidatorPublicKey []byte, LatestBlockHash []byte,
		LatestBlockHeight uint64, LatestBlockTime int64, err error)
	GetAccount(address crypto.Address) (acm.Account, error)
	QueryContract(callerAddress, calleeAddress crypto.Address, data []byte) (ret []byte, gasUsed uint64, err error)
	QueryContractCode(address crypto.Address, code, data []byte) (ret []byte, gasUsed uint64, err error)

	DumpStorage(address crypto.Address) (storage *rpc.ResultDumpStorage, err error)
	GetName(name string) (owner crypto.Address, data string, expirationBlock uint64, err error)
	ListValidators() (blockHeight uint64, bondedValidators, unbondingValidators []acm.Validator, err error)

	// Logging context for this NodeClient
	Logger() *logging.Logger
}

type NodeWebsocketClient

type NodeWebsocketClient interface {
	Subscribe(eventId string) error
	Unsubscribe(eventId string) error
	WaitForConfirmation(tx *txs.Envelope, inputAddr crypto.Address) (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