chain

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2024 License: GPL-3.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEventAttributeNumberUnMatch = errors.New("ErrEventAttributeNumberTooFew")

	SimulateBondReportedEvent = types.StringEvent{
		Type: stafiHubXLedgerTypes.EventTypeBondReported,
		Attributes: []types.Attribute{
			{Key: stafiHubXLedgerTypes.AttributeKeyDenom, Value: "uratom"},
			{Key: stafiHubXLedgerTypes.AttributeKeyShotId, Value: "710f75313464e035f1156c115ecc1ea5b8e1cf15e5070b7198fa211273388996"}},
	}
)
View Source
var (
	BlockRetryInterval = time.Second * 6
	BlockRetryLimit    = 50
	BlockConfirmNumber = int64(3)
)
View Source
var (
	ErrorTerminated = errors.New("terminated")
)

Functions

func NewBlockstore

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

func StartBlock

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

Types

type Chain

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

func NewChain

func NewChain() *Chain

func (*Chain) GetAddressPrefix

func (c *Chain) GetAddressPrefix(denom string) (*stafiHubXRBankTypes.QueryAddressPrefixResponse, error)

func (*Chain) GetIcaPools added in v1.4.0

func (*Chain) GetPoolDetail

func (c *Chain) GetPoolDetail(denom, pool string) (*stafiHubXLedgerTypes.QueryGetPoolDetailResponse, error)

func (*Chain) GetPools

func (*Chain) GetRParams

func (*Chain) GetSelectedValidators added in v1.3.0

func (c *Chain) GetSelectedValidators(denom, pool string) (*stafiHubXRValidatorTypes.QueryRValidatorListResponse, error)

func (*Chain) Initialize

func (c *Chain) Initialize(cfg *config.RawChainConfig, logger log.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"`
	Account        string `json:"account"`
	GasPrice       string `json:"gasPrice"`
	CaredSymbol    string `json:"caredSymbol"`
}

type Connection

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

func NewConnection

func NewConnection(cfg *config.RawChainConfig, option *ConfigOption, log log.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 log.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 utils.Blockstorer, conn *Connection, log log.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