context

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: Apache-2.0 Imports: 13 Imported by: 29

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLIContext

type CLIContext struct {
	Codec        *go_amino.Codec
	Client       rpcclient.Client
	Height       int64
	NodeURI      string
	Async        bool
	TrustNode    bool
	NonceNodeURI string
	JSONIndent   bool
}

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

func NewCLIContext

func NewCLIContext() CLIContext

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

func (CLIContext) BroadcastTx

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

func (CLIContext) BroadcastTxAndAwaitCommit

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

BroadcastTxAndAwaitCommit broadcasts transaction bytes to a Tendermint node and waits for a commit.

func (CLIContext) BroadcastTxAsync

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

BroadcastTxAsync broadcasts transaction bytes to a Tendermint node asynchronously.

func (CLIContext) BroadcastTxSync

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

BroadcastTxSync broadcasts transaction bytes to a Tendermint node synchronously.

func (CLIContext) GetNode

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

func (CLIContext) PrintResult

func (ctx CLIContext) PrintResult(obj interface{}) error

func (CLIContext) Query

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

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 *go_amino.Codec) CLIContext

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

func (CLIContext) WithNodeIP

func (ctx CLIContext) WithNodeIP(nodeIP string) CLIContext

func (CLIContext) WithNodeIPAndPort

func (ctx CLIContext) WithNodeIPAndPort(nodeIP string, nodeRPCPort int) CLIContext

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳