info

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: BSD-3-Clause Imports: 15 Imported by: 55

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(
	log logging.Logger,
	version version.Application,
	nodeID ids.ShortID,
	networkID uint32,
	chainManager chains.Manager,
	vmManager vms.Manager,
	peers network.Network,
	txFee uint64,
	createAssetTxFee uint64,
	createSubnetTxFee uint64,
	createBlockchainTxFee uint64,
) (*common.HTTPHandler, error)

NewService returns a new admin API service

Types

type Client added in v1.0.6

type Client struct {
	// contains filtered or unexported fields
}

Client is an Info API Client

func NewClient added in v1.0.6

func NewClient(uri string, requestTimeout time.Duration) *Client

NewClient returns a new Info API Client

func (*Client) GetBlockchainID added in v1.0.6

func (c *Client) GetBlockchainID(alias string) (ids.ID, error)

func (*Client) GetNetworkID added in v1.0.6

func (c *Client) GetNetworkID() (uint32, error)

func (*Client) GetNetworkName added in v1.0.6

func (c *Client) GetNetworkName() (string, error)

func (*Client) GetNodeID added in v1.0.6

func (c *Client) GetNodeID() (string, error)

func (*Client) GetNodeIP added in v1.0.6

func (c *Client) GetNodeIP() (string, error)

func (*Client) GetNodeVersion added in v1.4.12

func (c *Client) GetNodeVersion() (*GetNodeVersionReply, error)

func (*Client) GetTxFee added in v1.0.6

func (c *Client) GetTxFee() (*GetTxFeeResponse, error)

func (*Client) IsBootstrapped added in v1.0.6

func (c *Client) IsBootstrapped(chain string) (bool, error)

func (*Client) Peers added in v1.0.6

func (c *Client) Peers() ([]network.PeerID, 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 string `json:"nodeID"`
}

GetNodeIDReply are the results from calling GetNodeID

type GetNodeIPReply added in v1.0.4

type GetNodeIPReply struct {
	IP string `json:"ip"`
}

GetNodeIPReply are the results from calling GetNodeIP

type GetNodeVersionReply

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

GetNodeVersionReply are the results from calling GetNodeVersion

type GetTxFeeResponse added in v0.8.4

type GetTxFeeResponse struct {
	TxFee json.Uint64 `json:"txFee"`
	// TODO: remove [CreationTxFee] after enough time for dependencies to update
	CreationTxFee         json.Uint64 `json:"creationTxFee"`
	CreateAssetTxFee      json.Uint64 `json:"createAssetTxFee"`
	CreateSubnetTxFee     json.Uint64 `json:"createSubnetTxFee"`
	CreateBlockchainTxFee json.Uint64 `json:"createBlockchainTxFee"`
}

type Info

type Info struct {
	// contains filtered or unexported fields
}

Info is the API service for unprivileged info on a node

func (*Info) GetBlockchainID

func (service *Info) GetBlockchainID(_ *http.Request, args *GetBlockchainIDArgs, reply *GetBlockchainIDReply) error

GetBlockchainID returns the blockchain ID that resolves the alias that was supplied

func (*Info) GetNetworkID

func (service *Info) GetNetworkID(_ *http.Request, _ *struct{}, reply *GetNetworkIDReply) error

GetNetworkID returns the network ID this node is running on

func (*Info) GetNetworkName

func (service *Info) GetNetworkName(_ *http.Request, _ *struct{}, reply *GetNetworkNameReply) error

GetNetworkName returns the network name this node is running on

func (*Info) GetNodeID

func (service *Info) GetNodeID(_ *http.Request, _ *struct{}, reply *GetNodeIDReply) error

GetNodeID returns the node ID of this node

func (*Info) GetNodeIP added in v1.0.4

func (service *Info) GetNodeIP(_ *http.Request, _ *struct{}, reply *GetNodeIPReply) error

GetNodeIP returns the IP of this node

func (*Info) GetNodeVersion

func (service *Info) GetNodeVersion(_ *http.Request, _ *struct{}, reply *GetNodeVersionReply) error

GetNodeVersion returns the version this node is running

func (*Info) GetTxFee

func (service *Info) GetTxFee(_ *http.Request, args *struct{}, reply *GetTxFeeResponse) error

GetTxFee returns the transaction fee in nAVAX.

func (*Info) IsBootstrapped

func (service *Info) IsBootstrapped(_ *http.Request, args *IsBootstrappedArgs, reply *IsBootstrappedResponse) error

IsBootstrapped returns nil and sets [reply.IsBootstrapped] == true iff [args.Chain] exists and is done bootstrapping Returns an error if the chain doesn't exist

func (*Info) Peers

func (service *Info) Peers(_ *http.Request, args *PeersArgs, reply *PeersReply) error

Peers returns the list of current validators

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 PeersArgs added in v1.1.4

type PeersArgs struct {
	NodeIDs []string `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 []network.PeerID `json:"peers"`
}

PeersReply are the results from calling Peers

Jump to

Keyboard shortcuts

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