client

package
v0.0.2-rc7 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	VersionV1beta3 = "v1beta3"
)

Variables

View Source
var (
	ErrInvalidLengthAkash        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAkash          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupAkash = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrDetectClientVersion  = errors.New("chain-sdk: unable detect client version")
	ErrUnknownClientVersion = errors.New("chain-sdk: unknown client version")
)
View Source
var (
	ErrInvalidLengthClientInfo        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowClientInfo          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupClientInfo = fmt.Errorf("proto: unexpected end of group")
)

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 DiscoverLightClient(ctx context.Context, cctx sdkclient.Context, setup SetupFn) error

func DiscoverQueryClient

func DiscoverQueryClient(ctx context.Context, cctx sdkclient.Context, setup SetupFn) error

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.

Types

type Akash

type Akash struct {
	// ClientInfo holds information about the client.
	ClientInfo *ClientInfo `protobuf:"bytes,1,opt,name=client_info,json=clientInfo,proto3" json:"client_info" yaml:"client_info"`
}

Akash akash specific RPC parameters.

func RPCAkash

func RPCAkash(_ *cmtrpctypes.Context) (*Akash, error)

func (*Akash) Descriptor

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

func (*Akash) GetClientInfo

func (m *Akash) GetClientInfo() *ClientInfo

func (*Akash) Marshal

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

func (*Akash) MarshalTo

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

func (*Akash) MarshalToSizedBuffer

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

func (*Akash) ProtoMessage

func (*Akash) ProtoMessage()

func (*Akash) Reset

func (m *Akash) Reset()

func (*Akash) Size

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

func (*Akash) String

func (m *Akash) String() string

func (*Akash) Unmarshal

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

func (*Akash) XXX_DiscardUnknown

func (m *Akash) XXX_DiscardUnknown()

func (*Akash) XXX_Marshal

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

func (*Akash) XXX_Merge

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

func (*Akash) XXX_Size

func (m *Akash) XXX_Size() int

func (*Akash) XXX_Unmarshal

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

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

func (m *ClientInfo) MarshalTo(dAtA []byte) (int, 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 RPCClient

type RPCClient interface {
	client.TendermintRPC
	Akash(ctx context.Context) *Akash
}

func NewClient

func NewClient(remote string) (RPCClient, error)

NewClient allows for setting a custom http client (See New). An error is returned on invalid remote. The function panics when remote is nil.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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