chains

package
v0.0.0-...-77861b7 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2023 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const FlagMultiChain = "multichain"

Variables

This section is empty.

Functions

func ReloadConfig

func ReloadConfig() error

func StartMonitoring

func StartMonitoring(filters contracts.ReceiverContracts, signers map[uint64][]eth.Addr)

func StopMonitoring

func StopMonitoring()

Types

type Chain

type Chain struct {
	*OneChainConfig
	*Contracts

	EthClient *ethclient.Client
	// contains filtered or unexported fields
}

func GetChain

func GetChain(chid uint64) (*Chain, bool)

func GetChainMustExist

func GetChainMustExist(chid uint64) *Chain

func (*Chain) GetMsgBridgeAddr

func (c *Chain) GetMsgBridgeAddr(t msgtypes.TransferType) common.Address

func (*Chain) IsTransferReady

func (c *Chain) IsTransferReady(transferId eth.Hash, transferType msgtypes.TransferType) (ready bool, err error)

type Chains

type Chains struct {
	// contains filtered or unexported fields
}

func InitChains

func InitChains() *Chains

func NewChains

func NewChains() *Chains

func (*Chains) GetChain

func (c *Chains) GetChain(chid uint64) (*Chain, bool)

type Contracts

type Contracts struct {
	MessageBus  *eth.MsgBusContract
	LiqBridge   *eth.BridgeContract
	PegBridge   *eth.PegBridgeContract
	PegBridgeV2 *eth.PegBridgeV2Contract
	PegVault    *eth.PegVaultContract
	PegVaultV2  *eth.PegVaultV2Contract
}

func NewContracts

func NewContracts(ec *ethclient.Client, config *OneChainConfig) *Contracts

type OneChainConfig

type OneChainConfig struct {
	ChainID                                             uint64
	Name, Gateway                                       string
	BlkInterval, BlkDelay, MaxBlkDelta, ForwardBlkDelay uint64
	GasLimit                                            uint64
	AddGasEstimateRatio                                 float64
	// Legacy gas price flags
	AddGasGwei   uint64
	MinGasGwei   uint64
	MaxGasGwei   uint64
	ForceGasGwei string
	// EIP-1559 gas price flags
	MaxFeePerGasGwei         uint64
	MaxPriorityFeePerGasGwei uint64
	// cbridge contract address
	CBridge string
	// OriginalTokenVault contract address
	OTVault string
	// PeggedTokenBridge contract address
	PTBridge string
	// OriginalTokenVaultV2 contract address
	OTVault2 string
	// PeggedTokenBridgeV2 contract address
	PTBridge2 string
	// WithdrawInbox contract address
	WdInbox string
	// MsgBus contract address
	MsgBus string
	// MsgRecvAdapters contract address
	MsgRecvAdapters []string
	// FarmingRewards contract address
	FarmingRewards string
	// VeToken contract address
	VeToken string
	// if ProxyPort > 0, a proxy with this port will be created to support some special chain such as harmony, celo.
	// chainID will be used to determined which type proxy to create, so make sure the chainID is supported in the "endpoint-proxy"
	// create a proxy to the Gateway, and eth-client will be created to "127.0.0.1:ProxyPort"
	// more detail, https://github.com/celer-network/endpoint-proxy
	ProxyPort int
}

represent one chain in config file, include necessary info like chainid, gateway, cbridge address etc

Jump to

Keyboard shortcuts

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