types

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package types contains the type used by the administrative RPC client and servers. These types are shared like the protobuf types that these mimick, but they contain the json tags and marshalling behavior we want, plus they are not burdened by fields and methods from the google protobuf packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeInfo

type NodeInfo struct {
	ChainID         string `json:"chain_id"`
	Name            string `json:"name"`
	NodeID          string `json:"node_id"`
	ProtocolVersion uint64 `json:"proto_ver"`
	AppVersion      uint64 `json:"app_ver"`
	BlockVersion    uint64 `json:"block_ver"`
	ListenAddr      string `json:"listen_addr"`
	RPCAddr         string `json:"rpc_addr"`
}

NodeInfo describes a peer node. This may be a peer or a node being administered.

type PeerInfo

type PeerInfo struct {
	NodeInfo   *NodeInfo `json:"node"`
	Inbound    bool      `json:"inbound"`
	RemoteAddr string    `json:"remote_addr"`
}

PeerInfo describes a connected peer node.

type Status

type Status struct {
	Node      *NodeInfo      `json:"node"`
	Sync      *SyncInfo      `json:"sync"`
	Validator *ValidatorInfo `json:"validator"`
}

Status includes a comprehensive summary of a nodes status, including if the service is running, it's best block and if it is syncing, it's identity on the network, and the node's validator identity if it is one. Note that our validator is part of the node rather than an external signer.

type SyncInfo

type SyncInfo struct {
	AppHash         string    `json:"app_hash"`
	BestBlockHash   string    `json:"best_block_hash"`
	BestBlockHeight int64     `json:"best_block_height"`
	BestBlockTime   time.Time `json:"best_block_time"`

	Syncing bool `json:"syncing"`
}

SyncInfo describes the sync state of a node.

type ValidatorInfo

type ValidatorInfo struct {
	PubKey types.HexBytes `json:"pubkey"`
	Power  int64          `json:"power"`
}

ValidatorInfo describes a validator node.

Jump to

Keyboard shortcuts

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