param

package
v0.6.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRpcEthGetLogsMaxResults = 10000
	DefaultRetainBlocks            = -1
	DefaultNumKeptBlocks           = 10000
	DefaultNumKeptBlocksInDB       = -1
	DefaultSignatureCache          = 20000
	DefaultRecheckThreshold        = 1000
	DefaultTrunkCacheSize          = 200
	DefaultChangeRetainEveryN      = 100
	DefaultPruneEveryN             = 10

	DefaultAppDataPath    = "app"
	DefaultDbDataPath     = "db"
	DefaultSyncdbDataPath = "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

	// ccEpoch params
	BlocksInCCEpoch    int64 = 7
	CCEpochSwitchDelay int64 = 3 * 20 / 20

	// fork params
	XHedgeContractSequence uint64 = 0x13311
	XHedgeForkBlock        int64  = 4106000
	ShaGateForkBlock       int64  = 80000000
	ShaGateSwitch          bool   = false
)

FILE: consensus configurable params collected here!

Variables

This section is empty.

Functions

func WriteConfigFile

func WriteConfigFile(configFilePath string, config *AppConfig)

Types

type AppConfig

type AppConfig struct {
	//app config:
	AppDataPath    string `mapstructure:"app_data_path"`
	DbDataPath     string `mapstructure:"db_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 DB
	UseLiteDB bool `mapstructure:"use_litedb"`
	// the number of kept recent blocks for ads
	NumKeptBlocks int64 `mapstructure:"blocks_kept_ads"`
	// the number of kept recent blocks for db
	NumKeptBlocksInDB int64 `mapstructure:"blocks_kept_db"`
	// 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"`

	MainnetRPCUrl      string `mapstructure:"mainnet-rpc-url"`
	MainnetRPCUsername string `mapstructure:"mainnet-rpc-username"`
	MainnetRPCPassword string `mapstructure:"mainnet-rpc-password"`
	ZeniqsmartRPCUrl   string `mapstructure:"zeniqsmart-rpc-url"`
	Testing            bool   `mapstructure:"testing"`

	FrontierGasLimit uint64 `mapstructure:"frontier-gaslimit"`

	ArchiveMode bool `mapstructure:"archive-mode"`

	WithSyncDB bool `mapstructure:"with-syncdb"`

	BlocksBehind   int64      `mapstructure:"blocks-behind"`
	UpdateOfADSLog bool       `mapstructure:"update-of-ads-log"`
	CCRPCEpochs    [][]int64  `mapstructure:"cc-rpc-epochs"`
	CCRPCForkBlock int64      `mapstructure:"cc-rpc-fork-block"` // big number to disable CCRPC
	HeightRevision [][2]int64 `mapstructure:"height-revision"`
}

func DefaultAppConfig

func DefaultAppConfig() *AppConfig

func DefaultAppConfigWithHome

func DefaultAppConfigWithHome(home string) *AppConfig

func ParseConfig

func ParseConfig(home string) (*AppConfig, error)

type ChainConfig

type ChainConfig struct {
	NodeConfig *config.Config `mapstructure:"node_config"`
	AppConfig  *AppConfig     `mapstructure:"app_config"`
}

func DefaultConfig

func DefaultConfig() *ChainConfig

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL