appchain_mgr

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 9

Documentation

Index

Constants

View Source
const (
	PREFIX = "appchain-"

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

Variables

This section is empty.

Functions

func SetFSM

func SetFSM(chain *Appchain)

Types

type Appchain

type Appchain struct {
	ID            string             `json:"id"`
	Name          string             `json:"name"`
	Validators    string             `json:"validators"`
	ConsensusType string             `json:"consensus_type"`
	Status        g.GovernanceStatus `json:"status"`
	ChainType     string             `json:"chain_type"`
	Desc          string             `json:"desc"`
	Version       string             `json:"version"`
	PublicKey     string             `json:"public_key"`
	OwnerDID      string             `json:"owner_did"`
	DidDocAddr    string             `json:"did_doc_addr"`
	DidDocHash    string             `json:"did_doc_hash"`
	FSM           *fsm.FSM           `json:"fsm"`
}

type AppchainManager

type AppchainManager struct {
	g.Persister
}

func (*AppchainManager) All added in v1.3.0

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

Appchains 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 string, _ []byte) (bool, []byte)

func (*AppchainManager) CountAll added in v1.3.0

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

CountAppchains counts all appchains including approved, rejected or registered

func (*AppchainManager) CountAvailable added in v1.3.0

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

CountAvailableAppchains 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) GetPubKeyByChainID

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

GetPubKeyByChainID can get aim chain's public key using aim chain ID

func (*AppchainManager) QueryById added in v1.3.0

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

func (*AppchainManager) Register

func (am *AppchainManager) Register(info []byte) (bool, []byte)

Register registers appchain info return appchain id and error

func (*AppchainManager) Update added in v1.3.0

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

type AppchainMgr

type AppchainMgr interface {
	governance.Governance

	// Register registers object info, return object id and error
	Register(info []byte) (bool, []byte)

	// Update updates available or frozen object
	Update(info []byte) (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)

	// GetPubKeyByChainID can get aim chain's public key using aim chain ID
	GetPubKeyByChainID(id string) (bool, []byte)
}

func New

func New(persister g.Persister) AppchainMgr

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