Documentation ¶
Index ¶
- Constants
- Variables
- func AppchainKey(id string) string
- func AssetExchangeKey(id string) string
- func EthTxKey(hash string) string
- func ProposalKey(id string) string
- func RuleKey(id string) string
- type AppchainManager
- func (am *AppchainManager) ActivateAppchain(id string) *boltvm.Response
- func (am *AppchainManager) Appchains() *boltvm.Response
- func (am *AppchainManager) CountAppchains() *boltvm.Response
- func (am *AppchainManager) CountAvailableAppchains() *boltvm.Response
- func (am *AppchainManager) DeleteAppchain(toDeleteMethod string) *boltvm.Response
- func (am *AppchainManager) FreezeAppchain(id string) *boltvm.Response
- func (am *AppchainManager) GetAppchain(id string) *boltvm.Response
- func (am *AppchainManager) GetIdByAddr(addr string) *boltvm.Response
- func (am *AppchainManager) GetPubKeyByChainID(id string) *boltvm.Response
- func (am *AppchainManager) IsAdmin() *boltvm.Response
- func (am *AppchainManager) IsAppchainAdmin() *boltvm.Response
- func (am *AppchainManager) IsAvailable(chainId string) *boltvm.Response
- func (am *AppchainManager) LogoutAppchain(id string) *boltvm.Response
- func (am *AppchainManager) Manage(eventTyp string, proposalResult, lastStatus string, extra []byte) *boltvm.Response
- func (am *AppchainManager) Register(method string, docAddr, docHash, validators string, ...) *boltvm.Response
- func (am *AppchainManager) UpdateAppchain(id, docAddr, docHash, validators string, ...) *boltvm.Response
- type AssetExchange
- type AssetExchangeRecord
- type AssetExchangeStatus
- type AssetExchangeType
- type Ballot
- type BxhValidators
- type ContractAddr
- 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) IsAdmin() *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 Governance
- 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) GetDes(id 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) GetProposalStrategy(pt string) *boltvm.Response
- func (g *Governance) GetProposalStrategyType(pt string) *boltvm.Response
- func (g *Governance) GetProposalsByFrom(from string) *boltvm.Response
- func (g *Governance) GetProposalsByObjId(objId string) *boltvm.Response
- func (g *Governance) GetProposalsByStatus(status string) *boltvm.Response
- func (g *Governance) GetProposalsByTyp(typ string) *boltvm.Response
- func (g *Governance) GetStatus(id string) *boltvm.Response
- func (g *Governance) GetThresholdNum(id string) *boltvm.Response
- func (g *Governance) GetTyp(id 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) NewProposalStrategy(typ string, participateThreshold float64, extra []byte) *boltvm.Response
- func (g *Governance) SetProposalStrategy(pt string, psData []byte) *boltvm.Response
- func (g *Governance) SubmitProposal(from, eventTyp, des, typ, objId, objLastStatus string, extra []byte) *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 string) *boltvm.Response
- type InterRelayBroker
- func (ibroker *InterRelayBroker) GetInCouterMap() *boltvm.Response
- func (ibroker *InterRelayBroker) GetOutCouterMap() *boltvm.Response
- func (ibroker *InterRelayBroker) GetOutMessage(destChain string, index uint64) *boltvm.Response
- func (ibroker *InterRelayBroker) GetOutMessageMap() *boltvm.Response
- func (ibroker *InterRelayBroker) IncInCounter(from string) *boltvm.Response
- func (ibroker *InterRelayBroker) InvokeInterRelayContract(addr string, fun string, args []byte) *boltvm.Response
- func (ibroker *InterRelayBroker) RecordIBTPs(ibtpsBytes []byte) *boltvm.Response
- type InterchainManager
- func (x *InterchainManager) DeleteInterchain(id string) *boltvm.Response
- func (x *InterchainManager) GetIBTPByID(id string) *boltvm.Response
- func (x *InterchainManager) GetInterchain(id string) *boltvm.Response
- func (x *InterchainManager) HandleIBTP(ibtp *pb.IBTP) *boltvm.Response
- func (x *InterchainManager) Interchain(method string) *boltvm.Response
- func (x *InterchainManager) ProcessIBTP(ibtp *pb.IBTP, interchain *pb.Interchain)
- func (x *InterchainManager) Register(method string) *boltvm.Response
- type NodeManager
- func (nm *NodeManager) CountAvailableNodes(nodeType string) *boltvm.Response
- func (nm *NodeManager) CountNodes(nodeType string) *boltvm.Response
- func (nm *NodeManager) GetNode(nodePid string) *boltvm.Response
- func (nm *NodeManager) IsAvailable(nodePid string) *boltvm.Response
- func (nm *NodeManager) LogoutNode(nodePid string) *boltvm.Response
- func (nm *NodeManager) Manage(eventTyp string, proposalResult, lastStatus string, extra []byte) *boltvm.Response
- func (nm *NodeManager) Nodes(nodeType string) *boltvm.Response
- func (nm *NodeManager) RegisterNode(nodePid string, nodeVpId uint64, nodeAccount, nodeType string) *boltvm.Response
- type Permission
- type Proposal
- type ProposalStatus
- type ProposalStrategy
- type ProposalStrategyType
- type ProposalType
- type Role
- type RoleManager
- func (rm *RoleManager) ActivateRole(roleId string) *boltvm.Response
- func (rm *RoleManager) CheckPermission(permission string, regulatedAddr string, regulatorAddr string, ...) *boltvm.Response
- func (rm *RoleManager) FreezeRole(roleId string) *boltvm.Response
- func (rm *RoleManager) GetAdminRoles() *boltvm.Response
- func (rm *RoleManager) GetAuditAdminRoles() *boltvm.Response
- func (rm *RoleManager) GetAvailableRoles(roleTypesData []byte) *boltvm.Response
- func (rm *RoleManager) GetRole() *boltvm.Response
- func (rm *RoleManager) GetRoleById(roleId string) *boltvm.Response
- func (rm *RoleManager) GetRoleWeight(roleId string) *boltvm.Response
- func (rm *RoleManager) IsAdmin(roleId string) *boltvm.Response
- func (rm *RoleManager) IsAuditAdmin(roleId string) *boltvm.Response
- func (rm *RoleManager) IsAvailable(roleId string) *boltvm.Response
- func (rm *RoleManager) IsSuperAdmin(roleId string) *boltvm.Response
- func (rm *RoleManager) LogoutRole(roleId string) *boltvm.Response
- func (rm *RoleManager) Manage(eventTyp string, proposalResult, lastStatus string, extra []byte) *boltvm.Response
- func (rm *RoleManager) RegisterRole(roleId, roleType, nodePid string) *boltvm.Response
- func (rm *RoleManager) UpdateAuditAdminNode(roleId, nodePid string) *boltvm.Response
- type RoleType
- type RuleManager
- func (rm *RuleManager) CountAvailableRules(chainId string) *boltvm.Response
- func (rm *RuleManager) CountRules(chainId string) *boltvm.Response
- func (rm *RuleManager) DefaultRule(chainId string, ruleAddress string) *boltvm.Response
- func (rm *RuleManager) GetAvailableRuleAddr(chainId string) *boltvm.Response
- func (rm *RuleManager) GetMasterRule(chainId string) *boltvm.Response
- func (rm *RuleManager) GetRuleByAddr(chainId, ruleAddr 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 string, proposalResult, lastStatus string, extra []byte) *boltvm.Response
- func (rm *RuleManager) RegisterRule(chainId string, ruleAddress string) *boltvm.Response
- func (rm *RuleManager) Rules(chainId string) *boltvm.Response
- func (rm *RuleManager) UpdateMasterRule(chainId string, newMasterruleAddress string) *boltvm.Response
- type Store
- type TransactionInfo
- type TransactionManager
- func (t *TransactionManager) Begin(txId string) *boltvm.Response
- func (t *TransactionManager) BeginMultiTXs(globalId string, childTxIds ...string) *boltvm.Response
- func (t *TransactionManager) GetStatus(txId string) *boltvm.Response
- func (t *TransactionManager) Report(txId string, result int32) *boltvm.Response
Constants ¶
const ( EscrowsAddrKey = "escrows_addr_key" InterchainSwapAddrKey = "interchain_swap_addr_key" ProxyAddrKey = "proxy_addr_key" EthTxHashPrefix = "eth-hash" )
const ( PROPOSAL_PREFIX = "proposal-" AppchainMgr ProposalType = "AppchainMgr" RuleMgr ProposalType = "RuleMgr" NodeMgr ProposalType = "NodeMgr" ServiceMgr ProposalType = "ServiceMgr" RoleMgr ProposalType = "RoleMgr" ProposalStrategyMgr ProposalType = "ProposalStrategyMgr" PROPOSED ProposalStatus = "proposed" APPOVED ProposalStatus = "approve" REJECTED ProposalStatus = "reject" PAUSED ProposalStatus = "pause" BallotApprove = "approve" BallotReject = "reject" NormalReason EndReason = "end of normal voting" WithdrawnReason EndReason = "withdrawn by the proposal sponsor" PriorityReason EndReason = "forced shut down by a high-priority proposal" ElectorateReason EndReason = "not enough valid electorate" )
const ( CurAppchainNotAvailable = "current appchain not available" TargetAppchainNotAvailable = "target appchain not available" AppchainNotAvailable = "the appchain is not available" InvalidIBTP = "invalid ibtp" )
const ( InCounterKey = "InCounter" OutCounterKey = "OutCounter" InMessageKey = "InMessage" OutMessageKey = "OutMessage" Locked = true )
const MinimumVPNode = 4
const PREFIX = "tx-"
Variables ¶
var RoleAvailableState = []governance.GovernanceStatus{ governance.GovernanceAvailable, governance.GovernanceUpdating, governance.GovernanceFreezing, governance.GovernanceLogouting, }
var SpecialProposalEventType = []governance.EventType{ governance.EventFreeze, governance.EventActivate, governance.EventLogout, }
var SpecialProposalProposalType = []ProposalType{ RoleMgr, ProposalStrategyMgr, }
Functions ¶
func AppchainKey ¶ added in v1.0.1
func AssetExchangeKey ¶ added in v1.0.1
func ProposalKey ¶ added in v1.6.0
Key ====================================================================
Types ¶
type AppchainManager ¶
type AppchainManager struct { boltvm.Stub appchainMgr.AppchainManager }
func (*AppchainManager) ActivateAppchain ¶ added in v1.6.1
func (am *AppchainManager) ActivateAppchain(id string) *boltvm.Response
ActivateAppchain updates freezing 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 approved, rejected or registered
func (*AppchainManager) CountAvailableAppchains ¶ added in v1.6.0
func (am *AppchainManager) CountAvailableAppchains() *boltvm.Response
CountAvailableAppchains counts all available appchains
func (*AppchainManager) DeleteAppchain ¶
func (am *AppchainManager) DeleteAppchain(toDeleteMethod string) *boltvm.Response
func (*AppchainManager) FreezeAppchain ¶ added in v1.6.1
func (am *AppchainManager) FreezeAppchain(id string) *boltvm.Response
FreezeAppchain freezes available appchain
func (*AppchainManager) GetAppchain ¶
func (am *AppchainManager) GetAppchain(id string) *boltvm.Response
GetAppchain returns appchain info by appchain id
func (*AppchainManager) GetIdByAddr ¶ added in v1.9.0
func (am *AppchainManager) GetIdByAddr(addr string) *boltvm.Response
func (*AppchainManager) GetPubKeyByChainID ¶
func (am *AppchainManager) GetPubKeyByChainID(id string) *boltvm.Response
GetPubKeyByChainID can get aim chain's public key using aim chain ID
func (*AppchainManager) IsAdmin ¶
func (am *AppchainManager) IsAdmin() *boltvm.Response
func (*AppchainManager) IsAppchainAdmin ¶ added in v1.9.0
func (am *AppchainManager) IsAppchainAdmin() *boltvm.Response
GetAppchain returns appchain info by appchain id
func (*AppchainManager) IsAvailable ¶ added in v1.6.1
func (am *AppchainManager) IsAvailable(chainId string) *boltvm.Response
func (*AppchainManager) LogoutAppchain ¶ added in v1.6.1
func (am *AppchainManager) LogoutAppchain(id string) *boltvm.Response
LogoutAppchain updates available appchain
func (*AppchainManager) Manage ¶ added in v1.8.0
func (am *AppchainManager) Manage(eventTyp string, proposalResult, lastStatus string, extra []byte) *boltvm.Response
extra: appchainMgr.Appchain
func (*AppchainManager) Register ¶
func (am *AppchainManager) Register(method string, docAddr, docHash, validators string, consensusType, chainType, name, desc, version, pubkey string) *boltvm.Response
Register registers appchain info caller is the appchain manager address return appchain id, proposal id and error
func (*AppchainManager) UpdateAppchain ¶
func (am *AppchainManager) UpdateAppchain(id, docAddr, docHash, validators string, consensusType, chainType, name, desc, version, pubkey string) *boltvm.Response
UpdateAppchain updates available appchain
type AssetExchange ¶ added in v1.0.1
func (*AssetExchange) GetStatus ¶ added in v1.0.1
func (t *AssetExchange) GetStatus(id string) *boltvm.Response
func (*AssetExchange) Init ¶ added in v1.0.1
func (t *AssetExchange) Init(from, to string, info []byte) *boltvm.Response
type AssetExchangeRecord ¶ added in v1.0.1
type AssetExchangeRecord struct { Chain0 string Chain1 string Status AssetExchangeStatus Info pb.AssetExchangeInfo }
type AssetExchangeStatus ¶ added in v1.0.1
type AssetExchangeStatus uint64
const ( ASSET_PREFIX = "asset-" AssetExchangeInit AssetExchangeStatus = 0 AssetExchangeRedeem AssetExchangeStatus = 1 AssetExchangeRefund AssetExchangeStatus = 2 )
type AssetExchangeType ¶ added in v1.0.1
type AssetExchangeType uint64
type BxhValidators ¶ added in v1.0.1
type BxhValidators struct {
Addresses []string `json:"addresses"`
}
type ContractAddr ¶ added in v1.10.0
type ContractAddr struct {
Addr string `json:"addr"`
}
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) IsAdmin ¶ added in v1.10.0
func (ehm *EthHeaderManager) IsAdmin() *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 Governance ¶ added in v1.6.0
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
func (*Governance) GetDes ¶ added in v1.6.0
func (g *Governance) GetDes(id string) *boltvm.Response
Get proposal description information
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) GetProposalStrategy ¶ added in v1.6.0
func (g *Governance) GetProposalStrategy(pt string) *boltvm.Response
func (*Governance) GetProposalStrategyType ¶ added in v1.6.0
func (g *Governance) GetProposalStrategyType(pt string) *boltvm.Response
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) 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) GetStatus ¶ added in v1.6.0
func (g *Governance) GetStatus(id string) *boltvm.Response
Get proposal status
func (*Governance) GetThresholdNum ¶ added in v1.6.0
func (g *Governance) GetThresholdNum(id string) *boltvm.Response
Get the minimum number of votes required for the current voting strategy
func (*Governance) GetTyp ¶ added in v1.6.0
func (g *Governance) GetTyp(id string) *boltvm.Response
Get Proposal 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) NewProposalStrategy ¶ added in v1.6.0
func (*Governance) SetProposalStrategy ¶ added in v1.6.0
func (g *Governance) SetProposalStrategy(pt string, psData []byte) *boltvm.Response
set proposal strategy for a proposal type
func (*Governance) SubmitProposal ¶ added in v1.6.0
func (g *Governance) SubmitProposal(from, eventTyp, des, typ, objId, objLastStatus string, extra []byte) *boltvm.Response
func (*Governance) UpdateAvaliableElectorateNum ¶ added in v1.10.1
func (g *Governance) UpdateAvaliableElectorateNum(id string, num uint64) *boltvm.Response
Get the number of total votes, include all votes cast and all votes not cast
func (*Governance) Vote ¶ added in v1.6.0
func (g *Governance) Vote(id, approve string, reason string) *boltvm.Response
Add someone's voting information (each person can only vote once)
func (*Governance) WithdrawProposal ¶ added in v1.8.0
func (g *Governance) WithdrawProposal(id string) *boltvm.Response
Withdraw the proposal
type InterRelayBroker ¶ added in v1.5.0
InterRelayBroker manages all interchain ibtp meta data produced on relaychain, similar to broker contract on appchain.
func (*InterRelayBroker) GetInCouterMap ¶ added in v1.5.0
func (ibroker *InterRelayBroker) GetInCouterMap() *boltvm.Response
GetInCouterMap .
func (*InterRelayBroker) GetOutCouterMap ¶ added in v1.5.0
func (ibroker *InterRelayBroker) GetOutCouterMap() *boltvm.Response
GetOutCouterMap gets an index map, which implicates the greatest index of
func (*InterRelayBroker) GetOutMessage ¶ added in v1.5.0
func (ibroker *InterRelayBroker) GetOutMessage(destChain string, index uint64) *boltvm.Response
GetOutMessage returns interchain ibtp by index and target chain_id
func (*InterRelayBroker) GetOutMessageMap ¶ added in v1.5.0
func (ibroker *InterRelayBroker) GetOutMessageMap() *boltvm.Response
GetOutMessageMap returns interchain-message(ibtp) map
func (*InterRelayBroker) IncInCounter ¶ added in v1.5.0
func (ibroker *InterRelayBroker) IncInCounter(from string) *boltvm.Response
IncInCounter increases InCounter[from] by once
func (*InterRelayBroker) InvokeInterRelayContract ¶ added in v1.5.0
func (ibroker *InterRelayBroker) InvokeInterRelayContract(addr string, fun string, args []byte) *boltvm.Response
InvokeInterRelayContract receives inter-relaychain execution call and invokes
func (*InterRelayBroker) RecordIBTPs ¶ added in v1.5.0
func (ibroker *InterRelayBroker) RecordIBTPs(ibtpsBytes []byte) *boltvm.Response
RecordIBTPs receives ibtps, adds index for them, and stores in counter and message maps, called by inter-relaychain ibtp producer contracts
type InterchainManager ¶
func (*InterchainManager) DeleteInterchain ¶
func (x *InterchainManager) DeleteInterchain(id string) *boltvm.Response
func (*InterchainManager) GetIBTPByID ¶
func (x *InterchainManager) GetIBTPByID(id string) *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) Interchain ¶
func (x *InterchainManager) Interchain(method string) *boltvm.Response
Interchain returns information of the interchain count, Receipt count and SourceReceipt count
func (*InterchainManager) ProcessIBTP ¶ added in v1.0.1
func (x *InterchainManager) ProcessIBTP(ibtp *pb.IBTP, interchain *pb.Interchain)
type NodeManager ¶ added in v1.10.0
type NodeManager struct { boltvm.Stub node_mgr.NodeManager }
func (*NodeManager) CountAvailableNodes ¶ added in v1.10.0
func (nm *NodeManager) CountAvailableNodes(nodeType string) *boltvm.Response
CountAvailableVPNodes 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) GetNode ¶ added in v1.10.0
func (nm *NodeManager) GetNode(nodePid string) *boltvm.Response
GetNode returns node info by node id
func (*NodeManager) IsAvailable ¶ added in v1.10.0
func (nm *NodeManager) IsAvailable(nodePid string) *boltvm.Response
IsAvailable returns whether the node is available
func (*NodeManager) LogoutNode ¶ added in v1.10.0
func (nm *NodeManager) LogoutNode(nodePid string) *boltvm.Response
LogoutNode logout available node
func (*NodeManager) Manage ¶ added in v1.10.0
func (nm *NodeManager) Manage(eventTyp string, proposalResult, lastStatus string, extra []byte) *boltvm.Response
extra: nodeMgr.Node
func (*NodeManager) Nodes ¶ added in v1.10.0
func (nm *NodeManager) Nodes(nodeType string) *boltvm.Response
Nodes returns all nodes
func (*NodeManager) RegisterNode ¶ added in v1.10.0
func (nm *NodeManager) RegisterNode(nodePid string, nodeVpId uint64, nodeAccount, nodeType string) *boltvm.Response
Register registers node info caller is the bitxhub admin address return node pid, proposal id and error
type Permission ¶ added in v1.6.1
type Permission string
Permission manager
const ( PermissionSelf Permission = "PermissionSelf" PermissionAdmin Permission = "PermissionAdmin" PermissionSelfAdmin Permission = "PermissionSelfAdmin" PermissionSpecific Permission = "PermissionSpecific" )
type Proposal ¶ added in v1.6.0
type Proposal struct { Id string `json:"id"` Des string `json:"des"` 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"` ThresholdElectorateNum uint64 `json:"threshold_electorate_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"` 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 { Typ ProposalStrategyType `json:"typ"` // The minimum participation threshold. // Only when the number of voting participants reaches this proportion, // the proposal will take effect. That is, the proposal can be judged // according to the voting situation. ParticipateThreshold float64 `json:"participate_threshold"` Extra []byte `json:"extra"` }
type ProposalStrategyType ¶ added in v1.6.0
type ProposalStrategyType string
const ( SuperMajorityApprove ProposalStrategyType = "SuperMajorityApprove" SuperMajorityAgainst ProposalStrategyType = "SuperMajorityAgainst" SimpleMajority ProposalStrategyType = "SimpleMajority" )
type ProposalType ¶ added in v1.6.0
type ProposalType string
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 NodePid string `toml:"pid" json:"pid"` Status governance.GovernanceStatus `toml:"status" json:"status"` FSM *fsm.FSM `json:"fsm"` }
type RoleManager ¶ added in v1.10.1
func (*RoleManager) ActivateRole ¶ added in v1.10.1
func (rm *RoleManager) ActivateRole(roleId string) *boltvm.Response
ActivateRole updates frozen role
func (*RoleManager) CheckPermission ¶ added in v1.10.1
func (*RoleManager) FreezeRole ¶ added in v1.10.1
func (rm *RoleManager) FreezeRole(roleId string) *boltvm.Response
FreezeRole freezes available role
func (*RoleManager) GetAdminRoles ¶ added in v1.10.1
func (rm *RoleManager) GetAdminRoles() *boltvm.Response
func (*RoleManager) GetAuditAdminRoles ¶ added in v1.10.1
func (rm *RoleManager) GetAuditAdminRoles() *boltvm.Response
func (*RoleManager) GetAvailableRoles ¶ added in v1.10.1
func (rm *RoleManager) GetAvailableRoles(roleTypesData []byte) *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) GetRoleById ¶ added in v1.10.1
func (rm *RoleManager) GetRoleById(roleId string) *boltvm.Response
GetRole query a role by roleId
func (*RoleManager) GetRoleWeight ¶ added in v1.10.1
func (rm *RoleManager) GetRoleWeight(roleId string) *boltvm.Response
func (*RoleManager) IsAdmin ¶ added in v1.10.1
func (rm *RoleManager) IsAdmin(roleId string) *boltvm.Response
IsAdmin determines whether the role is GovernanceAdmin
func (*RoleManager) IsAuditAdmin ¶ added in v1.10.1
func (rm *RoleManager) IsAuditAdmin(roleId string) *boltvm.Response
IsAdmin determines whether the role is Audit Admin
func (*RoleManager) IsAvailable ¶ added in v1.10.1
func (rm *RoleManager) IsAvailable(roleId string) *boltvm.Response
IsAvailable determines whether the role is available
func (*RoleManager) IsSuperAdmin ¶ added in v1.10.1
func (rm *RoleManager) IsSuperAdmin(roleId string) *boltvm.Response
IsSuperAdmin determines whether the role is super GovernanceAdmin
func (*RoleManager) LogoutRole ¶ added in v1.10.1
func (rm *RoleManager) LogoutRole(roleId string) *boltvm.Response
LogoutRole logout role
func (*RoleManager) Manage ¶ added in v1.10.1
func (rm *RoleManager) Manage(eventTyp string, proposalResult, lastStatus string, extra []byte) *boltvm.Response
extra: Role
func (*RoleManager) RegisterRole ¶ added in v1.10.1
func (rm *RoleManager) RegisterRole(roleId, roleType, nodePid string) *boltvm.Response
Register registers role info caller is the bitxhub admin address return role id proposal id and error
func (*RoleManager) UpdateAuditAdminNode ¶ added in v1.10.1
func (rm *RoleManager) UpdateAuditAdminNode(roleId, nodePid string) *boltvm.Response
UpdateAuditAdminNode updates nodeId of nvp role
type RuleManager ¶
type RuleManager struct { boltvm.Stub ruleMgr.RuleManager }
RuleManager is the contract manage validation rules
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) DefaultRule ¶ added in v1.9.0
func (rm *RuleManager) DefaultRule(chainId string, ruleAddress string) *boltvm.Response
DefaultRule automatically adds default rules to the appchain after the appchain is registered successfully DefaultRule Adds default rules automatically. The rule will automatically bound if there is no master rule currently. All processes do not require vote. Possible situations: - Default validation rules are automatically added after successful application chain registration - It may be necessary to restore the identity of the master rule if it fails to freeze or logout
func (*RuleManager) GetAvailableRuleAddr ¶ added in v1.8.0
func (rm *RuleManager) GetAvailableRuleAddr(chainId string) *boltvm.Response
GetAvailableRuleAddr returns available rule address by appchain id and rule address
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) 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 string, proposalResult, lastStatus string, extra []byte) *boltvm.Response
extra: ruleMgr.rule
func (*RuleManager) RegisterRule ¶
func (rm *RuleManager) RegisterRule(chainId string, ruleAddress string) *boltvm.Response
Register records the rule, and then automatically binds the rule if there is no master validation rule
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 string) *boltvm.Response
BindRule binds the validation rule address with the chain id
type TransactionInfo ¶ added in v1.0.1
type TransactionInfo struct { GlobalState pb.TransactionStatus ChildTxInfo map[string]pb.TransactionStatus }
type TransactionManager ¶ added in v1.0.1
func (*TransactionManager) Begin ¶ added in v1.0.1
func (t *TransactionManager) Begin(txId string) *boltvm.Response
func (*TransactionManager) BeginMultiTXs ¶ added in v1.0.1
func (t *TransactionManager) BeginMultiTXs(globalId string, childTxIds ...string) *boltvm.Response