Help us shape the future of Go! Take the 2026 Go Developer Survey

gvalidators

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: BSD-3-Clause Imports: 3 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 is a gRPC client for validator operations.

func NewClient

func NewClient(conn interface{}) *Client

NewClient creates a new gRPC validator client.

func (*Client) GetCurrentHeight

func (c *Client) GetCurrentHeight(ctx context.Context) (uint64, error)

GetCurrentHeight returns the current height of the validator set.

func (*Client) GetMinimumHeight

func (c *Client) GetMinimumHeight(ctx context.Context) (uint64, error)

GetMinimumHeight returns the minimum height of the given validator set.

func (*Client) GetSubnetID

func (c *Client) GetSubnetID(ctx context.Context) (ids.ID, error)

GetSubnetID returns the subnet ID of the validator set.

func (*Client) GetValidatorSet

func (c *Client) GetValidatorSet(ctx context.Context, height uint64) (map[ids.NodeID]*validators.GetValidatorOutput, error)

GetValidatorSet returns the validator set at the given height.

type GetCurrentHeightRequest

type GetCurrentHeightRequest struct{}

type GetCurrentHeightResponse

type GetCurrentHeightResponse struct {
	Height uint64
}

type GetMinimumHeightRequest

type GetMinimumHeightRequest struct{}

Request types for gRPC methods

type GetMinimumHeightResponse

type GetMinimumHeightResponse struct {
	Height uint64
}

type GetSubnetIDRequest

type GetSubnetIDRequest struct {
	ChainID []byte
}

type GetSubnetIDResponse

type GetSubnetIDResponse struct {
	SubnetID []byte
}

type GetValidatorSetRequest

type GetValidatorSetRequest struct {
	Height   uint64
	SubnetID []byte
}

type GetValidatorSetResponse

type GetValidatorSetResponse struct {
	Validators []*ValidatorOutput
}

type Server

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

Server is a gRPC server for validator operations.

func NewServer

func NewServer(state validators.State) *Server

NewServer creates a new gRPC validator server.

func (*Server) GetCurrentHeight

func (s *Server) GetCurrentHeight(ctx context.Context, req interface{}) (interface{}, error)

GetCurrentHeight implements the gRPC server method.

func (*Server) GetMinimumHeight

func (s *Server) GetMinimumHeight(ctx context.Context, req interface{}) (interface{}, error)

GetMinimumHeight implements the gRPC server method.

func (*Server) GetSubnetID

func (s *Server) GetSubnetID(ctx context.Context, req interface{}) (interface{}, error)

GetSubnetID implements the gRPC server method.

func (*Server) GetValidatorSet

func (s *Server) GetValidatorSet(ctx context.Context, req interface{}) (interface{}, error)

GetValidatorSet implements the gRPC server method.

type ValidatorOutput

type ValidatorOutput struct {
	NodeID    []byte
	PublicKey []byte
	Weight    uint64
}

Jump to

Keyboard shortcuts

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