executor

package
v0.0.0-...-e273ca0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: LGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGasPrice = 20000000000 // 20 GWei

	FallBehindThreshold          = 5
	DataSeedDenyServiceThreshold = 60
)

Variables

This section is empty.

Functions

func Int64ToString

func Int64ToString(value int64) string

func NewBtcLightMirror

func NewBtcLightMirror(block *wire.MsgBlock) *lightmirror.BtcLightMirrorV2

func RevertHash

func RevertHash(blockHash *chainhash.Hash) *chainhash.Hash

Types

type BTCClient

type BTCClient struct {
	BTCClient     *rpcclient.Client
	Provider      string
	CurrentHeight int64
	UpdatedAt     time.Time
}

type BTCExecutor

type BTCExecutor struct {
	HighestHeight int64
	BTCClients    []*BTCClient
	Config        *config.Config
	// contains filtered or unexported fields
}

func NewBTCExecutor

func NewBTCExecutor(cfg *config.Config) (*BTCExecutor, error)

func (*BTCExecutor) GetBlock

func (executor *BTCExecutor) GetBlock(client *rpcclient.Client, hash *chainhash.Hash) (*wire.MsgBlock, error)

func (*BTCExecutor) GetBlockHash

func (executor *BTCExecutor) GetBlockHash(client *rpcclient.Client, height int64) (*chainhash.Hash, error)

func (*BTCExecutor) GetClient

func (executor *BTCExecutor) GetClient() *rpcclient.Client

func (*BTCExecutor) GetLatestBlockHeight

func (executor *BTCExecutor) GetLatestBlockHeight(client *rpcclient.Client) (int64, error)

func (*BTCExecutor) SwitchBTClient

func (executor *BTCExecutor) SwitchBTClient()

func (*BTCExecutor) UpdateClients

func (executor *BTCExecutor) UpdateClients()

type COREClient

type COREClient struct {
	COREClient    *ethclient.Client
	Provider      string
	CurrentHeight int64
	UpdatedAt     time.Time
}

type COREExecutor

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

func NewCOREExecutor

func NewCOREExecutor(cfg *config.Config) (*COREExecutor, error)

func (*COREExecutor) CallContext

func (executor *COREExecutor) CallContext(ec *ethclient.Client, result interface{}, ctx context.Context, method string, args ...interface{}) (interface{}, error)

callContext

func (*COREExecutor) CheckBlockRelayed

func (executor *COREExecutor) CheckBlockRelayed(blockHash *chainhash.Hash) (bool, error)

func (*COREExecutor) CheckSuccessRelayed

func (executor *COREExecutor) CheckSuccessRelayed(btcBlockHash *chainhash.Hash, coreTxHash common.Hash) (bool, bool, error)

* check if btc block is successfully relayed return bool:relayed success bool:retry

func (*COREExecutor) EthCall

func (executor *COREExecutor) EthCall(tx *types.Transaction, blockNumber *big.Int) ([]byte, error)

func (*COREExecutor) GetChainTip

func (executor *COREExecutor) GetChainTip() (*chainhash.Hash, error)

func (*COREExecutor) GetClient

func (executor *COREExecutor) GetClient() *ethclient.Client

func (*COREExecutor) GetLatestBlockHeight

func (executor *COREExecutor) GetLatestBlockHeight(client *ethclient.Client) (int64, error)

func (*COREExecutor) GetRelayerBalance

func (executor *COREExecutor) GetRelayerBalance() (*big.Int, error)

func (*COREExecutor) GetTxRecipient

func (executor *COREExecutor) GetTxRecipient(txHash common.Hash) (*types.Receipt, error)

func (*COREExecutor) IncreaseGas

func (executor *COREExecutor) IncreaseGas()

* increase gas

func (*COREExecutor) IsRelayer

func (executor *COREExecutor) IsRelayer() (bool, error)

func (*COREExecutor) QuerySubmitters

func (executor *COREExecutor) QuerySubmitters(blockHash *chainhash.Hash) (string, error)

func (*COREExecutor) RegisterRelayer

func (executor *COREExecutor) RegisterRelayer() (common.Hash, error)

func (*COREExecutor) SwitchCOREClient

func (executor *COREExecutor) SwitchCOREClient()

func (*COREExecutor) SyncBTCLightMirror

func (executor *COREExecutor) SyncBTCLightMirror(task *relayercommon.Task) (common.Hash, error)

* sync BTCLightMirror

func (*COREExecutor) TransactionByHash

func (executor *COREExecutor) TransactionByHash(txHash common.Hash) (*types.Transaction, bool, error)

func (*COREExecutor) UpdateClients

func (executor *COREExecutor) UpdateClients()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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