relayer

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventProcessed

func EventProcessed(bridgeClaims []types.EthereumBridgeClaim, event types.EthereumEvent) bool

EventProcessed check if the event processed by relayer

func GetAllProphecyClaim

func GetAllProphecyClaim(client *ethclient.Client, ethereumAddress common.Address, ethFromBlock int64, ethToBlock int64) []types.ProphecyClaimUnique

GetAllProphecyClaim get all prophecy claims

func GetValAddressFromKeyring

func GetValAddressFromKeyring(k keyring.Keyring, keyname string) (sdk.ValAddress, error)

func IsWebsocketURL

func IsWebsocketURL(rawurl string) bool

IsWebsocketURL returns true if the given URL is a websocket URL

func MessageProcessed

func MessageProcessed(message types.CosmosMsg, prophecyClaims []types.ProphecyClaimUnique) bool

MessageProcessed check if cosmogs message already processed

func MyDecode

func MyDecode(data []byte) (types.ProphecyClaimUnique, error)

MyDecode decode data in ProphecyClaim transaction

func NewKeybase

func NewKeybase(validatorMoniker, mnemonic, password string) (keyring.Keyring, keyring.Info, error)

NewKeybase create a new keybase instance

func SetupRPCEthClient

func SetupRPCEthClient(ethURL string) (*ethclient.Client, error)

SetupRPCEthClient returns boolean indicating if a URL is valid websocket ethclient

func SetupWebsocketEthClient

func SetupWebsocketEthClient(ethURL string) (*ethclient.Client, error)

SetupWebsocketEthClient returns boolean indicating if a URL is valid websocket ethclient

Types

type CosmosSub

type CosmosSub struct {
	TmProvider              string
	EthProvider             string
	RegistryContractAddress common.Address
	PrivateKey              *ecdsa.PrivateKey
	DB                      *leveldb.DB
	SugaredLogger           *zap.SugaredLogger
}

CosmosSub defines a Cosmos listener that relays events to Ethereum and Cosmos

func NewCosmosSub

func NewCosmosSub(tmProvider, ethProvider string, registryContractAddress common.Address,
	key *ecdsa.PrivateKey,
	db *leveldb.DB, sugaredLogger *zap.SugaredLogger) CosmosSub

NewCosmosSub initializes a new CosmosSub

func (CosmosSub) Replay

func (sub CosmosSub) Replay(symbolTranslator *symbol_translator.SymbolTranslator, fromBlock int64, toBlock int64, ethFromBlock int64, ethToBlock int64)

Replay the missed events

func (CosmosSub) Start

func (sub CosmosSub) Start(completionEvent *sync.WaitGroup, symbolTranslator *symbol_translator.SymbolTranslator)

Start a Cosmos chain subscription

type EthereumSub

type EthereumSub struct {
	EthProvider             string
	TmProvider              string
	RegistryContractAddress common.Address
	ValidatorName           string
	ValidatorAddress        sdk.ValAddress
	CliCtx                  client.Context
	PrivateKey              *ecdsa.PrivateKey
	DB                      *leveldb.DB
	SugaredLogger           *zap.SugaredLogger
}

EthereumSub is an Ethereum listener that can relay txs to Cosmos and Ethereum

func NewEthereumSub

func NewEthereumSub(
	cliCtx client.Context,
	nodeURL string,
	validatorMoniker,
	ethProvider string,
	registryContractAddress common.Address,
	validatorAddress sdk.ValAddress,
	db *leveldb.DB,
	sugaredLogger *zap.SugaredLogger,
) EthereumSub

NewEthereumSub initializes a new EthereumSub

func (EthereumSub) Replay

func (sub EthereumSub) Replay(txFactory tx.Factory, fromBlock int64, toBlock int64, cosmosFromBlock int64, cosmosToBlock int64, symbolTranslator *symbol_translator.SymbolTranslator)

Replay the missed events

func (EthereumSub) Start

func (sub EthereumSub) Start(txFactory tx.Factory, completionEvent *sync.WaitGroup, symbolTranslator *symbol_translator.SymbolTranslator)

Start an Ethereum chain subscription

type ListMissedCosmosEvent

type ListMissedCosmosEvent struct {
	TmProvider              string
	EthProvider             string
	RegistryContractAddress common.Address
	EthereumAddress         common.Address
	Days                    int64
	SugaredLogger           *zap.SugaredLogger
}

ListMissedCosmosEvent defines a Cosmos listener that relays events to Ethereum and Cosmos

func NewListMissedCosmosEvent

func NewListMissedCosmosEvent(tmProvider, ethProvider string, registryContractAddress common.Address,
	ethereumAddress common.Address, days int64, sugaredLogger *zap.SugaredLogger) ListMissedCosmosEvent

NewListMissedCosmosEvent initializes a new CosmosSub

func (ListMissedCosmosEvent) ListMissedCosmosEvent

func (list ListMissedCosmosEvent) ListMissedCosmosEvent(symbolTranslator *symbol_translator.SymbolTranslator)

ListMissedCosmosEvent print all missed cosmos events by this ebrelayer in days

Jump to

Keyboard shortcuts

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