Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultRpcEthGetLogsMaxResults = 10000 DefaultRetainBlocks = -1 DefaultNumKeptBlocks = 10000 DefaultNumKeptBlocksInMoDB = -1 DefaultSignatureCache = 20000 DefaultRecheckThreshold = 1000 DefaultTrunkCacheSize = 200 DefaultChangeRetainEveryN = 100 DefaultPruneEveryN = 10 AppDataPath = "app" ModbDataPath = "modb" SyncdbDataPath = "syncdb" )
View Source
const ( /**app consensus params**/ BlockMaxBytes int64 = 4 * 1024 * 1024 // 4MB BlockMaxGas int64 = 1_000_000_000 // 1Billion DefaultMinGasPrice uint64 = 10_000_000_000 // 10gwei /**ebp consensus params**/ EbpExeRoundCount int = 200 EbpRunnerNumber int = 256 EbpParallelNum int = 32 // gas limit for each transaction MaxTxGasLimit uint64 = 1000_0000 /**staking consensus params**/ // reward params EpochCountBeforeRewardMature int64 = 1 ProposerBaseMintFeePercentage uint64 = 15 CollectorMintFeePercentage uint64 = 15 // epoch params StakingMinVotingPercentPerEpoch int = 10 //10 percent in StakingNumBlocksInEpoch, like 2016 / 10 = 201 StakingMinVotingPubKeysPercentPerEpoch int = 34 //34 percent in active validators, StakingNumBlocksInEpoch int64 = 2016 StakingEpochSwitchDelay int64 = 600 * 2016 / 20 // 5% time of an epoch MaxActiveValidatorCount int = 50 BlocksInEpochAfterStakingFork int64 = 2016 * 10 * 60 / 6 // ccEpoch params BlocksInCCEpoch int64 = 7 CCEpochSwitchDelay int64 = 3 * 20 / 20 // staking and slash params ValidatorWatchWindowSize int64 = 100 ValidatorWatchMinSignatures int32 = 5 VotingPowerDivider int64 = 10 OnlineWindowSize int64 = 14400 // 24 * 3600s / 6s MinOnlineSignatures int32 = 8640 // OnlineWindowSize * 0.6 NotOnlineSlashAmountDivisor uint64 = 16 // 1/16 MinimumStakingAmountAfterStakingFork DuplicateSigSlashAMountDivisor uint64 = 4 // 1/4 MinimumStakingAmountAfterStakingFork SlashReceiver string = "0xad114243D2D61b78F76D63C1Fef6709219b2cd22" // network params IsAmber bool = false AmberBlocksInEpochAfterXHedgeFork int64 = 2016 * 10 * 60 / 6 // fork params XHedgeContractSequence uint64 = 0x13311 XHedgeForkBlock int64 = 4106000 ShaGateForkBlock int64 = math.MaxInt64 ShaGateSwitch bool = false StakingForkHeight int64 = 11006000 // near 20230815 SymbolSbchForkHeight int64 = 13627300 )
FILE: consensus configurable params collected here!
Variables ¶
This section is empty.
Functions ¶
func WriteConfigFile ¶ added in v0.3.0
Types ¶
type AppConfig ¶ added in v0.3.0
type AppConfig struct { //app config: AppDataPath string `mapstructure:"app_data_path"` ModbDataPath string `mapstructure:"modb_data_path"` SyncdbDataPath string `mapstructure:"syncdb_data_path"` // rpc config RpcEthGetLogsMaxResults int `mapstructure:"get_logs_max_results"` // tm db config RetainBlocks int64 `mapstructure:"retain-blocks"` ChangeRetainEveryN int64 `mapstructure:"retain_interval_blocks"` // Use LiteDB instead of MoDB UseLiteDB bool `mapstructure:"use_litedb"` // the number of kept recent blocks for moeingads NumKeptBlocks int64 `mapstructure:"blocks_kept_ads"` // the number of kept recent blocks for moeingdb NumKeptBlocksInMoDB int64 `mapstructure:"blocks_kept_modb"` // the entry count of the signature cache SigCacheSize int `mapstructure:"sig_cache_size"` TrunkCacheSize int `mapstructure:"trunk_cache_size"` PruneEveryN int64 `mapstructure:"prune_every_n"` // How many transactions are allowed to left in the mempool // If more than this threshold, no further transactions can go in mempool RecheckThreshold int `mapstructure:"recheck_threshold"` //watcher config MainnetRPCUrl string `mapstructure:"mainnet-rpc-url"` MainnetRPCUsername string `mapstructure:"mainnet-rpc-username"` MainnetRPCPassword string `mapstructure:"mainnet-rpc-password"` SmartBchRPCUrl string `mapstructure:"smartbch-rpc-url"` Speedup bool `mapstructure:"watcher-speedup"` FrontierGasLimit uint64 `mapstructure:"frontier-gaslimit"` ArchiveMode bool `mapstructure:"archive-mode"` WithSyncDB bool `mapstructure:"with-syncdb"` DisableBchClient bool `mapstructure:"disable-bch-client"` }
func DefaultAppConfig ¶ added in v0.3.0
func DefaultAppConfig() *AppConfig
func DefaultAppConfigWithHome ¶ added in v0.3.4
func ParseConfig ¶ added in v0.3.0
type ChainConfig ¶
type ChainConfig struct { NodeConfig *config.Config `mapstructure:"node_config"` AppConfig *AppConfig `mapstructure:"app_config"` }
func DefaultConfig ¶
func DefaultConfig() *ChainConfig
Click to show internal directories.
Click to hide internal directories.