settings

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 8 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MainNetSettings = &BlockchainSettings{
		Type: MainNet,
		FunctionalitySettings: FunctionalitySettings{
			FeaturesVotingPeriod:                          5000,
			VotesForFeatureActivation:                     4000,
			PreactivatedFeatures:                          nil,
			DoubleFeaturesPeriodsAfterHeight:              810000,
			GenerationBalanceDepthFrom50To1000AfterHeight: 232000,
			BlockVersion3AfterHeight:                      795000,
			ResetEffectiveBalanceAtHeight:                 462000,
			StolenAliasesWindowTimeStart:                  1522463241035,
			StolenAliasesWindowTimeEnd:                    1530161445559,
			ReissueBugWindowTimeStart:                     1522463241035,
			ReissueBugWindowTimeEnd:                       1530161445559,
			AllowMultipleLeaseCancelUntilTime:             1492768800000,
			AllowLeasedBalanceTransferUntilTime:           1513357014002,
			CheckTempNegativeAfterTime:                    1479168000000,
			TxChangesSortedCheckAfterTime:                 1479416400000,
			TxFromFutureCheckAfterTime:                    1479168000000,
			UnissuedAssetUntilTime:                        1479416400000,
			InvalidReissueInSameBlockUntilTime:            1492768800000,
			MinimalGeneratingBalanceCheckAfterTime:        1479168000000,
			MaxTxTimeBackOffset:                           120 * 60000,
			MaxTxTimeForwardOffset:                        90 * 60000,
			AddressSchemeCharacter:                        proto.MainNetScheme,
			AverageBlockDelaySeconds:                      60,
			MaxBaseTarget:                                 math.MaxUint64,
			BlockRewardTerm:                               100000,
			InitialBlockReward:                            600000000,
			BlockRewardIncrement:                          50000000,
			BlockRewardVotingPeriod:                       10000,
		},
		GenesisGetter: MainnetGenesis,
	}

	TestNetSettings = &BlockchainSettings{
		Type: TestNet,
		FunctionalitySettings: FunctionalitySettings{
			FeaturesVotingPeriod:                          3000,
			VotesForFeatureActivation:                     2700,
			PreactivatedFeatures:                          nil,
			DoubleFeaturesPeriodsAfterHeight:              math.MaxUint64,
			GenerationBalanceDepthFrom50To1000AfterHeight: 0,
			BlockVersion3AfterHeight:                      161700,
			ResetEffectiveBalanceAtHeight:                 51500,
			StolenAliasesWindowTimeStart:                  0,
			StolenAliasesWindowTimeEnd:                    0,
			ReissueBugWindowTimeStart:                     1520411086003,
			ReissueBugWindowTimeEnd:                       1523096218005,
			AllowMultipleLeaseCancelUntilTime:             1492560000000,
			AllowLeasedBalanceTransferUntilTime:           1508230496004,
			CheckTempNegativeAfterTime:                    1477958400000,
			TxChangesSortedCheckAfterTime:                 1479416400000,
			TxFromFutureCheckAfterTime:                    1478100000000,
			UnissuedAssetUntilTime:                        1479416400000,
			InvalidReissueInSameBlockUntilTime:            1492560000000,
			MinimalGeneratingBalanceCheckAfterTime:        0,
			MaxTxTimeBackOffset:                           120 * 60000,
			MaxTxTimeForwardOffset:                        90 * 60000,
			AddressSchemeCharacter:                        proto.TestNetScheme,
			AverageBlockDelaySeconds:                      60,
			MaxBaseTarget:                                 math.MaxUint64,
			BlockRewardTerm:                               100000,
			InitialBlockReward:                            600000000,
			BlockRewardIncrement:                          50000000,
			BlockRewardVotingPeriod:                       10000,
		},
		GenesisGetter: TestnetGenesis,
	}

	StageNetSettings = &BlockchainSettings{
		Type: StageNet,
		FunctionalitySettings: FunctionalitySettings{
			FeaturesVotingPeriod:             100,
			VotesForFeatureActivation:        40,
			PreactivatedFeatures:             []int16{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13},
			DoubleFeaturesPeriodsAfterHeight: 1000000000,
			MaxTxTimeBackOffset:              120 * 60000,
			MaxTxTimeForwardOffset:           90 * 60000,
			AddressSchemeCharacter:           proto.StageNetScheme,
			AverageBlockDelaySeconds:         60,
			MaxBaseTarget:                    math.MaxUint64,
			BlockRewardTerm:                  100000,
			InitialBlockReward:               600000000,
			BlockRewardIncrement:             50000000,
			BlockRewardVotingPeriod:          10000,
		},
		GenesisGetter: StagenetGenesis,
	}
)
View Source
var FeaturesInfo = map[Feature]FeatureInfo{
	SmallerMinimalGeneratingBalance: {true, "Minimum Generating Balance of 1000 WAVES"},
	NG:                              {true, "NG Protocol"},
	MassTransfer:                    {true, "Mass Transfer Transaction"},
	SmartAccounts:                   {true, "Smart Accounts"},
	DataTransaction:                 {true, "Data Transaction"},
	BurnAnyTokens:                   {true, "Burn Any Tokens"},
	FeeSponsorship:                  {true, "Fee Sponsorship"},
	FairPoS:                         {true, "Fair PoS"},
	SmartAssets:                     {true, "Smart Assets"},
	SmartAccountTrading:             {true, "Smart Account Trading"},
	Ride4DApps:                      {true, "RIDE 4 DAPPS"},
	OrderV3:                         {true, "Order Version 3"},
	ReduceNFTFee:                    {true, "Reduce NFT fee"},
	BlockReward:                     {true, "Block Reward and Community Driven Monetary Policy"},
}
View Source
var MainnetGenesis = EmbeddedGenesisGetter{}
View Source
var StagenetGenesis = FromCurrentDir("../state/genesis", "stagenet.json")
View Source
var TestnetGenesis = FromCurrentDir("../state/genesis", "testnet.json")

Functions

func ApplySettings

func ApplySettings(settings *NodeSettings, f ...func(*NodeSettings) error) error

func FromJavaEnviron

func FromJavaEnviron(settings *NodeSettings) error

func FromJavaEnvironString

func FromJavaEnvironString(settings *NodeSettings, s string)

Types

type BlockchainSettings

type BlockchainSettings struct {
	FunctionalitySettings
	Type BlockchainType
	// GenesisGetter is way how you get genesis file.
	GenesisGetter GenesisGetter
}

func DefaultSettingsForCustomBlockchain

func DefaultSettingsForCustomBlockchain(genesisGetter GenesisGetter) *BlockchainSettings

func NetworkSettingsByType

func NetworkSettingsByType(networkType string) (*BlockchainSettings, error)

type BlockchainType

type BlockchainType byte
const (
	MainNet BlockchainType = iota
	TestNet
	StageNet
	Custom
)

type EmbeddedGenesisGetter

type EmbeddedGenesisGetter struct {
}

func (EmbeddedGenesisGetter) Get

func (a EmbeddedGenesisGetter) Get() (*proto.Block, error)

type Feature

type Feature int16
const (
	SmallerMinimalGeneratingBalance Feature = iota + 1
	NG
	MassTransfer
	SmartAccounts
	DataTransaction
	BurnAnyTokens
	FeeSponsorship
	FairPoS
	SmartAssets
	SmartAccountTrading
	Ride4DApps
	OrderV3
	ReduceNFTFee
	BlockReward
)

type FeatureInfo

type FeatureInfo struct {
	Implemented bool
	Description string
}

type FunctionalitySettings

type FunctionalitySettings struct {
	// Features.
	FeaturesVotingPeriod             uint64
	VotesForFeatureActivation        uint64
	PreactivatedFeatures             []int16
	DoubleFeaturesPeriodsAfterHeight uint64

	// Heights when some of rules change.
	GenerationBalanceDepthFrom50To1000AfterHeight uint64
	BlockVersion3AfterHeight                      uint64

	// Lease cancellation.
	ResetEffectiveBalanceAtHeight uint64
	// Window when stolen aliases are valid.
	StolenAliasesWindowTimeStart uint64
	StolenAliasesWindowTimeEnd   uint64
	// Window when unreissueable assets can be reissued.
	ReissueBugWindowTimeStart           uint64
	ReissueBugWindowTimeEnd             uint64
	AllowMultipleLeaseCancelUntilTime   uint64
	AllowLeasedBalanceTransferUntilTime uint64
	// Timestamps when different kinds of checks become relevant.
	CheckTempNegativeAfterTime             uint64
	TxChangesSortedCheckAfterTime          uint64
	TxFromFutureCheckAfterTime             uint64
	UnissuedAssetUntilTime                 uint64
	InvalidReissueInSameBlockUntilTime     uint64
	MinimalGeneratingBalanceCheckAfterTime uint64

	// Diff in milliseconds.
	MaxTxTimeBackOffset    uint64
	MaxTxTimeForwardOffset uint64

	AddressSchemeCharacter proto.Scheme

	AverageBlockDelaySeconds uint64
	// Configurable.
	MaxBaseTarget uint64

	// Block Reward
	BlockRewardTerm         uint64
	InitialBlockReward      uint64
	BlockRewardIncrement    uint64
	BlockRewardVotingPeriod uint64
}

func (*FunctionalitySettings) ActivationWindowSize

func (f *FunctionalitySettings) ActivationWindowSize(height uint64) uint64

func (*FunctionalitySettings) VotesForFeatureElection

func (f *FunctionalitySettings) VotesForFeatureElection(height uint64) uint64

type GenesisGetter

type GenesisGetter interface {
	Get() (*proto.Block, error)
}

func FromCurrentDir

func FromCurrentDir(path ...string) GenesisGetter

func FromPath

func FromPath(path ...string) GenesisGetter

type NodeSettings

type NodeSettings struct {
	DeclaredAddr string
	WavesNetwork string
	Addresses    string
	HttpAddr     string
}

func (NodeSettings) Validate

func (a NodeSettings) Validate() error

Jump to

Keyboard shortcuts

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