rpc

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents an RPC client for communicating with the validator

func NewClient

func NewClient(url string) *Client

NewClient creates a new RPC client

func (*Client) GetHealth

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

Health checks if the validator is healthy

func (*Client) GetIdentity

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

GetIdentity gets the validator's identity public key (public method)

func (*Client) GetNodeWithIdentityPublicKey added in v0.1.12

func (c *Client) GetNodeWithIdentityPublicKey(identityPublicKey string) (found bool, node *clusterNodeResult, err error)

GetNodeWithIdentityPublicKey gets a validator with the given identity public key

func (*Client) GetVersion

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

GetVersion gets the validator's version (public method)

func (*Client) GetVoteAccounts added in v0.1.41

func (c *Client) GetVoteAccounts() (*VoteAccounts, error)

GetVoteAccounts gets current and delinquent vote accounts.

type JSONRPCRequest

type JSONRPCRequest struct {
	JSONRPC string        `json:"jsonrpc"`
	ID      int           `json:"id"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
}

JSONRPCRequest represents a JSON-RPC request

type JSONRPCResponse

type JSONRPCResponse struct {
	JSONRPC string      `json:"jsonrpc"`
	ID      int         `json:"id"`
	Result  interface{} `json:"result,omitempty"`
	Error   *RPCError   `json:"error,omitempty"`
}

JSONRPCResponse represents a JSON-RPC response

type RPCError

type RPCError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

RPCError represents an RPC error

type ValidatorState

type ValidatorState struct {
	// RunningVersion is the currently running version of the validator
	RunningVersion string
	// IdentityPubkey is the public key of the validator's identity
	IdentityPubkey string
	// Role is the role of the validator (active/passive)
	Role string
}

ValidatorState represents the current state of the validator

type VoteAccount added in v0.1.41

type VoteAccount struct {
	VotePubkey string `json:"votePubkey"`
	NodePubkey string `json:"nodePubkey"`
}

VoteAccount contains the identity association needed for validator role discovery.

type VoteAccounts added in v0.1.41

type VoteAccounts struct {
	Current    []VoteAccount `json:"current"`
	Delinquent []VoteAccount `json:"delinquent"`
}

VoteAccounts contains current and delinquent vote accounts.

Jump to

Keyboard shortcuts

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