Documentation
¶
Index ¶
- Constants
- func Int64ToString(value int64) string
- func NewBtcLightMirror(block *wire.MsgBlock) *lightmirror.BtcLightMirrorV2
- func RevertHash(blockHash *chainhash.Hash) *chainhash.Hash
- type BTCClient
- type BTCExecutor
- func (executor *BTCExecutor) GetBlock(client *rpcclient.Client, hash *chainhash.Hash) (*wire.MsgBlock, error)
- func (executor *BTCExecutor) GetBlockHash(client *rpcclient.Client, height int64) (*chainhash.Hash, error)
- func (executor *BTCExecutor) GetClient() *rpcclient.Client
- func (executor *BTCExecutor) GetLatestBlockHeight(client *rpcclient.Client) (int64, error)
- func (executor *BTCExecutor) SwitchBTClient()
- func (executor *BTCExecutor) UpdateClients()
- type COREClient
- type COREExecutor
- func (executor *COREExecutor) CallContext(ec *ethclient.Client, result interface{}, ctx context.Context, method string, ...) (interface{}, error)
- func (executor *COREExecutor) CheckBlockRelayed(blockHash *chainhash.Hash) (bool, error)
- func (executor *COREExecutor) CheckSuccessRelayed(btcBlockHash *chainhash.Hash, coreTxHash common.Hash) (bool, bool, error)
- func (executor *COREExecutor) EthCall(tx *types.Transaction, blockNumber *big.Int) ([]byte, error)
- func (executor *COREExecutor) GetChainTip() (*chainhash.Hash, error)
- func (executor *COREExecutor) GetClient() *ethclient.Client
- func (executor *COREExecutor) GetLatestBlockHeight(client *ethclient.Client) (int64, error)
- func (executor *COREExecutor) GetRelayerBalance() (*big.Int, error)
- func (executor *COREExecutor) GetTxRecipient(txHash common.Hash) (*types.Receipt, error)
- func (executor *COREExecutor) IncreaseGas()
- func (executor *COREExecutor) IsRelayer() (bool, error)
- func (executor *COREExecutor) QuerySubmitters(blockHash *chainhash.Hash) (string, error)
- func (executor *COREExecutor) RegisterRelayer() (common.Hash, error)
- func (executor *COREExecutor) SwitchCOREClient()
- func (executor *COREExecutor) SyncBTCLightMirror(task *relayercommon.Task) (common.Hash, error)
- func (executor *COREExecutor) TransactionByHash(txHash common.Hash) (*types.Transaction, bool, error)
- func (executor *COREExecutor) UpdateClients()
Constants ¶
View Source
const ( DefaultGasPrice = 20000000000 // 20 GWei FallBehindThreshold = 5 DataSeedDenyServiceThreshold = 60 )
Variables ¶
This section is empty.
Functions ¶
func Int64ToString ¶
func NewBtcLightMirror ¶
func NewBtcLightMirror(block *wire.MsgBlock) *lightmirror.BtcLightMirrorV2
Types ¶
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) GetBlockHash ¶
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 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 (*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()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.