Documentation
¶
Overview ¶
Package client is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func DiscoverClient(ctx context.Context, cctx sdkclient.Context, setup SetupFn, ...) error
- func DiscoverLightClient(ctx context.Context, cctx sdkclient.Context, setup SetupFn) error
- func DiscoverQueryClient(ctx context.Context, cctx sdkclient.Context, setup SetupFn) error
- func NewHTTPClient(ctx context.Context, remoteAddr string) (*http.Client, error)
- func NormalizeEndpoint(rawURL string) string
- func PrintJSON(ctx client.Context, v interface{}) error
- func RegisterDiscoveryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterDiscoveryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DiscoveryClient) error
- func RegisterDiscoveryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterDiscoveryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DiscoveryServer) error
- func RegisterDiscoveryServer(s grpc1.Server, srv DiscoveryServer)
- func RegisterDiscoveryService(server gogogrpc.Server, registry *VersionRegistry)
- func SetRegistry(r *VersionRegistry)
- type Akash
- func (*Akash) Descriptor() ([]byte, []int)
- func (m *Akash) GetChainID() string
- func (m *Akash) GetClientInfo() ClientInfo
- func (m *Akash) GetMinClientVersion() string
- func (m *Akash) GetNodeVersion() string
- func (m *Akash) GetSupportedVersions() []VersionInfo
- func (m *Akash) Marshal() (dAtA []byte, err error)
- func (m *Akash) MarshalTo(dAtA []byte) (int, error)
- func (m *Akash) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Akash) ProtoMessage()
- func (m *Akash) Reset()
- func (m *Akash) Size() (n int)
- func (m *Akash) String() string
- func (m *Akash) Unmarshal(dAtA []byte) error
- func (m *Akash) XXX_DiscardUnknown()
- func (m *Akash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Akash) XXX_Merge(src proto.Message)
- func (m *Akash) XXX_Size() int
- func (m *Akash) XXX_Unmarshal(b []byte) error
- type Client
- type ClientInfo
- func (*ClientInfo) Descriptor() ([]byte, []int)
- func (m *ClientInfo) GetApiVersion() string
- func (m *ClientInfo) Marshal() (dAtA []byte, err error)
- func (m *ClientInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *ClientInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ClientInfo) ProtoMessage()
- func (m *ClientInfo) Reset()
- func (m *ClientInfo) Size() (n int)
- func (m *ClientInfo) String() string
- func (m *ClientInfo) Unmarshal(dAtA []byte) error
- func (m *ClientInfo) XXX_DiscardUnknown()
- func (m *ClientInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ClientInfo) XXX_Merge(src proto.Message)
- func (m *ClientInfo) XXX_Size() int
- func (m *ClientInfo) XXX_Unmarshal(b []byte) error
- type DiscoveryClient
- type DiscoveryServer
- type GetInfoRequest
- func (*GetInfoRequest) Descriptor() ([]byte, []int)
- func (m *GetInfoRequest) Marshal() (dAtA []byte, err error)
- func (m *GetInfoRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *GetInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GetInfoRequest) ProtoMessage()
- func (m *GetInfoRequest) Reset()
- func (m *GetInfoRequest) Size() (n int)
- func (m *GetInfoRequest) String() string
- func (m *GetInfoRequest) Unmarshal(dAtA []byte) error
- func (m *GetInfoRequest) XXX_DiscardUnknown()
- func (m *GetInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetInfoRequest) XXX_Merge(src proto.Message)
- func (m *GetInfoRequest) XXX_Size() int
- func (m *GetInfoRequest) XXX_Unmarshal(b []byte) error
- type GetInfoResponse
- func (*GetInfoResponse) Descriptor() ([]byte, []int)
- func (m *GetInfoResponse) GetInfo() *Akash
- func (m *GetInfoResponse) Marshal() (dAtA []byte, err error)
- func (m *GetInfoResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *GetInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GetInfoResponse) ProtoMessage()
- func (m *GetInfoResponse) Reset()
- func (m *GetInfoResponse) Size() (n int)
- func (m *GetInfoResponse) String() string
- func (m *GetInfoResponse) Unmarshal(dAtA []byte) error
- func (m *GetInfoResponse) XXX_DiscardUnknown()
- func (m *GetInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetInfoResponse) XXX_Merge(src proto.Message)
- func (m *GetInfoResponse) XXX_Size() int
- func (m *GetInfoResponse) XXX_Unmarshal(b []byte) error
- type LightClient
- type ModuleVersion
- func (*ModuleVersion) Descriptor() ([]byte, []int)
- func (m *ModuleVersion) GetModule() string
- func (m *ModuleVersion) GetVersion() string
- func (m *ModuleVersion) Marshal() (dAtA []byte, err error)
- func (m *ModuleVersion) MarshalTo(dAtA []byte) (int, error)
- func (m *ModuleVersion) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ModuleVersion) ProtoMessage()
- func (m *ModuleVersion) Reset()
- func (m *ModuleVersion) Size() (n int)
- func (m *ModuleVersion) String() string
- func (m *ModuleVersion) Unmarshal(dAtA []byte) error
- func (m *ModuleVersion) XXX_DiscardUnknown()
- func (m *ModuleVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ModuleVersion) XXX_Merge(src proto.Message)
- func (m *ModuleVersion) XXX_Size() int
- func (m *ModuleVersion) XXX_Unmarshal(b []byte) error
- type QueryClient
- type RPCClient
- type RegistryOption
- type SetupFn
- type UnimplementedDiscoveryServer
- type VersionInfo
- func (*VersionInfo) Descriptor() ([]byte, []int)
- func (m *VersionInfo) GetApiVersion() string
- func (m *VersionInfo) GetFeatures() []string
- func (m *VersionInfo) GetModules() []ModuleVersion
- func (m *VersionInfo) Marshal() (dAtA []byte, err error)
- func (m *VersionInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *VersionInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*VersionInfo) ProtoMessage()
- func (m *VersionInfo) Reset()
- func (m *VersionInfo) Size() (n int)
- func (m *VersionInfo) String() string
- func (m *VersionInfo) Unmarshal(dAtA []byte) error
- func (m *VersionInfo) XXX_DiscardUnknown()
- func (m *VersionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *VersionInfo) XXX_Merge(src proto.Message)
- func (m *VersionInfo) XXX_Size() int
- func (m *VersionInfo) XXX_Unmarshal(b []byte) error
- type VersionRegistry
Constants ¶
const ( VersionV1beta3 = "v1beta3" VersionV1beta4 = "v1beta4" )
Variables ¶
var ( ErrInvalidLengthAkash = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAkash = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupAkash = fmt.Errorf("proto: unexpected end of group") )
var ( ErrDetectClientVersion = errors.New("chain-sdk: unable detect client version") ErrUnknownClientVersion = errors.New("chain-sdk: unknown client version") )
var ( ErrInvalidLengthClientInfo = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowClientInfo = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupClientInfo = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthService = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowService = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group") )
var Discovery_serviceDesc = _Discovery_serviceDesc
Functions ¶
func DiscoverClient ¶
func DiscoverClient(ctx context.Context, cctx sdkclient.Context, setup SetupFn, opts ...cltypes.ClientOption) error
DiscoverClient queries an RPC node to get the version of the client and executes a SetupFn function passing a new versioned Client instance as parameter. If any error occurs when calling the RPC node or the Cosmos SDK client Context is set to offline the default value of DefaultClientAPIVersion will be used. An error is returned if client discovery is not successful.
func DiscoverLightClient ¶
func DiscoverQueryClient ¶
DiscoverQueryClient queries an RPC node to get the version of the client and executes a SetupFn function passing a new versioned QueryClient instance as parameter. If any error occurs when calling the RPC node or the Cosmos SDK client Context is set to offline the default value of DefaultClientAPIVersion will be used. An error is returned if client discovery is not successful.
func NewHTTPClient ¶ added in v0.1.8
NewHTTPClient is used to create an http client with some default parameters. We overwrite the http.Client.Dial so we can do http over tcp or unix. remoteAddr should be fully featured (eg. with tcp:// or unix://). An error will be returned in case of invalid remoteAddr.
func NormalizeEndpoint ¶ added in v0.2.9
NormalizeEndpoint ensures that a URL string contains an explicit port. When the port is absent it is inferred from the scheme:
https, wss → 443 http, ws, tcp → 80
Unix-socket URLs and URLs that already carry a port are returned unchanged. An empty or unparseable string is returned as-is.
func RegisterDiscoveryHandler ¶ added in v0.2.10
func RegisterDiscoveryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterDiscoveryHandler registers the http handlers for service Discovery to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterDiscoveryHandlerClient ¶ added in v0.2.10
func RegisterDiscoveryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DiscoveryClient) error
RegisterDiscoveryHandlerClient registers the http handlers for service Discovery to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "DiscoveryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "DiscoveryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "DiscoveryClient" to call the correct interceptors.
func RegisterDiscoveryHandlerFromEndpoint ¶ added in v0.2.10
func RegisterDiscoveryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterDiscoveryHandlerFromEndpoint is same as RegisterDiscoveryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterDiscoveryHandlerServer ¶ added in v0.2.10
func RegisterDiscoveryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DiscoveryServer) error
RegisterDiscoveryHandlerServer registers the http handlers for service Discovery to "mux". UnaryRPC :call DiscoveryServer 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 RegisterDiscoveryHandlerFromEndpoint instead.
func RegisterDiscoveryServer ¶ added in v0.2.10
func RegisterDiscoveryServer(s grpc1.Server, srv DiscoveryServer)
func RegisterDiscoveryService ¶ added in v0.2.10
func RegisterDiscoveryService(server gogogrpc.Server, registry *VersionRegistry)
RegisterDiscoveryService registers the Discovery gRPC service on the given server. Accepts gogogrpc.Server so it can be called from within Cosmos SDK's RegisterGRPCServerWithSkipCheckHeader or with a concrete *grpc.Server.
func SetRegistry ¶ added in v0.2.10
func SetRegistry(r *VersionRegistry)
SetRegistry replaces the global version registry used by RPCAkash and GetRegistry. It must be called during node startup before the RPC server begins accepting requests. Passing nil panics.
Types ¶
type Akash ¶
type Akash struct {
// ClientInfo holds information about the client.
// Kept for backward compatibility. New clients should use supported_versions.
ClientInfo ClientInfo `protobuf:"bytes,1,opt,name=client_info,json=clientInfo,proto3" json:"client_info" yaml:"client_info"`
// SupportedVersions lists all API versions the node supports.
// Clients should pick the best match from this list.
SupportedVersions []VersionInfo `` /* 128-byte string literal not displayed */
// ChainID is the identifier of the blockchain network.
ChainID string `protobuf:"bytes,3,opt,name=chain_id,json=chainId,proto3" json:"chain_id" yaml:"chain_id"`
// NodeVersion is the software version of the node.
NodeVersion string `protobuf:"bytes,4,opt,name=node_version,json=nodeVersion,proto3" json:"node_version" yaml:"node_version"`
// MinClientVersion is the minimum client version the node accepts.
MinClientVersion string `` /* 127-byte string literal not displayed */
}
Akash akash specific RPC parameters.
func (*Akash) Descriptor ¶
func (*Akash) GetChainID ¶ added in v0.2.10
func (*Akash) GetClientInfo ¶
func (m *Akash) GetClientInfo() ClientInfo
func (*Akash) GetMinClientVersion ¶ added in v0.2.10
func (*Akash) GetNodeVersion ¶ added in v0.2.10
func (*Akash) GetSupportedVersions ¶ added in v0.2.10
func (m *Akash) GetSupportedVersions() []VersionInfo
func (*Akash) ProtoMessage ¶
func (*Akash) ProtoMessage()
func (*Akash) XXX_DiscardUnknown ¶
func (m *Akash) XXX_DiscardUnknown()
func (*Akash) XXX_Marshal ¶
func (*Akash) XXX_Unmarshal ¶
type ClientInfo ¶
type ClientInfo struct {
// ApiVersion is the version of the API running on the client.
ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version" yaml:"api_version"`
}
ClientInfo is the akash specific client info.
func (*ClientInfo) Descriptor ¶
func (*ClientInfo) Descriptor() ([]byte, []int)
func (*ClientInfo) GetApiVersion ¶
func (m *ClientInfo) GetApiVersion() string
func (*ClientInfo) Marshal ¶
func (m *ClientInfo) Marshal() (dAtA []byte, err error)
func (*ClientInfo) MarshalToSizedBuffer ¶
func (m *ClientInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ClientInfo) ProtoMessage ¶
func (*ClientInfo) ProtoMessage()
func (*ClientInfo) Reset ¶
func (m *ClientInfo) Reset()
func (*ClientInfo) Size ¶
func (m *ClientInfo) Size() (n int)
func (*ClientInfo) String ¶
func (m *ClientInfo) String() string
func (*ClientInfo) Unmarshal ¶
func (m *ClientInfo) Unmarshal(dAtA []byte) error
func (*ClientInfo) XXX_DiscardUnknown ¶
func (m *ClientInfo) XXX_DiscardUnknown()
func (*ClientInfo) XXX_Marshal ¶
func (m *ClientInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ClientInfo) XXX_Merge ¶
func (m *ClientInfo) XXX_Merge(src proto.Message)
func (*ClientInfo) XXX_Size ¶
func (m *ClientInfo) XXX_Size() int
func (*ClientInfo) XXX_Unmarshal ¶
func (m *ClientInfo) XXX_Unmarshal(b []byte) error
type DiscoveryClient ¶ added in v0.2.10
type DiscoveryClient interface {
// GetInfo returns the node's supported API versions and metadata.
GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error)
}
DiscoveryClient is the client API for Discovery service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewDiscoveryClient ¶ added in v0.2.10
func NewDiscoveryClient(cc grpc1.ClientConn) DiscoveryClient
type DiscoveryServer ¶ added in v0.2.10
type DiscoveryServer interface {
// GetInfo returns the node's supported API versions and metadata.
GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error)
}
DiscoveryServer is the server API for Discovery service.
func NewDiscoveryServer ¶ added in v0.2.10
func NewDiscoveryServer(registry *VersionRegistry) DiscoveryServer
NewDiscoveryServer creates a new gRPC DiscoveryServer backed by the given registry. Passing a nil registry panics.
type GetInfoRequest ¶ added in v0.2.10
type GetInfoRequest struct {
}
GetInfoRequest is the request type for the Discovery/GetInfo RPC method.
func (*GetInfoRequest) Descriptor ¶ added in v0.2.10
func (*GetInfoRequest) Descriptor() ([]byte, []int)
func (*GetInfoRequest) Marshal ¶ added in v0.2.10
func (m *GetInfoRequest) Marshal() (dAtA []byte, err error)
func (*GetInfoRequest) MarshalTo ¶ added in v0.2.10
func (m *GetInfoRequest) MarshalTo(dAtA []byte) (int, error)
func (*GetInfoRequest) MarshalToSizedBuffer ¶ added in v0.2.10
func (m *GetInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GetInfoRequest) ProtoMessage ¶ added in v0.2.10
func (*GetInfoRequest) ProtoMessage()
func (*GetInfoRequest) Reset ¶ added in v0.2.10
func (m *GetInfoRequest) Reset()
func (*GetInfoRequest) Size ¶ added in v0.2.10
func (m *GetInfoRequest) Size() (n int)
func (*GetInfoRequest) String ¶ added in v0.2.10
func (m *GetInfoRequest) String() string
func (*GetInfoRequest) Unmarshal ¶ added in v0.2.10
func (m *GetInfoRequest) Unmarshal(dAtA []byte) error
func (*GetInfoRequest) XXX_DiscardUnknown ¶ added in v0.2.10
func (m *GetInfoRequest) XXX_DiscardUnknown()
func (*GetInfoRequest) XXX_Marshal ¶ added in v0.2.10
func (m *GetInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetInfoRequest) XXX_Merge ¶ added in v0.2.10
func (m *GetInfoRequest) XXX_Merge(src proto.Message)
func (*GetInfoRequest) XXX_Size ¶ added in v0.2.10
func (m *GetInfoRequest) XXX_Size() int
func (*GetInfoRequest) XXX_Unmarshal ¶ added in v0.2.10
func (m *GetInfoRequest) XXX_Unmarshal(b []byte) error
type GetInfoResponse ¶ added in v0.2.10
type GetInfoResponse struct {
// Info contains the node's version and capability information.
Info *Akash `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"`
}
GetInfoResponse is the response type for the Discovery/GetInfo RPC method.
func (*GetInfoResponse) Descriptor ¶ added in v0.2.10
func (*GetInfoResponse) Descriptor() ([]byte, []int)
func (*GetInfoResponse) GetInfo ¶ added in v0.2.10
func (m *GetInfoResponse) GetInfo() *Akash
func (*GetInfoResponse) Marshal ¶ added in v0.2.10
func (m *GetInfoResponse) Marshal() (dAtA []byte, err error)
func (*GetInfoResponse) MarshalTo ¶ added in v0.2.10
func (m *GetInfoResponse) MarshalTo(dAtA []byte) (int, error)
func (*GetInfoResponse) MarshalToSizedBuffer ¶ added in v0.2.10
func (m *GetInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GetInfoResponse) ProtoMessage ¶ added in v0.2.10
func (*GetInfoResponse) ProtoMessage()
func (*GetInfoResponse) Reset ¶ added in v0.2.10
func (m *GetInfoResponse) Reset()
func (*GetInfoResponse) Size ¶ added in v0.2.10
func (m *GetInfoResponse) Size() (n int)
func (*GetInfoResponse) String ¶ added in v0.2.10
func (m *GetInfoResponse) String() string
func (*GetInfoResponse) Unmarshal ¶ added in v0.2.10
func (m *GetInfoResponse) Unmarshal(dAtA []byte) error
func (*GetInfoResponse) XXX_DiscardUnknown ¶ added in v0.2.10
func (m *GetInfoResponse) XXX_DiscardUnknown()
func (*GetInfoResponse) XXX_Marshal ¶ added in v0.2.10
func (m *GetInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetInfoResponse) XXX_Merge ¶ added in v0.2.10
func (m *GetInfoResponse) XXX_Merge(src proto.Message)
func (*GetInfoResponse) XXX_Size ¶ added in v0.2.10
func (m *GetInfoResponse) XXX_Size() int
func (*GetInfoResponse) XXX_Unmarshal ¶ added in v0.2.10
func (m *GetInfoResponse) XXX_Unmarshal(b []byte) error
type LightClient ¶
type LightClient interface {
v1beta3.LightClient
}
type ModuleVersion ¶ added in v0.2.10
type ModuleVersion struct {
// Module is the name of the module (e.g., "deployment", "market", "oracle").
Module string `protobuf:"bytes,1,opt,name=module,proto3" json:"module" yaml:"module"`
// Version is the API version of the module (e.g., "v1beta4", "v1beta5", "v2").
Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version" yaml:"version"`
}
ModuleVersion describes a single module and its API version.
func (*ModuleVersion) Descriptor ¶ added in v0.2.10
func (*ModuleVersion) Descriptor() ([]byte, []int)
func (*ModuleVersion) GetModule ¶ added in v0.2.10
func (m *ModuleVersion) GetModule() string
func (*ModuleVersion) GetVersion ¶ added in v0.2.10
func (m *ModuleVersion) GetVersion() string
func (*ModuleVersion) Marshal ¶ added in v0.2.10
func (m *ModuleVersion) Marshal() (dAtA []byte, err error)
func (*ModuleVersion) MarshalTo ¶ added in v0.2.10
func (m *ModuleVersion) MarshalTo(dAtA []byte) (int, error)
func (*ModuleVersion) MarshalToSizedBuffer ¶ added in v0.2.10
func (m *ModuleVersion) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ModuleVersion) ProtoMessage ¶ added in v0.2.10
func (*ModuleVersion) ProtoMessage()
func (*ModuleVersion) Reset ¶ added in v0.2.10
func (m *ModuleVersion) Reset()
func (*ModuleVersion) Size ¶ added in v0.2.10
func (m *ModuleVersion) Size() (n int)
func (*ModuleVersion) String ¶ added in v0.2.10
func (m *ModuleVersion) String() string
func (*ModuleVersion) Unmarshal ¶ added in v0.2.10
func (m *ModuleVersion) Unmarshal(dAtA []byte) error
func (*ModuleVersion) XXX_DiscardUnknown ¶ added in v0.2.10
func (m *ModuleVersion) XXX_DiscardUnknown()
func (*ModuleVersion) XXX_Marshal ¶ added in v0.2.10
func (m *ModuleVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ModuleVersion) XXX_Merge ¶ added in v0.2.10
func (m *ModuleVersion) XXX_Merge(src proto.Message)
func (*ModuleVersion) XXX_Size ¶ added in v0.2.10
func (m *ModuleVersion) XXX_Size() int
func (*ModuleVersion) XXX_Unmarshal ¶ added in v0.2.10
func (m *ModuleVersion) XXX_Unmarshal(b []byte) error
type QueryClient ¶
type QueryClient interface {
v1beta3.QueryClient
}
type RegistryOption ¶ added in v0.2.10
type RegistryOption func(*VersionRegistry)
RegistryOption configures a VersionRegistry.
func WithChainID ¶ added in v0.2.10
func WithChainID(chainID string) RegistryOption
WithChainID sets the chain ID on the registry.
func WithMinClientVersion ¶ added in v0.2.10
func WithMinClientVersion(version string) RegistryOption
WithMinClientVersion sets the minimum required client version.
func WithNodeVersion ¶ added in v0.2.10
func WithNodeVersion(version string) RegistryOption
WithNodeVersion sets the node software version on the registry.
type SetupFn ¶
type SetupFn func(interface{}) error
SetupFn defines a function that takes a parameter, ideally a Client or QueryClient. These functions must validate the client and make it accessible.
type UnimplementedDiscoveryServer ¶ added in v0.2.10
type UnimplementedDiscoveryServer struct {
}
UnimplementedDiscoveryServer can be embedded to have forward compatible implementations.
func (*UnimplementedDiscoveryServer) GetInfo ¶ added in v0.2.10
func (*UnimplementedDiscoveryServer) GetInfo(ctx context.Context, req *GetInfoRequest) (*GetInfoResponse, error)
type VersionInfo ¶ added in v0.2.10
type VersionInfo struct {
// ApiVersion is the composite API version identifier (e.g., "v1beta4").
ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version" yaml:"api_version"`
// Modules lists the per-module versions included in this API version.
Modules []ModuleVersion `protobuf:"bytes,2,rep,name=modules,proto3" json:"modules" yaml:"modules"`
// Features lists optional feature flags supported by this API version.
Features []string `protobuf:"bytes,3,rep,name=features,proto3" json:"features" yaml:"features"`
}
VersionInfo describes a complete API version and its metadata.
func (*VersionInfo) Descriptor ¶ added in v0.2.10
func (*VersionInfo) Descriptor() ([]byte, []int)
func (*VersionInfo) GetApiVersion ¶ added in v0.2.10
func (m *VersionInfo) GetApiVersion() string
func (*VersionInfo) GetFeatures ¶ added in v0.2.10
func (m *VersionInfo) GetFeatures() []string
func (*VersionInfo) GetModules ¶ added in v0.2.10
func (m *VersionInfo) GetModules() []ModuleVersion
func (*VersionInfo) Marshal ¶ added in v0.2.10
func (m *VersionInfo) Marshal() (dAtA []byte, err error)
func (*VersionInfo) MarshalTo ¶ added in v0.2.10
func (m *VersionInfo) MarshalTo(dAtA []byte) (int, error)
func (*VersionInfo) MarshalToSizedBuffer ¶ added in v0.2.10
func (m *VersionInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*VersionInfo) ProtoMessage ¶ added in v0.2.10
func (*VersionInfo) ProtoMessage()
func (*VersionInfo) Reset ¶ added in v0.2.10
func (m *VersionInfo) Reset()
func (*VersionInfo) Size ¶ added in v0.2.10
func (m *VersionInfo) Size() (n int)
func (*VersionInfo) String ¶ added in v0.2.10
func (m *VersionInfo) String() string
func (*VersionInfo) Unmarshal ¶ added in v0.2.10
func (m *VersionInfo) Unmarshal(dAtA []byte) error
func (*VersionInfo) XXX_DiscardUnknown ¶ added in v0.2.10
func (m *VersionInfo) XXX_DiscardUnknown()
func (*VersionInfo) XXX_Marshal ¶ added in v0.2.10
func (m *VersionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*VersionInfo) XXX_Merge ¶ added in v0.2.10
func (m *VersionInfo) XXX_Merge(src proto.Message)
func (*VersionInfo) XXX_Size ¶ added in v0.2.10
func (m *VersionInfo) XXX_Size() int
func (*VersionInfo) XXX_Unmarshal ¶ added in v0.2.10
func (m *VersionInfo) XXX_Unmarshal(b []byte) error
type VersionRegistry ¶ added in v0.2.10
type VersionRegistry struct {
// contains filtered or unexported fields
}
VersionRegistry holds the server's supported API versions and metadata. It is used by both the CometBFT JSON-RPC handler and the gRPC Discovery service to produce version responses.
func DefaultRegistry ¶ added in v0.2.10
func DefaultRegistry(opts ...RegistryOption) *VersionRegistry
DefaultRegistry creates a registry with v1beta3 and v1beta4 support.
func GetRegistry ¶ added in v0.2.10
func GetRegistry() *VersionRegistry
GetRegistry returns the current global version registry.
func NewRegistry ¶ added in v0.2.10
func NewRegistry(versions []VersionInfo, opts ...RegistryOption) *VersionRegistry
NewRegistry creates a new VersionRegistry with the given supported versions.
func (*VersionRegistry) OldestVersion ¶ added in v0.2.10
func (r *VersionRegistry) OldestVersion() string
OldestVersion returns the lowest supported version string. Used as the value for ClientInfo.ApiVersion for backward compatibility with old clients.
func (*VersionRegistry) SetChainID ¶ added in v0.2.10
func (r *VersionRegistry) SetChainID(chainID string)
SetChainID updates the chain ID. Safe for concurrent use.
func (*VersionRegistry) SupportsVersion ¶ added in v0.2.10
func (r *VersionRegistry) SupportsVersion(v string) bool
SupportsVersion checks if a specific version is in the supported set.
func (*VersionRegistry) ToAkash ¶ added in v0.2.10
func (r *VersionRegistry) ToAkash() *Akash
ToAkash converts the registry state to a proto Akash response. ClientInfo.ApiVersion is set to the oldest supported version for backward compatibility.