parachain

package
v0.0.0-...-56f3d1a Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ParaChainStatusStart = 0
	ParaChainStatusStop  = 1
)
View Source
const (
	ConfigName = "engine.yaml"
)
View Source
const (
	ParaChainKernelContract = "$parachain"
)

Variables

View Source
var (
	ErrGroupNotFound = errors.New("group not found")
	ErrUnAuthorized  = errors.New("unAuthorized")
	ErrChainNotFound = errors.New("chain not found")
	ErrBcNameEmpty   = errors.New("block chain name is empty")
	ErrBcDataEmpty   = errors.New("first block data is empty")
	ErrAdminEmpty    = errors.New("no administrator")
)

Functions

func NewParaChainContract

func NewParaChainContract(bcName string, minNewChainAmount int64, newChainWhiteList map[string]bool, chainCtx *common.ChainCtx) *paraChainContract

Types

type Config

type Config struct {
	MinNewChainAmount string
	NewChainWhiteList map[string]bool `yaml:"newChainWhiteList,omitempty"` //能创建链的address白名单
}

type Ctx

type Ctx struct {
	// 基础上下文
	xcontext.BaseCtx
	BcName   string
	Contract contract.Manager
	ChainCtx *common.ChainCtx
}

func NewParaChainCtx

func NewParaChainCtx(bcName string, cCtx *common.ChainCtx) (*Ctx, error)

type Group

type Group struct {
	GroupID    string   `json:"name,omitempty"`       // group name which is the same as its parachain name
	Admin      []string `json:"admin,omitempty"`      // admin addresses
	Identities []string `json:"identities,omitempty"` // accessible addresses
	Status     int      `json:"status,omitempty"`     // parachain status
}

Group 平行链群组

func GetParaChainGroup

func GetParaChainGroup(reader kledger.XMSnapshotReader, bcName string) (Group, error)

func (*Group) IsParaChainEnable

func (g *Group) IsParaChainEnable() bool

IsParaChainEnable returns true when status is `start`

type Manager

type Manager struct {
	Ctx *Ctx
}

Manager

func NewParaChainManager

func NewParaChainManager(ctx *Ctx) (*Manager, error)

NewParaChainManager create instance of ParaChain

type ParaChainConfig

type ParaChainConfig = Config

Deprecated use Config instead

type ParaChainCtx

type ParaChainCtx = Ctx

Deprecated use Ctx instead

Jump to

Keyboard shortcuts

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