rpc

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 7 Imported by: 0

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)

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

Jump to

Keyboard shortcuts

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