Documentation ¶
Overview ¶
The substrate package contains the logic for interacting with substrate chains. The current supported transfer types are Fungible.
There are 3 major components: the connection, the listener, and the writer.
Connection ¶
The Connection handles connecting to the substrate client, and submitting transactions to the client. It also handles state queries. The connection is shared by the writer and listener.
Listener ¶
The substrate listener polls blocks and parses the associated events for the three transfer types. It then forwards these into the router.
Writer ¶
As the writer receives messages from the router, nothing happened.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Frequency of polling for a new block BlockRetryInterval = 6 * time.Second BlockRetryLimit = 100 EventRetryLimit = 20 EventRetryInterval = 100 * time.Millisecond )
View Source
var (
ErrEventAttributeNumberUnMatch = errors.New("ErrEventAttributeNumberTooFew")
)
View Source
var ErrorTerminated = errors.New("terminated")
Functions ¶
func NewListener ¶
func NewListener(conn *Connection, name string, id msg.ChainId, startBlock uint64, log log15.Logger, bs blockstore.Blockstorer, stop <-chan int, sysErr chan<- error) *listener
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(cfg *core.ChainConfig, log log15.Logger, stop <-chan int) (*Connection, error)
func (*Connection) Address ¶
func (c *Connection) Address() string
func (*Connection) Close ¶
func (c *Connection) Close()
func (*Connection) FinalizedBlockNumber ¶
func (c *Connection) FinalizedBlockNumber() (uint64, error)
func (*Connection) GetEvents ¶
func (c *Connection) GetEvents(blockNum uint64) ([]*types.TxResponse, error)
func (*Connection) LatestBlockNumber ¶
func (c *Connection) LatestBlockNumber() (uint64, error)
Click to show internal directories.
Click to hide internal directories.