rpc

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxClassify_Normal    uint32 = 0
	TxClassify_Contract  uint32 = 1
	TxClassify_Extension uint32 = 2
)

BlockDetails struct

Variables

This section is empty.

Functions

func BlockCommand

func BlockCommand() *cobra.Command

BlockCommand returns the verified block data for a given heights

func BlockRequestHandlerFn

func BlockRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc

REST handler to get a block

func CLIVersionRequestHandler

func CLIVersionRequestHandler(w http.ResponseWriter, r *http.Request)

cli version REST handler endpoint

func GetBlockDetailFn

func GetBlockDetailFn(cliCtx context.CLIContext, cdc *codec.Codec) http.HandlerFunc

GetBlockDetailFn

func GetChainHeight

func GetChainHeight(cliCtx context.CLIContext) (int64, error)

get the current blockchain height

func GetTxFn

func GetTxFn(cdc *codec.Codec, cliCtx context.CLIContext) http.HandlerFunc

func LatestBlockRequestHandlerFn

func LatestBlockRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc

REST handler to get the latest block

func LatestValidatorSetRequestHandlerFn

func LatestValidatorSetRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc

Latest Validator Set REST handler

func NodeInfoRequestHandlerFn

func NodeInfoRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc

REST handler for node info

func NodeSyncingRequestHandlerFn

func NodeSyncingRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc

REST handler for node syncing

func NodeVersionRequestHandler

func NodeVersionRequestHandler(cliCtx context.CLIContext) http.HandlerFunc

connected node version REST handler endpoint

func RegisterRoutes

func RegisterRoutes(cliCtx context.CLIContext, r *mux.Router, cdc *codec.Codec)

Register REST endpoints

func StatusCommand

func StatusCommand() *cobra.Command

StatusCommand returns the status of the network

func ValidatorCommand

func ValidatorCommand(cdc *codec.Codec) *cobra.Command

ValidatorCommand returns the validator set for a given height

func ValidatorSetRequestHandlerFn

func ValidatorSetRequestHandlerFn(cliCtx context.CLIContext) http.HandlerFunc

Validator Set at a height REST handler

Types

type BlockInfo

type BlockInfo struct {
	BlockMeta *tmTypes.BlockMeta `json:"block_meta"`
	Block     DisplayBlock       `json:"block"`
	Time      string             `json:"time"`
}

type DisplayBlock

type DisplayBlock struct {
	Txs        []DisplayTx          `json:"txs"`
	Evidence   tmTypes.EvidenceData `json:"evidence"`
	LastCommit *tmTypes.Commit      `json:"last_commit"`
}

type DisplayFee

type DisplayFee struct {
	// Amount    []sdk.BigCoin `json:"amount"` // junying-todo, 2019-12-07
	GasWanted string `json:"gas_wanted"`
	GasPrice  string `json:"gas_price"`
}

type DisplayTx

type DisplayTx struct {
	From       string
	To         string
	Amount     []sdk.BigCoin
	Hash       string
	Memo       string
	Data       string
	TxClassify uint32
	TypeName   string
}

type GetTxResponse

type GetTxResponse struct {
	Height    int64               `json:"height"`
	TxHash    string              `json:"txhash"`
	Code      uint32              `json:"code,omitempty"`
	Log       sdk.ABCIMessageLogs `json:"log,omitempty"`
	Info      string              `json:"info,omitempty"`
	GasWanted int64               `json:"gas_wanted,omitempty"`
	GasUsed   int64               `json:"gas_used,omitempty"`
	Tags      sdk.StringTags      `json:"tags,omitempty"`
	Codespace string              `json:"codespace,omitempty"`
	Tx        StdTx               `json:"tx,omitempty"`
}

type ResultValidatorsOutput

type ResultValidatorsOutput struct {
	BlockHeight int64             `json:"block_height"`
	Validators  []ValidatorOutput `json:"validators"`
}

Validators at a certain height output in bech32 format

func GetValidators

func GetValidators(cliCtx context.CLIContext, height *int64) (ResultValidatorsOutput, error)

func (ResultValidatorsOutput) String

func (rvo ResultValidatorsOutput) String() string

type StdTx

type StdTx struct {
	Msgs       []DisplayTx         `json:"msg"`
	Fee        DisplayFee          `json:"fee"`
	Signatures []auth.StdSignature `json:"signatures"`
	Memo       string              `json:"memo"`
}

type ValidatorOutput

type ValidatorOutput struct {
	Address          sdk.ConsAddress `json:"address"`
	PubKey           string          `json:"pub_key"`
	ProposerPriority int64           `json:"proposer_priority"`
	VotingPower      int64           `json:"voting_power"`
}

Validator output in bech32 format

Jump to

Keyboard shortcuts

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