appchain_mgr

package
v1.28.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 8 Imported by: 9

Documentation

Index

Constants

View Source
const (
	Prefix                = "appchain"
	ChainNumPrefix        = "chain-num"
	ChainOccupyIdPrefix   = "chain-occupy-id"
	ChainOccupyNamePrefix = "chain-occupy-name"
	NameChainPrefix       = "name-chain"
	AdminChainPrefix      = "admin-chain"
	ChainAdminsPrefix     = "chain-admins"

	RelaychainType = "relaychain"
	AppchainType   = "appchain"
	FabricType     = "fabric"

	ChainTypeFabric1_4_3     = "Fabric V1.4.3"
	ChainTypeFabric1_4_4     = "Fabric V1.4.4"
	ChainTypeHyperchain1_8_3 = "Hyperchain V1.8.3"
	ChainTypeHyperchain1_8_6 = "Hyperchain V1.8.6"
	ChainTypeFlato1_0_0      = "Flato V1.0.0"
	ChainTypeFlato1_0_3      = "Flato V1.0.3"
	ChainTypeFlato1_0_6      = "Flato V1.0.6"
	ChainTypeBCOS2_6_0       = "BCOS V2.6.0"
	ChainTypeCITA20_2_2      = "CITA V20.2.2"
	ChainTypeETH             = "ETH"
)

Variables

This section is empty.

Functions

func AppAdminsChainKey added in v1.20.0

func AppAdminsChainKey(id string) string

func AppchainAdminKey added in v1.20.0

func AppchainAdminKey(addr string) string

func AppchainKey added in v1.20.0

func AppchainKey(id string) string

func AppchainNameKey added in v1.20.0

func AppchainNameKey(name string) string

func AppchainOccupyNameKey added in v1.20.0

func AppchainOccupyNameKey(name string) string

Types

type Appchain

type Appchain struct {
	ID        string `json:"id"`
	ChainName string `json:"chain_name"`
	ChainType string `json:"chain_type"`
	TrustRoot []byte `json:"trust_root"`
	Broker    []byte `json:"broker"`
	Desc      string `json:"desc"`
	Version   uint64 `json:"version"`
	DID       string `json:"did"`
	PubKey    []byte `json:"pub_key"`

	Status g.GovernanceStatus `json:"status"`
	FSM    *fsm.FSM           `json:"fsm"`
}

func (*Appchain) IsAvailable added in v1.20.0

func (a *Appchain) IsAvailable() bool

func (*Appchain) IsBitXHub added in v1.20.0

func (a *Appchain) IsBitXHub() bool

type AppchainManager

type AppchainManager struct {
	g.Persister
}

func (*AppchainManager) All added in v1.3.0

func (am *AppchainManager) All(_ []byte) (interface{}, error)

All returns all appchains

func (*AppchainManager) Audit

func (am *AppchainManager) Audit(proposer string, isApproved int32, desc string) (bool, []byte)

Audit bitxhub manager audit appchain register info

func (*AppchainManager) ChangeStatus

func (am *AppchainManager) ChangeStatus(id, trigger, lastStatus string, _ []byte) (bool, []byte)

func (*AppchainManager) CountAll added in v1.3.0

func (am *AppchainManager) CountAll(_ []byte) (bool, []byte)

CountAll counts all appchains including approved, rejected or registered

func (*AppchainManager) CountAvailable added in v1.3.0

func (am *AppchainManager) CountAvailable(_ []byte) (bool, []byte)

CountAvailable counts all available appchains

func (*AppchainManager) DeleteAppchain

func (am *AppchainManager) DeleteAppchain(id string) (bool, []byte)

func (*AppchainManager) FetchAuditRecords

func (am *AppchainManager) FetchAuditRecords(id string) (bool, []byte)

func (*AppchainManager) GetChainIdByName added in v1.20.0

func (am *AppchainManager) GetChainIdByName(name string) (string, error)

func (*AppchainManager) GovernancePre added in v1.20.0

func (am *AppchainManager) GovernancePre(chainId string, event g.EventType, _ []byte) (interface{}, *boltvm.BxhError)

GovernancePre checks if the appchain can do the event. (only check, not modify infomation) return *appchain, extra info, error

func (*AppchainManager) QueryById added in v1.3.0

func (am *AppchainManager) QueryById(id string, _ []byte) (interface{}, error)

func (*AppchainManager) Register

func (am *AppchainManager) Register(chainInfo *Appchain)

Register registers appchain info, return chain id

func (*AppchainManager) Update added in v1.3.0

func (am *AppchainManager) Update(updateInfo *Appchain) (bool, []byte)

type AppchainMgr

type AppchainMgr interface {
	governance.Governance

	// Register registers object info, return object id and error
	Register(chainInfo *Appchain)

	// Update updates available or frozen object
	Update(updateInfo *Appchain) (bool, []byte)

	// Audit bitxhub manager audit appchain register info
	// caller is the bitxhub manager address
	// proposer is the appchain manager address
	Audit(proposer string, isApproved int32, desc string) (bool, []byte)

	//FetchAuditRecords fetches audit records by appchain id
	FetchAuditRecords(id string) (bool, []byte)

	// DeleteAppchain deletes appchain
	DeleteAppchain(id string) (bool, []byte)

	GetChainIdByName(name string) (string, error)
}

func New

func New(persister g.Persister) AppchainMgr

type FabricBroker added in v1.20.0

type FabricBroker struct {
	ChannelID     string `json:"channel_id"`
	ChaincodeID   string `json:"chaincode_id"`
	BrokerVersion string `json:"broker_version"`
}

Directories

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

Jump to

Keyboard shortcuts

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