node

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

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")
)

Functions

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

func (m *ConfigResponse) GetHaltHeight() uint64

func (*ConfigResponse) GetMinimumGasPrice

func (m *ConfigResponse) GetMinimumGasPrice() string

func (*ConfigResponse) GetPruningInterval

func (m *ConfigResponse) GetPruningInterval() string

func (*ConfigResponse) GetPruningKeepRecent

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

type StatusRequest struct {
}

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

func (*StatusRequest) Descriptor

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

func (*StatusRequest) Marshal

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

func (*StatusRequest) MarshalTo

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

func (*StatusRequest) MarshalToSizedBuffer

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

func (*StatusRequest) ProtoMessage

func (*StatusRequest) ProtoMessage()

func (*StatusRequest) Reset

func (m *StatusRequest) Reset()

func (*StatusRequest) Size

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

func (*StatusRequest) String

func (m *StatusRequest) String() string

func (*StatusRequest) Unmarshal

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

func (*StatusRequest) XXX_DiscardUnknown

func (m *StatusRequest) XXX_DiscardUnknown()

func (*StatusRequest) XXX_Marshal

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

func (*StatusRequest) XXX_Merge

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

func (*StatusRequest) XXX_Size

func (m *StatusRequest) XXX_Size() int

func (*StatusRequest) XXX_Unmarshal

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

type StatusResponse

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"`
}

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

func (*StatusResponse) Descriptor

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

func (*StatusResponse) GetAppHash

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

func (*StatusResponse) GetEarliestStoreHeight

func (m *StatusResponse) GetEarliestStoreHeight() uint64

func (*StatusResponse) GetHeight

func (m *StatusResponse) GetHeight() uint64

func (*StatusResponse) GetTimestamp

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

func (*StatusResponse) GetValidatorHash

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

func (*StatusResponse) Marshal

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

func (*StatusResponse) MarshalTo

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

func (*StatusResponse) MarshalToSizedBuffer

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

func (*StatusResponse) ProtoMessage

func (*StatusResponse) ProtoMessage()

func (*StatusResponse) Reset

func (m *StatusResponse) Reset()

func (*StatusResponse) Size

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

func (*StatusResponse) String

func (m *StatusResponse) String() string

func (*StatusResponse) Unmarshal

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

func (*StatusResponse) XXX_DiscardUnknown

func (m *StatusResponse) XXX_DiscardUnknown()

func (*StatusResponse) XXX_Marshal

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

func (*StatusResponse) XXX_Merge

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

func (*StatusResponse) XXX_Size

func (m *StatusResponse) XXX_Size() int

func (*StatusResponse) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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