relayd

package
v0.0.0-...-0abe6a2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: BSD-3-Clause Imports: 29 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	PrivateKey string `json:"privateKey"`
	PublicKey  string `json:"publicKey"`
	Address    string `json:"address"`
}

Auth auth key struct

type BtcClient

type BtcClient interface {
	Start() error
	Stop() error
	GetLatestBlock() (*chainhash.Hash, uint64, error)
	GetBlockHeader(height uint64) (*ty.BtcHeader, error)
	GetSPV(height uint64, txHash string) (*ty.BtcSpv, error)
	GetTransaction(hash string) (*ty.BtcTransaction, error)
	Ping()
}

BtcClient interface

type Btcd

type Btcd struct {
	ID                   string
	Host                 string
	Endpoint             string
	User                 string
	Pass                 string
	DisableTLS           bool
	CertPath             string
	Proxy                string
	ProxyUser            string
	ProxyPass            string
	DisableAutoReconnect bool
	DisableConnectOnNew  bool
	HTTPPostMode         bool
	EnableBCInfoHacks    bool
	ReconnectAttempts    int
}

Btcd adapt to btcd

func (*Btcd) BitConnConfig

func (b *Btcd) BitConnConfig() *rpcclient.ConnConfig

BitConnConfig btc connect config

type Chain33

type Chain33 struct {
	ID                   string
	Host                 string
	User                 string
	Pass                 string
	DisableAutoReconnect bool
	ReconnectAttempts    int
}

Chain33 define adapt to chain33 relay exec

type Client33

type Client33 struct {
	types.Chain33Client
	// contains filtered or unexported fields
}

Client33 to connect with chain33

func NewClient33

func NewClient33(cfg *Chain33) *Client33

NewClient33 new client instance

func (*Client33) Close

func (c *Client33) Close() error

Close chain33 close

func (*Client33) SendTransaction

func (c *Client33) SendTransaction(ctx context.Context, in *types.Transaction) (*types.Reply, error)

SendTransaction send tx to chain33

func (*Client33) Start

func (c *Client33) Start(ctx context.Context)

Start begin heartbeat to chain33

type Config

type Config struct {
	Title          string
	Watch          bool
	Tick33         int
	TickBTC        int
	BtcdOrWeb      int
	SyncSetup      uint64
	SyncSetupCount uint64
	Chain33        Chain33
	FirstBtcHeight uint64
	Btcd           Btcd
	Log            types.Log
	Auth           Auth
}

Config relayd toml config

func NewConfig

func NewConfig(path string) *Config

NewConfig create a new config

type Relayd

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

Relayd define

func NewRelayd

func NewRelayd(config *Config) *Relayd

NewRelayd create relayd instance

func (*Relayd) Close

func (r *Relayd) Close()

Close relayd close

func (*Relayd) Start

func (r *Relayd) Start()

Start relayd start up

Jump to

Keyboard shortcuts

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