Documentation ¶
Index ¶
- Constants
- Variables
- func GenesisConsensusPayload(txhash common.Uint256, height uint32) ([]byte, error)
- func Pubkey(nodeid string) (keypair.PublicKey, error)
- func PubkeyID(pub keypair.PublicKey) string
- func VerifyChainConfig(cfg *ChainConfig) error
- type ChainConfig
- type PeerConfig
- type VRFValue
- type VbftBlockInfo
Constants ¶
View Source
const ( VRF_SIZE = 64 // bytes MAX_PROPOSER_COUNT = 32 MAX_ENDORSER_COUNT = 240 MAX_COMMITTER_COUNT = 240 )
Variables ¶
View Source
var NilVRF = VRFValue{}
View Source
var (
Version uint32 = 1
)
Functions ¶
func GenesisConsensusPayload ¶
func VerifyChainConfig ¶
func VerifyChainConfig(cfg *ChainConfig) error
Types ¶
type ChainConfig ¶
type ChainConfig struct { Version uint32 `json:"version"` // software version View uint32 `json:"view"` // config-updated version N uint32 `json:"n"` // network size C uint32 `json:"c"` // consensus quorum BlockMsgDelay time.Duration `json:"block_msg_delay"` HashMsgDelay time.Duration `json:"hash_msg_delay"` PeerHandshakeTimeout time.Duration `json:"peer_handshake_timeout"` Peers []*PeerConfig `json:"peers"` PosTable []uint32 `json:"pos_table"` MaxBlockChangeView uint32 `json:"MaxBlockChangeView"` }
func GenesisChainConfig ¶
func GenesisChainConfig(config *config.VBFTConfig, peersinfo []*config.VBFTPeerStakeInfo, txhash common.Uint256, height uint32) (*ChainConfig, error)
GenesisChainConfig return chainconfig
func (*ChainConfig) Deserialize ¶
func (cc *ChainConfig) Deserialize(r io.Reader, length int) error
func (*ChainConfig) Hash ¶
func (cc *ChainConfig) Hash() common.Uint256
type PeerConfig ¶
func (*PeerConfig) Deserialize ¶
func (pc *PeerConfig) Deserialize(r io.Reader) error
type VbftBlockInfo ¶
type VbftBlockInfo struct { Proposer uint32 `json:"leader"` VrfValue []byte `json:"vrf_value"` VrfProof []byte `json:"vrf_proof"` LastConfigBlockNum uint32 `json:"last_config_block_num"` NewChainConfig *ChainConfig `json:"new_chain_config"` }
VBFT consensus payload, stored on each block header
Click to show internal directories.
Click to hide internal directories.