btc_relayer

package module
v0.0.0-...-c0f8dde Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: GPL-3.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

BTC Relayer

简介

​ BTC Relayer是跨链生态中比特币网络与联盟链之间沟通的桥梁,负责将BTC的跨链交易转发到联盟链上,这是跨链的第一步。它的主要功能包括两部分,首先是监听比特币网络,将要跨链到其他链的BTC交易,转发到联盟链;然后是监听联盟链,将要转回比特币链的交易广播到比特币网络中。

使用

​ 在项目的cmd文件夹下,进行编译。

go build -o run_btc_relayer run.go 

​ 通过下列命令,启动relayer。

run_btc_relayer -conf-file=/path/to/conf.json -log-path=/path/to/log/ 

​ 当然配置conf.json需要自行填写

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccountByPassword

func GetAccountByPassword(sdk *sdk.PolySdk, path string, pwd []byte) (*sdk.Account, error)

Types

type BtcRelayer

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

func NewBtcRelayer

func NewBtcRelayer(conf *RelayerConfig, pwd []byte) (*BtcRelayer, error)

func (*BtcRelayer) Broadcast

func (relayer *BtcRelayer) Broadcast()

func (*BtcRelayer) BtcListen

func (relayer *BtcRelayer) BtcListen()

func (*BtcRelayer) PolyListen

func (relayer *BtcRelayer) PolyListen()

func (*BtcRelayer) ReBroadcast

func (relayer *BtcRelayer) ReBroadcast()

func (*BtcRelayer) RelayHeaders

func (relayer *BtcRelayer) RelayHeaders()

func (*BtcRelayer) RelayTx

func (relayer *BtcRelayer) RelayTx()

func (*BtcRelayer) SendCCIFromDB

func (relayer *BtcRelayer) SendCCIFromDB()

type RelayerConfig

type RelayerConfig struct {
	BtcObConf       *observer.BtcObConfig  `json:"btc_ob_conf"`
	PolyObConf      *observer.PolyObConfig `json:"poly_ob_conf"`
	RetryDuration   int                    `json:"retry_duration"`
	RetryTimes      int                    `json:"retry_times"`
	RetryDBPath     string                 `json:"retry_db_path"`
	LogLevel        int                    `json:"log_level"`
	SleepTime       int                    `json:"sleep_time"`
	MaxReadSize     uint64                 `json:"max_read_size"`
	RetryCCIDura    int                    `json:"retry_cci_dura"`
	SendHeadersDura int                    `json:"send_headers_dura"`
	TxTimeOut       float64                `json:"tx_time_out"`
}

func NewRelayerConfig

func NewRelayerConfig(file string) (*RelayerConfig, error)

func (*RelayerConfig) Init

func (this *RelayerConfig) Init(fileName string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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