chain

package
v0.0.0-...-948bdf6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: GPL-3.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BlockRetryInterval = time.Second * 6
	BlockRetryLimit    = 50
	BlockConfirmNumber = int64(3)
)
View Source
var (
	ErrEventAttributeNumberUnMatch = errors.New("ErrEventAttributeNumberTooFew")
)
View Source
var (
	ErrorTerminated = errors.New("terminated")
)

Functions

func NewBlockstore

func NewBlockstore(path string, relayer string) (*blockstore.Blockstore, error)

func StartBlock

func StartBlock(bs *blockstore.Blockstore, blk uint64) (uint64, error)

Types

type Chain

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

func NewChain

func NewChain() *Chain

func (*Chain) Initialize

func (c *Chain) Initialize(cfg *config.RawChainConfig, logger log15.Logger, sysErr chan<- error) error

func (*Chain) Name

func (c *Chain) Name() string

func (*Chain) RSymbol

func (c *Chain) RSymbol() core.RSymbol

func (*Chain) SetRouter

func (c *Chain) SetRouter(r *core.Router)

func (*Chain) Start

func (c *Chain) Start() error

func (*Chain) Stop

func (c *Chain) Stop()

stop will stop handler and listener

type ConfigOption

type ConfigOption struct {
	BlockstorePath string `json:"blockstorePath"`
	StartBlock     int    `json:"startBlock"`
	ChainID        string `json:"chainId"`
	Denom          string `json:"denom"`
	GasPrice       string `json:"gasPrice"`
	Account        string `json:"account"`
	CaredSymbol    string `json:"caredSymbol"`
}

type Connection

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

func NewConnection

func NewConnection(cfg *config.RawChainConfig, option *ConfigOption, log log15.Logger) (*Connection, error)

func (*Connection) BlockStoreUseAddress

func (c *Connection) BlockStoreUseAddress() string

type Handler

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

func NewHandler

func NewHandler(conn *Connection, log log15.Logger, stopChan <-chan struct{}, sysErrChan chan<- error) *Handler

func (*Handler) HandleMessage

func (w *Handler) HandleMessage(m *core.Message)

resolve msg from other chains

type Listener

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

func NewListener

func NewListener(name string, symbol, caredSymbol core.RSymbol, startBlock uint64, bs blockstore.Blockstorer, conn *Connection, log log15.Logger, stopChan <-chan struct{}, sysErr chan<- error) *Listener

Jump to

Keyboard shortcuts

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