Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyConsensusVersion(ver ConsensusVerson, cfg *ConsensusConf)
- type BlockchainConfig
- type Config
- type ConsensusConf
- type ConsensusVerson
- type GenesisAllocation
- type GenesisConf
- type IpfsConfig
- type IpfsGcConfig
- type Mempool
- type OfflineDetectionConfig
- type P2P
- type SyncConfig
- type ValidationConfig
- func (cfg *ValidationConfig) GetFlipLotteryDuration() time.Duration
- func (cfg *ValidationConfig) GetLongSessionDuration(networkSize int) time.Duration
- func (cfg *ValidationConfig) GetNextValidationTime(validationTime time.Time, networkSize int, enableUpgrade12 bool) time.Time
- func (cfg *ValidationConfig) GetShortSessionDuration() time.Duration
Constants ¶
View Source
const ( LowPowerProfile = "lowpower" DefaultProfile = "default" )
View Source
const ( DefaultDataDir = "datadir" DefaultPort = 40404 DefaultRpcHost = "localhost" DefaultRpcPort = 9009 DefaultRpcPortBuiltInNode = 9119 DefaultIpfsDataDir = "ipfs" DefaultIpfsPort = 40405 DefaultGodAddress = "0x4d60dc6a2cba8c3ef1ba5e1eba5c12c54cee6b61" DefaultCeremonyTime = int64(1567171800) DefaultSwarmKey = "00d6f96bb2b02a7308ad87938d6139a974b555cc029ce416641a60c46db2f531" DefaultForceFullSync = 100 DefaultStoreCertRange = 2000 DefaultMaxInboundOwnShardPeers = 8 DefaultMaxOutboundOwnShardPeers = 4 DefaultMaxInboundNotOwnShardPeers = 4 DefaultMaxOutboundNotOwnShardPeers = 2 DefaultBurntTxRange = 4320 LowPowerMaxInboundOwnShardPeers = 3 LowPowerMaxOutboundOwnShardPeers = 2 LowPowerMaxInboundNotOwnShardPeers = 1 LowPowerMaxOutboundNotOwnShardPeers = 1 )
Variables ¶
View Source
var ( DefaultIpfsBootstrapNodes = []string{ "/ip4/135.181.40.10/tcp/40405/ipfs/QmNYWtiwM1UfeCmHfWSdefrMuQdg6nycY5yS64HYqWCUhD", "/ip4/157.230.61.115/tcp/40403/ipfs/QmQHYY49pWWFeXXdR9rKd31bHRqRi2E4tk4CXDgYJZq5ry", "/ip4/124.71.148.124/tcp/40405/ipfs/QmWH9D4DjSvQyWyRUw76AopCfRS5CPR2gRnRoxP3QFaefx", "/ip4/139.59.42.4/tcp/40405/ipfs/QmNagyEFFNMdkFT7W6HivNjJAmYB6zjrr7ussnC8ys9b7f", } CfgFileFlag = cli.StringFlag{ Name: "config", Usage: "JSON configuration file", } DataDirFlag = cli.StringFlag{ Name: "datadir", Usage: "datadir for blockchain", } TcpPortFlag = cli.IntFlag{ Name: "port", Usage: "Network listening port", } RpcHostFlag = cli.StringFlag{ Name: "rpcaddr", Usage: "RPC listening address", } RpcPortFlag = cli.IntFlag{ Name: "rpcport", Usage: "RPC listening port", } BootNodeFlag = cli.StringFlag{ Name: "bootnode", Usage: "Bootstrap node url", } AutomineFlag = cli.BoolFlag{ Name: "automine", Usage: "Mine blocks alone without peers", } IpfsBootNodeFlag = cli.StringFlag{ Name: "ipfsbootnode", Usage: "Ipfs bootstrap node (overrides existing)", } IpfsPortFlag = cli.IntFlag{ Name: "ipfsport", Usage: "Ipfs port", } NoDiscoveryFlag = cli.BoolFlag{ Name: "nodiscovery", Usage: "NoDiscovery can be used to disable the peer discovery mechanism.", } VerbosityFlag = cli.IntFlag{ Name: "verbosity", Usage: "Log verbosity", Value: 3, } GodAddressFlag = cli.StringFlag{ Name: "godaddress", Usage: "Idena god address", } CeremonyTimeFlag = cli.Int64Flag{ Name: "ceremonytime", Usage: "First ceremony time (unix)", } MaxNetworkDelayFlag = cli.IntFlag{ Name: "maxnetdelay", Usage: "Max network delay for broadcasting", } FastSyncFlag = cli.BoolFlag{ Name: "fast", Usage: "Enable fast sync", } ForceFullSyncFlag = cli.Uint64Flag{ Name: "forcefullsync", Usage: "Force full sync on last blocks", } ProfileFlag = cli.StringFlag{ Name: "profile", Usage: "Configuration profile", } IpfsPortStaticFlag = cli.BoolFlag{ Name: "ipfsportstatic", Usage: "Enable static ipfs port", } ApiKeyFlag = cli.StringFlag{ Name: "apikey", Usage: "Set RPC api key", } LogFileSizeFlag = cli.IntFlag{ Name: "logfilesize", Usage: "Set log file size in KB", Value: 1024 * 100, } LogColoring = cli.BoolFlag{ Name: "logcoloring", Usage: "Use log coloring", } AutoOnline = cli.BoolFlag{ Name: "autoonline", Usage: "Node will automatically turn on online mining status", } )
View Source
var (
ConsensusVersions map[ConsensusVerson]*ConsensusConf
)
Functions ¶
func ApplyConsensusVersion ¶ added in v0.23.0
func ApplyConsensusVersion(ver ConsensusVerson, cfg *ConsensusConf)
Types ¶
type BlockchainConfig ¶
type Config ¶
type Config struct { DataDir string Network uint32 AutoOnline bool IsDebug bool Consensus *ConsensusConf P2P P2P RPC *rpc.Config GenesisConf *GenesisConf IpfsConf *IpfsConfig Validation *ValidationConfig Sync *SyncConfig OfflineDetection *OfflineDetectionConfig Blockchain *BlockchainConfig Mempool *Mempool }
func MakeConfig ¶
func MakeConfigFromFile ¶
func (*Config) KeyStoreDataDir ¶
func (*Config) ProvideNodeKey ¶
type ConsensusConf ¶
type ConsensusConf struct { Version ConsensusVerson StartActivationDate int64 // unix timestamp EndActivationDate int64 // unix timestamp MigrationTimeout time.Duration GenerateGenesisAfterUpgrade bool MaxSteps uint8 AgreementThreshold float64 CommitteePercent float64 FinalCommitteePercent float64 WaitBlockDelay time.Duration WaitSortitionProofDelay time.Duration EstimatedBaVariance time.Duration WaitForStepDelay time.Duration Automine bool BlockReward *big.Int StakeRewardRate float32 StakeRewardRateForNewbie float32 FinalCommitteeReward *big.Int FeeBurnRate float32 SnapshotRange uint64 OfflinePenaltyBlocksCount int64 OfflinePenaltyDuration time.Duration SuccessfulValidationRewardPercent float32 StakingRewardPercent float32 CandidateRewardPercent float32 FlipRewardPercent float32 FlipRewardBasicPercent float32 FlipRewardExtraPercent float32 ValidInvitationRewardPercent float32 ReportsRewardPercent float32 FoundationPayoutsPercent float32 ZeroWalletPercent float32 FirstInvitationRewardCoef float32 SecondInvitationRewardCoef float32 ThirdInvitationRewardCoef float32 SavedInviteRewardCoef float32 SavedInviteWinnerRewardCoef float32 FeeSensitivityCoef float32 MinBlockDistance time.Duration MaxCommitteeSize int StatusSwitchRange uint64 DelegationSwitchRange uint64 DiscriminationSwitchRange uint64 InvitesPercent float32 MinProposerThreshold float64 UpgradeIntervalBeforeValidation time.Duration ReductionOneDelay time.Duration EnableUpgrade10 bool BurnTxRange uint64 KeyWordsV3Epoch uint16 UnlockStakeAge uint8 EnableUpgrade11 bool EnableUpgrade12 bool }
func GetDefaultConsensusConfig ¶
func GetDefaultConsensusConfig() *ConsensusConf
type ConsensusVerson ¶ added in v0.23.0
type ConsensusVerson uint16
const ( ConsensusV9 ConsensusVerson = 9 ConsensusV10 ConsensusVerson = 10 ConsensusV11 ConsensusVerson = 11 ConsensusV12 ConsensusVerson = 12 )
type GenesisAllocation ¶
type GenesisConf ¶
type IpfsConfig ¶
type IpfsConfig struct { DataDir string BootNodes []string IpfsPort int StaticPort bool SwarmKey string Routing string LowWater int HighWater int GracePeriod string ReproviderInterval string Profile string BlockPinThreshold float32 FlipPinThreshold float32 PublishPeers bool Gc IpfsGcConfig }
func GetDefaultIpfsConfig ¶ added in v0.19.2
func GetDefaultIpfsConfig() *IpfsConfig
type IpfsGcConfig ¶ added in v0.30.3
type Mempool ¶ added in v0.19.2
type Mempool struct { TxPoolQueueSlots int TxPoolExecutableSlots int TxPoolAddrQueueLimit int TxPoolAddrExecutableLimit int TxLifetime time.Duration ResetInCeremony bool }
func GetDefaultMempoolConfig ¶ added in v0.19.2
func GetDefaultMempoolConfig() *Mempool
type OfflineDetectionConfig ¶
type OfflineDetectionConfig struct { PersistInterval int MaxSelfOffline time.Duration OfflineProposeInterval time.Duration OfflineVoteInterval time.Duration IntervalBetweenOfflineRetry time.Duration }
func GetDefaultOfflineDetectionConfig ¶
func GetDefaultOfflineDetectionConfig() *OfflineDetectionConfig
type SyncConfig ¶
type ValidationConfig ¶
type ValidationConfig struct { // Do not use directly ValidationInterval time.Duration // Do not use directly FlipLotteryDuration time.Duration // Do not use directly ShortSessionDuration time.Duration // Do not use directly LongSessionDuration time.Duration }
func (*ValidationConfig) GetFlipLotteryDuration ¶
func (cfg *ValidationConfig) GetFlipLotteryDuration() time.Duration
func (*ValidationConfig) GetLongSessionDuration ¶
func (cfg *ValidationConfig) GetLongSessionDuration(networkSize int) time.Duration
func (*ValidationConfig) GetNextValidationTime ¶
func (*ValidationConfig) GetShortSessionDuration ¶
func (cfg *ValidationConfig) GetShortSessionDuration() time.Duration
Click to show internal directories.
Click to hide internal directories.