relayer

package
v0.0.0-...-d163155 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: Apache-2.0 Imports: 31 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsWebsocketURL

func IsWebsocketURL(rawurl string) bool

IsWebsocketURL returns true if the given URL is a websocket URL

func LoadTendermintCLIContext

func LoadTendermintCLIContext(appCodec *amino.Codec, validatorAddress sdk.ValAddress, validatorName string,
	rpcURL string, chainID string) sdkContext.CLIContext

LoadTendermintCLIContext : loads CLI context for tendermint txs

func LoadValidatorCredentials

func LoadValidatorCredentials(validatorFrom string, inBuf io.Reader) (sdk.ValAddress, string, error)

LoadValidatorCredentials : loads validator's credentials (address, moniker, and passphrase)

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
	Logger                  tmLog.Logger
}

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

func NewCosmosSub

func NewCosmosSub(tmProvider, ethProvider string, registryContractAddress common.Address,
	privateKey *ecdsa.PrivateKey, logger tmLog.Logger) CosmosSub

NewCosmosSub initializes a new CosmosSub

func (CosmosSub) Start

func (sub CosmosSub) Start()

Start a Cosmos chain subscription

type EthereumSub

type EthereumSub struct {
	Cdc                     *codec.Codec
	EthProvider             string
	RegistryContractAddress common.Address
	ValidatorName           string
	ValidatorAddress        sdk.ValAddress
	CliCtx                  sdkContext.CLIContext
	TxBldr                  authtypes.TxBuilder
	PrivateKey              *ecdsa.PrivateKey
	Logger                  tmLog.Logger
}

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

func NewEthereumSub

func NewEthereumSub(inBuf io.Reader, rpcURL string, cdc *codec.Codec, validatorMoniker, chainID,
	ethProvider string, registryContractAddress common.Address, privateKey *ecdsa.PrivateKey,
	logger tmLog.Logger) (EthereumSub, error)

NewEthereumSub initializes a new EthereumSub

func (EthereumSub) Start

func (sub EthereumSub) Start()

Start an Ethereum chain subscription

Jump to

Keyboard shortcuts

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