Documentation
¶
Index ¶
- type Client
- func (c *Client) GetCurrentHeight(ctx context.Context) (uint64, error)
- func (c *Client) GetMinimumHeight(ctx context.Context) (uint64, error)
- func (c *Client) GetSubnetID(ctx context.Context) (ids.ID, error)
- func (c *Client) GetValidatorSet(ctx context.Context, height uint64) (map[ids.NodeID]*validators.GetValidatorOutput, error)
- type GRPCClient
- func (c *GRPCClient) ApplyValidatorPublicKeyDiffs(ctx context.Context, validators map[ids.NodeID]*validators.GetValidatorOutput, ...) error
- func (c *GRPCClient) ApplyValidatorWeightDiffs(ctx context.Context, validators map[ids.NodeID]*validators.GetValidatorOutput, ...) error
- func (c *GRPCClient) GetCurrentHeight(ctx context.Context) (uint64, error)
- func (c *GRPCClient) GetCurrentValidatorSet(ctx context.Context, subnetID ids.ID) (map[ids.ID]*validators.GetCurrentValidatorOutput, uint64, error)
- func (c *GRPCClient) GetMinimumHeight(ctx context.Context) (uint64, error)
- func (c *GRPCClient) GetSubnetID(ctx context.Context, chainID ids.ID) (ids.ID, error)
- func (c *GRPCClient) GetValidatorSet(ctx context.Context, height uint64, subnetID ids.ID) (map[ids.NodeID]*validators.GetValidatorOutput, error)
- type GRPCServer
- func (s *GRPCServer) GetCurrentHeight(ctx context.Context, _ *emptypb.Empty) (*validatorstatepb.GetCurrentHeightResponse, error)
- func (s *GRPCServer) GetCurrentValidatorSet(ctx context.Context, req *validatorstatepb.GetCurrentValidatorSetRequest) (*validatorstatepb.GetCurrentValidatorSetResponse, error)
- func (s *GRPCServer) GetMinimumHeight(ctx context.Context, _ *emptypb.Empty) (*validatorstatepb.GetMinimumHeightResponse, error)
- func (s *GRPCServer) GetSubnetID(ctx context.Context, req *validatorstatepb.GetSubnetIDRequest) (*validatorstatepb.GetSubnetIDResponse, error)
- func (s *GRPCServer) GetValidatorSet(ctx context.Context, req *validatorstatepb.GetValidatorSetRequest) (*validatorstatepb.GetValidatorSetResponse, error)
- type GetCurrentHeightRequest
- type GetCurrentHeightResponse
- type GetMinimumHeightRequest
- type GetMinimumHeightResponse
- type GetSubnetIDRequest
- type GetSubnetIDResponse
- type GetValidatorSetRequest
- type GetValidatorSetResponse
- type Server
- func (s *Server) GetCurrentHeight(ctx context.Context, _ *emptypb.Empty) (*validatorstate.GetCurrentHeightResponse, error)
- func (s *Server) GetMinimumHeight(ctx context.Context, req interface{}) (interface{}, error)
- func (s *Server) GetSubnetID(ctx context.Context, req interface{}) (interface{}, error)
- func (s *Server) GetValidatorSet(ctx context.Context, req interface{}) (interface{}, error)
- type ValidatorOutput
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 ¶
GetCurrentHeight returns the current height of the validator set.
func (*Client) GetMinimumHeight ¶
GetMinimumHeight returns the minimum height of the given validator set.
func (*Client) GetSubnetID ¶
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 consensus.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 consensus.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 consensus.ValidatorState
func (*GRPCClient) GetCurrentHeight ¶
func (c *GRPCClient) GetCurrentHeight(ctx context.Context) (uint64, error)
GetCurrentHeight implements consensus.ValidatorState
func (*GRPCClient) GetCurrentValidatorSet ¶
func (c *GRPCClient) GetCurrentValidatorSet( ctx context.Context, subnetID ids.ID, ) (map[ids.ID]*validators.GetCurrentValidatorOutput, uint64, error)
GetCurrentValidatorSet implements consensus.ValidatorState
func (*GRPCClient) GetMinimumHeight ¶
func (c *GRPCClient) GetMinimumHeight(ctx context.Context) (uint64, error)
GetMinimumHeight implements consensus.ValidatorState
func (*GRPCClient) GetSubnetID ¶
GetSubnetID implements consensus.ValidatorState
func (*GRPCClient) GetValidatorSet ¶
func (c *GRPCClient) GetValidatorSet( ctx context.Context, height uint64, subnetID ids.ID, ) (map[ids.NodeID]*validators.GetValidatorOutput, error)
GetValidatorSet implements consensus.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 ¶
func (s *GRPCServer) GetCurrentHeight(ctx context.Context, _ *emptypb.Empty) (*validatorstatepb.GetCurrentHeightResponse, error)
GetCurrentHeight implements ValidatorStateServer
func (*GRPCServer) GetCurrentValidatorSet ¶
func (s *GRPCServer) GetCurrentValidatorSet(ctx context.Context, req *validatorstatepb.GetCurrentValidatorSetRequest) (*validatorstatepb.GetCurrentValidatorSetResponse, error)
GetCurrentValidatorSet implements ValidatorStateServer
func (*GRPCServer) GetMinimumHeight ¶
func (s *GRPCServer) GetMinimumHeight(ctx context.Context, _ *emptypb.Empty) (*validatorstatepb.GetMinimumHeightResponse, error)
GetMinimumHeight implements ValidatorStateServer
func (*GRPCServer) GetSubnetID ¶
func (s *GRPCServer) GetSubnetID(ctx context.Context, req *validatorstatepb.GetSubnetIDRequest) (*validatorstatepb.GetSubnetIDResponse, error)
GetSubnetID implements ValidatorStateServer
func (*GRPCServer) GetValidatorSet ¶
func (s *GRPCServer) GetValidatorSet(ctx context.Context, req *validatorstatepb.GetValidatorSetRequest) (*validatorstatepb.GetValidatorSetResponse, error)
GetValidatorSet implements ValidatorStateServer
type GetCurrentHeightRequest ¶
type GetCurrentHeightRequest struct{}
type GetCurrentHeightResponse ¶
type GetCurrentHeightResponse struct {
Height uint64
}
type GetMinimumHeightResponse ¶
type GetMinimumHeightResponse struct {
Height uint64
}
type GetSubnetIDRequest ¶
type GetSubnetIDRequest struct {
ChainID []byte
}
type GetSubnetIDResponse ¶
type GetSubnetIDResponse struct {
SubnetID []byte
}
type GetValidatorSetRequest ¶
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, _ *emptypb.Empty) (*validatorstate.GetCurrentHeightResponse, error)
GetCurrentHeight implements the gRPC server method.
func (*Server) GetMinimumHeight ¶
GetMinimumHeight implements the gRPC server method.
func (*Server) GetSubnetID ¶
GetSubnetID implements the gRPC server method.