info

package
v1.1.14 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: BSD-3-Clause Imports: 9 Imported by: 8

Documentation

Overview

What a node will tell anyone who asks.

SEVERAL SHAPES HERE ARE AN OBJECT ON THE JSON WIRE AND A LIST IN GO, and the reason is the same every time: a ZAP field is an offset, a map has no order to give one, so a reply carrying a map cannot cross between two processes at all. The list is ordered by the key it was an object of, which is an order a map never had — so the answer is now the same twice running as well.

The JSON is unchanged. Each list marshals to the object it replaced, and reads one back.

Index

Constants

View Source
const (
	MethodGetNodeVersion  = "info.getNodeVersion"
	MethodGetNodeID       = "info.getNodeID"
	MethodGetNodeIP       = "info.getNodeIP"
	MethodGetNetworkID    = "info.getNetworkID"
	MethodGetNetworkName  = "info.getNetworkName"
	MethodGetBlockchainID = "info.getBlockchainID"
	MethodPeers           = "info.peers"
	MethodIsBootstrapped  = "info.isBootstrapped"
	MethodUpgrades        = "info.upgrades"
	MethodUptime          = "info.uptime"
	MethodLps             = "info.lps"
	MethodGetTxFee        = "info.getTxFee"
	MethodGetVMs          = "info.getVMs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsensusInfo added in v1.0.5

type ConsensusInfo struct {
	// Mode is one of "triple" (BLS + Corona + ML-DSA), "dual" (BLS +
	// Corona), or "classical" (BLS only). Free-form so future modes
	// don't bump the API version.
	Mode string `json:"mode"`
	// BLS is always true for production Quasar nodes.
	BLS bool `json:"bls"`
	// Corona is true when the post-quantum lattice threshold path is wired.
	Corona bool `json:"corona"`
	// MLDSA is true when ML-DSA-65 (FIPS 204) signature verification is wired.
	MLDSA bool `json:"mlDSA"`
	// PlatformVM is true when the production PlatformVM wiring is in use,
	// false when running with the dev/stub PlatformVM.
	PlatformVM bool `json:"platformVM"`
}

ConsensusInfo summarises the consensus configuration of a running node so callers don't have to scrape the boot logs to learn whether Quasar is in triple/dual/classical mode.

func (*ConsensusInfo) MarshalZAP added in v1.1.14

func (x *ConsensusInfo) MarshalZAP() ([]byte, error)

MarshalZAP writes ConsensusInfo from constant offsets.

func (*ConsensusInfo) UnmarshalZAP added in v1.1.14

func (x *ConsensusInfo) UnmarshalZAP(data []byte) error

UnmarshalZAP reads ConsensusInfo out of the buffer that arrived.

type FxName added in v1.1.14

type FxName struct {
	// Fx is the extension's id.
	Fx ids.ID `json:"fx"`
	// Name is what it is called.
	Name string `json:"name"`
}

FxName is one feature extension and what it is called.

func (*FxName) MarshalZAP added in v1.1.14

func (x *FxName) MarshalZAP() ([]byte, error)

MarshalZAP writes FxName from constant offsets.

func (*FxName) UnmarshalZAP added in v1.1.14

func (x *FxName) UnmarshalZAP(data []byte) error

UnmarshalZAP reads FxName out of the buffer that arrived.

type FxNames added in v1.1.14

type FxNames []FxName

FxNames are the feature extensions a node knows: an object keyed by id on the JSON wire, a list ordered by that id here.

func (FxNames) MarshalJSON added in v1.1.14

func (f FxNames) MarshalJSON() ([]byte, error)

func (*FxNames) UnmarshalJSON added in v1.1.14

func (f *FxNames) UnmarshalJSON(b []byte) error

type GetBlockchainIDArgs

type GetBlockchainIDArgs struct {
	// Alias is the name the chain answers to, such as "X".
	Alias string `json:"alias"`
}

GetBlockchainIDArgs are the arguments for calling GetBlockchainID.

func (*GetBlockchainIDArgs) MarshalZAP added in v1.1.13

func (x *GetBlockchainIDArgs) MarshalZAP() ([]byte, error)

MarshalZAP writes GetBlockchainIDArgs from constant offsets.

func (*GetBlockchainIDArgs) UnmarshalZAP added in v1.1.13

func (x *GetBlockchainIDArgs) UnmarshalZAP(data []byte) error

UnmarshalZAP reads GetBlockchainIDArgs out of the buffer that arrived.

type GetBlockchainIDReply

type GetBlockchainIDReply struct {
	BlockchainID ids.ID `json:"blockchainID"`
}

GetBlockchainIDReply are the results from calling GetBlockchainID.

func (*GetBlockchainIDReply) MarshalZAP added in v1.1.13

func (x *GetBlockchainIDReply) MarshalZAP() ([]byte, error)

MarshalZAP writes GetBlockchainIDReply from constant offsets.

func (*GetBlockchainIDReply) UnmarshalZAP added in v1.1.13

func (x *GetBlockchainIDReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads GetBlockchainIDReply out of the buffer that arrived.

type GetNetworkIDReply

type GetNetworkIDReply struct {
	NetworkID types.Uint32 `json:"networkID"`
}

GetNetworkIDReply are the results from calling GetNetworkID.

func (*GetNetworkIDReply) MarshalZAP added in v1.1.13

func (x *GetNetworkIDReply) MarshalZAP() ([]byte, error)

MarshalZAP writes GetNetworkIDReply from constant offsets.

func (*GetNetworkIDReply) UnmarshalZAP added in v1.1.13

func (x *GetNetworkIDReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads GetNetworkIDReply out of the buffer that arrived.

type GetNetworkNameReply

type GetNetworkNameReply struct {
	NetworkName string `json:"networkName"`
}

GetNetworkNameReply is the result from calling GetNetworkName.

func (*GetNetworkNameReply) MarshalZAP added in v1.1.13

func (x *GetNetworkNameReply) MarshalZAP() ([]byte, error)

MarshalZAP writes GetNetworkNameReply from constant offsets.

func (*GetNetworkNameReply) UnmarshalZAP added in v1.1.13

func (x *GetNetworkNameReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads GetNetworkNameReply out of the buffer that arrived.

type GetNodeIDReply

type GetNodeIDReply struct {
	NodeID  ids.NodeID         `json:"nodeID"`
	NodePOP *ProofOfPossession `json:"nodePOP"`
}

GetNodeIDReply are the results from calling GetNodeID.

func (*GetNodeIDReply) MarshalZAP added in v1.1.13

func (x *GetNodeIDReply) MarshalZAP() ([]byte, error)

MarshalZAP writes GetNodeIDReply from constant offsets.

func (*GetNodeIDReply) UnmarshalZAP added in v1.1.13

func (x *GetNodeIDReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads GetNodeIDReply out of the buffer that arrived.

type GetNodeIPReply

type GetNodeIPReply struct {
	// IP is the address this node tells peers to reach it at.
	IP types.Addr `json:"ip"`
}

GetNodeIPReply are the results from calling GetNodeIP.

func (*GetNodeIPReply) MarshalZAP added in v1.1.13

func (x *GetNodeIPReply) MarshalZAP() ([]byte, error)

MarshalZAP writes GetNodeIPReply from constant offsets.

func (*GetNodeIPReply) UnmarshalZAP added in v1.1.13

func (x *GetNodeIPReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads GetNodeIPReply out of the buffer that arrived.

type GetNodeVersionReply

type GetNodeVersionReply struct {
	Version            string       `json:"version"`
	DatabaseVersion    string       `json:"databaseVersion"`
	RPCProtocolVersion types.Uint32 `json:"rpcProtocolVersion"`
	GitCommit          string       `json:"gitCommit"`
	VMVersions         VMVersions   `json:"vmVersions"`
	// Consensus describes the active consensus configuration. Populated
	// from the in-memory consensus engine state at request time. Omitted
	// for legacy clients that don't wire it through.
	Consensus *ConsensusInfo `json:"consensus,omitempty"`
}

GetNodeVersionReply are the results from calling GetNodeVersion.

func (*GetNodeVersionReply) MarshalZAP added in v1.1.14

func (x *GetNodeVersionReply) MarshalZAP() ([]byte, error)

MarshalZAP writes GetNodeVersionReply from constant offsets.

func (*GetNodeVersionReply) UnmarshalZAP added in v1.1.14

func (x *GetNodeVersionReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads GetNodeVersionReply out of the buffer that arrived.

type GetTxFeeResponse

type GetTxFeeResponse struct {
	TxFee                  types.Uint64 `json:"txFee"`
	CreateAssetTxFee       types.Uint64 `json:"createAssetTxFee"`
	CreateNetworkTxFee     types.Uint64 `json:"createNetworkTxFee"`
	TransformChainTxFee    types.Uint64 `json:"transformChainTxFee"`
	CreateChainTxFee       types.Uint64 `json:"createChainTxFee"`
	AddNetworkValidatorFee types.Uint64 `json:"addNetworkValidatorFee"`
	AddNetworkDelegatorFee types.Uint64 `json:"addNetworkDelegatorFee"`
}

GetTxFeeResponse are the results from calling GetTxFee.

func (*GetTxFeeResponse) MarshalZAP added in v1.1.13

func (x *GetTxFeeResponse) MarshalZAP() ([]byte, error)

MarshalZAP writes GetTxFeeResponse from constant offsets.

func (*GetTxFeeResponse) UnmarshalZAP added in v1.1.13

func (x *GetTxFeeResponse) UnmarshalZAP(data []byte) error

UnmarshalZAP reads GetTxFeeResponse out of the buffer that arrived.

type GetVMsReply

type GetVMsReply struct {
	VMs VMAliases `json:"vms"`
	Fxs FxNames   `json:"fxs"`
}

GetVMsReply contains the response metadata for GetVMs.

func (*GetVMsReply) MarshalZAP added in v1.1.14

func (x *GetVMsReply) MarshalZAP() ([]byte, error)

MarshalZAP writes GetVMsReply from constant offsets.

func (*GetVMsReply) UnmarshalZAP added in v1.1.14

func (x *GetVMsReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads GetVMsReply out of the buffer that arrived.

type IsBootstrappedArgs

type IsBootstrappedArgs struct {
	// Chain is the alias or id of the chain to ask about.
	Chain string `json:"chain"`
}

IsBootstrappedArgs are the arguments for calling IsBootstrapped.

func (*IsBootstrappedArgs) MarshalZAP added in v1.1.13

func (x *IsBootstrappedArgs) MarshalZAP() ([]byte, error)

MarshalZAP writes IsBootstrappedArgs from constant offsets.

func (*IsBootstrappedArgs) UnmarshalZAP added in v1.1.13

func (x *IsBootstrappedArgs) UnmarshalZAP(data []byte) error

UnmarshalZAP reads IsBootstrappedArgs out of the buffer that arrived.

type IsBootstrappedResponse

type IsBootstrappedResponse struct {
	IsBootstrapped bool `json:"isBootstrapped"`
}

IsBootstrappedResponse are the results from calling IsBootstrapped.

func (*IsBootstrappedResponse) MarshalZAP added in v1.1.13

func (x *IsBootstrappedResponse) MarshalZAP() ([]byte, error)

MarshalZAP writes IsBootstrappedResponse from constant offsets.

func (*IsBootstrappedResponse) UnmarshalZAP added in v1.1.13

func (x *IsBootstrappedResponse) UnmarshalZAP(data []byte) error

UnmarshalZAP reads IsBootstrappedResponse out of the buffer that arrived.

type LP

type LP struct {
	SupportWeight types.Uint64 `json:"supportWeight"`
	// Supporters are the peers voting for it, ordered by node id.
	Supporters   []ids.NodeID `json:"supporters"`
	ObjectWeight types.Uint64 `json:"objectWeight"`
	// Objectors are the peers voting against it, ordered by node id.
	Objectors     []ids.NodeID `json:"objectors"`
	AbstainWeight types.Uint64 `json:"abstainWeight"`
}

LP is information about an LP proposal.

func (*LP) MarshalZAP added in v1.1.14

func (x *LP) MarshalZAP() ([]byte, error)

MarshalZAP writes LP from constant offsets.

func (*LP) UnmarshalZAP added in v1.1.14

func (x *LP) UnmarshalZAP(data []byte) error

UnmarshalZAP reads LP out of the buffer that arrived.

type LPStatus added in v1.1.14

type LPStatus struct {
	// Number is the LP's number, the key it appears under on the JSON wire.
	Number uint32 `json:"number"`
	// LP is the stake for, against and abstaining.
	LP LP `json:"lp"`
}

LPStatus is one LP proposal and where the network's stake stands on it.

func (*LPStatus) MarshalZAP added in v1.1.14

func (x *LPStatus) MarshalZAP() ([]byte, error)

MarshalZAP writes LPStatus from constant offsets.

func (*LPStatus) UnmarshalZAP added in v1.1.14

func (x *LPStatus) UnmarshalZAP(data []byte) error

UnmarshalZAP reads LPStatus out of the buffer that arrived.

type LPs added in v1.1.14

type LPs []LPStatus

LPs is where the network stands on every LP: an object keyed by LP number on the JSON wire, a list in ascending number here.

func (LPs) Find added in v1.1.14

func (l LPs) Find(number uint32) (*LPStatus, bool)

Find is the status of one LP, and whether the reply carries it.

func (LPs) MarshalJSON added in v1.1.14

func (l LPs) MarshalJSON() ([]byte, error)

func (*LPs) UnmarshalJSON added in v1.1.14

func (l *LPs) UnmarshalJSON(b []byte) error

type LPsReply

type LPsReply struct {
	LPs LPs `json:"lps"`
}

LPsReply are the results from calling LPs.

func (*LPsReply) MarshalZAP added in v1.1.14

func (x *LPsReply) MarshalZAP() ([]byte, error)

MarshalZAP writes LPsReply from constant offsets.

func (*LPsReply) UnmarshalZAP added in v1.1.14

func (x *LPsReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads LPsReply out of the buffer that arrived.

type Peer

type Peer struct {
	PeerInfo

	Benched []string `json:"benched"`
}

Peer is information about a peer in the network.

func (*Peer) MarshalZAP added in v1.1.14

func (x *Peer) MarshalZAP() ([]byte, error)

MarshalZAP writes Peer from constant offsets.

func (*Peer) UnmarshalZAP added in v1.1.14

func (x *Peer) UnmarshalZAP(data []byte) error

UnmarshalZAP reads Peer out of the buffer that arrived.

type PeerInfo added in v1.0.13

type PeerInfo struct {
	// IP is the address this node reaches the peer at.
	IP types.Addr `json:"ip"`
	// PublicIP is the address the peer says it is reachable at.
	PublicIP types.Addr `json:"publicIP,omitempty"`
	// ID is the peer's node id.
	ID ids.NodeID `json:"nodeID"`
	// Version is the node software the peer is running.
	Version string `json:"version"`
	// LastSent is when this node last sent the peer a message.
	LastSent types.Time `json:"lastSent"`
	// LastReceived is when this node last heard from the peer.
	LastReceived types.Time `json:"lastReceived"`
	// ObservedUptime is the percentage of time this node has seen the peer up.
	ObservedUptime types.Uint32 `json:"observedUptime"`
	// TrackedChains are the chains the peer serves, ordered by id.
	TrackedChains []ids.ID `json:"trackedChains"`
	// SupportedLPs are the LPs the peer votes for, ascending.
	SupportedLPs []uint32 `json:"supportedLPs"`
	// ObjectedLPs are the LPs the peer votes against, ascending.
	ObjectedLPs []uint32 `json:"objectedLPs"`
}

PeerInfo is the JSON wire shape for a peer in the Peers RPC reply. It is the local owner of this shape; previously this type came from github.com/luxfi/p2p/peer.Info, but that module is being archived per LP-201. Field tags are stable across the rename — JSON consumers see no difference.

func (*PeerInfo) MarshalZAP added in v1.1.14

func (x *PeerInfo) MarshalZAP() ([]byte, error)

MarshalZAP writes PeerInfo from constant offsets.

func (*PeerInfo) UnmarshalZAP added in v1.1.14

func (x *PeerInfo) UnmarshalZAP(data []byte) error

UnmarshalZAP reads PeerInfo out of the buffer that arrived.

type PeersArgs

type PeersArgs struct {
	// NodeIDs narrows the answer to these peers. Empty asks for all of them.
	NodeIDs []ids.NodeID `json:"nodeIDs"`
}

PeersArgs are the arguments for calling Peers.

func (*PeersArgs) MarshalZAP added in v1.1.13

func (x *PeersArgs) MarshalZAP() ([]byte, error)

MarshalZAP writes PeersArgs from constant offsets.

func (*PeersArgs) UnmarshalZAP added in v1.1.13

func (x *PeersArgs) UnmarshalZAP(data []byte) error

UnmarshalZAP reads PeersArgs out of the buffer that arrived.

type PeersReply

type PeersReply struct {
	NumPeers types.Uint64 `json:"numPeers"`
	Peers    []Peer       `json:"peers"`
}

PeersReply are the results from calling Peers.

func (*PeersReply) MarshalZAP added in v1.1.14

func (x *PeersReply) MarshalZAP() ([]byte, error)

MarshalZAP writes PeersReply from constant offsets.

func (*PeersReply) UnmarshalZAP added in v1.1.14

func (x *PeersReply) UnmarshalZAP(data []byte) error

UnmarshalZAP reads PeersReply out of the buffer that arrived.

type ProofOfPossession

type ProofOfPossession struct {
	PublicKey         string `json:"publicKey"`
	ProofOfPossession string `json:"proofOfPossession"`
}

ProofOfPossession is a JSON-friendly representation of a BLS PoP.

func (*ProofOfPossession) MarshalZAP added in v1.1.13

func (x *ProofOfPossession) MarshalZAP() ([]byte, error)

MarshalZAP writes ProofOfPossession from constant offsets.

func (*ProofOfPossession) UnmarshalZAP added in v1.1.13

func (x *ProofOfPossession) UnmarshalZAP(data []byte) error

UnmarshalZAP reads ProofOfPossession out of the buffer that arrived.

type Service

type Service interface {
	GetNodeVersion(ctx context.Context) (*GetNodeVersionReply, error)
	GetNodeID(ctx context.Context) (*GetNodeIDReply, error)
	GetNodeIP(ctx context.Context) (*GetNodeIPReply, error)
	GetNetworkID(ctx context.Context) (*GetNetworkIDReply, error)
	GetNetworkName(ctx context.Context) (*GetNetworkNameReply, error)
	GetBlockchainID(ctx context.Context, args *GetBlockchainIDArgs) (*GetBlockchainIDReply, error)
	Peers(ctx context.Context, args *PeersArgs) (*PeersReply, error)
	IsBootstrapped(ctx context.Context, args *IsBootstrappedArgs) (*IsBootstrappedResponse, error)
	Upgrades(ctx context.Context) (*map[string]any, error)
	Uptime(ctx context.Context) (*UptimeResponse, error)
	Lps(ctx context.Context) (*LPsReply, error)
	GetTxFee(ctx context.Context) (*GetTxFeeResponse, error)
	GetVMs(ctx context.Context) (*GetVMsReply, error)
}

Service defines the info API contract.

type UptimeResponse

type UptimeResponse struct {
	RewardingStakePercentage  types.Float64 `json:"rewardingStakePercentage"`
	WeightedAveragePercentage types.Float64 `json:"weightedAveragePercentage"`
}

UptimeResponse are the results from calling Uptime.

func (*UptimeResponse) MarshalZAP added in v1.1.13

func (x *UptimeResponse) MarshalZAP() ([]byte, error)

MarshalZAP writes UptimeResponse from constant offsets.

func (*UptimeResponse) UnmarshalZAP added in v1.1.13

func (x *UptimeResponse) UnmarshalZAP(data []byte) error

UnmarshalZAP reads UptimeResponse out of the buffer that arrived.

type VMAlias added in v1.1.14

type VMAlias struct {
	// VM is the VM's id.
	VM ids.ID `json:"vm"`
	// Aliases are the names it also answers to.
	Aliases []string `json:"aliases"`
}

VMAlias is one VM and the names it answers to.

func (*VMAlias) MarshalZAP added in v1.1.14

func (x *VMAlias) MarshalZAP() ([]byte, error)

MarshalZAP writes VMAlias from constant offsets.

func (*VMAlias) UnmarshalZAP added in v1.1.14

func (x *VMAlias) UnmarshalZAP(data []byte) error

UnmarshalZAP reads VMAlias out of the buffer that arrived.

type VMAliases added in v1.1.14

type VMAliases []VMAlias

VMAliases are the VMs installed on a node: an object keyed by VM id on the JSON wire, a list ordered by that id here.

func (VMAliases) MarshalJSON added in v1.1.14

func (v VMAliases) MarshalJSON() ([]byte, error)

func (*VMAliases) UnmarshalJSON added in v1.1.14

func (v *VMAliases) UnmarshalJSON(b []byte) error

type VMVersion added in v1.1.14

type VMVersion struct {
	// VM is the VM's alias.
	VM string `json:"vm"`
	// Version is the release of it this node runs.
	Version string `json:"version"`
}

VMVersion is one VM and the version of it a node runs.

func (*VMVersion) MarshalZAP added in v1.1.14

func (x *VMVersion) MarshalZAP() ([]byte, error)

MarshalZAP writes VMVersion from constant offsets.

func (*VMVersion) UnmarshalZAP added in v1.1.14

func (x *VMVersion) UnmarshalZAP(data []byte) error

UnmarshalZAP reads VMVersion out of the buffer that arrived.

type VMVersions added in v1.1.14

type VMVersions []VMVersion

VMVersions is what a node runs of each VM: an object keyed by VM alias on the JSON wire, a list ordered by that alias here.

func (VMVersions) MarshalJSON added in v1.1.14

func (v VMVersions) MarshalJSON() ([]byte, error)

func (*VMVersions) UnmarshalJSON added in v1.1.14

func (v *VMVersions) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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