node

package
v0.52.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 27 Imported by: 524

Documentation

Overview

Package node is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ServiceAutoCLIDescriptor = &autocliv1.ServiceCommandDescriptor{
	Service: nodev1beta1.Service_ServiceDesc.ServiceName,
	RpcCommandOptions: []*autocliv1.RpcCommandOptions{
		{
			RpcMethod: "Config",
			Use:       "config",
			Short:     "Query the current node config",
		},
		{
			RpcMethod: "Status",
			Use:       "status",
			Short:     "Query the current node status",
		},
	},
}
View Source
var Service_serviceDesc = _Service_serviceDesc

Functions

func NewNodeCommands

func NewNodeCommands() *nodeModule

NewNodeCommands is a fake `appmodule.Module` to be considered as a module and be added in AutoCLI.

func RegisterGRPCGatewayRoutes

func RegisterGRPCGatewayRoutes(clientConn gogogrpc.ClientConn, mux *runtime.ServeMux)

RegisterGRPCGatewayRoutes mounts the node gRPC service's GRPC-gateway routes on the given mux object.

func RegisterNodeService

func RegisterNodeService(clientCtx client.Context, server gogogrpc.Server, cfg config.Config)

RegisterNodeService registers the node gRPC service on the provided gRPC router.

func RegisterServiceHandler

func RegisterServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterServiceHandler registers the http handlers for service Service to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterServiceHandlerClient

func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error

RegisterServiceHandlerClient registers the http handlers for service Service to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ServiceClient" to call the correct interceptors.

func RegisterServiceHandlerFromEndpoint

func RegisterServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterServiceHandlerFromEndpoint is same as RegisterServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterServiceHandlerServer

func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServer) error

RegisterServiceHandlerServer registers the http handlers for service Service to "mux". UnaryRPC :call ServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterServiceHandlerFromEndpoint instead.

func RegisterServiceServer

func RegisterServiceServer(s grpc1.Server, srv ServiceServer)

Types

type ConfigRequest

type ConfigRequest struct {
}

ConfigRequest defines the request structure for the Config gRPC query.

func (*ConfigRequest) Descriptor

func (*ConfigRequest) Descriptor() ([]byte, []int)

func (*ConfigRequest) Marshal

func (m *ConfigRequest) Marshal() (dAtA []byte, err error)

func (*ConfigRequest) MarshalTo

func (m *ConfigRequest) MarshalTo(dAtA []byte) (int, error)

func (*ConfigRequest) MarshalToSizedBuffer

func (m *ConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConfigRequest) ProtoMessage

func (*ConfigRequest) ProtoMessage()

func (*ConfigRequest) Reset

func (m *ConfigRequest) Reset()

func (*ConfigRequest) Size

func (m *ConfigRequest) Size() (n int)

func (*ConfigRequest) String

func (m *ConfigRequest) String() string

func (*ConfigRequest) Unmarshal

func (m *ConfigRequest) Unmarshal(dAtA []byte) error

func (*ConfigRequest) XXX_DiscardUnknown

func (m *ConfigRequest) XXX_DiscardUnknown()

func (*ConfigRequest) XXX_Marshal

func (m *ConfigRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConfigRequest) XXX_Merge

func (m *ConfigRequest) XXX_Merge(src proto.Message)

func (*ConfigRequest) XXX_Size

func (m *ConfigRequest) XXX_Size() int

func (*ConfigRequest) XXX_Unmarshal

func (m *ConfigRequest) XXX_Unmarshal(b []byte) error

type ConfigResponse

type ConfigResponse struct {
	MinimumGasPrice   string `protobuf:"bytes,1,opt,name=minimum_gas_price,json=minimumGasPrice,proto3" json:"minimum_gas_price,omitempty"`
	PruningKeepRecent string `protobuf:"bytes,2,opt,name=pruning_keep_recent,json=pruningKeepRecent,proto3" json:"pruning_keep_recent,omitempty"`
	PruningInterval   string `protobuf:"bytes,3,opt,name=pruning_interval,json=pruningInterval,proto3" json:"pruning_interval,omitempty"`
	HaltHeight        uint64 `protobuf:"varint,4,opt,name=halt_height,json=haltHeight,proto3" json:"halt_height,omitempty"`
}

ConfigResponse defines the response structure for the Config gRPC query.

func (*ConfigResponse) Descriptor

func (*ConfigResponse) Descriptor() ([]byte, []int)

func (*ConfigResponse) GetHaltHeight added in v0.50.3

func (m *ConfigResponse) GetHaltHeight() uint64

func (*ConfigResponse) GetMinimumGasPrice

func (m *ConfigResponse) GetMinimumGasPrice() string

func (*ConfigResponse) GetPruningInterval added in v0.50.0

func (m *ConfigResponse) GetPruningInterval() string

func (*ConfigResponse) GetPruningKeepRecent added in v0.50.0

func (m *ConfigResponse) GetPruningKeepRecent() string

func (*ConfigResponse) Marshal

func (m *ConfigResponse) Marshal() (dAtA []byte, err error)

func (*ConfigResponse) MarshalTo

func (m *ConfigResponse) MarshalTo(dAtA []byte) (int, error)

func (*ConfigResponse) MarshalToSizedBuffer

func (m *ConfigResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ConfigResponse) ProtoMessage

func (*ConfigResponse) ProtoMessage()

func (*ConfigResponse) Reset

func (m *ConfigResponse) Reset()

func (*ConfigResponse) Size

func (m *ConfigResponse) Size() (n int)

func (*ConfigResponse) String

func (m *ConfigResponse) String() string

func (*ConfigResponse) Unmarshal

func (m *ConfigResponse) Unmarshal(dAtA []byte) error

func (*ConfigResponse) XXX_DiscardUnknown

func (m *ConfigResponse) XXX_DiscardUnknown()

func (*ConfigResponse) XXX_Marshal

func (m *ConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ConfigResponse) XXX_Merge

func (m *ConfigResponse) XXX_Merge(src proto.Message)

func (*ConfigResponse) XXX_Size

func (m *ConfigResponse) XXX_Size() int

func (*ConfigResponse) XXX_Unmarshal

func (m *ConfigResponse) XXX_Unmarshal(b []byte) error

type ServiceClient

type ServiceClient interface {
	// Config queries for the operator configuration.
	Config(ctx context.Context, in *ConfigRequest, opts ...grpc.CallOption) (*ConfigResponse, error)
	// Status queries for the node status.
	Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error)
}

ServiceClient is the client API for Service service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewServiceClient

func NewServiceClient(cc grpc1.ClientConn) ServiceClient

type ServiceServer

type ServiceServer interface {
	// Config queries for the operator configuration.
	Config(context.Context, *ConfigRequest) (*ConfigResponse, error)
	// Status queries for the node status.
	Status(context.Context, *StatusRequest) (*StatusResponse, error)
}

ServiceServer is the server API for Service service.

func NewQueryServer

func NewQueryServer(clientCtx client.Context, cfg config.Config) ServiceServer

type StatusRequest added in v0.50.0

type StatusRequest struct {
}

StatusRequest defines the request structure for the status of a node.

func (*StatusRequest) Descriptor added in v0.50.0

func (*StatusRequest) Descriptor() ([]byte, []int)

func (*StatusRequest) Marshal added in v0.50.0

func (m *StatusRequest) Marshal() (dAtA []byte, err error)

func (*StatusRequest) MarshalTo added in v0.50.0

func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error)

func (*StatusRequest) MarshalToSizedBuffer added in v0.50.0

func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StatusRequest) ProtoMessage added in v0.50.0

func (*StatusRequest) ProtoMessage()

func (*StatusRequest) Reset added in v0.50.0

func (m *StatusRequest) Reset()

func (*StatusRequest) Size added in v0.50.0

func (m *StatusRequest) Size() (n int)

func (*StatusRequest) String added in v0.50.0

func (m *StatusRequest) String() string

func (*StatusRequest) Unmarshal added in v0.50.0

func (m *StatusRequest) Unmarshal(dAtA []byte) error

func (*StatusRequest) XXX_DiscardUnknown added in v0.50.0

func (m *StatusRequest) XXX_DiscardUnknown()

func (*StatusRequest) XXX_Marshal added in v0.50.0

func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StatusRequest) XXX_Merge added in v0.50.0

func (m *StatusRequest) XXX_Merge(src proto.Message)

func (*StatusRequest) XXX_Size added in v0.50.0

func (m *StatusRequest) XXX_Size() int

func (*StatusRequest) XXX_Unmarshal added in v0.50.0

func (m *StatusRequest) XXX_Unmarshal(b []byte) error

type StatusResponse added in v0.50.0

type StatusResponse struct {
	EarliestStoreHeight uint64     `protobuf:"varint,1,opt,name=earliest_store_height,json=earliestStoreHeight,proto3" json:"earliest_store_height,omitempty"`
	Height              uint64     `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
	Timestamp           *time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp,omitempty"`
	AppHash             []byte     `protobuf:"bytes,4,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"`
	ValidatorHash       []byte     `protobuf:"bytes,5,opt,name=validator_hash,json=validatorHash,proto3" json:"validator_hash,omitempty"`
}

StatusResponse defines the response structure for the status of a node.

func (*StatusResponse) Descriptor added in v0.50.0

func (*StatusResponse) Descriptor() ([]byte, []int)

func (*StatusResponse) GetAppHash added in v0.50.0

func (m *StatusResponse) GetAppHash() []byte

func (*StatusResponse) GetEarliestStoreHeight added in v0.50.0

func (m *StatusResponse) GetEarliestStoreHeight() uint64

func (*StatusResponse) GetHeight added in v0.50.0

func (m *StatusResponse) GetHeight() uint64

func (*StatusResponse) GetTimestamp added in v0.50.0

func (m *StatusResponse) GetTimestamp() *time.Time

func (*StatusResponse) GetValidatorHash added in v0.50.0

func (m *StatusResponse) GetValidatorHash() []byte

func (*StatusResponse) Marshal added in v0.50.0

func (m *StatusResponse) Marshal() (dAtA []byte, err error)

func (*StatusResponse) MarshalTo added in v0.50.0

func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error)

func (*StatusResponse) MarshalToSizedBuffer added in v0.50.0

func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StatusResponse) ProtoMessage added in v0.50.0

func (*StatusResponse) ProtoMessage()

func (*StatusResponse) Reset added in v0.50.0

func (m *StatusResponse) Reset()

func (*StatusResponse) Size added in v0.50.0

func (m *StatusResponse) Size() (n int)

func (*StatusResponse) String added in v0.50.0

func (m *StatusResponse) String() string

func (*StatusResponse) Unmarshal added in v0.50.0

func (m *StatusResponse) Unmarshal(dAtA []byte) error

func (*StatusResponse) XXX_DiscardUnknown added in v0.50.0

func (m *StatusResponse) XXX_DiscardUnknown()

func (*StatusResponse) XXX_Marshal added in v0.50.0

func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StatusResponse) XXX_Merge added in v0.50.0

func (m *StatusResponse) XXX_Merge(src proto.Message)

func (*StatusResponse) XXX_Size added in v0.50.0

func (m *StatusResponse) XXX_Size() int

func (*StatusResponse) XXX_Unmarshal added in v0.50.0

func (m *StatusResponse) XXX_Unmarshal(b []byte) error

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedServiceServer) Config

func (*UnimplementedServiceServer) Status added in v0.50.0

Jump to

Keyboard shortcuts

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