gvalidators

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: BSD-3-Clause Imports: 5 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 GRPCClient

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

GRPCClient is a gRPC client that implements quasar.ValidatorState

func NewGRPCClient

func NewGRPCClient(client validatorstatepb.ValidatorStateClient) *GRPCClient

NewGRPCClient creates a new gRPC validator state client

func (*GRPCClient) ApplyValidatorPublicKeyDiffs

func (c *GRPCClient) ApplyValidatorPublicKeyDiffs(
	ctx context.Context,
	validators map[ids.NodeID]*validators.GetValidatorOutput,
	startHeight uint64,
	endHeight uint64,
	subnetID ids.ID,
) error

ApplyValidatorPublicKeyDiffs implements quasar.ValidatorState

func (*GRPCClient) ApplyValidatorWeightDiffs

func (c *GRPCClient) ApplyValidatorWeightDiffs(
	ctx context.Context,
	validators map[ids.NodeID]*validators.GetValidatorOutput,
	startHeight uint64,
	endHeight uint64,
	subnetID ids.ID,
) error

ApplyValidatorWeightDiffs implements quasar.ValidatorState

func (*GRPCClient) GetCurrentHeight

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

GetCurrentHeight implements quasar.ValidatorState

func (*GRPCClient) GetCurrentValidatorSet

func (c *GRPCClient) GetCurrentValidatorSet(
	ctx context.Context,
	subnetID ids.ID,
) (map[ids.ID]*validators.GetCurrentValidatorOutput, uint64, error)

GetCurrentValidatorSet implements quasar.ValidatorState

func (*GRPCClient) GetMinimumHeight

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

GetMinimumHeight implements quasar.ValidatorState

func (*GRPCClient) GetSubnetID

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

GetSubnetID implements quasar.ValidatorState

func (*GRPCClient) GetValidatorSet

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

GetValidatorSet implements quasar.ValidatorState

type GRPCServer

type GRPCServer struct {
	validatorstatepb.UnimplementedValidatorStateServer
	// contains filtered or unexported fields
}

GRPCServer is a gRPC server that implements ValidatorStateServer

func NewGRPCServer

func NewGRPCServer(state validators.State) *GRPCServer

NewGRPCServer creates a new gRPC validator server.

func (*GRPCServer) GetCurrentHeight

GetCurrentHeight implements ValidatorStateServer

func (*GRPCServer) GetCurrentValidatorSet

GetCurrentValidatorSet implements ValidatorStateServer

func (*GRPCServer) GetMinimumHeight

GetMinimumHeight implements ValidatorStateServer

func (*GRPCServer) GetSubnetID

GetSubnetID implements ValidatorStateServer

func (*GRPCServer) GetValidatorSet

GetValidatorSet implements ValidatorStateServer

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

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