Documentation
¶
Index ¶
- Constants
- Variables
- func GetNetworkMagic(id uint32) uint32
- func GetNetworkName(id uint32) string
- func GetOpcodeUpdateCheckHeight(id uint32) uint32
- func GetStateHashCheckHeight(id uint32) uint32
- type BlockchainConfig
- type CommonConfig
- type ConsensusConfig
- type DBFTConfig
- type GenesisConfig
- type P2PNodeConfig
- type P2PRsvConfig
- type RestfulConfig
- type RpcConfig
- type SOLOConfig
- type VBFTConfig
- type VBFTPeerStakeInfo
- type WebSocketConfig
Constants ¶
View Source
const ( DEFAULT_CONFIG_FILE_NAME = "./config.json" DEFAULT_WALLET_FILE_NAME = "./wallet.dat" MIN_GEN_BLOCK_TIME = 2 DEFAULT_GEN_BLOCK_TIME = 6 DBFT_MIN_NODE_NUM = 4 //min node number of dbft consensus SOLO_MIN_NODE_NUM = 1 //min node number of solo consensus VBFT_MIN_NODE_NUM = 4 //min node number of vbft consensus CONSENSUS_TYPE_DBFT = "dbft" CONSENSUS_TYPE_SOLO = "solo" CONSENSUS_TYPE_VBFT = "vbft" DEFAULT_LOG_LEVEL = log.InfoLog DEFAULT_MAX_LOG_SIZE = 100 //MByte DEFAULT_NODE_PORT = uint(20338) DEFAULT_CONSENSUS_PORT = uint(20339) DEFAULT_RPC_PORT = uint(20336) DEFAULT_RPC_LOCAL_PORT = uint(20337) DEFAULT_REST_PORT = uint(20334) DEFAULT_WS_PORT = uint(20335) DEFAULT_REST_MAX_CONN = uint(1024) DEFAULT_MAX_CONN_IN_BOUND = uint(1024) DEFAULT_MAX_CONN_OUT_BOUND = uint(1024) DEFAULT_MAX_CONN_IN_BOUND_FOR_SINGLE_IP = uint(16) DEFAULT_HTTP_INFO_PORT = uint(0) DEFAULT_MAX_TX_IN_BLOCK = 60000 DEFAULT_MAX_SYNC_HEADER = 500 DEFAULT_ENABLE_CONSENSUS = true DEFAULT_ENABLE_EVENT_LOG = true DEFAULT_CLI_RPC_PORT = uint(20000) DEFUALT_CLI_RPC_ADDRESS = "127.0.0.1" DEFAULT_GAS_LIMIT = 20000 DEFAULT_GAS_PRICE = 0 DEFAULT_WASM_GAS_FACTOR = uint64(10) DEFAULT_WASM_MAX_STEPCOUNT = uint64(8000000) DEFAULT_DATA_DIR = "./Chain" DEFAULT_RESERVED_FILE = "./peers.rsv" )
View Source
const ( NETWORK_ID_MAIN_NET = 1 NETWORK_ID_POLARIS_NET = 2 NETWORK_ID_SOLO_NET = 3 NETWORK_NAME_MAIN_NET = "mainnet" NETWORK_NAME_POLARIS_NET = "polaris" NETWORK_NAME_SOLO_NET = "testmode" )
View Source
const (
WASM_GAS_FACTOR = "WASM_GAS_FACTOR"
)
Variables ¶
View Source
var DefConfig = NewBlockchainConfig()
View Source
var NETWORK_MAGIC = map[uint32]uint32{ NETWORK_ID_MAIN_NET: constants.NETWORK_MAGIC_MAINNET, NETWORK_ID_POLARIS_NET: constants.NETWORK_MAGIC_POLARIS, NETWORK_ID_SOLO_NET: 0, }
View Source
var NETWORK_NAME = map[uint32]string{ NETWORK_ID_MAIN_NET: NETWORK_NAME_MAIN_NET, NETWORK_ID_POLARIS_NET: NETWORK_NAME_POLARIS_NET, NETWORK_ID_SOLO_NET: NETWORK_NAME_SOLO_NET, }
View Source
var Version = "" //Set value when build project
Functions ¶
func GetNetworkMagic ¶
func GetNetworkName ¶
func GetStateHashCheckHeight ¶
Types ¶
type BlockchainConfig ¶
type BlockchainConfig struct {
Genesis *GenesisConfig
Common *CommonConfig
Consensus *ConsensusConfig
P2PNode *P2PNodeConfig
Rpc *RpcConfig
Restful *RestfulConfig
Ws *WebSocketConfig
}
func NewBlockchainConfig ¶
func NewBlockchainConfig() *BlockchainConfig
func (*BlockchainConfig) GetBookkeepers ¶
func (this *BlockchainConfig) GetBookkeepers() ([]keypair.PublicKey, error)
type CommonConfig ¶
type ConsensusConfig ¶
type DBFTConfig ¶
type GenesisConfig ¶
type GenesisConfig struct {
SeedList []string
ConsensusType string
VBFT *VBFTConfig
DBFT *DBFTConfig
SOLO *SOLOConfig
}
func NewGenesisConfig ¶
func NewGenesisConfig() *GenesisConfig
type P2PNodeConfig ¶
type P2PNodeConfig struct {
ReservedPeersOnly bool
ReservedCfg *P2PRsvConfig
NetworkMagic uint32
NetworkId uint32
NetworkName string
NodePort uint
IsTLS bool
CertPath string
KeyPath string
CAPath string
HttpInfoPort uint
MaxHdrSyncReqs uint
MaxConnInBound uint
MaxConnOutBound uint
MaxConnInBoundForSingleIP uint
}
type P2PRsvConfig ¶
type RestfulConfig ¶
type SOLOConfig ¶
type VBFTConfig ¶
type VBFTConfig struct {
N uint32 `json:"n"` // network size
C uint32 `json:"c"` // consensus quorum
K uint32 `json:"k"`
L uint32 `json:"l"`
BlockMsgDelay uint32 `json:"block_msg_delay"`
HashMsgDelay uint32 `json:"hash_msg_delay"`
PeerHandshakeTimeout uint32 `json:"peer_handshake_timeout"`
MaxBlockChangeView uint32 `json:"max_block_change_view"`
MinInitStake uint32 `json:"min_init_stake"`
AdminOntID string `json:"admin_ont_id"`
VrfValue string `json:"vrf_value"`
VrfProof string `json:"vrf_proof"`
Peers []*VBFTPeerStakeInfo `json:"peers"`
}
VBFT genesis config, from local config file
func (*VBFTConfig) Deserialization ¶
func (this *VBFTConfig) Deserialization(source *common.ZeroCopySource) error
func (*VBFTConfig) Serialization ¶
func (self *VBFTConfig) Serialization(sink *common.ZeroCopySink) error
type VBFTPeerStakeInfo ¶
type VBFTPeerStakeInfo struct {
Index uint32 `json:"index"`
PeerPubkey string `json:"peerPubkey"`
Address string `json:"address"`
InitPos uint64 `json:"initPos"`
}
func (*VBFTPeerStakeInfo) Deserialization ¶
func (this *VBFTPeerStakeInfo) Deserialization(source *common.ZeroCopySource) error
func (*VBFTPeerStakeInfo) Serialization ¶
func (this *VBFTPeerStakeInfo) Serialization(sink *common.ZeroCopySink) error
Click to show internal directories.
Click to hide internal directories.