info

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AwaitBootstrapped

func AwaitBootstrapped(ctx context.Context, c *Client, chainID string, freq time.Duration, options ...rpc.Option) (bool, error)

AwaitBootstrapped polls the node every [freq] to check if [chainID] has finished bootstrapping. Returns true once [chainID] reports that it has finished bootstrapping. Only returns an error if [ctx] returns an error.

Types

type Client

type Client struct {
	Requester rpc.EndpointRequester
}

func NewClient

func NewClient(uri string) *Client

func (*Client) GetBlockchainID

func (c *Client) GetBlockchainID(ctx context.Context, alias string, options ...rpc.Option) (ids.ID, error)

func (*Client) GetNetworkID

func (c *Client) GetNetworkID(ctx context.Context, options ...rpc.Option) (uint32, error)

func (*Client) GetNetworkName

func (c *Client) GetNetworkName(ctx context.Context, options ...rpc.Option) (string, error)

func (*Client) GetNodeID

func (c *Client) GetNodeID(ctx context.Context, options ...rpc.Option) (ids.NodeID, *ProofOfPossession, error)

func (*Client) GetNodeIP

func (c *Client) GetNodeIP(ctx context.Context, options ...rpc.Option) (netip.AddrPort, error)

func (*Client) GetNodeVersion

func (c *Client) GetNodeVersion(ctx context.Context, options ...rpc.Option) (*GetNodeVersionReply, error)

func (*Client) GetVMs

func (c *Client) GetVMs(ctx context.Context, options ...rpc.Option) (map[ids.ID][]string, error)

func (*Client) IsBootstrapped

func (c *Client) IsBootstrapped(ctx context.Context, chainID string, options ...rpc.Option) (bool, error)

func (*Client) Peers

func (c *Client) Peers(ctx context.Context, nodeIDs []ids.NodeID, options ...rpc.Option) ([]Peer, error)

func (*Client) Upgrades

func (c *Client) Upgrades(ctx context.Context, options ...rpc.Option) (*upgrade.Config, error)

func (*Client) Uptime

func (c *Client) Uptime(ctx context.Context, options ...rpc.Option) (*UptimeResponse, error)

type GetBlockchainIDArgs

type GetBlockchainIDArgs struct {
	Alias string `json:"alias"`
}

GetBlockchainIDArgs are the arguments for calling GetBlockchainID.

type GetBlockchainIDReply

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

GetBlockchainIDReply are the results from calling GetBlockchainID.

type GetNetworkIDReply

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

GetNetworkIDReply are the results from calling GetNetworkID.

type GetNetworkNameReply

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

GetNetworkNameReply is the result from calling GetNetworkName.

type GetNodeIDReply

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

GetNodeIDReply are the results from calling GetNodeID.

type GetNodeIPReply

type GetNodeIPReply struct {
	IP netip.AddrPort `json:"ip"`
}

GetNodeIPReply are the results from calling GetNodeIP.

type GetNodeVersionReply

type GetNodeVersionReply struct {
	Version            string            `json:"version"`
	DatabaseVersion    string            `json:"databaseVersion"`
	RPCProtocolVersion json.Uint32       `json:"rpcProtocolVersion"`
	GitCommit          string            `json:"gitCommit"`
	VMVersions         map[string]string `json:"vmVersions"`
}

GetNodeVersionReply are the results from calling GetNodeVersion.

type GetTxFeeResponse

type GetTxFeeResponse struct {
	TxFee                         json.Uint64 `json:"txFee"`
	CreateAssetTxFee              json.Uint64 `json:"createAssetTxFee"`
	CreateNetTxFee                json.Uint64 `json:"createNetTxFee"`
	TransformChainTxFee           json.Uint64 `json:"transformNetTxFee"`
	CreateBlockchainTxFee         json.Uint64 `json:"createBlockchainTxFee"`
	AddPrimaryNetworkValidatorFee json.Uint64 `json:"addPrimaryNetworkValidatorFee"`
	AddPrimaryNetworkDelegatorFee json.Uint64 `json:"addPrimaryNetworkDelegatorFee"`
	AddNetValidatorFee            json.Uint64 `json:"addNetValidatorFee"`
	AddNetDelegatorFee            json.Uint64 `json:"addNetDelegatorFee"`
}

type GetVMsReply

type GetVMsReply struct {
	VMs map[ids.ID][]string `json:"vms"`
	Fxs map[ids.ID]string   `json:"fxs"`
}

GetVMsReply contains the response metadata for GetVMs.

type IsBootstrappedArgs

type IsBootstrappedArgs struct {
	// Alias of the chain
	// Can also be the string representation of the chain's ID
	Chain string `json:"chain"`
}

IsBootstrappedArgs are the arguments for calling IsBootstrapped.

type IsBootstrappedResponse

type IsBootstrappedResponse struct {
	// True iff the chain exists and is done bootstrapping
	IsBootstrapped bool `json:"isBootstrapped"`
}

IsBootstrappedResponse are the results from calling IsBootstrapped.

type LP

type LP struct {
	SupportWeight json.Uint64         `json:"supportWeight"`
	Supporters    set.Set[ids.NodeID] `json:"supporters"`
	ObjectWeight  json.Uint64         `json:"objectWeight"`
	Objectors     set.Set[ids.NodeID] `json:"objectors"`
	AbstainWeight json.Uint64         `json:"abstainWeight"`
}

type LPsReply

type LPsReply struct {
	LPs map[uint32]*LP `json:"lps"`
}

func (*LPsReply) GetLP

func (a *LPsReply) GetLP(lpNum uint32) *LP

type Peer

type Peer struct {
	peer.Info

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

type PeersArgs

type PeersArgs struct {
	NodeIDs []ids.NodeID `json:"nodeIDs"`
}

PeersArgs are the arguments for calling Peers.

type PeersReply

type PeersReply struct {
	// Number of elements in [Peers]
	NumPeers json.Uint64 `json:"numPeers"`
	// Each element is a peer
	Peers []Peer `json:"peers"`
}

PeersReply are the results from calling Peers.

type ProofOfPossession

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

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

type UptimeResponse

type UptimeResponse struct {
	// RewardingStakePercentage shows what percent of network stake thinks we're
	// above the uptime requirement.
	RewardingStakePercentage json.Float64 `json:"rewardingStakePercentage"`

	// WeightedAveragePercentage is the average perceived uptime of this node,
	// weighted by stake.
	// Note that this is different from RewardingStakePercentage, which shows
	// the percent of the network stake that thinks this node is above the
	// uptime requirement. WeightedAveragePercentage is weighted by uptime.
	// i.e If uptime requirement is 85 and a peer reports 40 percent it will be
	// counted (40*weight) in WeightedAveragePercentage but not in
	// RewardingStakePercentage since 40 < 85
	WeightedAveragePercentage json.Float64 `json:"weightedAveragePercentage"`
}

UptimeResponse are the results from calling Uptime.

Jump to

Keyboard shortcuts

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