node

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: GPL-3.0 Imports: 23 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)

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 QueryChainIDRequest

type QueryChainIDRequest struct {
}

QueryChainIDRequest is request type for the Service/ChainID RPC method.

func (*QueryChainIDRequest) Descriptor

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

func (*QueryChainIDRequest) Marshal

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

func (*QueryChainIDRequest) MarshalTo

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

func (*QueryChainIDRequest) MarshalToSizedBuffer

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

func (*QueryChainIDRequest) ProtoMessage

func (*QueryChainIDRequest) ProtoMessage()

func (*QueryChainIDRequest) Reset

func (m *QueryChainIDRequest) Reset()

func (*QueryChainIDRequest) Size

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

func (*QueryChainIDRequest) String

func (m *QueryChainIDRequest) String() string

func (*QueryChainIDRequest) Unmarshal

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

func (*QueryChainIDRequest) XXX_DiscardUnknown

func (m *QueryChainIDRequest) XXX_DiscardUnknown()

func (*QueryChainIDRequest) XXX_Marshal

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

func (*QueryChainIDRequest) XXX_Merge

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

func (*QueryChainIDRequest) XXX_Size

func (m *QueryChainIDRequest) XXX_Size() int

func (*QueryChainIDRequest) XXX_Unmarshal

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

type QueryEVMValidatorsRequest

type QueryEVMValidatorsRequest struct {
}

QueryEVMValidatorsRequest is request type for the Service/EVMValidators RPC method.

func (*QueryEVMValidatorsRequest) Descriptor

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

func (*QueryEVMValidatorsRequest) Marshal

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

func (*QueryEVMValidatorsRequest) MarshalTo

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

func (*QueryEVMValidatorsRequest) MarshalToSizedBuffer

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

func (*QueryEVMValidatorsRequest) ProtoMessage

func (*QueryEVMValidatorsRequest) ProtoMessage()

func (*QueryEVMValidatorsRequest) Reset

func (m *QueryEVMValidatorsRequest) Reset()

func (*QueryEVMValidatorsRequest) Size

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

func (*QueryEVMValidatorsRequest) String

func (m *QueryEVMValidatorsRequest) String() string

func (*QueryEVMValidatorsRequest) Unmarshal

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

func (*QueryEVMValidatorsRequest) XXX_DiscardUnknown

func (m *QueryEVMValidatorsRequest) XXX_DiscardUnknown()

func (*QueryEVMValidatorsRequest) XXX_Marshal

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

func (*QueryEVMValidatorsRequest) XXX_Merge

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

func (*QueryEVMValidatorsRequest) XXX_Size

func (m *QueryEVMValidatorsRequest) XXX_Size() int

func (*QueryEVMValidatorsRequest) XXX_Unmarshal

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

type ServiceChainIDResponse added in v0.8.0

type ServiceChainIDResponse struct {
	ChainID string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
}

QueryChainIDResponse is response type for the Service/ChainID RPC method.

func (*ServiceChainIDResponse) Descriptor added in v0.8.0

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

func (*ServiceChainIDResponse) GetChainID added in v0.8.0

func (m *ServiceChainIDResponse) GetChainID() string

func (*ServiceChainIDResponse) Marshal added in v0.8.0

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

func (*ServiceChainIDResponse) MarshalTo added in v0.8.0

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

func (*ServiceChainIDResponse) MarshalToSizedBuffer added in v0.8.0

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

func (*ServiceChainIDResponse) ProtoMessage added in v0.8.0

func (*ServiceChainIDResponse) ProtoMessage()

func (*ServiceChainIDResponse) Reset added in v0.8.0

func (m *ServiceChainIDResponse) Reset()

func (*ServiceChainIDResponse) Size added in v0.8.0

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

func (*ServiceChainIDResponse) String added in v0.8.0

func (m *ServiceChainIDResponse) String() string

func (*ServiceChainIDResponse) Unmarshal added in v0.8.0

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

func (*ServiceChainIDResponse) XXX_DiscardUnknown added in v0.8.0

func (m *ServiceChainIDResponse) XXX_DiscardUnknown()

func (*ServiceChainIDResponse) XXX_Marshal added in v0.8.0

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

func (*ServiceChainIDResponse) XXX_Merge added in v0.8.0

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

func (*ServiceChainIDResponse) XXX_Size added in v0.8.0

func (m *ServiceChainIDResponse) XXX_Size() int

func (*ServiceChainIDResponse) XXX_Unmarshal added in v0.8.0

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

type ServiceClient

type ServiceClient interface {
	// ChainID queries the chain ID of this node
	ChainID(ctx context.Context, in *QueryChainIDRequest, opts ...grpc.CallOption) (*ServiceChainIDResponse, error)
	// EVMValidators queries current list of validator's address and power
	EVMValidators(ctx context.Context, in *QueryEVMValidatorsRequest, opts ...grpc.CallOption) (*ServiceEVMValidatorsResponse, 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 ServiceEVMValidatorsResponse added in v0.8.0

type ServiceEVMValidatorsResponse struct {
	// BlockHeight is the latest block height
	BlockHeight int64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
	// Validators is list of validator's addresss and voting power
	Validators []ValidatorMinimal `protobuf:"bytes,2,rep,name=validators,proto3" json:"validators"`
}

QueryEVMValidatorsResponse is response type for the Service/EVMValidators RPC method.

func (*ServiceEVMValidatorsResponse) Descriptor added in v0.8.0

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

func (*ServiceEVMValidatorsResponse) GetBlockHeight added in v0.8.0

func (m *ServiceEVMValidatorsResponse) GetBlockHeight() int64

func (*ServiceEVMValidatorsResponse) GetValidators added in v0.8.0

func (m *ServiceEVMValidatorsResponse) GetValidators() []ValidatorMinimal

func (*ServiceEVMValidatorsResponse) Marshal added in v0.8.0

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

func (*ServiceEVMValidatorsResponse) MarshalTo added in v0.8.0

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

func (*ServiceEVMValidatorsResponse) MarshalToSizedBuffer added in v0.8.0

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

func (*ServiceEVMValidatorsResponse) ProtoMessage added in v0.8.0

func (*ServiceEVMValidatorsResponse) ProtoMessage()

func (*ServiceEVMValidatorsResponse) Reset added in v0.8.0

func (m *ServiceEVMValidatorsResponse) Reset()

func (*ServiceEVMValidatorsResponse) Size added in v0.8.0

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

func (*ServiceEVMValidatorsResponse) String added in v0.8.0

func (*ServiceEVMValidatorsResponse) Unmarshal added in v0.8.0

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

func (*ServiceEVMValidatorsResponse) XXX_DiscardUnknown added in v0.8.0

func (m *ServiceEVMValidatorsResponse) XXX_DiscardUnknown()

func (*ServiceEVMValidatorsResponse) XXX_Marshal added in v0.8.0

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

func (*ServiceEVMValidatorsResponse) XXX_Merge added in v0.8.0

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

func (*ServiceEVMValidatorsResponse) XXX_Size added in v0.8.0

func (m *ServiceEVMValidatorsResponse) XXX_Size() int

func (*ServiceEVMValidatorsResponse) XXX_Unmarshal added in v0.8.0

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

type ServiceServer

type ServiceServer interface {
	// ChainID queries the chain ID of this node
	ChainID(context.Context, *QueryChainIDRequest) (*ServiceChainIDResponse, error)
	// EVMValidators queries current list of validator's address and power
	EVMValidators(context.Context, *QueryEVMValidatorsRequest) (*ServiceEVMValidatorsResponse, error)
}

ServiceServer is the server API for Service service.

func NewQueryServer

func NewQueryServer(clientCtx client.Context) ServiceServer

NewQueryServer returns new queryServer from provided client.Context

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedServiceServer) ChainID

func (*UnimplementedServiceServer) EVMValidators

type ValidatorMinimal

type ValidatorMinimal struct {
	Address     string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	VotingPower int64  `protobuf:"varint,2,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"`
}

ValidatorMinimal is the data structure for storing validator's address and voting power

func (*ValidatorMinimal) Descriptor

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

func (*ValidatorMinimal) GetAddress

func (m *ValidatorMinimal) GetAddress() string

func (*ValidatorMinimal) GetVotingPower

func (m *ValidatorMinimal) GetVotingPower() int64

func (*ValidatorMinimal) Marshal

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

func (*ValidatorMinimal) MarshalTo

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

func (*ValidatorMinimal) MarshalToSizedBuffer

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

func (*ValidatorMinimal) ProtoMessage

func (*ValidatorMinimal) ProtoMessage()

func (*ValidatorMinimal) Reset

func (m *ValidatorMinimal) Reset()

func (*ValidatorMinimal) Size

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

func (*ValidatorMinimal) String

func (m *ValidatorMinimal) String() string

func (*ValidatorMinimal) Unmarshal

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

func (*ValidatorMinimal) XXX_DiscardUnknown

func (m *ValidatorMinimal) XXX_DiscardUnknown()

func (*ValidatorMinimal) XXX_Marshal

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

func (*ValidatorMinimal) XXX_Merge

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

func (*ValidatorMinimal) XXX_Size

func (m *ValidatorMinimal) XXX_Size() int

func (*ValidatorMinimal) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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