Documentation
¶
Index ¶
Constants ¶
View Source
const ( MaxUint = ^uint(0) MaxInt = int(MaxUint >> 1) MaxNumTxnPerBlock = 4096 MaxBlockSize = 1 * 1024 * 1024 // in bytes ConsensusDuration = 20 * time.Second ConsensusTimeout = 60 * time.Second MinNumSuccessors = 8 NodeIDBytes = 32 MaxRollbackBlocks = 180 SigChainBlockDelay = 1 SigChainPropogationTime = 2 HeaderVersion = 1 DBVersion = 0x01 InitialIssueAddress = "NKNFCrUMFPkSeDRMG2ME21hD6wBCA2poc347" InitialIssueAmount = 700000000 * common.StorageFactor TotalMiningRewards = 300000000 * common.StorageFactor TotalRewardDuration = uint32(25) InitialReward = common.Fixed64(18000000 * common.StorageFactor) RewardAdjustInterval = 365 * 24 * 60 * 60 / int(ConsensusDuration/time.Second) ReductionAmount = common.Fixed64(500000 * common.StorageFactor) DonationAddress = "NKNaaaaaaaaaaaaaaaaaaaaaaaaaaaeJ6gxa" DonationAdjustDividendFactor = 1 DonationAdjustDivisorFactor = 2 MinGenIDRegistrationFee = 0 GenerateIDBlockDelay = 8 RandomBeaconUniqueLength = vrf.Size RandomBeaconLength = vrf.Size + vrf.ProofSize ProtocolVersion = 30 MinCompatibleProtocolVersion = 30 MaxCompatibleProtocolVersion = 39 TxPoolCleanupInterval = ConsensusDuration ShortHashSize = uint32(8) MaxAssetPrecision = uint32(8) NKNAssetName = "NKN" NKNAssetSymbol = "nkn" NKNAssetPrecision = uint32(8) GASAssetName = "New Network Coin" GASAssetSymbol = "nnc" GASAssetPrecision = uint32(8) )
Variables ¶
View Source
var ( ShortHashSalt = util.RandomBytes(32) GenesisTimestamp = time.Date(2019, time.June, 29, 13, 10, 13, 0, time.UTC).Unix() GenesisBeacon = make([]byte, RandomBeaconLength) NKNAssetID = common.Uint256{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, } GASAssetID = common.Uint256{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, } MaxTxnSubIdentifierList = HeightDependentInt{ // contains filtered or unexported fields } MaxTxnSubMetaList = HeightDependentInt{ // contains filtered or unexported fields } )
View Source
var ( Version string SkipNAT bool ConfigFile string LogPath string ChainDBPath string WalletFile string BeneficiaryAddr string SeedList string GenesisBlockProposer string Parameters = &Configuration{ Version: 1, Transport: "tcp", NodePort: 30001, HttpWsPort: 30002, HttpJsonPort: 30003, NAT: true, Mining: true, MiningDebug: true, LogLevel: 1, MaxLogFileSize: 20, SyncBatchWindowSize: 0, SyncBlockHeadersBatchSize: 128, SyncBlocksBatchSize: 4, SyncBlocksMaxMemorySize: 0, RPCReadTimeout: 5, RPCWriteTimeout: 10, KeepAliveTimeout: 15, NATPortMappingTimeout: 365 * 86400, NumTxnPerBlock: 256, TxPoolPerAccountTxCap: 32, TxPoolTotalTxCap: 0, TxPoolMaxMemorySize: 32, RegisterIDRegFee: 0, RegisterIDTxnFee: 0, LogPath: "Log", ChainDBPath: "ChainDB", WalletFile: "wallet.json", MaxGetIDSeeds: 3, DBFilesCacheCapacity: 100, NumLowFeeTxnPerBlock: 0, LowFeeTxnSizePerBlock: 4096, MinTxnFee: 10000000, } )
Functions ¶
Types ¶
type Configuration ¶
type Configuration struct {
Version int `json:"Version"`
SeedList []string `json:"SeedList"`
RestCertPath string `json:"RestCertPath"`
RestKeyPath string `json:"RestKeyPath"`
RPCCert string `json:"RPCCert"`
RPCKey string `json:"RPCKey"`
HttpWsPort uint16 `json:"HttpWsPort"`
HttpJsonPort uint16 `json:"HttpJsonPort"`
NodePort uint16 `json:"-"`
LogLevel int `json:"LogLevel"`
MaxLogFileSize uint32 `json:"MaxLogSize"`
IsTLS bool `json:"IsTLS"`
CertPath string `json:"CertPath"`
KeyPath string `json:"KeyPath"`
CAPath string `json:"CAPath"`
GenesisBlockProposer string `json:"GenesisBlockProposer"`
NumLowFeeTxnPerBlock uint32 `json:"NumLowFeeTxnPerBlock"`
LowFeeTxnSizePerBlock uint32 `json:"LowFeeTxnSizePerBlock"` // in bytes
MinTxnFee int64 `json:"MinTxnFee"`
RegisterIDRegFee int64 `json:"RegisterIDRegFee"`
RegisterIDTxnFee int64 `json:"RegisterIDTxnFee"`
Hostname string `json:"Hostname"`
Transport string `json:"Transport"`
NAT bool `json:"NAT"`
Mining bool `json:"Mining"`
MiningDebug bool `json:"MiningDebug"`
BeneficiaryAddr string `json:"BeneficiaryAddr"`
SyncBatchWindowSize uint32 `json:"SyncBatchWindowSize"`
SyncBlockHeadersBatchSize uint32 `json:"SyncBlockHeadersBatchSize"`
SyncBlocksBatchSize uint32 `json:"SyncBlocksBatchSize"`
SyncBlocksMaxMemorySize uint32 `json:"SyncBlocksMaxMemorySize"` // in megabytes (MB)
NumTxnPerBlock uint32 `json:"NumTxnPerBlock"`
TxPoolPerAccountTxCap uint32 `json:"TxPoolPerAccountTxCap"`
TxPoolTotalTxCap uint32 `json:"TxPoolTotalTxCap"`
TxPoolMaxMemorySize uint32 `json:"TxPoolMaxMemorySize"` // in megabytes (MB)
RPCReadTimeout time.Duration `json:"RPCReadTimeout"` // in seconds
RPCWriteTimeout time.Duration `json:"RPCWriteTimeout"` // in seconds
KeepAliveTimeout time.Duration `json:"KeepAliveTimeout"` // in seconds
NATPortMappingTimeout time.Duration `json:"NATPortMappingTimeout"` // in seconds
LogPath string `json:"LogPath"`
ChainDBPath string `json:"ChainDBPath"`
WalletFile string `json:"WalletFile"`
MaxGetIDSeeds uint32 `json:"MaxGetIDSeeds"`
DBFilesCacheCapacity uint32 `json:"DBFilesCacheCapacity"`
}
func (*Configuration) CheckPorts ¶
func (config *Configuration) CheckPorts(myIP string) (bool, error)
func (*Configuration) CleanPortMapping ¶
func (config *Configuration) CleanPortMapping() error
func (*Configuration) SetupPortMapping ¶
func (config *Configuration) SetupPortMapping() error
type HeightDependentInt ¶
type HeightDependentInt struct {
// contains filtered or unexported fields
}
func (*HeightDependentInt) GetValueAtHeight ¶
func (hdi *HeightDependentInt) GetValueAtHeight(height uint32) int
Click to show internal directories.
Click to hide internal directories.