router

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RouteIBTPKey

func RouteIBTPKey(id string) []byte

Types

type Router

type Router interface {
	// Start starts the router module
	Start() error

	// Stop
	Stop() error

	//Broadcast broadcasts the registered appchain ids to the union network
	Broadcast(ids []string) error

	//Route sends ibtp to the union pier in target relay chain
	Route(ibtp *pb.IBTP) error

	//ExistAppchain returns if appchain id exist in route map
	ExistAppchain(id string) bool

	//AddAppchains adds appchains to route map and broadcast them to union network
	AddAppchains(appchains []*appchainmgr.Appchain) error
}

type UnionRouter

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

func New

func New(peermgr peermgr.PeerManager, store storage.Storage, logger logrus.FieldLogger, connectedPierIDs []string) *UnionRouter

func (*UnionRouter) AddAppchains

func (u *UnionRouter) AddAppchains(appchains []*appchainmgr.Appchain) error

AddAppchains adds appchains to route map and broadcast them to union network

func (*UnionRouter) Broadcast

func (u *UnionRouter) Broadcast(appchainIds []string) error

Broadcast broadcasts the registered appchain ids to the union network

func (*UnionRouter) ExistAppchain

func (u *UnionRouter) ExistAppchain(id string) bool

ExistAppchain returns if appchain id exit in route map

func (*UnionRouter) Route

func (u *UnionRouter) Route(ibtp *pb.IBTP) error

Route sends ibtp to the union pier in target relay chain

func (*UnionRouter) Start

func (u *UnionRouter) Start() error

func (*UnionRouter) Stop

func (u *UnionRouter) Stop() error

Directories

Path Synopsis
Package mock_router is a generated GoMock package.
Package mock_router is a generated GoMock package.

Jump to

Keyboard shortcuts

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