Documentation
¶
Index ¶
- Constants
- Variables
- func CheckRuleAddress(persister governance.Persister, addr, chainType string) *boltvm.Response
- func DappKey(id string) string
- func DappNameKey(name string) string
- func DappOccupyContractKey(addr string) string
- func DappOccupyNameKey(name string) string
- func EthTxKey(hash string) string
- func GlobalTxInfoKey(id string) string
- func IndexMapKey(id string) string
- func IndexReceiptMapKey(id string) string
- func MultiTxNotifyKey(height uint64) string
- func OccupyAccountKey(addr string) string
- func OwnerKey(addr string) string
- func ProposalFromKey(id string) string
- func ProposalKey(id string) string
- func ProposalObjKey(id string) string
- func ProposalStatusKey(status string) string
- func ProposalStrategyKey(ps string) string
- func ProposalTypKey(typ string) string
- func RoleAppchainAdminKey(appchainID string) string
- func RoleKey(id string) string
- func RoleTypeKey(typ string) string
- func TimeoutKey(height uint64) string
- func TxInfoKey(id string) string
- type AppchainManager
- func (am *AppchainManager) ActivateAppchain(id, reason string) *boltvm.Response
- func (am *AppchainManager) Appchains() *boltvm.Response
- func (am *AppchainManager) CountAppchains() *boltvm.Response
- func (am *AppchainManager) CountAvailableAppchains() *boltvm.Response
- func (am *AppchainManager) FreezeAppchain(id, reason string) *boltvm.Response
- func (am *AppchainManager) GetAdminByChainId(chainId string) *boltvm.Response
- func (am *AppchainManager) GetAppchain(id string) *boltvm.Response
- func (am *AppchainManager) GetAppchainByName(name string) *boltvm.Response
- func (am *AppchainManager) GetBitXHubChainIDs() *boltvm.Response
- func (am *AppchainManager) IsAvailable(chainID string) *boltvm.Response
- func (am *AppchainManager) IsAvailableBitxhub(chainID string) *boltvm.Response
- func (am *AppchainManager) LogoutAppchain(id, reason string) *boltvm.Response
- func (am *AppchainManager) Manage(eventTyp, proposalResult, lastStatus, objId string, extra []byte) *boltvm.Response
- func (am *AppchainManager) PauseAppchain(id string) *boltvm.Response
- func (am *AppchainManager) RegisterAppchain(chainID string, chainName string, chainType string, trustRoot []byte, ...) *boltvm.Response
- func (am *AppchainManager) UnPauseAppchain(id, lastStatus string) *boltvm.Response
- func (am *AppchainManager) UpdateAppchain(id, name, desc string, trustRoot []byte, adminAddrs, reason string) *boltvm.Response
- type Ballot
- type BxhValidators
- type CallFunc
- type ChainService
- type ContractAddr
- type Dapp
- type DappManager
- func (dm *DappManager) ActivateDapp(id, reason string) *boltvm.Response
- func (dm *DappManager) ConfirmTransfer(id string) *boltvm.Response
- func (dm *DappManager) EvaluateDapp(id, desc string, score float64) *boltvm.Response
- func (dm *DappManager) FreezeDapp(id, reason string) *boltvm.Response
- func (dm *DappManager) GetAllDapps() *boltvm.Response
- func (dm *DappManager) GetDapp(id string) *boltvm.Response
- func (dm *DappManager) GetDappByName(name string) *boltvm.Response
- func (dm *DappManager) GetDappsByOwner(ownerAddr string) *boltvm.Response
- func (dm *DappManager) GetPermissionAvailableDapps(caller string) *boltvm.Response
- func (dm *DappManager) GetPermissionDapps(caller string) *boltvm.Response
- func (dm *DappManager) IsAvailable(dappID string) *boltvm.Response
- func (dm *DappManager) Manage(eventTyp, proposalResult, lastStatus, objId string, extra []byte) *boltvm.Response
- func (dm *DappManager) RegisterDapp(name, typ, desc, url, conAddrs, permits, reason string) *boltvm.Response
- func (dm *DappManager) TransferDapp(id, newOwnerAddr, reason string) *boltvm.Response
- func (dm *DappManager) UpdateDapp(id, name, desc, url, conAddrs, permits, reason string) *boltvm.Response
- type DappType
- type Dapps
- type EndReason
- type EthHeaderManager
- func (ehm *EthHeaderManager) CurrentBlockHeader() *boltvm.Response
- func (ehm *EthHeaderManager) GetBlockHeader(hash string) *boltvm.Response
- func (ehm *EthHeaderManager) GetEscrowAddr(pierAddr string) *boltvm.Response
- func (ehm *EthHeaderManager) GetInterchainSwapAddr() *boltvm.Response
- func (ehm *EthHeaderManager) GetPrefixedHash(hash string) *boltvm.Response
- func (ehm *EthHeaderManager) GetProxyAddr() *boltvm.Response
- func (ehm *EthHeaderManager) InsertBlockHeaders(headersData []byte) *boltvm.Response
- func (ehm *EthHeaderManager) Mint(receiptData []byte, proofData []byte) *boltvm.Response
- func (ehm *EthHeaderManager) SetEscrowAddr(pierAddr string, addr string) *boltvm.Response
- func (ehm *EthHeaderManager) SetInterchainSwapAddr(addr string) *boltvm.Response
- func (ehm *EthHeaderManager) SetProxyAddr(addr string) *boltvm.Response
- type GovStrategy
- func (g *GovStrategy) GetAllProposalStrategy() *boltvm.Response
- func (g *GovStrategy) GetProposalStrategy(pt string) *boltvm.Response
- func (g *GovStrategy) Manage(eventTyp, proposalResult, lastStatus, objId string, extra []byte) *boltvm.Response
- func (g *GovStrategy) UpdateAllProposalStrategy(typ string, strategyExtra string, reason string) *boltvm.Response
- func (g *GovStrategy) UpdateProposalStrategy(module string, typ string, strategyExtra string, reason string) *boltvm.Response
- func (g *GovStrategy) UpdateProposalStrategyByRolesChange(availableNum uint64) *boltvm.Response
- type Governance
- func (g *Governance) EndObjProposal(objId, endReason string, extra []byte) *boltvm.Response
- func (g *Governance) GetAgainst(id string) *boltvm.Response
- func (g *Governance) GetAgainstNum(id string) *boltvm.Response
- func (g *Governance) GetApprove(id string) *boltvm.Response
- func (g *Governance) GetApproveNum(id string) *boltvm.Response
- func (g *Governance) GetAvaliableElectorateNum(id string) *boltvm.Response
- func (g *Governance) GetBallot(voterAddr, proposalId string) *boltvm.Response
- func (g *Governance) GetNotClosedProposals() *boltvm.Response
- func (g *Governance) GetPrimaryElectorateNum(id string) *boltvm.Response
- func (g *Governance) GetProposal(id string) *boltvm.Response
- func (g *Governance) GetProposalsByFrom(from string) *boltvm.Response
- func (g *Governance) GetProposalsByObjId(objId string) *boltvm.Response
- func (g *Governance) GetProposalsByObjIdInCreateTimeOrder(objId string) *boltvm.Response
- func (g *Governance) GetProposalsByStatus(status string) *boltvm.Response
- func (g *Governance) GetProposalsByTyp(typ string) *boltvm.Response
- func (g *Governance) GetUnvote(id string) *boltvm.Response
- func (g *Governance) GetUnvoteNum(id string) *boltvm.Response
- func (g *Governance) GetVoted(id string) *boltvm.Response
- func (g *Governance) GetVotedNum(id string) *boltvm.Response
- func (g *Governance) LockLowPriorityProposal(objId, eventTyp string) *boltvm.Response
- func (g *Governance) SubmitProposal(from, eventTyp, typ, objId, objLastStatus, reason string, extra []byte) *boltvm.Response
- func (g *Governance) UnLockLowPriorityProposal(objId, eventTyp string) *boltvm.Response
- func (g *Governance) UpdateAvaliableElectorateNum(id string, num uint64) *boltvm.Response
- func (g *Governance) Vote(id, approve string, reason string) *boltvm.Response
- func (g *Governance) WithdrawProposal(id, reason string) *boltvm.Response
- func (g *Governance) ZeroPermission(id string) *boltvm.Response
- type InterBroker
- func (ib *InterBroker) EmitInterchain(fromServiceId, toServiceId, funcs, args, argsCb, argsRb string) *boltvm.Response
- func (ib *InterBroker) GetCallbackMeta() *boltvm.Response
- func (ib *InterBroker) GetInMessage(from, to string, index uint64) *boltvm.Response
- func (ib *InterBroker) GetInMeta() *boltvm.Response
- func (ib *InterBroker) GetOutMessage(from, to string, index uint64) *boltvm.Response
- func (ib *InterBroker) GetOutMeta() *boltvm.Response
- func (ib *InterBroker) InvokeInterchain(input []byte) *boltvm.Response
- func (ib *InterBroker) InvokeReceipt(input []byte) *boltvm.Response
- type InterchainInvoke
- type InterchainManager
- func (x *InterchainManager) DeleteInterchain(id string) *boltvm.Response
- func (x *InterchainManager) GetAllServiceIDs() *boltvm.Response
- func (x *InterchainManager) GetBitXHubID() *boltvm.Response
- func (x *InterchainManager) GetIBTPByID(id string, isReq bool) *boltvm.Response
- func (x *InterchainManager) GetInterchain(id string) *boltvm.Response
- func (x *InterchainManager) HandleIBTP(ibtp *pb.IBTP) *boltvm.Response
- func (x *InterchainManager) HandleIBTPData(input []byte) *boltvm.Response
- func (x *InterchainManager) ProcessIBTP(ibtp *pb.IBTP, interchain *pb.Interchain, isTargetFail bool) []byte
- func (x *InterchainManager) Register(chainServiceID string) *boltvm.Response
- type NodeManager
- func (nm *NodeManager) BindNode(nodeAccount, auditAdminAddr string) *boltvm.Response
- func (nm *NodeManager) CountAvailableNodes(nodeType string) *boltvm.Response
- func (nm *NodeManager) CountNodes(nodeType string) *boltvm.Response
- func (nm *NodeManager) GetNextVpID() *boltvm.Response
- func (nm *NodeManager) GetNode(nodeAccount string) *boltvm.Response
- func (nm *NodeManager) GetNvpNodeByName(nodeName string) *boltvm.Response
- func (nm *NodeManager) GetVpNodeByPid(nodePid string) *boltvm.Response
- func (nm *NodeManager) GetVpNodeByVpId(nodeVpId string) *boltvm.Response
- func (nm *NodeManager) IsAvailable(nodeAccount string) *boltvm.Response
- func (nm *NodeManager) LogoutNode(nodeAccount, reason string) *boltvm.Response
- func (nm *NodeManager) Manage(eventTyp, proposalResult, lastStatus, objId string, extra []byte) *boltvm.Response
- func (nm *NodeManager) ManageBindNode(nodeAccount, auditAdminAddr, resultEvent string) *boltvm.Response
- func (nm *NodeManager) Nodes() *boltvm.Response
- func (nm *NodeManager) RegisterNode(nodeAccount, nodeType, nodePid string, nodeVpId uint64, ...) *boltvm.Response
- func (nm *NodeManager) UnbindNode(nodeAccount string) *boltvm.Response
- func (nm *NodeManager) UpdateNode(nodeAccount, nodeName, permitStr, reason string) *boltvm.Response
- type Permission
- type Proposal
- type ProposalStatus
- type ProposalStrategy
- type ProposalStrategyType
- type ProposalType
- type Proposals
- type RegisterAppchainInfo
- type Role
- type RoleManager
- func (rm *RoleManager) ActivateRole(roleId, reason string) *boltvm.Response
- func (rm *RoleManager) BindRole(roleId, nodeAccount, reason string) *boltvm.Response
- func (rm *RoleManager) CheckOccupiedAccount(account string) *boltvm.Response
- func (rm *RoleManager) FreeAccount(addrs string) *boltvm.Response
- func (rm *RoleManager) FreezeRole(roleId, reason string) *boltvm.Response
- func (rm *RoleManager) GetAllRoles() *boltvm.Response
- func (rm *RoleManager) GetAppchainAdmin(appchainID string) *boltvm.Response
- func (rm *RoleManager) GetRole() *boltvm.Response
- func (rm *RoleManager) GetRoleByAddr(addr string) *boltvm.Response
- func (rm *RoleManager) GetRoleInfoById(roleId string) *boltvm.Response
- func (rm *RoleManager) GetRoleWeight(roleId string) *boltvm.Response
- func (rm *RoleManager) GetRolesByType(roleType string) *boltvm.Response
- func (rm *RoleManager) IsAnyAdmin(roleId, roleType string) *boltvm.Response
- func (rm *RoleManager) IsAnyAvailableAdmin(roleId, roleType string) *boltvm.Response
- func (rm *RoleManager) IsAppchainAdmin(roleId, appchainId string) *boltvm.Response
- func (rm *RoleManager) LogoutRole(roleId, reason string) *boltvm.Response
- func (rm *RoleManager) Manage(eventTyp, proposalResult, lastStatus, objId string, extra []byte) *boltvm.Response
- func (rm *RoleManager) OccupyAccount(addrs string, roleType string) *boltvm.Response
- func (rm *RoleManager) PauseAuditAdmin(nodeId string) *boltvm.Response
- func (rm *RoleManager) PauseAuditAdminBinding(nodeId string) *boltvm.Response
- func (rm *RoleManager) RegisterRole(roleId, roleType, nodeAccount, reason string) *boltvm.Response
- func (rm *RoleManager) RestoreAuditAdminBinding(nodeId string) *boltvm.Response
- func (rm *RoleManager) UpdateAppchainAdmin(appchainID string, adminAddrs string) *boltvm.Response
- type RoleType
- type RuleManager
- func (rm *RuleManager) ClearRule(chainID string) *boltvm.Response
- func (rm *RuleManager) CountAvailableRules(chainID string) *boltvm.Response
- func (rm *RuleManager) CountRules(chainID string) *boltvm.Response
- func (rm *RuleManager) GetAllRules() *boltvm.Response
- func (rm *RuleManager) GetMasterRule(chainID string) *boltvm.Response
- func (rm *RuleManager) GetRuleByAddr(chainID, ruleAddr string) *boltvm.Response
- func (rm *RuleManager) HasMasterRule(chainID string) *boltvm.Response
- func (rm *RuleManager) IsAvailableRule(chainID, ruleAddress string) *boltvm.Response
- func (rm *RuleManager) LogoutRule(chainID string, ruleAddress string) *boltvm.Response
- func (rm *RuleManager) Manage(eventTyp, proposalResult, lastStatus, chainRuleID string, extra []byte) *boltvm.Response
- func (rm *RuleManager) RegisterRule(chainID string, ruleAddress, ruleUrl string) *boltvm.Response
- func (rm *RuleManager) RegisterRuleFirst(chainID, chainType, ruleAddress, ruleUrl string) *boltvm.Response
- func (rm *RuleManager) Rules(chainID string) *boltvm.Response
- func (rm *RuleManager) UpdateMasterRule(chainID string, newMasterruleAddress, reason string) *boltvm.Response
- type ServiceManager
- func (sm *ServiceManager) ActivateService(chainServiceID, reason string) *boltvm.Response
- func (sm *ServiceManager) ClearChainService(chainID string) *boltvm.Response
- func (sm *ServiceManager) EvaluateService(chainServiceID, desc string, score float64) *boltvm.Response
- func (sm *ServiceManager) FreezeService(chainServiceID, reason string) *boltvm.Response
- func (sm *ServiceManager) GetAllServices() *boltvm.Response
- func (sm *ServiceManager) GetPermissionServices(chainServiceId string) *boltvm.Response
- func (sm *ServiceManager) GetServiceByName(name string) *boltvm.Response
- func (sm *ServiceManager) GetServiceInfo(id string) *boltvm.Response
- func (sm *ServiceManager) GetServicesByAppchainID(chainID string) *boltvm.Response
- func (sm *ServiceManager) GetServicesByType(typ string) *boltvm.Response
- func (sm *ServiceManager) IsAvailable(id string) *boltvm.Response
- func (sm *ServiceManager) LogoutService(chainServiceID, reason string) *boltvm.Response
- func (sm *ServiceManager) Manage(eventTyp, proposalResult, lastStatus, objId string, extra []byte) *boltvm.Response
- func (sm *ServiceManager) PauseChainService(chainID string) *boltvm.Response
- func (sm *ServiceManager) RecordInvokeService(fullServiceID, fromFullServiceID string, result bool) *boltvm.Response
- func (sm *ServiceManager) RegisterService(chainID, serviceID, name, typ, intro string, ordered uint64, ...) *boltvm.Response
- func (sm *ServiceManager) UnPauseChainService(chainID string) *boltvm.Response
- func (sm *ServiceManager) UpdateService(chainServiceID, name, intro, permits, details, reason string) *boltvm.Response
- type StatusChange
- type Store
- type TransactionEvent
- type TransactionInfo
- type TransactionManager
- func (t *TransactionManager) Begin(txId string, timeoutHeight uint64, isFailed bool) *boltvm.Response
- func (t *TransactionManager) BeginMultiTXs(globalID, ibtpID string, timeoutHeight uint64, isFailed bool, count uint64) *boltvm.Response
- func (t *TransactionManager) GetStatus(txId string) *boltvm.Response
- func (t *TransactionManager) Report(txId string, result int32) *boltvm.Response
- type TransferRecord
- type TrustChain
- type TrustMeta
- type UpdateAppchainInfo
- type UpdateDappInfo
- type UpdateInfo
- type UpdateMapInfo
- type UpdateMasterRuleInfo
- type UpdateNodeInfo
- type UpdateServiceInfo
- type UpdateStrategyInfo
Constants ¶
const ( EscrowsAddrKey = "escrows_addr_key" InterchainSwapAddrKey = "interchain_swap_addr_key" ProxyAddrKey = "proxy_addr_key" EthTxHashPrefix = "eth-hash" )
const ( DappPrefix = "dapp" DappOwnerPrefix = "owner-dapp" DappNamePrefix = "name-dapp" DappOccupyNamePrefix = "occupy-dapp-name" DappOccupyContractPrefix = "occupy-dapp-contract" )
const ( PROPOSAL_PREFIX = "proposal" PROPOSALFREOM_PREFIX = "from" PROPOSALOBJ_PREFIX = "obj" PROPOSALTYPE_PREFIX = "type" PROPOSALSTRATEGY_PREFIX = "strategy" PROPOSALSTATUS_PREFIX = "status" AppchainMgr ProposalType = repo.AppchainMgr RuleMgr ProposalType = repo.RuleMgr NodeMgr ProposalType = repo.NodeMgr ServiceMgr ProposalType = repo.ServiceMgr RoleMgr ProposalType = repo.RoleMgr ProposalStrategyMgr ProposalType = repo.ProposalStrategyMgr DappMgr ProposalType = repo.DappMgr PROPOSED ProposalStatus = "proposed" APPROVED ProposalStatus = "approve" REJECTED ProposalStatus = "reject" PAUSED ProposalStatus = "pause" BallotApprove = "approve" BallotReject = "reject" NormalReason EndReason = "end of normal voting" ZeroPermissionReason EndReason = "zero permission reason" WithdrawnReason EndReason = "withdrawn by the proposal sponsor" PriorityReason EndReason = "forced shut down by a high-priority proposal" ElectorateReason EndReason = "not enough valid electorate" ClearReason EndReason = "the proposal was cleared" FALSE = "false" TRUE = "true" )
const ( InCounterKey = "InCounter" OutCounterKey = "OutCounter" CallbackCounterKey = "CallbackCounter" )
const ( BitXHubID = "bitxhub-id" CurAppchainNotAvailable = "current appchain not available" TargetAppchainNotAvailable = "target appchain not available" SrcBitXHubNotAvailable = "source bitxhub not available" TargetBitXHubNotAvailable = "target bitxhub not available" CurServiceNotAvailable = "current service not available" TargetServiceNotAvailable = "target service not available" InvalidIBTP = "invalid ibtp" InvalidTargetService = "invalid target service" DEFAULT_UNION_PIER_ID = "default_union_pier_id" INTERCHAINSERVICE_PREFIX = "service" MULTITX_PREFIX = "multitx" )
const ( GenesisBalance = "genesis_balance" RolePrefix = "role" RoleTypePrefix = "type" RoleAppchainAdminPrefix = "appchain" RoleOccupyAccountPrefix = "occupy-account" GovernanceAdmin RoleType = "governanceAdmin" SuperGovernanceAdmin RoleType = "superGovernanceAdmin" AuditAdmin RoleType = "auditAdmin" AppchainAdmin RoleType = "appchainAdmin" NodeAccount RoleType = "nodeAccount" NoRole RoleType = "none" PermissionSelf Permission = "PermissionSelf" PermissionAdmin Permission = "PermissionAdmin" PermissionSpecific Permission = "PermissionSpecific" )
const ( PREFIX = "tx" TIMEOUT_PREFIX = "timeout" )
const (
MinimumVPNode = 4
)
Variables ¶
var SpecialProposalEventType = []governance.EventType{ governance.EventFreeze, governance.EventActivate, governance.EventLogout, }
var SpecialProposalProposalType = []ProposalType{ RoleMgr, ProposalStrategyMgr, }
Functions ¶
func CheckRuleAddress ¶ added in v1.15.0
func CheckRuleAddress(persister governance.Persister, addr, chainType string) *boltvm.Response
func DappNameKey ¶ added in v1.16.0
func DappOccupyContractKey ¶ added in v1.15.0
func DappOccupyNameKey ¶ added in v1.15.0
func GlobalTxInfoKey ¶ added in v1.15.0
func IndexMapKey ¶ added in v1.11.2
func IndexReceiptMapKey ¶ added in v1.14.0
func MultiTxNotifyKey ¶ added in v1.15.0
func OccupyAccountKey ¶ added in v1.16.0
func ProposalFromKey ¶ added in v1.11.1
func ProposalKey ¶ added in v1.6.0
Key ====================================================================
func ProposalObjKey ¶ added in v1.14.0
func ProposalStatusKey ¶ added in v1.14.0
func ProposalStrategyKey ¶ added in v1.18.0
func ProposalTypKey ¶ added in v1.14.0
func RoleAppchainAdminKey ¶ added in v1.15.0
func RoleTypeKey ¶ added in v1.13.0
func TimeoutKey ¶ added in v1.12.0
Types ¶
type AppchainManager ¶
type AppchainManager struct { boltvm.Stub appchainMgr.AppchainManager }
func (*AppchainManager) ActivateAppchain ¶ added in v1.6.1
func (am *AppchainManager) ActivateAppchain(id, reason string) *boltvm.Response
=========== ActivateAppchain activates frozen appchain
func (*AppchainManager) Appchains ¶
func (am *AppchainManager) Appchains() *boltvm.Response
Appchains returns all appchains
func (*AppchainManager) CountAppchains ¶
func (am *AppchainManager) CountAppchains() *boltvm.Response
CountAppchains counts all appchains including all status
func (*AppchainManager) CountAvailableAppchains ¶ added in v1.6.0
func (am *AppchainManager) CountAvailableAppchains() *boltvm.Response
CountAvailableAppchains counts all available appchains
func (*AppchainManager) FreezeAppchain ¶ added in v1.6.1
func (am *AppchainManager) FreezeAppchain(id, reason string) *boltvm.Response
=========== FreezeAppchain freezes appchain
func (*AppchainManager) GetAdminByChainId ¶ added in v1.15.0
func (am *AppchainManager) GetAdminByChainId(chainId string) *boltvm.Response
func (*AppchainManager) GetAppchain ¶
func (am *AppchainManager) GetAppchain(id string) *boltvm.Response
GetAppchain returns appchain info by appchain id
func (*AppchainManager) GetAppchainByName ¶ added in v1.15.0
func (am *AppchainManager) GetAppchainByName(name string) *boltvm.Response
GetAppchain returns appchain info by appchain id
func (*AppchainManager) GetBitXHubChainIDs ¶ added in v1.13.0
func (am *AppchainManager) GetBitXHubChainIDs() *boltvm.Response
func (*AppchainManager) IsAvailable ¶ added in v1.6.1
func (am *AppchainManager) IsAvailable(chainID string) *boltvm.Response
func (*AppchainManager) IsAvailableBitxhub ¶ added in v1.18.0
func (am *AppchainManager) IsAvailableBitxhub(chainID string) *boltvm.Response
func (*AppchainManager) LogoutAppchain ¶ added in v1.6.1
func (am *AppchainManager) LogoutAppchain(id, reason string) *boltvm.Response
=========== LogoutAppchain logouts appchain
func (*AppchainManager) Manage ¶ added in v1.8.0
func (am *AppchainManager) Manage(eventTyp, proposalResult, lastStatus, objId string, extra []byte) *boltvm.Response
=========== Manage does some subsequent operations when the proposal is over
func (*AppchainManager) PauseAppchain ¶ added in v1.11.2
func (am *AppchainManager) PauseAppchain(id string) *boltvm.Response
=========== PauseAppchain freezes appchain without governance This function is triggered when the master rule is updating. Information about the appchain before the pause is returned
so that the appchain can be restored when unpause is invoked.
func (*AppchainManager) RegisterAppchain ¶ added in v1.13.0
func (am *AppchainManager) RegisterAppchain(chainID string, chainName string, chainType string, trustRoot []byte, broker string, desc, masterRuleAddr, masterRuleUrl, adminAddrs, reason string) *boltvm.Response
=========== RegisterAppchain registers appchain info, returns proposal id and error
func (*AppchainManager) UnPauseAppchain ¶ added in v1.11.2
func (am *AppchainManager) UnPauseAppchain(id, lastStatus string) *boltvm.Response
=========== UnPauseAppchain restores to the state before the appchain was suspended This exist when the rule is update successsfully
func (*AppchainManager) UpdateAppchain ¶
func (am *AppchainManager) UpdateAppchain(id, name, desc string, trustRoot []byte, adminAddrs, reason string) *boltvm.Response
=========== UpdateAppchain updates appchain info.
type BxhValidators ¶ added in v1.0.1
type BxhValidators struct {
Addresses []string `json:"addresses"`
}
type ChainService ¶ added in v1.12.0
type ContractAddr ¶ added in v1.10.0
type ContractAddr struct {
Addr string `json:"addr"`
}
type Dapp ¶ added in v1.11.2
type Dapp struct { DappID string `json:"dapp_id"` // first owner address + num Name string `json:"name"` Type DappType `json:"type"` Desc string `json:"desc"` Url string `json:"url"` ContractAddr map[string]struct{} `json:"contract_addr"` Permission map[string]struct{} `json:"permission"` // users which are not allowed to see the dapp OwnerAddr string `json:"owner_addr"` CreateTime int64 `json:"create_time"` Score float64 `json:"score"` EvaluationRecords map[string]*governance.EvaluationRecord `json:"evaluation_records"` TransferRecords []*TransferRecord `json:"transfer_records"` Status governance.GovernanceStatus `json:"status"` FSM *fsm.FSM `json:"fsm"` }
func (*Dapp) IsAvailable ¶ added in v1.11.2
type DappManager ¶ added in v1.11.2
func (*DappManager) ActivateDapp ¶ added in v1.11.2
func (dm *DappManager) ActivateDapp(id, reason string) *boltvm.Response
=========== ActivateDapp activates frozen dapp
func (*DappManager) ConfirmTransfer ¶ added in v1.11.2
func (dm *DappManager) ConfirmTransfer(id string) *boltvm.Response
func (*DappManager) EvaluateDapp ¶ added in v1.11.2
func (dm *DappManager) EvaluateDapp(id, desc string, score float64) *boltvm.Response
func (*DappManager) FreezeDapp ¶ added in v1.11.2
func (dm *DappManager) FreezeDapp(id, reason string) *boltvm.Response
=========== FreezeDapp freezes dapp
func (*DappManager) GetAllDapps ¶ added in v1.11.2
func (dm *DappManager) GetAllDapps() *boltvm.Response
GetAllDapps returns all dapps
func (*DappManager) GetDapp ¶ added in v1.11.2
func (dm *DappManager) GetDapp(id string) *boltvm.Response
========================== Query interface ======================== GetDapp returns dapp info by dapp id
func (*DappManager) GetDappByName ¶ added in v1.16.0
func (dm *DappManager) GetDappByName(name string) *boltvm.Response
func (*DappManager) GetDappsByOwner ¶ added in v1.11.2
func (dm *DappManager) GetDappsByOwner(ownerAddr string) *boltvm.Response
get dApps by owner addr, including dApps a person currently owns and the dApps they once owned
func (*DappManager) GetPermissionAvailableDapps ¶ added in v1.11.2
func (dm *DappManager) GetPermissionAvailableDapps(caller string) *boltvm.Response
GetPermissionAvailableDapps returns the available DApp that the caller is allowed to call
func (*DappManager) GetPermissionDapps ¶ added in v1.11.2
func (dm *DappManager) GetPermissionDapps(caller string) *boltvm.Response
GetPermissionDapps returns all the DApp that the caller is allowed to call
func (*DappManager) IsAvailable ¶ added in v1.11.2
func (dm *DappManager) IsAvailable(dappID string) *boltvm.Response
func (*DappManager) Manage ¶ added in v1.11.2
func (dm *DappManager) Manage(eventTyp, proposalResult, lastStatus, objId string, extra []byte) *boltvm.Response
========================== Governance interface ======================== =========== Manage does some subsequent operations when the proposal is over extra: update - dapp info, transfer - transfer record, register - dapp
func (*DappManager) RegisterDapp ¶ added in v1.11.2
func (dm *DappManager) RegisterDapp(name, typ, desc, url, conAddrs, permits, reason string) *boltvm.Response
=========== RegisterDapp registers dapp info, returns proposal id and error
func (*DappManager) TransferDapp ¶ added in v1.11.2
func (dm *DappManager) TransferDapp(id, newOwnerAddr, reason string) *boltvm.Response
=========== TransferDapp transfers dapp
func (*DappManager) UpdateDapp ¶ added in v1.11.2
func (dm *DappManager) UpdateDapp(id, name, desc, url, conAddrs, permits, reason string) *boltvm.Response
=========== UpdateDapp updates dapp info.
type EthHeaderManager ¶ added in v1.10.0
func NewEthHeaderManager ¶ added in v1.10.0
func NewEthHeaderManager(ropstenOracle *appchain.EthLightChainOracle) *EthHeaderManager
func (*EthHeaderManager) CurrentBlockHeader ¶ added in v1.10.0
func (ehm *EthHeaderManager) CurrentBlockHeader() *boltvm.Response
func (*EthHeaderManager) GetBlockHeader ¶ added in v1.10.0
func (ehm *EthHeaderManager) GetBlockHeader(hash string) *boltvm.Response
func (*EthHeaderManager) GetEscrowAddr ¶ added in v1.10.0
func (ehm *EthHeaderManager) GetEscrowAddr(pierAddr string) *boltvm.Response
func (*EthHeaderManager) GetInterchainSwapAddr ¶ added in v1.10.0
func (ehm *EthHeaderManager) GetInterchainSwapAddr() *boltvm.Response
func (*EthHeaderManager) GetPrefixedHash ¶ added in v1.10.0
func (ehm *EthHeaderManager) GetPrefixedHash(hash string) *boltvm.Response
func (*EthHeaderManager) GetProxyAddr ¶ added in v1.11.0
func (ehm *EthHeaderManager) GetProxyAddr() *boltvm.Response
func (*EthHeaderManager) InsertBlockHeaders ¶ added in v1.10.0
func (ehm *EthHeaderManager) InsertBlockHeaders(headersData []byte) *boltvm.Response
func (*EthHeaderManager) Mint ¶ added in v1.10.0
func (ehm *EthHeaderManager) Mint(receiptData []byte, proofData []byte) *boltvm.Response
func (*EthHeaderManager) SetEscrowAddr ¶ added in v1.10.0
func (ehm *EthHeaderManager) SetEscrowAddr(pierAddr string, addr string) *boltvm.Response
func (*EthHeaderManager) SetInterchainSwapAddr ¶ added in v1.10.0
func (ehm *EthHeaderManager) SetInterchainSwapAddr(addr string) *boltvm.Response
func (*EthHeaderManager) SetProxyAddr ¶ added in v1.11.0
func (ehm *EthHeaderManager) SetProxyAddr(addr string) *boltvm.Response
type GovStrategy ¶ added in v1.18.0
func (*GovStrategy) GetAllProposalStrategy ¶ added in v1.18.0
func (g *GovStrategy) GetAllProposalStrategy() *boltvm.Response
func (*GovStrategy) GetProposalStrategy ¶ added in v1.18.0
func (g *GovStrategy) GetProposalStrategy(pt string) *boltvm.Response
func (*GovStrategy) Manage ¶ added in v1.18.0
func (g *GovStrategy) Manage(eventTyp, proposalResult, lastStatus, objId string, extra []byte) *boltvm.Response
=========== Manage does some subsequent operations when the proposal is over
func (*GovStrategy) UpdateAllProposalStrategy ¶ added in v1.18.0
func (g *GovStrategy) UpdateAllProposalStrategy(typ string, strategyExtra string, reason string) *boltvm.Response
update proposal strategy for a proposal type
func (*GovStrategy) UpdateProposalStrategy ¶ added in v1.18.0
func (g *GovStrategy) UpdateProposalStrategy(module string, typ string, strategyExtra string, reason string) *boltvm.Response
update proposal strategy for a proposal type
func (*GovStrategy) UpdateProposalStrategyByRolesChange ¶ added in v1.18.0
func (g *GovStrategy) UpdateProposalStrategyByRolesChange(availableNum uint64) *boltvm.Response
update proposal strategy for a proposal type
type Governance ¶ added in v1.6.0
func (*Governance) EndObjProposal ¶ added in v1.18.0
func (g *Governance) EndObjProposal(objId, endReason string, extra []byte) *boltvm.Response
=========== EndCurrentProposal forces proposals about an object to be ended and does not process other proposals associated with the proposal
func (*Governance) GetAgainst ¶ added in v1.6.0
func (g *Governance) GetAgainst(id string) *boltvm.Response
Get negative vote information
func (*Governance) GetAgainstNum ¶ added in v1.6.0
func (g *Governance) GetAgainstNum(id string) *boltvm.Response
Get the total number of negative votes
func (*Governance) GetApprove ¶ added in v1.6.0
func (g *Governance) GetApprove(id string) *boltvm.Response
Get affirmative vote information
func (*Governance) GetApproveNum ¶ added in v1.6.0
func (g *Governance) GetApproveNum(id string) *boltvm.Response
Get the total number of affirmative votes
func (*Governance) GetAvaliableElectorateNum ¶ added in v1.10.1
func (g *Governance) GetAvaliableElectorateNum(id string) *boltvm.Response
Get the number of total votes, include all votes cast and all votes not cast
func (*Governance) GetBallot ¶ added in v1.6.0
func (g *Governance) GetBallot(voterAddr, proposalId string) *boltvm.Response
========================== Query interface ========================
func (*Governance) GetNotClosedProposals ¶ added in v1.10.1
func (g *Governance) GetNotClosedProposals() *boltvm.Response
get proposal which is not closed (status is proposed or paused)
func (*Governance) GetPrimaryElectorateNum ¶ added in v1.10.1
func (g *Governance) GetPrimaryElectorateNum(id string) *boltvm.Response
Get the number of total votes, include all votes cast and all votes not cast
func (*Governance) GetProposal ¶ added in v1.6.0
func (g *Governance) GetProposal(id string) *boltvm.Response
GetProposal query proposal by id
func (*Governance) GetProposalsByFrom ¶ added in v1.6.0
func (g *Governance) GetProposalsByFrom(from string) *boltvm.Response
Query proposals by proposal type, returning a list of proposal for that type
func (*Governance) GetProposalsByObjId ¶ added in v1.8.0
func (g *Governance) GetProposalsByObjId(objId string) *boltvm.Response
Query proposals by the ID of the managed chain, returning a list of proposal for that type
func (*Governance) GetProposalsByObjIdInCreateTimeOrder ¶ added in v1.11.2
func (g *Governance) GetProposalsByObjIdInCreateTimeOrder(objId string) *boltvm.Response
Query proposals by the ID of the managed chain in create time order, returning a list of proposal for that type
func (*Governance) GetProposalsByStatus ¶ added in v1.6.0
func (g *Governance) GetProposalsByStatus(status string) *boltvm.Response
Query proposals based on proposal status, returning a list of proposal for that status
func (*Governance) GetProposalsByTyp ¶ added in v1.6.0
func (g *Governance) GetProposalsByTyp(typ string) *boltvm.Response
Query proposals by proposal type, returning a list of proposal for that type
func (*Governance) GetUnvote ¶ added in v1.6.0
func (g *Governance) GetUnvote(id string) *boltvm.Response
Get Unvoted information
func (*Governance) GetUnvoteNum ¶ added in v1.6.0
func (g *Governance) GetUnvoteNum(id string) *boltvm.Response
Get Unvoted information
func (*Governance) GetVoted ¶ added in v1.6.0
func (g *Governance) GetVoted(id string) *boltvm.Response
Get voted information
func (*Governance) GetVotedNum ¶ added in v1.6.0
func (g *Governance) GetVotedNum(id string) *boltvm.Response
Get the number of people who have voted
func (*Governance) LockLowPriorityProposal ¶ added in v1.13.0
func (g *Governance) LockLowPriorityProposal(objId, eventTyp string) *boltvm.Response
=========== LockLowPriorityProposal locks a proposed proposal for an object
func (*Governance) SubmitProposal ¶ added in v1.6.0
func (g *Governance) SubmitProposal(from, eventTyp, typ, objId, objLastStatus, reason string, extra []byte) *boltvm.Response
=========== SubmitProposal submits kinds of proposal
func (*Governance) UnLockLowPriorityProposal ¶ added in v1.13.0
func (g *Governance) UnLockLowPriorityProposal(objId, eventTyp string) *boltvm.Response
=========== UnLockLowPriorityProposal unlocks a suspended proposal for an object
func (*Governance) UpdateAvaliableElectorateNum ¶ added in v1.10.1
func (g *Governance) UpdateAvaliableElectorateNum(id string, num uint64) *boltvm.Response
=========== UpdateAvaliableElectorateNum updates AvaliableElectorateNum for a proposal, because of changes in the number of administrators available
func (*Governance) Vote ¶ added in v1.6.0
func (g *Governance) Vote(id, approve string, reason string) *boltvm.Response
=========== Vote add someone's voting information (each person can only vote once)
func (*Governance) WithdrawProposal ¶ added in v1.8.0
func (g *Governance) WithdrawProposal(id, reason string) *boltvm.Response
=========== WithdrawProposal withdraws the designated proposal
func (*Governance) ZeroPermission ¶ added in v1.18.0
func (g *Governance) ZeroPermission(id string) *boltvm.Response
type InterBroker ¶ added in v1.12.0
InterBroker manages all interchain ibtp meta data produced on relaychain, similar to broker contract on appchain.
func (*InterBroker) EmitInterchain ¶ added in v1.12.0
func (ib *InterBroker) EmitInterchain(fromServiceId, toServiceId, funcs, args, argsCb, argsRb string) *boltvm.Response
func (*InterBroker) GetCallbackMeta ¶ added in v1.12.0
func (ib *InterBroker) GetCallbackMeta() *boltvm.Response
GetCallbackMeta returns map[string]map[string]uint64
func (*InterBroker) GetInMessage ¶ added in v1.12.0
func (ib *InterBroker) GetInMessage(from, to string, index uint64) *boltvm.Response
func (*InterBroker) GetInMeta ¶ added in v1.12.0
func (ib *InterBroker) GetInMeta() *boltvm.Response
GetInMeta returns map[string]map[string]uint64
func (*InterBroker) GetOutMessage ¶ added in v1.12.0
func (ib *InterBroker) GetOutMessage(from, to string, index uint64) *boltvm.Response
func (*InterBroker) GetOutMeta ¶ added in v1.12.0
func (ib *InterBroker) GetOutMeta() *boltvm.Response
GetOutMeta returns map[string]map[string]uint64
func (*InterBroker) InvokeInterchain ¶ added in v1.12.0
func (ib *InterBroker) InvokeInterchain(input []byte) *boltvm.Response
func (*InterBroker) InvokeReceipt ¶ added in v1.14.0
func (ib *InterBroker) InvokeReceipt(input []byte) *boltvm.Response
type InterchainInvoke ¶ added in v1.14.0
type InterchainManager ¶
func (*InterchainManager) DeleteInterchain ¶
func (x *InterchainManager) DeleteInterchain(id string) *boltvm.Response
func (*InterchainManager) GetAllServiceIDs ¶ added in v1.15.0
func (x *InterchainManager) GetAllServiceIDs() *boltvm.Response
func (*InterchainManager) GetBitXHubID ¶ added in v1.13.0
func (x *InterchainManager) GetBitXHubID() *boltvm.Response
func (*InterchainManager) GetIBTPByID ¶
func (x *InterchainManager) GetIBTPByID(id string, isReq bool) *boltvm.Response
func (*InterchainManager) GetInterchain ¶ added in v1.0.1
func (x *InterchainManager) GetInterchain(id string) *boltvm.Response
GetInterchain returns information of the interchain count, Receipt count and SourceReceipt count by id
func (*InterchainManager) HandleIBTP ¶
func (x *InterchainManager) HandleIBTP(ibtp *pb.IBTP) *boltvm.Response
func (*InterchainManager) HandleIBTPData ¶ added in v1.12.0
func (x *InterchainManager) HandleIBTPData(input []byte) *boltvm.Response
func (*InterchainManager) ProcessIBTP ¶ added in v1.0.1
func (x *InterchainManager) ProcessIBTP(ibtp *pb.IBTP, interchain *pb.Interchain, isTargetFail bool) []byte
type NodeManager ¶ added in v1.10.0
type NodeManager struct { boltvm.Stub nodemgr.NodeManager }
func (*NodeManager) BindNode ¶ added in v1.16.0
func (nm *NodeManager) BindNode(nodeAccount, auditAdminAddr string) *boltvm.Response
=========== BindNode binds audit node to audit admin
func (*NodeManager) CountAvailableNodes ¶ added in v1.10.0
func (nm *NodeManager) CountAvailableNodes(nodeType string) *boltvm.Response
CountAvailableNodes counts all available node
func (*NodeManager) CountNodes ¶ added in v1.10.0
func (nm *NodeManager) CountNodes(nodeType string) *boltvm.Response
CountNodes counts all nodes
func (*NodeManager) GetNextVpID ¶ added in v1.16.0
func (nm *NodeManager) GetNextVpID() *boltvm.Response
========================== Query interface ========================
func (*NodeManager) GetNode ¶ added in v1.10.0
func (nm *NodeManager) GetNode(nodeAccount string) *boltvm.Response
GetNode returns node info by node id
func (*NodeManager) GetNvpNodeByName ¶ added in v1.16.0
func (nm *NodeManager) GetNvpNodeByName(nodeName string) *boltvm.Response
func (*NodeManager) GetVpNodeByPid ¶ added in v1.16.0
func (nm *NodeManager) GetVpNodeByPid(nodePid string) *boltvm.Response
func (*NodeManager) GetVpNodeByVpId ¶ added in v1.16.0
func (nm *NodeManager) GetVpNodeByVpId(nodeVpId string) *boltvm.Response
func (*NodeManager) IsAvailable ¶ added in v1.10.0
func (nm *NodeManager) IsAvailable(nodeAccount string) *boltvm.Response
IsAvailable returns whether the node is available
func (*NodeManager) LogoutNode ¶ added in v1.10.0
func (nm *NodeManager) LogoutNode(nodeAccount, reason string) *boltvm.Response
=========== LogoutNode logouts node Logout scenarios in different node states:
- unavailable: cannot log out without successfully registering
- registering: cannot log out without successfully registering
- available(vp) : logout if consensus conditions are met
- available(nvp) : logout according to the normal management process
- binding(only nvp): when submitting a proposal, 1. need to pause the proposal for the role registration or binding when proposal approved, if bound role is still registering or binding, 1. need to reject the proposal for the role registration or binding; 2. pause the role (going into the unavailable or frozen state) if bound role is forbidden, 1. need to reject the proposal for the role registration or binding; 2. pause the role (not change state) when proposal rejected, if bound role is still registering or binding, 1. need to restore the proposal for the role registration or binding if bound role is forbidden, 1. need to reject the proposal for the role registration or binding;
- binded(only nvp): when submitting a proposal, no additional operations when proposal approved, if bound role is available 1. need to pause the role (going into the frozen state) if bound role is forbidden 1. need to pause the role (not change state) when proposal rejected, if bound role is available, no additional operation if bound role is forbidden, unbind node
- updating(only nvp): when submitting a proposal, no additional operations when proposal approved, if bound role is available, 1. need to pause the role (going into the frozen state) if bound role is forbidden, 1. need to pause the role (not change state) when proposal rejected, if bound role is available, no additional operation if bound role is forbidden, unbind node
- logouting: logout cannot be logged out again
- forbidden: logout cannot be logged out again
func (*NodeManager) Manage ¶ added in v1.10.0
func (nm *NodeManager) Manage(eventTyp, proposalResult, lastStatus, objId string, extra []byte) *boltvm.Response
=========== Manage does some subsequent operations when the proposal is over other operation: - register - approve : register info - register - reject : free occupation info - update(only nvp) - approve : 1. update info; 2. if the bound audit admin is unavailable, need to unbind the node - update(only nvp) - reject : 1. free occupation info; 2. if the bound audit admin is unavailable, need to unbind the node - logout - approve - vp : post logout event - logout - reject - vp : no other operation - logout - approve - nvp : 1. reject the proposal for the role registration or binding if the bound audit admin has; 2. pause the role (going into the unavailable or frozen state) - logout - reject - nvp : 1. restore the proposal for the role registration or binding if the bound audit admin has; 2. if the bound audit admin is unavailable, need to unbind the node; 3. if the audit admin which would be bound is unavailable, need to reject binding proposal
func (*NodeManager) ManageBindNode ¶ added in v1.16.0
func (nm *NodeManager) ManageBindNode(nodeAccount, auditAdminAddr, resultEvent string) *boltvm.Response
func (*NodeManager) Nodes ¶ added in v1.10.0
func (nm *NodeManager) Nodes() *boltvm.Response
Nodes returns all nodes
func (*NodeManager) RegisterNode ¶ added in v1.10.0
func (nm *NodeManager) RegisterNode(nodeAccount, nodeType, nodePid string, nodeVpId uint64, nodeName, permitStr, reason string) *boltvm.Response
=========== RegisterNode registers node info, returns proposal id and error Only the unavailable state can be registered, need to occupy info such as the accout, name, pid
func (*NodeManager) UnbindNode ¶ added in v1.16.0
func (nm *NodeManager) UnbindNode(nodeAccount string) *boltvm.Response
=========== UnbindNode unbinds audit node with audit admin
func (*NodeManager) UpdateNode ¶ added in v1.16.0
func (nm *NodeManager) UpdateNode(nodeAccount, nodeName, permitStr, reason string) *boltvm.Response
=========== UpdateNode updates audit node
type Permission ¶ added in v1.6.1
type Permission string
type Proposal ¶ added in v1.6.0
type Proposal struct { Id string `json:"id"` Typ ProposalType `json:"typ"` Status ProposalStatus `json:"status"` ObjId string `json:"obj_id"` ObjLastStatus governance.GovernanceStatus `json:"obj_last_status"` // ballot information: voter address -> ballot BallotMap map[string]Ballot `json:"ballot_map"` ApproveNum uint64 `json:"approve_num"` AgainstNum uint64 `json:"against_num"` ElectorateList []*Role `json:"electorate_list"` InitialElectorateNum uint64 `json:"initial_electorate_num"` AvaliableElectorateNum uint64 `json:"avaliable_electorate_num"` ThresholdApproveNum uint64 `json:"threshold_approve_num"` EventType governance.EventType `json:"event_type"` EndReason EndReason `json:"end_reason"` LockProposalId string `json:"lock_proposal_id"` IsSpecial bool `json:"is_special"` IsSuperAdminVoted bool `json:"is_super_admin_voted"` SubmitReason string `json:"submit_reason"` WithdrawReason string `json:"withdraw_reason"` StrategyType ProposalStrategyType `json:"strategy_type"` StrategyExpression string `json:"strategy_expression"` CreateTime int64 `json:"create_time"` Extra []byte `json:"extra"` }
type ProposalStatus ¶ added in v1.6.0
type ProposalStatus string
type ProposalStrategy ¶ added in v1.6.0
type ProposalStrategy struct { Module string `json:"module"` Typ ProposalStrategyType `json:"typ"` Extra string `json:"extra"` Status governance.GovernanceStatus `json:"status"` FSM *fsm.FSM `json:"fsm"` }
type ProposalStrategyType ¶ added in v1.6.0
type ProposalStrategyType string
Proposal strategy ===============================================================
const ( SuperMajorityApprove ProposalStrategyType = repo.SuperMajorityApprove SuperMajorityAgainst ProposalStrategyType = repo.SuperMajorityAgainst SimpleMajority ProposalStrategyType = repo.SimpleMajority ZeroPermission ProposalStrategyType = repo.ZeroPermission )
type ProposalType ¶ added in v1.6.0
type ProposalType string
type Proposals ¶ added in v1.11.2
type Proposals []*Proposal
Others =============================================================
type RegisterAppchainInfo ¶ added in v1.15.0
type RegisterAppchainInfo struct { ChainInfo *appchainMgr.Appchain `json:"chain_info"` MasterRule *ruleMgr.Rule `json:"master_rule"` AdminAddrs string `json:"admin_addrs"` // comma-separated list of addresses }
type Role ¶
type Role struct { ID string `toml:"id" json:"id"` RoleType RoleType `toml:"role_type" json:"role_type"` // GovernanceAdmin info Weight uint64 `json:"weight" toml:"weight"` // AuditAdmin info NodeAccount string `toml:"node_account" json:"node_account"` // AppchainAdmin info AppchainID string `toml:"appchain_id" json:"appchain_id"` Status governance.GovernanceStatus `toml:"status" json:"status"` FSM *fsm.FSM `json:"fsm"` }
func (*Role) IsAvailable ¶ added in v1.13.0
type RoleManager ¶ added in v1.10.1
func (*RoleManager) ActivateRole ¶ added in v1.10.1
func (rm *RoleManager) ActivateRole(roleId, reason string) *boltvm.Response
=========== ActivateRole updates frozen role
func (*RoleManager) BindRole ¶ added in v1.16.0
func (rm *RoleManager) BindRole(roleId, nodeAccount, reason string) *boltvm.Response
=========== BindRole binds audit admin with audit node
func (*RoleManager) CheckOccupiedAccount ¶ added in v1.18.0
func (rm *RoleManager) CheckOccupiedAccount(account string) *boltvm.Response
func (*RoleManager) FreeAccount ¶ added in v1.16.0
func (rm *RoleManager) FreeAccount(addrs string) *boltvm.Response
func (*RoleManager) FreezeRole ¶ added in v1.10.1
func (rm *RoleManager) FreezeRole(roleId, reason string) *boltvm.Response
=========== FreezeRole freezes role
func (*RoleManager) GetAllRoles ¶ added in v1.13.0
func (rm *RoleManager) GetAllRoles() *boltvm.Response
GetAllRoles query all roles
func (*RoleManager) GetAppchainAdmin ¶ added in v1.13.0
func (rm *RoleManager) GetAppchainAdmin(appchainID string) *boltvm.Response
func (*RoleManager) GetRole ¶ added in v1.10.1
func (rm *RoleManager) GetRole() *boltvm.Response
GetRole return the role of the caller
func (*RoleManager) GetRoleByAddr ¶ added in v1.11.1
func (rm *RoleManager) GetRoleByAddr(addr string) *boltvm.Response
GetRole return the role of the addr
func (*RoleManager) GetRoleInfoById ¶ added in v1.13.0
func (rm *RoleManager) GetRoleInfoById(roleId string) *boltvm.Response
GetRoleInfoById query a role info by roleId
func (*RoleManager) GetRoleWeight ¶ added in v1.10.1
func (rm *RoleManager) GetRoleWeight(roleId string) *boltvm.Response
func (*RoleManager) GetRolesByType ¶ added in v1.13.0
func (rm *RoleManager) GetRolesByType(roleType string) *boltvm.Response
The role contract includes three role types currently : - "governanceAdmin" - "auditAdmin" - "appchainAdmin"
func (*RoleManager) IsAnyAdmin ¶ added in v1.11.1
func (rm *RoleManager) IsAnyAdmin(roleId, roleType string) *boltvm.Response
IsAdmin determines whether the role is GovernanceAdmin
func (*RoleManager) IsAnyAvailableAdmin ¶ added in v1.11.2
func (rm *RoleManager) IsAnyAvailableAdmin(roleId, roleType string) *boltvm.Response
IsAdmin determines whether the role is GovernanceAdmin
func (*RoleManager) IsAppchainAdmin ¶ added in v1.15.0
func (rm *RoleManager) IsAppchainAdmin(roleId, appchainId string) *boltvm.Response
IsAppchainAdmin determines whether the role is an appchain admin of the specifiec appchain admin 0 - false, 1 - true
func (*RoleManager) LogoutRole ¶ added in v1.10.1
func (rm *RoleManager) LogoutRole(roleId, reason string) *boltvm.Response
=========== LogoutRole logouts role Logout scenarios in different role states:
- unavailable/registering : cannot log out without successfully registering
- available (governance): when submitting a proposal, available state(available) to unavailable state(logouting), need to update role related proposal info when proposal is approved, unavailable state(logouting) to unavailable state(forbidden), no other operation when proposal is rejected, unavailable state(logouting) to available state(available), need to update role related proposal info
- available (audit) : when submitting a proposal, no other operation when proposal is approved, clear proposal, unbind bound node(if node is forbidden, not need to unbind) when proposal is rejected, if bound node is available, no other operation if bound node is forbidden, need to pause role(going to forzen state)
- freezing (only governance): when submitting a proposal, available state(freezing) to unavailable state(logouting), update role related proposal info when proposal is approved, unavailable state(logouting) to unavailable state(forbidden), no other operation when proposal is rejected, unavailable state(logouting) to available state(freezing), update role related proposal info
- activating (only governance): when submitting a proposal, unavailable state(activating) to unavailable state(logouting), no other operation when proposal is approved, unavailable state(logouting) to unavailable state(forbidden), no other operation when proposal is rejected, unavailable state(logouting) to unavailable state(activating), no other operation
- frozen (governance): when submitting a proposal, unavailable state(frozen) to unavailable state(logouting), no other operation when proposal is approved, unavailable state(logouting) to unavailable state(forbidden), no other operation when proposal is rejected, unavailable state(logouting) to unavailable state(frozen), no other operation
- frozen (audit): when submitting a proposal / proposal approved / proposal rejected, no bound node, no other operation
- binding (only audit) : when submitting a proposal, role binding proposal will be paused, no other operation when proposal is approved, clear proposal, role binding proposal will be rejected, no other operation when proposal is rejected, role binding proposal will be retored, if node is forbidden, need to rejected binding proposal
- logouting/forbidden: logout cannot be logged out again
func (*RoleManager) Manage ¶ added in v1.10.1
func (rm *RoleManager) Manage(eventTyp, proposalResult, lastStatus, objId string, extra []byte) *boltvm.Response
=========== Manage does some subsequent operations when the proposal is over extra: update - role info
func (*RoleManager) OccupyAccount ¶ added in v1.16.0
func (rm *RoleManager) OccupyAccount(addrs string, roleType string) *boltvm.Response
func (*RoleManager) PauseAuditAdmin ¶ added in v1.16.0
func (rm *RoleManager) PauseAuditAdmin(nodeId string) *boltvm.Response
=========== PauseAuditAdmin pause audit admin when the audit node which is bound or would be bound is not available 1. audit admin going to frozen 2. if there is proposal about the role, need to reject it
func (*RoleManager) PauseAuditAdminBinding ¶ added in v1.18.0
func (rm *RoleManager) PauseAuditAdminBinding(nodeId string) *boltvm.Response
=========== PauseAuditAdminBinding pause audit admin binding proposal when the audit node is logouting
func (*RoleManager) RegisterRole ¶ added in v1.10.1
func (rm *RoleManager) RegisterRole(roleId, roleType, nodeAccount, reason string) *boltvm.Response
=========== RegisterRole registers role info, returns proposal id and error
func (*RoleManager) RestoreAuditAdminBinding ¶ added in v1.18.0
func (rm *RoleManager) RestoreAuditAdminBinding(nodeId string) *boltvm.Response
=========== RestoreAuditAdminBinding restore audit admin binding proposal when the audit node logout proposal is end
func (*RoleManager) UpdateAppchainAdmin ¶ added in v1.15.0
func (rm *RoleManager) UpdateAppchainAdmin(appchainID string, adminAddrs string) *boltvm.Response
=========== UpdateAppchainAdmin update appchain admin Only called after the appchain registration proposal has been voted through The admin addrs are checked(format is valid and registrable) before the call
and is checked when submitting appchain register proposal
type RuleManager ¶
type RuleManager struct { boltvm.Stub ruleMgr.RuleManager }
RuleManager is the contract manage validation rules
func (*RuleManager) ClearRule ¶ added in v1.16.0
func (rm *RuleManager) ClearRule(chainID string) *boltvm.Response
=========== PauseRule pause the proposals about rule of one chain. The rules management module only has updated proposals, which in this case are actually paused proposals.
func (*RuleManager) CountAvailableRules ¶ added in v1.8.0
func (rm *RuleManager) CountAvailableRules(chainID string) *boltvm.Response
CountAvailableRules counts all available rules (should be 0 or 1)
func (*RuleManager) CountRules ¶ added in v1.8.0
func (rm *RuleManager) CountRules(chainID string) *boltvm.Response
CountRules counts all rules of a chain
func (*RuleManager) GetAllRules ¶ added in v1.15.0
func (rm *RuleManager) GetAllRules() *boltvm.Response
========================== Query interface ========================
func (*RuleManager) GetMasterRule ¶ added in v1.9.0
func (rm *RuleManager) GetMasterRule(chainID string) *boltvm.Response
GetRuleByAddr returns rule by appchain id and rule address
func (*RuleManager) GetRuleByAddr ¶ added in v1.8.0
func (rm *RuleManager) GetRuleByAddr(chainID, ruleAddr string) *boltvm.Response
GetRuleByAddr returns rule by appchain id and rule address
func (*RuleManager) HasMasterRule ¶ added in v1.13.0
func (rm *RuleManager) HasMasterRule(chainID string) *boltvm.Response
GetRuleByAddr returns rule by appchain id and rule address
func (*RuleManager) IsAvailableRule ¶ added in v1.8.0
func (rm *RuleManager) IsAvailableRule(chainID, ruleAddress string) *boltvm.Response
func (*RuleManager) LogoutRule ¶ added in v1.8.0
func (rm *RuleManager) LogoutRule(chainID string, ruleAddress string) *boltvm.Response
=========== LogoutRule logout the validation rule address with the chain id
func (*RuleManager) Manage ¶ added in v1.8.0
func (rm *RuleManager) Manage(eventTyp, proposalResult, lastStatus, chainRuleID string, extra []byte) *boltvm.Response
=========== Manage does some subsequent operations when the proposal is over Currently here are only update master rule events extra: update :UpdateMasterRuleInfo
func (*RuleManager) RegisterRule ¶
func (rm *RuleManager) RegisterRule(chainID string, ruleAddress, ruleUrl string) *boltvm.Response
=========== RegisterRule records the rule, and then automatically binds the rule if there is no master validation rule
func (*RuleManager) RegisterRuleFirst ¶ added in v1.15.0
func (rm *RuleManager) RegisterRuleFirst(chainID, chainType, ruleAddress, ruleUrl string) *boltvm.Response
=========== RegisterRuleFirst registers the default rule and binds the specified master rule Only called after the appchain registration proposal has been voted through The master rule is checked(has deployed if not default) before the call
and is checked when submitting appchain register proposal
func (*RuleManager) Rules ¶ added in v1.8.0
func (rm *RuleManager) Rules(chainID string) *boltvm.Response
Rules returns all rules of a chain
func (*RuleManager) UpdateMasterRule ¶ added in v1.9.0
func (rm *RuleManager) UpdateMasterRule(chainID string, newMasterruleAddress, reason string) *boltvm.Response
=========== UpdateMasterRule binds the validation rule address with the chain id and unbinds the master rule
type ServiceManager ¶ added in v1.12.0
type ServiceManager struct { boltvm.Stub servicemgr.ServiceManager }
func (*ServiceManager) ActivateService ¶ added in v1.13.0
func (sm *ServiceManager) ActivateService(chainServiceID, reason string) *boltvm.Response
=========== ActivateService activates frozen service
func (*ServiceManager) ClearChainService ¶ added in v1.16.0
func (sm *ServiceManager) ClearChainService(chainID string) *boltvm.Response
=========== ClearChainService clears services by chainID
func (*ServiceManager) EvaluateService ¶ added in v1.13.0
func (sm *ServiceManager) EvaluateService(chainServiceID, desc string, score float64) *boltvm.Response
func (*ServiceManager) FreezeService ¶ added in v1.13.0
func (sm *ServiceManager) FreezeService(chainServiceID, reason string) *boltvm.Response
=========== FreezeService freezes service
func (*ServiceManager) GetAllServices ¶ added in v1.13.0
func (sm *ServiceManager) GetAllServices() *boltvm.Response
GetAllServices returns all service
func (*ServiceManager) GetPermissionServices ¶ added in v1.13.0
func (sm *ServiceManager) GetPermissionServices(chainServiceId string) *boltvm.Response
GetPermissionServices returns all permission dapps
func (*ServiceManager) GetServiceByName ¶ added in v1.16.0
func (sm *ServiceManager) GetServiceByName(name string) *boltvm.Response
func (*ServiceManager) GetServiceInfo ¶ added in v1.12.0
func (sm *ServiceManager) GetServiceInfo(id string) *boltvm.Response
========================== Query interface ======================== GetServiceInfo returns Service info by service id
func (*ServiceManager) GetServicesByAppchainID ¶ added in v1.12.0
func (sm *ServiceManager) GetServicesByAppchainID(chainID string) *boltvm.Response
GetServicesByAppchainID return services of an appchain
func (*ServiceManager) GetServicesByType ¶ added in v1.14.0
func (sm *ServiceManager) GetServicesByType(typ string) *boltvm.Response
GetServicesByAppchainID return services of an appchain
func (*ServiceManager) IsAvailable ¶ added in v1.13.0
func (sm *ServiceManager) IsAvailable(id string) *boltvm.Response
func (*ServiceManager) LogoutService ¶ added in v1.13.0
func (sm *ServiceManager) LogoutService(chainServiceID, reason string) *boltvm.Response
=========== LogoutService logouts service
func (*ServiceManager) Manage ¶ added in v1.13.0
func (sm *ServiceManager) Manage(eventTyp, proposalResult, lastStatus, objId string, extra []byte) *boltvm.Response
========================== Governance interface ======================== =========== Manage does some subsequent operations when the proposal is over extra: update - service info,
func (*ServiceManager) PauseChainService ¶ added in v1.13.0
func (sm *ServiceManager) PauseChainService(chainID string) *boltvm.Response
=========== PauseChainService pauses services by chainID
func (*ServiceManager) RecordInvokeService ¶ added in v1.13.0
func (sm *ServiceManager) RecordInvokeService(fullServiceID, fromFullServiceID string, result bool) *boltvm.Response
func (*ServiceManager) RegisterService ¶ added in v1.13.0
func (sm *ServiceManager) RegisterService(chainID, serviceID, name, typ, intro string, ordered uint64, permits, details, reason string) *boltvm.Response
=========== RegisterService registers service info, returns proposal id and error
func (*ServiceManager) UnPauseChainService ¶ added in v1.13.0
func (sm *ServiceManager) UnPauseChainService(chainID string) *boltvm.Response
=========== UnPauseChainService resumes suspended services by chain id
func (*ServiceManager) UpdateService ¶ added in v1.13.0
func (sm *ServiceManager) UpdateService(chainServiceID, name, intro, permits, details, reason string) *boltvm.Response
=========== UpdateService updates service info. updata permits does not need proposal
type StatusChange ¶ added in v1.15.0
type StatusChange struct { PrevStatus pb.TransactionStatus CurStatus pb.TransactionStatus OtherIBTPIDs []string }
func (*StatusChange) NotifyFlags ¶ added in v1.15.0
func (c *StatusChange) NotifyFlags() (bool, bool)
type TransactionEvent ¶ added in v1.15.0
type TransactionEvent string
const ( TransactionEvent_BEGIN TransactionEvent = "begin" TransactionEvent_BEGIN_FAILURE TransactionEvent = "begin_failure" TransactionEvent_TIMEOUT TransactionEvent = "timeout" TransactionEvent_FAILURE TransactionEvent = "failure" TransactionEvent_SUCCESS TransactionEvent = "success" TransactionEvent_ROLLBACK TransactionEvent = "rollback" TransactionState_INIT = "init" )
func (TransactionEvent) String ¶ added in v1.15.0
func (e TransactionEvent) String() string
type TransactionInfo ¶ added in v1.0.1
type TransactionInfo struct { GlobalState pb.TransactionStatus Height uint64 ChildTxInfo map[string]pb.TransactionStatus ChildTxCount uint64 }
type TransactionManager ¶ added in v1.0.1
func (*TransactionManager) BeginMultiTXs ¶ added in v1.0.1
type TransferRecord ¶ added in v1.11.2
type TrustChain ¶ added in v1.12.0
func (*TrustChain) AddTrustMeta ¶ added in v1.12.0
func (t *TrustChain) AddTrustMeta(data []byte) *boltvm.Response
func (*TrustChain) GetTrustMeta ¶ added in v1.12.0
func (t *TrustChain) GetTrustMeta(key []byte) *boltvm.Response
type UpdateAppchainInfo ¶ added in v1.15.0
type UpdateAppchainInfo struct { Name UpdateInfo `json:"name"` Desc UpdateInfo `json:"desc"` TrustRoot UpdateInfo `json:"trust_root"` AdminAddrs UpdateInfo `json:"admin_addrs"` }
type UpdateDappInfo ¶ added in v1.11.2
type UpdateDappInfo struct { DappName UpdateInfo `json:"dapp_name"` Desc UpdateInfo `json:"desc"` Url UpdateInfo `json:"url"` ContractAddr UpdateMapInfo `json:"contract_addr"` Permission UpdateMapInfo `json:"permission"` }
type UpdateInfo ¶ added in v1.11.2
type UpdateInfo struct { OldInfo interface{} NewInfo interface{} IsEdit bool }
type UpdateMapInfo ¶ added in v1.11.2
type UpdateMasterRuleInfo ¶ added in v1.11.2
type UpdateNodeInfo ¶ added in v1.16.0
type UpdateNodeInfo struct { NodeName UpdateInfo `json:"node_name"` Permission UpdateMapInfo `json:"permission"` }
type UpdateServiceInfo ¶ added in v1.15.0
type UpdateServiceInfo struct { ServiceName UpdateInfo `json:"service_name"` Intro UpdateInfo `json:"intro"` Details UpdateInfo `json:"details"` Permission UpdateMapInfo `json:"permission"` }
type UpdateStrategyInfo ¶ added in v1.18.0
type UpdateStrategyInfo struct { Typ UpdateInfo `json:"typ"` Extra UpdateInfo `json:"extra"` }