Documentation ¶
Index ¶
- Constants
- func ApproveCandidate(native *native.NativeService) ([]byte, error)
- func BlackNode(native *native.NativeService) ([]byte, error)
- func CheckConsensusSigns(native *native.NativeService, method string, input []byte, ...) (bool, error)
- func CheckVBFTConfig(configuration *config.VBFTConfig) error
- func CommitDpos(native *native.NativeService) ([]byte, error)
- func GetCurConOperator(native *native.NativeService) (common.Address, error)
- func GetView(native *native.NativeService) (uint32, error)
- func InitConfig(native *native.NativeService) ([]byte, error)
- func QuitNode(native *native.NativeService) ([]byte, error)
- func RegisterCandidate(native *native.NativeService) ([]byte, error)
- func RegisterNodeManagerContract(native *native.NativeService)
- func UnRegisterCandidate(native *native.NativeService) ([]byte, error)
- func UpdateConfig(native *native.NativeService) ([]byte, error)
- func WhiteNode(native *native.NativeService) ([]byte, error)
- type BlackListItem
- type Configuration
- type ConsensusSigns
- type GovernanceView
- type PeerListParam
- type PeerParam
- type PeerPoolItem
- type PeerPoolMap
- type RegisterPeerParam
- type Status
- type UpdateConfigParam
Constants ¶
View Source
const ( //status CandidateStatus Status = iota ConsensusStatus QuitingStatus BlackStatus //function name REGISTER_CANDIDATE = "registerCandidate" UNREGISTER_CANDIDATE = "unRegisterCandidate" APPROVE_CANDIDATE = "approveCandidate" BLACK_NODE = "blackNode" WHITE_NODE = "whiteNode" QUIT_NODE = "quitNode" UPDATE_CONFIG = "updateConfig" COMMIT_DPOS = "commitDpos" //key prefix GOVERNANCE_VIEW = "governanceView" VBFT_CONFIG = "vbftConfig" CANDIDITE_INDEX = "candidateIndex" PEER_APPLY = "peerApply" PEER_POOL = "peerPool" PEER_INDEX = "peerIndex" BLACK_LIST = "blackList" CONSENSUS_SIGNS = "consensusSigns" //const MIN_PEER_NUM = 4 )
Variables ¶
This section is empty.
Functions ¶
func ApproveCandidate ¶
func ApproveCandidate(native *native.NativeService) ([]byte, error)
Approve a registered candidate node
func BlackNode ¶
func BlackNode(native *native.NativeService) ([]byte, error)
Put a node into black list, remove node from pool Node in black list can't be registered.
func CheckConsensusSigns ¶
func CheckVBFTConfig ¶
func CheckVBFTConfig(configuration *config.VBFTConfig) error
func CommitDpos ¶
func CommitDpos(native *native.NativeService) ([]byte, error)
Go to next consensus epoch
func GetCurConOperator ¶
func GetCurConOperator(native *native.NativeService) (common.Address, error)
Get current epoch operator derived from current epoch consensus book keepers' public keys
func InitConfig ¶
func InitConfig(native *native.NativeService) ([]byte, error)
Init node_manager contract
func QuitNode ¶
func QuitNode(native *native.NativeService) ([]byte, error)
Quit a registered node, used by node owner. Remove node from pool
func RegisterCandidate ¶
func RegisterCandidate(native *native.NativeService) ([]byte, error)
Register a candidate node, used by users.
func RegisterNodeManagerContract ¶
func RegisterNodeManagerContract(native *native.NativeService)
Register methods of node_manager contract
func UnRegisterCandidate ¶
func UnRegisterCandidate(native *native.NativeService) ([]byte, error)
Unregister a registered candidate node, will remove node from pool
func UpdateConfig ¶
func UpdateConfig(native *native.NativeService) ([]byte, error)
Update VBFT config
Types ¶
type BlackListItem ¶
type BlackListItem struct { PeerPubkey string //peerPubkey in black list Address common.Address //the owner of this peer }
func (*BlackListItem) Deserialization ¶
func (this *BlackListItem) Deserialization(source *common.ZeroCopySource) error
func (*BlackListItem) Serialization ¶
func (this *BlackListItem) Serialization(sink *common.ZeroCopySink)
type Configuration ¶
type Configuration struct { BlockMsgDelay uint32 HashMsgDelay uint32 PeerHandshakeTimeout uint32 MaxBlockChangeView uint32 }
func GetConfig ¶
func GetConfig(native *native.NativeService) (*Configuration, error)
func (*Configuration) Deserialization ¶
func (this *Configuration) Deserialization(source *common.ZeroCopySource) error
func (*Configuration) Serialization ¶
func (this *Configuration) Serialization(sink *common.ZeroCopySink)
type ConsensusSigns ¶
func (*ConsensusSigns) Deserialization ¶
func (this *ConsensusSigns) Deserialization(source *common.ZeroCopySource) error
func (*ConsensusSigns) Serialization ¶
func (this *ConsensusSigns) Serialization(sink *common.ZeroCopySink)
type GovernanceView ¶
func GetGovernanceView ¶
func GetGovernanceView(native *native.NativeService) (*GovernanceView, error)
func (*GovernanceView) Deserialization ¶
func (this *GovernanceView) Deserialization(source *common.ZeroCopySource) error
func (*GovernanceView) Serialization ¶
func (this *GovernanceView) Serialization(sink *common.ZeroCopySink)
type PeerListParam ¶
func (*PeerListParam) Deserialization ¶
func (this *PeerListParam) Deserialization(source *common.ZeroCopySource) error
func (*PeerListParam) Serialization ¶
func (this *PeerListParam) Serialization(sink *common.ZeroCopySink)
type PeerParam ¶
func (*PeerParam) Deserialization ¶
func (this *PeerParam) Deserialization(source *common.ZeroCopySource) error
func (*PeerParam) Serialization ¶
func (this *PeerParam) Serialization(sink *common.ZeroCopySink)
type PeerPoolItem ¶
type PeerPoolItem struct { Index uint32 //peer index PeerPubkey string //peer pubkey Address common.Address //peer owner Status Status }
func (*PeerPoolItem) Deserialization ¶
func (this *PeerPoolItem) Deserialization(source *common.ZeroCopySource) error
func (*PeerPoolItem) Serialization ¶
func (this *PeerPoolItem) Serialization(sink *common.ZeroCopySink)
type PeerPoolMap ¶
type PeerPoolMap struct {
PeerPoolMap map[string]*PeerPoolItem
}
func GetPeerPoolMap ¶
func GetPeerPoolMap(native *native.NativeService, view uint32) (*PeerPoolMap, error)
func (*PeerPoolMap) Deserialization ¶
func (this *PeerPoolMap) Deserialization(source *common.ZeroCopySource) error
func (*PeerPoolMap) Serialization ¶
func (this *PeerPoolMap) Serialization(sink *common.ZeroCopySink)
type RegisterPeerParam ¶
func GetPeerApply ¶
func GetPeerApply(native *native.NativeService, peerPubkey string) (*RegisterPeerParam, error)
func (*RegisterPeerParam) Deserialization ¶
func (this *RegisterPeerParam) Deserialization(source *common.ZeroCopySource) error
func (*RegisterPeerParam) Serialization ¶
func (this *RegisterPeerParam) Serialization(sink *common.ZeroCopySink)
type Status ¶
type Status uint8
func (*Status) Deserialization ¶
func (this *Status) Deserialization(source *common.ZeroCopySource) error
func (*Status) Serialization ¶
func (this *Status) Serialization(sink *common.ZeroCopySink)
type UpdateConfigParam ¶
type UpdateConfigParam struct {
Configuration *Configuration
}
func (*UpdateConfigParam) Deserialization ¶
func (this *UpdateConfigParam) Deserialization(source *common.ZeroCopySource) error
func (*UpdateConfigParam) Serialization ¶
func (this *UpdateConfigParam) Serialization(sink *common.ZeroCopySink)
Click to show internal directories.
Click to hide internal directories.