parachain

package
v0.0.0-...-b124b1e Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

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 (
	// ErrCreateBlockChain is returned when create block chain error
	ErrCreateBlockChain = errors.New("create blockChain error")
	ErrGroupNotFound    = errors.New("group not found")
	ErrUnAuthorized     = errors.New("unAuthorized")
	ErrChainNotFound    = errors.New("chain not found")
	ErrCtxEmpty         = errors.New("chain context is 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 IsParaChainEnable

func IsParaChainEnable(g Group) bool

func NewParaChainContract

func NewParaChainContract(bcName string, minNewChainAmount int64, chainCtx *engineBase.ChainCtx) *paraChainContract

Types

type Group

type Group struct {
	GroupID    string   `json:"name,omitempty"`
	Admin      []string `json:"admin,omitempty"`
	Identities []string `json:"identities,omitempty"`
	Status     int      `json:"status,omitempty"`
}

////////// Group ///////////

func GetParaChainGroup

func GetParaChainGroup(reader ledger.SnapshotReader, bcname string) (Group, error)

type Manager

type Manager struct {
	Ctx *ParaChainCtx
}

Manager

func NewParaChainManager

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

NewParaChainManager create instance of ParaChain

type ParaChainConfig

type ParaChainConfig struct {
	MinNewChainAmount string
}

type ParaChainCtx

type ParaChainCtx struct {
	// 基础上下文
	xctx.BaseCtx
	BcName   string
	Contract contractBase.Manager
	ChainCtx *base.ChainCtx
}

ParaChainCtx 这个可能和ChainCtx重复了

func NewParaChainCtx

func NewParaChainCtx(bcName string, cctx *base.ChainCtx) (*ParaChainCtx, error)

Jump to

Keyboard shortcuts

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