Documentation ¶
Index ¶
- Variables
- func Bech32ifyAddressBytes(prefix string, address sdktypes.AccAddress) (string, error)
- func SetSDKConfigPrefix(prefix string)
- type ChainConfig
- func (c *ChainConfig) GetAddress() string
- func (c *ChainConfig) GetAddressBytes() sdktypes.AccAddress
- func (r *ChainConfig) GetClient() *rpchttp.HTTP
- func (c *ChainConfig) GetPrivKeyAddress() (sdkcryptotypes.PrivKey, sdktypes.AccAddress)
- func (r *ChainConfig) Init(codec *codec.ProtoCodec, cache *ristretto.Cache) error
- func (c *ChainConfig) SignAndBroadcastMsg(ctx context.Context, cliContext *client.Context, exec []sdktypes.Msg, ...) (string, uint32, error)
- type Config
- type QueryClient
- type RPCClient
- func (c *RPCClient) ABCIInfo(ctx context.Context) (*ctypes.ResultABCIInfo, error)
- func (c *RPCClient) ABCIQuery(ctx context.Context, path string, data bytes.HexBytes) (*ctypes.ResultABCIQuery, error)
- func (c *RPCClient) ABCIQueryWithOptions(ctx context.Context, path string, data bytes.HexBytes, ...) (*ctypes.ResultABCIQuery, error)
- func (c *RPCClient) Block(ctx context.Context, height *int64) (*ctypes.ResultBlock, error)
- func (c *RPCClient) BlockByHash(ctx context.Context, hash []byte) (*ctypes.ResultBlock, error)
- func (c *RPCClient) BlockResults(ctx context.Context, height *int64) (*ctypes.ResultBlockResults, error)
- func (c *RPCClient) BlockSearch(ctx context.Context, query string, page, perPage *int, orderBy string) (*ctypes.ResultBlockSearch, error)
- func (c *RPCClient) BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error)
- func (c *RPCClient) BroadcastEvidence(ctx context.Context, ev types.Evidence) (*ctypes.ResultBroadcastEvidence, error)
- func (c *RPCClient) BroadcastTxAsync(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error)
- func (c *RPCClient) BroadcastTxCommit(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error)
- func (c *RPCClient) BroadcastTxSync(ctx context.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error)
- func (c *RPCClient) CheckTx(ctx context.Context, tx types.Tx) (*ctypes.ResultCheckTx, error)
- func (c *RPCClient) Commit(ctx context.Context, height *int64) (*ctypes.ResultCommit, error)
- func (c *RPCClient) ConsensusParams(ctx context.Context, height *int64) (*ctypes.ResultConsensusParams, error)
- func (c *RPCClient) ConsensusState(ctx context.Context) (*ctypes.ResultConsensusState, error)
- func (c *RPCClient) DumpConsensusState(ctx context.Context) (*ctypes.ResultDumpConsensusState, error)
- func (c *RPCClient) Genesis(ctx context.Context) (*ctypes.ResultGenesis, error)
- func (c *RPCClient) GenesisChunked(ctx context.Context, id uint) (*ctypes.ResultGenesisChunk, error)
- func (c *RPCClient) Health(ctx context.Context) (*ctypes.ResultHealth, error)
- func (c *RPCClient) NetInfo(ctx context.Context) (*ctypes.ResultNetInfo, error)
- func (c *RPCClient) NumUnconfirmedTxs(ctx context.Context) (*ctypes.ResultUnconfirmedTxs, error)
- func (c *RPCClient) Status(ctx context.Context) (*ctypes.ResultStatus, error)
- func (c *RPCClient) Tx(ctx context.Context, hash []byte, prove bool) (*ctypes.ResultTx, error)
- func (c *RPCClient) TxSearch(ctx context.Context, query string, prove bool, page, perPage *int, ...) (*ctypes.ResultTxSearch, error)
- func (c *RPCClient) UnconfirmedTxs(ctx context.Context, limit *int) (*ctypes.ResultUnconfirmedTxs, error)
- func (c *RPCClient) Validators(ctx context.Context, height *int64, page, perPage *int) (*ctypes.ResultValidators, error)
- type RPCClientI
- type ReadOnlyChainConfig
- func (r *ReadOnlyChainConfig) GetClientId(ctx context.Context, connectionId string, logger log2.Logger, ...) (string, error)
- func (r *ReadOnlyChainConfig) GetClientState(ctx context.Context, clientId string, logger log2.Logger, ...) (*clienttypes.QueryClientStateResponse, error)
- func (r *ReadOnlyChainConfig) GetClientStateHeights(ctx context.Context, clientId string, chainId string, height uint64, ...) ([]clienttypes.Height, error)
- func (r *ReadOnlyChainConfig) GetCurrentHeight(ctx context.Context, cache *ristretto.Cache, logger log2.Logger) (int64, error)
- func (r *ReadOnlyChainConfig) Init(codec *codec.ProtoCodec, cache *ristretto.Cache) error
- func (r *ReadOnlyChainConfig) LightBlock(ctx context.Context, height int64) (*tmtypes.LightBlock, error)
- func (r *ReadOnlyChainConfig) RunABCIQuery(ctx context.Context, method string, reqBz []byte, height int64, prove bool, ...) (abcitypes.ResponseQuery, error)
- func (r *ReadOnlyChainConfig) Tx(hash []byte) (*codectypes.Any, int64, error)
- type TxClient
- type TxResultMinimal
- type TxResultMinimalCelestia
Constants ¶
This section is empty.
Variables ¶
var (
DefaultHomePath, _ = os.UserHomeDir()
DefaultConfigPath = filepath.Join(DefaultHomePath, ".icq-relayer")
)
Functions ¶
func Bech32ifyAddressBytes ¶
func Bech32ifyAddressBytes(prefix string, address sdktypes.AccAddress) (string, error)
func SetSDKConfigPrefix ¶
func SetSDKConfigPrefix(prefix string)
Types ¶
type ChainConfig ¶
type ChainConfig struct { *ReadOnlyChainConfig MnemonicPath string Prefix string TxSubmitTimeoutSeconds int GasLimit int GasPrice string GasMultiplier float64 AddressBytes sdktypes.AccAddress `toml:"-"` }
func (*ChainConfig) GetAddress ¶
func (c *ChainConfig) GetAddress() string
func (*ChainConfig) GetAddressBytes ¶
func (c *ChainConfig) GetAddressBytes() sdktypes.AccAddress
func (*ChainConfig) GetClient ¶
func (r *ChainConfig) GetClient() *rpchttp.HTTP
func (*ChainConfig) GetPrivKeyAddress ¶
func (c *ChainConfig) GetPrivKeyAddress() (sdkcryptotypes.PrivKey, sdktypes.AccAddress)
func (*ChainConfig) Init ¶
func (r *ChainConfig) Init(codec *codec.ProtoCodec, cache *ristretto.Cache) error
type Config ¶
type Config struct { BindPort int MaxMsgsPerTx int AllowedQueries []string SkipEpoch bool DefaultChain *ChainConfig Chains map[string]*ReadOnlyChainConfig ProtoCodec *codec.ProtoCodec `toml:"-"` ClientContext *client.Context `toml:"-"` HomePath string `toml:"-"` }
Config represents the config file for the relayer
type QueryClient ¶
type QueryClient interface { Init(codec *codec.ProtoCodec, cache *ristretto.Cache) error GetClientState(ctx context.Context, clientId string, logger log2.Logger, metrics prommetrics.Metrics) (*clienttypes.QueryClientStateResponse, error) GetClientStateHeights(ctx context.Context, clientId string, chainId string, height uint64, logger log2.Logger, metrics prommetrics.Metrics, depth int) ([]clienttypes.Height, error) GetClientId(ctx context.Context, connectionId string, logger log2.Logger, metrics prommetrics.Metrics) (string, error) }
type RPCClient ¶
type RPCClient struct {
// contains filtered or unexported fields
}
RPCClient is a client for the Tendermint RPC interface. This is copy and pasted from github.com/tendermint/tendermint/rpc/client/http, which does not expost the baseRPCClient, and as such does not permit you to create a HTTP RPC Client without websocket connection.
func NewWithTimeout ¶
Create timeout enabled http client
func (*RPCClient) ABCIQueryWithOptions ¶
func (*RPCClient) BlockByHash ¶
func (*RPCClient) BlockResults ¶
func (*RPCClient) BlockSearch ¶
func (*RPCClient) BlockchainInfo ¶
func (*RPCClient) BroadcastEvidence ¶
func (*RPCClient) BroadcastTxAsync ¶
func (*RPCClient) BroadcastTxCommit ¶
func (*RPCClient) BroadcastTxSync ¶
func (*RPCClient) ConsensusParams ¶
func (*RPCClient) ConsensusState ¶
func (*RPCClient) DumpConsensusState ¶
func (*RPCClient) GenesisChunked ¶
func (*RPCClient) NumUnconfirmedTxs ¶
func (*RPCClient) UnconfirmedTxs ¶
func (*RPCClient) Validators ¶
type RPCClientI ¶
type RPCClientI interface { rpcclient.ABCIClient rpcclient.HistoryClient rpcclient.NetworkClient rpcclient.SignClient rpcclient.StatusClient }
type ReadOnlyChainConfig ¶
type ReadOnlyChainConfig struct { ChainID string RpcUrl string ConnectTimeoutSeconds int QueryTimeoutSeconds int QueryRetries int QueryRetryDelayMilliseconds int CompatibilityMode string Client RPCClientI `toml:"-"` LightProvider prov.Provider `toml:"-"` Codec *codec.ProtoCodec `toml:"-"` Cache *ristretto.Cache `toml:"-"` }
func DefaultReadOnlyChainConfig ¶
func DefaultReadOnlyChainConfig(chainID string, rpcUrl string) *ReadOnlyChainConfig
func (*ReadOnlyChainConfig) GetClientId ¶
func (r *ReadOnlyChainConfig) GetClientId(ctx context.Context, connectionId string, logger log2.Logger, metrics prommetrics.Metrics) (string, error)
func (*ReadOnlyChainConfig) GetClientState ¶
func (r *ReadOnlyChainConfig) GetClientState(ctx context.Context, clientId string, logger log2.Logger, metrics prommetrics.Metrics) (*clienttypes.QueryClientStateResponse, error)
func (*ReadOnlyChainConfig) GetClientStateHeights ¶
func (r *ReadOnlyChainConfig) GetClientStateHeights(ctx context.Context, clientId string, chainId string, height uint64, logger log2.Logger, metrics prommetrics.Metrics, depth int) ([]clienttypes.Height, error)
func (*ReadOnlyChainConfig) GetCurrentHeight ¶
func (*ReadOnlyChainConfig) Init ¶
func (r *ReadOnlyChainConfig) Init(codec *codec.ProtoCodec, cache *ristretto.Cache) error
func (*ReadOnlyChainConfig) LightBlock ¶
func (r *ReadOnlyChainConfig) LightBlock(ctx context.Context, height int64) (*tmtypes.LightBlock, error)
func (*ReadOnlyChainConfig) RunABCIQuery ¶
func (r *ReadOnlyChainConfig) RunABCIQuery(ctx context.Context, method string, reqBz []byte, height int64, prove bool, metrics prommetrics.Metrics) (abcitypes.ResponseQuery, error)
func (*ReadOnlyChainConfig) Tx ¶
func (r *ReadOnlyChainConfig) Tx(hash []byte) (*codectypes.Any, int64, error)
tm0.37 has a breaking change whereby tx events are no longer base64 encoded, so are represented as string and not bytes. As a result, we cannot use the RPCClient.Tx() method which attempts to unmarshal the Result, including the underlying Tx object. As such, we want to query the result directly, and unmarshal the json ourselves, to a representation of the result that conveniently does not contain the Tx object (that we don't use, because the TxProof already contains a byte representation of tx anyway!) Note: this function is compatible with 0.34 and 0.37 representations of transactions.
type TxResultMinimal ¶
a minimised representation of the Tx emitted by a Tx query, only containing Height and Proof and thus compatbiel with tm0.34 and tm0.37.
type TxResultMinimalCelestia ¶
type TxResultMinimalCelestia struct { Height string `json:"height"` Proof celestiatypes.ShareProof `json:"proof"` Index uint32 `json:"index"` }
define celestia based TxResultMinimal