params

package
v0.0.0-...-4f0ab6e Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 0 Imported by: 14

Documentation

Overview

Copyright (c) 2018-present, MultiVAC Foundation. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Package params : This package keeps the parameters of the protocol which are use by many packages. The difference from this package to package `config` is that this package should be determined by compile time. For runtime config which users should be able to set via command line flag, please use `config` package. To avoid dependency loop, this package should depend on no other packages in this repo.

Index

Constants

View Source
const (
	// StorageNodeShardConfig If enabled, people can configure supported shards in storage node, otherwise it is all-shards.
	StorageNodeShardConfig = false
	//EnableCoinbaseTx allows to hava a transaction from coinbase.
	EnableCoinbaseTx = true

	// EnableStorageReward enable means that storage node has reward.
	EnableStorageReward = false

	// EnableTestnetThreshold require users to mortgage to qualify for mining.
	EnableTestnetThreshold = false
)

All temporary feature flags.

View Source
const (
	// LeveldbCacheMb defines the write buffer size of leveldb.
	LeveldbCacheMb = 64

	// LeveldbBlockCacheMb defines the capacity of the leveldb's 'sorted table' block caching.
	LeveldbBlockCacheMb = 128

	// LeveldbFileNumber defines the capacity of the leveldb's open files caching.
	LeveldbFileNumber = 64

	// SecurityLevel Determines whether the probability of being selected in the shard.
	// rand < 1 - (1 - securityLevel)^depositUnit, as mtv yellow paper.
	SecurityLevel = 0.8

	// ReshardRoundThreshold is the number of rounds that trigger resharding.
	// TODO(issue #127, tianhongce): Set a more reasonable threshold.
	ReshardRoundThreshold = 20
	// ReshardPrepareRoundThreshold is the number of perparation rounds before resharding.
	// More details about the preparation of the resharding, please see the controller/README.md.
	ReshardPrepareRoundThreshold = 5
	// RelayCache define the size of lru map.
	RelayCache = 1000000
	// DepositValue is defined that how much  mtv that user has deposited can have qualifications to mine.
	DepositValue = 1000000
	// LeaderRateBase defines the number of miner who may mine block.
	LeaderRateBase = 20
)
View Source
const (
	// GenesisShardPrefixLength defines the length of prefix, this is used to generate shard list and genesis blocks.
	// e.g. When the prefix is 4, there are 2^4 = 16 shards.
	// Note: The max value for this prefix length is 32.
	GenesisShardPrefixLength = 2
	// GenesisNumberOfShards defines the number of miner in shard.
	GenesisNumberOfShards = 1 << GenesisShardPrefixLength
)

Variables

View Source
var (
	// OnlineTimeS defines that the duration of a miner must be online.
	OnlineTimeS int64 = 180

	// TimeDeviationS defines the acceptable deviation of time for heartbeat.
	TimeDeviationS int64 = 100

	// SendHeartbeatIntervalS defines the interval to send heartbeat.
	SendHeartbeatIntervalS int64 = 60
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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