appchain

package
v0.0.0-...-f069fcf Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: GPL-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 AppChain

type AppChain interface {
	Executor
	Monitor
}

type Executor

type Executor interface {
	// ExecuteIBTP handles interchain ibtps from other appchains
	// and return the receipt ibtp for ack or callback
	ExecuteIBTP(Ibtp *pb.IBTP) (*pb.IBTP, error)

	// Rollback rollbacks ibtp on appchain
	Rollback(ibtp *pb.IBTP, isSrcChain bool)

	// QueryIBTPReceipt query receipt for original interchain ibtp
	QueryIBTPReceipt(originalIBTP *pb.IBTP) (*pb.IBTP, error)

	// QueryInterchainMeta queries latest index map of ibtps executed on appchain
	// For the returned map, key is the source chain ID,
	// and value is the latest index of tx executed on appchain
	QueryInterchainMeta() map[string]uint64

	// QueryCallbackMeta queries latest index map of ibtps callbacks executed on appchain
	// For the returned map, key is the destination chain ID,
	// and value is the latest index of callback executed on appchain
	QueryCallbackMeta() map[string]uint64
}

type Manager

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

func NewManager

func NewManager(clients []plugins.Client, cryptor txcrypto.Cryptor, logger logrus.FieldLogger) *Manager

func (*Manager) AppChain

func (m *Manager) AppChain(id string) AppChain

func (*Manager) Ports

func (m *Manager) Ports() []port.Port

func (*Manager) Start

func (m *Manager) Start() error

func (*Manager) Stop

func (m *Manager) Stop() error

type Monitor

type Monitor interface {
	// listen on interchain ibtp from appchain
	ListenIBTP() <-chan *pb.IBTP
	// query historical ibtp by its id
	// QueryIBTP(id string) (*pb.IBTP, error)
	QueryIBTP(to string, id string) (*pb.IBTP, error)
	// QueryLatestMeta queries latest index map of ibtps threw on appchain
	QueryOuterMeta() map[string]uint64
}

Directories

Path Synopsis
Package mock_executor is a generated GoMock package.
Package mock_executor is a generated GoMock package.
Package mock_monitor is a generated GoMock package.
Package mock_monitor is a generated GoMock package.

Jump to

Keyboard shortcuts

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