Documentation
¶
Index ¶
- func AwaitBootstrapped(ctx context.Context, c *Client, chainID string, freq time.Duration, ...) (bool, error)
- type Client
- func (c *Client) GetBlockchainID(ctx context.Context, alias string, options ...rpc.Option) (ids.ID, error)
- func (c *Client) GetNetworkID(ctx context.Context, options ...rpc.Option) (uint32, error)
- func (c *Client) GetNetworkName(ctx context.Context, options ...rpc.Option) (string, error)
- func (c *Client) GetNodeID(ctx context.Context, options ...rpc.Option) (ids.NodeID, *ProofOfPossession, error)
- func (c *Client) GetNodeIP(ctx context.Context, options ...rpc.Option) (netip.AddrPort, error)
- func (c *Client) GetNodeVersion(ctx context.Context, options ...rpc.Option) (*GetNodeVersionReply, error)
- func (c *Client) GetVMs(ctx context.Context, options ...rpc.Option) (map[ids.ID][]string, error)
- func (c *Client) IsBootstrapped(ctx context.Context, chainID string, options ...rpc.Option) (bool, error)
- func (c *Client) Peers(ctx context.Context, nodeIDs []ids.NodeID, options ...rpc.Option) ([]Peer, error)
- func (c *Client) Upgrades(ctx context.Context, options ...rpc.Option) (*upgrade.Config, error)
- func (c *Client) Uptime(ctx context.Context, options ...rpc.Option) (*UptimeResponse, error)
- type GetBlockchainIDArgs
- type GetBlockchainIDReply
- type GetNetworkIDReply
- type GetNetworkNameReply
- type GetNodeIDReply
- type GetNodeIPReply
- type GetNodeVersionReply
- type GetTxFeeResponse
- type GetVMsReply
- type IsBootstrappedArgs
- type IsBootstrappedResponse
- type LP
- type LPsReply
- type Peer
- type PeersArgs
- type PeersReply
- type ProofOfPossession
- type UptimeResponse
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 (*Client) GetBlockchainID ¶
func (*Client) GetNetworkID ¶
func (*Client) GetNetworkName ¶
func (*Client) GetNodeVersion ¶
func (*Client) IsBootstrapped ¶
type GetBlockchainIDArgs ¶
type GetBlockchainIDArgs struct {
Alias string `json:"alias"`
}
GetBlockchainIDArgs are the arguments for calling GetBlockchainID.
type GetBlockchainIDReply ¶
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 ¶
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 ¶
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 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.