rpc

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommands

func AddCommands(cmd *cobra.Command)

AddCommands adds a number of rpc-related subcommands

func BlockCommand

func BlockCommand() *cobra.Command

BlockCommand returns the verified block data for a given heights

func BlockRequestHandlerFn

func BlockRequestHandlerFn(ctx context.CoreContext) http.HandlerFunc

REST handler to get a block

func GetChainHeight

func GetChainHeight(ctx context.CoreContext) (int64, error)

get the current blockchain height

func LatestBlockRequestHandlerFn

func LatestBlockRequestHandlerFn(ctx context.CoreContext) http.HandlerFunc

REST handler to get the latest block

func LatestValidatorSetRequestHandlerFn

func LatestValidatorSetRequestHandlerFn(ctx context.CoreContext) http.HandlerFunc

Latest Validator Set REST handler

func NodeInfoRequestHandlerFn

func NodeInfoRequestHandlerFn(ctx context.CoreContext) http.HandlerFunc

REST handler for node info

func NodeSyncingRequestHandlerFn

func NodeSyncingRequestHandlerFn(ctx context.CoreContext) http.HandlerFunc

REST handler for node syncing

func RegisterRoutes

func RegisterRoutes(ctx context.CoreContext, r *mux.Router)

Register REST endpoints

func ValidatorCommand

func ValidatorCommand() *cobra.Command

ValidatorCommand returns the validator set for a given height

func ValidatorSetRequestHandlerFn

func ValidatorSetRequestHandlerFn(ctx context.CoreContext) http.HandlerFunc

Validator Set at a height REST handler

Types

type ResultValidatorsOutput

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

Validators at a certain height output in bech32 format

type ValidatorOutput

type ValidatorOutput struct {
	Address     sdk.ValAddress `json:"address"` // in bech32
	PubKey      string         `json:"pub_key"` // in bech32
	Accum       int64          `json:"accum"`
	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