Documentation ¶
Index ¶
- Constants
- Variables
- type BlockchainConfig
- type Config
- type ConsensusConf
- type GenesisAllocation
- type GenesisConf
- type IpfsConfig
- type OfflineDetectionConfig
- type P2P
- type SyncConfig
- type ValidationConfig
- func (cfg *ValidationConfig) GetAfterLongSessionDuration() time.Duration
- func (cfg *ValidationConfig) GetFlipLotteryDuration() time.Duration
- func (cfg *ValidationConfig) GetLongSessionDuration(networkSize int) time.Duration
- func (cfg *ValidationConfig) GetNextValidationTime(validationTime time.Time, networkSize int) time.Time
- func (cfg *ValidationConfig) GetShortSessionDuration() time.Duration
Constants ¶
View Source
const ( DefaultDataDir = "datadir" DefaultPort = 40404 DefaultRpcHost = "localhost" DefaultRpcPort = 9009 DefaultIpfsDataDir = "ipfs" DefaultIpfsPort = 40405 DefaultGodAddress = "0x4d60dc6a2cba8c3ef1ba5e1eba5c12c54cee6b61" DefaultCeremonyTime = int64(1567171800) DefaultSwarmKey = "9ad6f96bb2b02a7308ad87938d6139a974b550cc029ce416641a60c46db2f530" DefaultForceFullSync = 100 DefaultStoreCertRange = 2000 DefaultMaxInboundPeers = 12 DefaultMaxOutboundPeers = 6 DefaultBurntTxRange = 180 LowPowerMaxInboundPeers = 6 LowPowerMaxOutboundPeers = 3 )
View Source
const ( FlipLottery = 5 * time.Minute ShortSession = 2 * time.Minute AfterLongSession = 1 * time.Minute )
View Source
const (
LowPowerProfile = "lowpower"
)
Variables ¶
View Source
var ( DefaultIpfsBootstrapNodes = []string{ "/ip4/206.81.23.186/tcp/40403/ipfs/QmTHDLnNMAp6K8txLmJW6EHUbwoHTGhkEUBCp4gAtpNqKY", "/ip4/165.227.91.202/tcp/40403/ipfs/QmZ9VnVZsokXEttRYiHbHmCUBSdzSQywjj5wM3Me96XoVD", } 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 * 10, } LogColoring = cli.BoolFlag{ Name: "logcoloring", Usage: "Use log coloring", } )
Functions ¶
This section is empty.
Types ¶
type BlockchainConfig ¶
type Config ¶
type Config struct { DataDir string Network uint32 Consensus *ConsensusConf P2P P2P RPC *rpc.Config GenesisConf *GenesisConf IpfsConf *IpfsConfig Validation *ValidationConfig Sync *SyncConfig OfflineDetection *OfflineDetectionConfig Blockchain *BlockchainConfig }
func MakeConfigFromFile ¶
func (*Config) KeyStoreDataDir ¶
func (*Config) NodeKey ¶
func (c *Config) NodeKey() *ecdsa.PrivateKey
func (*Config) ProvideNodeKey ¶
type ConsensusConf ¶
type ConsensusConf struct { 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 SuccessfulValidationRewardPercent float32 FlipRewardPercent float32 ValidInvitationRewardPercent float32 FoundationPayoutsPercent float32 ZeroWalletPercent float32 FirstInvitationRewardCoef float32 SecondInvitationRewardCoef float32 ThirdInvitationRewardCoef float32 SavedInviteRewardCoef float32 SavedInviteWinnerRewardCoef float32 FeeSensitivityCoef float32 MinFeePerByte *big.Int MinBlockDistance time.Duration MaxCommitteeSize int StatusSwitchRange uint64 InvitesPercent float32 }
func GetDefaultConsensusConfig ¶
func GetDefaultConsensusConfig() *ConsensusConf
type GenesisAllocation ¶
type GenesisConf ¶
type IpfsConfig ¶
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 // Do not use directly AfterLongSessionDuration time.Duration }
func (*ValidationConfig) GetAfterLongSessionDuration ¶
func (cfg *ValidationConfig) GetAfterLongSessionDuration() 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.