rpc

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockRequestHandlerFn

func BlockRequestHandlerFn(clientCtx context.Context) http.HandlerFunc

REST handler to get a block

func GetChainHeight

func GetChainHeight(clientCtx context.Context) (int64, error)

get the current blockchain height

func LatestBlockRequestHandlerFn

func LatestBlockRequestHandlerFn(ctx context.Context) http.HandlerFunc

REST handler to get the latest block

func LatestValidatorSetRequestHandlerFn

func LatestValidatorSetRequestHandlerFn(clientCtx context.Context) http.HandlerFunc

Latest Validator Set REST handler

func NodeInfoRequestHandlerFn

func NodeInfoRequestHandlerFn(ctx context.Context) http.HandlerFunc

func NodeSyncingRequestHandlerFn

func NodeSyncingRequestHandlerFn(ctx context.Context) http.HandlerFunc

func RegisterRoutes

func RegisterRoutes(cliCtx context.Context, r *mux.Router)

func ValidatorSetRequestHandlerFn

func ValidatorSetRequestHandlerFn(clientCtx context.Context) http.HandlerFunc

Validator Set at a height REST handler

Types

type NodeInfoResponse

type NodeInfoResponse struct {
	p2p.DefaultNodeInfo `json:"node_info"`

	ApplicationVersion version.Info `json:"application_version"`
}

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(clientCtx context.Context, height *int64, page, limit *int) (ResultValidatorsOutput, error)

GetValidators from client

type SyncingResponse

type SyncingResponse struct {
	Syncing bool `json:"syncing"`
}

type ValidatorOutput

type ValidatorOutput struct {
	Address          sdk.AccAddress `json:"address"`
	PubKey           crypto.PubKey  `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