context

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ACCOUNT_NOT_EXIST = "Account is not exsit."

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIContext

type CLIContext struct {
	Codec           *wire.Codec
	Client          rpcclient.Client
	Logger          io.Writer
	Height          int64
	NodeURI         string
	FromAddressName string
	AccountStore    string
	KVStore         string
	TrustNode       bool
	UseLedger       bool
	Async           bool
	JSON            bool
	PrintResponse   bool
}

CLIContext implements a typical CLI context created in SDK modules for transaction handling and queries.

func NewCLIContext1

func NewCLIContext1(nodeURI string) CLIContext

NewCLIContext returns a new initialized CLIContext with parameters from the command line using Viper.

func (CLIContext) BroadcastTx

func (ctx CLIContext) BroadcastTx(tx []byte) (*ctypes.ResultBroadcastTxCommit, error)

BroadcastTx broadcasts transaction bytes to a Tendermint node.

func (CLIContext) BroadcastTxAsync

func (ctx CLIContext) BroadcastTxAsync(tx []byte) (*ctypes.ResultBroadcastTx, error)

BroadcastTxAsync broadcasts transaction bytes to a Tendermint node asynchronously.

func (CLIContext) EnsureBroadcastTx

func (ctx CLIContext) EnsureBroadcastTx(txBytes []byte) (*ctypes.ResultBroadcastTxCommit, error)

EnsureBroadcastTx broadcasts a transactions either synchronously or asynchronously based on the context parameters. The result of the broadcast is parsed into an intermediate structure which is logged if the context has a logger defined.

func (CLIContext) GetAccount

func (ctx CLIContext) GetAccount(address []byte, cdc *wire.Codec) (*account.QOSAccount, error)

GetAccount queries for an account given an address and a block height. An error is returned if the query or decoding fails.

func (CLIContext) GetNode

func (ctx CLIContext) GetNode() (rpcclient.Client, error)

GetNode returns an RPC client. If the context's client is not defined, an error is returned.

func (CLIContext) Query

func (ctx CLIContext) Query(path string) (res []byte, err error)

Query performs a query for information about the connected node.

func (CLIContext) QueryInvestadCustom

func (ctx CLIContext) QueryInvestadCustom(key cmn.HexBytes) (res []byte, err error)

QueryStore performs a query from a Tendermint node with the provided key and store name.

func (CLIContext) QueryKV

func (ctx CLIContext) QueryKV(key cmn.HexBytes) (res []byte, err error)

QueryStore performs a query from a Tendermint node with the provided key and store name.

func (CLIContext) QueryQOSAccount

func (ctx CLIContext) QueryQOSAccount(key cmn.HexBytes) (res []byte, err error)

QueryStore performs a query from a Tendermint node with the provided key and store name.

func (CLIContext) QuerySequenceIn

func (ctx CLIContext) QuerySequenceIn(chainid string) (in int64, err error)

QuerySequenceIn performs a query from a Tendermint node with the provided chainid

func (CLIContext) QuerySequenceOut

func (ctx CLIContext) QuerySequenceOut(chainid string) (out int64, err error)

QuerySequenceOut performs a query from a Tendermint node with the provided chainid

func (CLIContext) QueryStore

func (ctx CLIContext) QueryStore(key cmn.HexBytes, storeName string) (res []byte, err error)

QueryStore performs a query from a Tendermint node with the provided key and store name.

func (CLIContext) WithAccountStore

func (ctx CLIContext) WithAccountStore(accountStore string) CLIContext

WithAccountStore returns a copy of the context with an updated AccountStore.

func (CLIContext) WithClient

func (ctx CLIContext) WithClient(client rpcclient.Client) CLIContext

WithClient returns a copy of the context with an updated RPC client instance.

func (CLIContext) WithCodec

func (ctx CLIContext) WithCodec(cdc *wire.Codec) CLIContext

WithCodec returns a copy of the context with an updated codec.

func (CLIContext) WithFromAddressName

func (ctx CLIContext) WithFromAddressName(addrName string) CLIContext

WithFromAddressName returns a copy of the context with an updated from address.

func (CLIContext) WithKVStore

func (ctx CLIContext) WithKVStore(kvStore string) CLIContext

WithKVStore returns a copy of the context with an updated KVStore.

func (CLIContext) WithLogger

func (ctx CLIContext) WithLogger(w io.Writer) CLIContext

WithLogger returns a copy of the context with an updated logger.

func (CLIContext) WithNodeURI

func (ctx CLIContext) WithNodeURI(nodeURI string) CLIContext

WithNodeURI returns a copy of the context with an updated node URI.

func (CLIContext) WithTrustNode

func (ctx CLIContext) WithTrustNode(trustNode bool) CLIContext

WithTrustNode returns a copy of the context with an updated TrustNode flag.

func (CLIContext) WithUseLedger

func (ctx CLIContext) WithUseLedger(useLedger bool) CLIContext

WithUseLedger returns a copy of the context with an updated UseLedger flag.

Jump to

Keyboard shortcuts

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