relayer

package
v0.0.0-...-3085ac3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EthSetupWebsocketClient

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

EthSetupWebsocketClient returns boolean indicating if a URL is valid websocket ethclient

func HmySetupWebsocketClient

func HmySetupWebsocketClient(hmyURL string) (*hmyclient.Client, error)

HmySetupWebsocketClient returns boolean indicating if a URL is valid websocket hmyclient

func IsWebsocketURL

func IsWebsocketURL(rawurl string) bool

IsWebsocketURL returns true if the given URL is a websocket URL

Types

type EthereumSub

type EthereumSub struct {
	EthereumProvider       string
	HarmonyProvider        string
	EthereumBridgeRegistry common.Address
	HarmonyBridgeRegistry  common.Address
	ValidatorName          string
	EthPrivateKey          *ecdsa.PrivateKey
	HmyPrivatekey          *ecdsa.PrivateKey
	Logger                 tmLog.Logger
}

EthereumSub is an Ethereum listener that can relay txs to Harmony

func NewEthereumSub

func NewEthereumSub(inBuf io.Reader, validatorMoniker, ethereumProvider string, harmonyProvider string,
	ethereumBridgeRegistry common.Address, harmonyBridgeRegistry common.Address, ethPrivateKey *ecdsa.PrivateKey, hmyPrivateKey *ecdsa.PrivateKey, logger tmLog.Logger) (EthereumSub, error)

NewEthereumSub initializes a new EthereumSub

func (EthereumSub) EthHandleLogLockEvent

func (sub EthereumSub) EthHandleLogLockEvent(clientChainID *big.Int, contractAddress common.Address,
	contractABI abi.ABI, eventName string, cLog ctypes.Log) error

EthHandleLogLockEvent unpacks an EthLogLockEvent, and relays a tx to Harmony

func (EthereumSub) EthHandleLogNewUnlockClaim

func (sub EthereumSub) EthHandleLogNewUnlockClaim(contractAddress common.Address, contractABI abi.ABI,
	eventName string, cLog ctypes.Log) error

EthHandleLogNewUnlockClaim unpacks a EthLogNewUnlockClaim event, builds a new OracleClaim, and relays it to Ethereum

func (EthereumSub) EthStartContractEventSub

func (sub EthereumSub) EthStartContractEventSub(logs chan ctypes.Log, client *ethclient.Client,
	contractName txs.ContractRegistry) (common.Address, ethereum.Subscription)

EthStartContractEventSub : starts an event subscription on the specified Ethereum contract

func (EthereumSub) Start

func (sub EthereumSub) Start()

Start an Ethereum chain subscription

type HarmonySub

type HarmonySub struct {
	HarmonyProvider        string
	EthereumProvider       string
	HarmonyBridgeRegistry  common.Address
	EthereumBridgeRegistry common.Address
	ValidatorName          string
	HmyPrivateKey          *ecdsa.PrivateKey
	EthPrivateKey          *ecdsa.PrivateKey
	Logger                 tmLog.Logger
}

HarmonySub is an Harmony listener that can relay txs to Ethereum

func NewHarmonySub

func NewHarmonySub(inBuf io.Reader, validatorMoniker,
	harmonyProvider string, ethereumProvider string, harmonyBridgeRegistry common.Address, ethereumBridgeRegistry common.Address, hmyPrivateKey *ecdsa.PrivateKey, ethPrivateKey *ecdsa.PrivateKey,
	logger tmLog.Logger) (HarmonySub, error)

NewHarmonySub initializes a new HarmonySub

func (HarmonySub) HmyHandleLogLockEvent

func (sub HarmonySub) HmyHandleLogLockEvent(clientChainID *big.Int, bridgeBankAddress common.Address,
	contractABI abi.ABI, eventName string, cLog htypes.Log) error

HmyHandleLogLockEvent unpacks a HmyLogLockEvent, and relays a tx to Ethereum

func (HarmonySub) HmyHandleLogNewUnlockClaim

func (sub HarmonySub) HmyHandleLogNewUnlockClaim(contractAddress common.Address, contractABI abi.ABI,
	eventName string, hLog htypes.Log) error

HmyHandleLogNewUnlockClaim unpacks a HmyLogNewUnlockClaim event, builds a new OracleClaim, and relays it to Harmony

func (HarmonySub) HmyStartContractEventSub

func (sub HarmonySub) HmyStartContractEventSub(logs chan htypes.Log, client *hmyclient.Client,
	contractName txs.ContractRegistry) (common.Address, ethereum.Subscription)

HmyStartContractEventSub : starts an event subscription on the specified Harmony contract

func (HarmonySub) Start

func (sub HarmonySub) Start()

Start an Harmony chain subscription

Jump to

Keyboard shortcuts

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