core

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chain

type Chain interface {
	Start() error // Start chain
	SetRouter(*Router)
	Id() msg.ChainId
	Name() string
	Stop()
	Conn() Connection
}

type ChainConfig

type ChainConfig struct {
	Name             string            // Human-readable chain name
	Id               msg.ChainId       // ChainID
	Endpoint         string            // url for rpc endpoint
	Network          string            //
	From             string            // address of key to use
	KeystorePath     string            // Location of key files
	NearKeystorePath string            // Location of key files
	Insecure         bool              // Indicated whether the test keyring should be used
	BlockstorePath   string            // Location of blockstore
	FreshStart       bool              // If true, blockstore is ignored at start.
	LatestBlock      bool              // If true, overrides blockstore or latest block in config and starts from current block
	Opts             map[string]string // Per chain options
	SkipError        bool              // Flag of Skip Error
}

type Connection added in v1.2.0

type Connection interface {
	Connect() error
	Keypair() *keystore.Key
	Opts() *bind.TransactOpts
	CallOpts() *bind.CallOpts
	LockAndUpdateOpts(bool) error
	UnlockOpts()
	Client() *ethclient.Client
	EnsureHasBytecode(address common.Address) error
	LatestBlock() (*big.Int, error)
	WaitForBlock(block *big.Int, delay *big.Int) error
	Close()
}

type Core

type Core struct {
	Registry []Chain
	// contains filtered or unexported fields
}

func NewCore

func NewCore(sysErr <-chan error, mapcid msg.ChainId, role mapprotocol.Role) *Core

func (*Core) AddChain

func (c *Core) AddChain(chain Chain)

AddChain registers the chain in the Registry and calls Chain.SetRouter()

func (*Core) Errors

func (c *Core) Errors() <-chan error

func (*Core) Start

func (c *Core) Start()

Start will call all registered chains' Start methods and block forever (or until signal is received)

func (*Core) ToUCoreRegistry

func (c *Core) ToUCoreRegistry() []utilcore.Chain

type CreateConn added in v1.2.0

type CreateConn func(string, bool, *keystore.Key, log15.Logger, *big.Int, *big.Int, float64) Connection

type Eth2Connection added in v1.2.0

type Eth2Connection interface {
	Connection
	Eth2Client() *eth2.Client
}

type KConnection added in v1.2.0

type KConnection interface {
	Connection
	KClient() *klaytn.Client
}

type Router

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

Router forwards messages from their source to their destination

func NewRouter

func NewRouter(log log.Logger, mapcid msg.ChainId) *Router

func (*Router) Listen

func (r *Router) Listen(id msg.ChainId, w Writer)

Listen registers a Writer with a ChainId which Router.Send can then use to propagate messages

func (*Router) Send

func (r *Router) Send(msg msg.Message) error

Send passes a message to the destination Writer if it exists

type Writer

type Writer interface {
	ResolveMessage(message msg.Message) bool
}

Writer consumes a message and makes the requried on-chain interactions.

Jump to

Keyboard shortcuts

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