info

package
v1.37.21 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

What a node tells anyone who asks — the conformance corpus, in Go.

This service exists three times: here, in rust/examples/info, and in cpp/examples/info. The three are written in their own languages, in their own idioms, and each one's framework projects it without help from the other two. The projections they produce are then compared byte for byte, which is the only proof that zip is ONE framework with three implementations rather than one with two clients.

The shapes are chosen to be the ones that break: a quoted decimal (a value whose JSON form is not what it is made of), a nested named struct, a list of structs, a map, a path-free GET with a query parameter, and an op that takes nothing at all.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bootstrapped

type Bootstrapped struct {
	// IsBootstrapped is true once the chain has caught up.
	IsBootstrapped bool `json:"isBootstrapped"`
}

Bootstrapped is whether a chain has finished bootstrapping.

type BootstrappedArgs

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

BootstrappedArgs names the chain whose bootstrap state is being asked about.

type Chain

type Chain struct {
	// ID is the chain's id.
	ID string `json:"id"`
	// Name is the chain's name.
	Name string `json:"name"`
	// VMID is the id of the virtual machine the chain runs.
	VMID string `json:"vmID"`
	// Bootstrapped is whether this node has caught the chain up.
	Bootstrapped bool `json:"bootstrapped"`
}

Chain is one chain this node runs.

type ChainAlias

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

ChainAlias names the chain a caller is asking about.

type ChainID

type ChainID struct {
	// BlockchainID is the chain's id.
	BlockchainID string `json:"blockchainID"`
}

ChainID is the id an alias names.

type Chains

type Chains struct {
	// Chains are the chains this node is running.
	Chains []Chain `json:"chains"`
}

Chains are the chains this node runs.

type Fees

type Fees struct {
	// TxFee is the fee for an ordinary transaction.
	TxFee Uint64 `json:"txFee"`
	// CreateAssetTxFee is the fee to create an asset.
	CreateAssetTxFee Uint64 `json:"createAssetTxFee"`
	// CreateChainTxFee is the fee to create a chain.
	CreateChainTxFee Uint64 `json:"createChainTxFee"`
}

Fees are the transaction fees this node charges, in nLUX.

type Info

type Info struct {
	Release string
	Network uint32
}

Info answers questions about one node. It holds the answers rather than computing them, because this service exists to be projected, not to run a network.

func (*Info) Ops

func (i *Info) Ops() *zip.App

Ops is this service's typed operations. Registering a handler yields the REST route, the OpenAPI document, the MCP tool, the CLI command and the ZAP method, all from this one registration and the doc comment above it.

type LP

type LP struct {
	// SupportWeight is the stake in favour.
	SupportWeight Uint64 `json:"supportWeight"`
	// ObjectWeight is the stake against.
	ObjectWeight Uint64 `json:"objectWeight"`
	// AbstainWeight is the stake that has not said.
	AbstainWeight Uint64 `json:"abstainWeight"`
}

LP is where the stake stands on one proposal.

type LPs

type LPs struct {
	// LPs are the proposals, by number.
	LPs map[string]LP `json:"lps"`
}

LPs is where the network's stake stands on every current proposal.

type NetworkID

type NetworkID struct {
	// NetworkID is the network's number.
	NetworkID uint32 `json:"networkID"`
}

NetworkID is the number of the network a node is on.

type NetworkName

type NetworkName struct {
	// NetworkName is the network's name.
	NetworkName string `json:"networkName"`
}

NetworkName is the name of the network a node is on.

type NodeID

type NodeID struct {
	// NodeID is the id peers know this node by.
	NodeID string `json:"nodeID"`
	// NodePOP is the proof this node holds the key its id is derived from.
	NodePOP ProofOfPossession `json:"nodePOP"`
}

NodeID is this node's id, with the proof it holds the staking key.

type NodeIP

type NodeIP struct {
	// IP is the address and port peers dial.
	IP string `json:"ip"`
}

NodeIP is where this node tells its peers to reach it.

type NodeVersion

type NodeVersion struct {
	// Version is the node's own release.
	Version string `json:"version"`
	// DatabaseVersion is the database format this node reads.
	DatabaseVersion string `json:"databaseVersion"`
	// RPCProtocolVersion is the VM protocol this node speaks.
	RPCProtocolVersion uint32 `json:"rpcProtocolVersion"`
	// GitCommit is the commit this node was built from.
	GitCommit string `json:"gitCommit"`
}

NodeVersion is what this node is running.

type Peer

type Peer struct {
	// IP is the address this node reaches the peer at.
	IP string `json:"ip"`
	// PublicIP is the address the peer tells others to use.
	PublicIP string `json:"publicIP"`
	// NodeID is the peer's id.
	NodeID string `json:"nodeID"`
	// Version is the release the peer is running.
	Version string `json:"version"`
	// ObservedUptime is the share of time this node has seen the peer up.
	ObservedUptime uint32 `json:"observedUptime"`
	// TrackedChains are the chains the peer is following.
	TrackedChains []string `json:"trackedChains"`
}

Peer is one connection this node holds.

type Peers

type Peers struct {
	// NumPeers is how many connections this node holds.
	NumPeers Uint64 `json:"numPeers"`
	// Peers are the connections themselves.
	Peers []Peer `json:"peers"`
}

Peers are the nodes this one is connected to.

type PeersArgs

type PeersArgs struct {
	// NodeIDs are the peers to answer for; none asks for all of them.
	NodeIDs []string `json:"nodeIDs"`
}

PeersArgs narrows the peer list to the nodes named.

type ProofOfPossession

type ProofOfPossession struct {
	// PublicKey is the BLS public key, hex encoded.
	PublicKey string `json:"publicKey"`
	// ProofOfPossession is the signature over that key, hex encoded.
	ProofOfPossession string `json:"proofOfPossession"`
}

ProofOfPossession is a staking key and a signature over it.

type Uint64

type Uint64 uint64

Uint64 is a 64-bit count carried as a quoted decimal, because JSON numbers lose precision above 2^53 and a stake does not.

It is the case that makes the manifest carry two answers for one type: to a JSON reader this is a string, and to a fixed layout it is eight bytes. A description that could only say one of those would make one projection lie.

func (Uint64) JSONSchema

func (Uint64) JSONSchema() map[string]any

JSONSchema states this type's wire form, next to the code that writes it.

func (Uint64) MarshalJSON

func (u Uint64) MarshalJSON() ([]byte, error)

func (Uint64) MarshalText

func (u Uint64) MarshalText() ([]byte, error)

MarshalText and UnmarshalText are the same value as ONE WORD, which is what a URL can carry. A quoted decimal is already text; saying so is what lets it be a query parameter as well as a body field.

func (*Uint64) UnmarshalJSON

func (u *Uint64) UnmarshalJSON(b []byte) error

func (*Uint64) UnmarshalText

func (u *Uint64) UnmarshalText(b []byte) error

type Upgrades

type Upgrades struct {
	// StopVertexID is the vertex the linearisation stopped at.
	StopVertexID string `json:"stopVertexID"`
	// EpochDuration is how long one epoch lasts, in nanoseconds.
	EpochDuration Uint64 `json:"epochDuration"`
}

Upgrades is the upgrade schedule this node runs.

type Uptime

type Uptime struct {
	// RewardingStakePercentage is the share of stake that would reward this node.
	RewardingStakePercentage string `json:"rewardingStakePercentage"`
	// WeightedAveragePercentage is the stake-weighted average uptime.
	WeightedAveragePercentage string `json:"weightedAveragePercentage"`
}

Uptime is how much of the network reports having seen this node up.

type VMs

type VMs struct {
	// VMs are the installed machines, by id, each with the names it answers to.
	VMs map[string][]string `json:"vms"`
	// Fxs are the feature extensions the UTXO chains understand, by id.
	Fxs map[string]string `json:"fxs"`
}

VMs are the virtual machines installed on this node.

Jump to

Keyboard shortcuts

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