configuration

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2021 License: Unlicense Imports: 9 Imported by: 0

Documentation

Overview

This package will eventually consolidate all data relevant to the genesis of one particular Nyzo chain: The amount of coins in the system, block time, the genesis block, the trusted entry points etc. The idea is, that to start a new chain with Nyzo characteristics, the contents of this package are the only things you'd have to change.

Index

Constants

View Source
const (
	// Software version
	Version = "go-550"

	// If we have a coin value of $1 = ∩1, then the transaction increment is one-ten-thousandth of a cent, and the
	// market cap is $100 million. If we have a coin value of $100,000, then the transaction increment is $0.10,
	// and the market cap is $10 trillion.
	NyzosInSystem                 = 100000000
	MicronyzoMultiplierRatio      = 1000000
	MicronyzosInSystem            = NyzosInSystem * MicronyzoMultiplierRatio
	MaximumCycleTransactionAmount = 100000 * MicronyzoMultiplierRatio
	// Charge an account maintenance fee every ... blocks
	BlocksBetweenFee = 500

	// v2 cycle transaction caps
	ApprovedCycleTransactionRetentionInterval = 10000
	MaximumCycleTransactionSumPerInterval     = 100000 * MicronyzoMultiplierRatio

	// Target block duration in milliseconds
	BlockDuration = 7000

	// Sentinel automatic whitelisting interval, in milliseconds (10 minutes)
	DynamicWhitelistInterval = 1000 * 60 * 10

	PrivateKeyFileName       = "verifier_private_seed"
	VerifierInfoFileName     = "verifier_info"
	NicknameFileName         = "nickname"
	EntryPointFileName       = "trusted_entry_points"
	ManagedVerifiersFileName = "managed_verifiers"
	NodesFileName            = "nodes"
	PersistentDataFileName   = "persistent_data"
	PreferencesFileName      = "preferences"
	BlockDirectory           = "blocks"
	IndividualBlockDirectory = "blocks/individual"
	GenesisBlockFileName     = "i_000000000.nyzoblock"
	LockedAccountsFileName   = "locked_accounts"
	SeedTransactionDirectory = "seed_transactions"
	SeedTransactionSource    = "https://nyzo-transactions.nyc3.digitaloceanspaces.com"

	// The public id of the genesis block verifier
	GenesisVerifierNyzoHex = "64afc20a4a4097e8-494239f2e7d1b1db-de59a9b157453138-f4716b72a0424fef"
	// Not sure what this account is/was used for, but we have to reproduce it to be compatible with the Java version
	TransferAccountNyzoHex = "0000000000000000-0000000000000000-0000000000000000-0000000000000001"
	// Imaginary account (no known private key) for cycle funding
	CycleAccountNyzoHex = "0000000000000000-0000000000000000-0000000000000000-0000000000000002"

	// How long a new verifier has to wait until it enters the lottery, in milliseconds (30 days)
	LotteryWaitTime = 1000 * 60 * 60 * 24 * 30

	// Online block source
	OnlineBlockSource = "https://nyzo-blocks.nyc3.digitaloceanspaces.com"

	// Listening ports
	ListeningPortTcp = 9444
	ListeningPortUdp = 9446

	// Keys for persistent data key value store
	HaveNodeHistoryKey           = "have_node_history"
	WinningIdentifierKey         = "winning_identifier"
	LastVerifierJoinHeightKey    = "last_verifier_join_height"
	LastVerifierRemovalHeightKey = "last_verifier_removal_height"

	// Keys for user preferences
	SqlProtocolKey                         = "sql_protocol"
	SqlHostKey                             = "sql_host"
	SqlPortKey                             = "sql_port"
	SqlDbNameKey                           = "sql_db_name"
	SqlUserKey                             = "sql_user"
	SqlPasswordKey                         = "sql_password"
	BlockFileConsolidatorKey               = "block_file_consolidator"
	BlockFileConsolidatorOptionConsolidate = "consolidate"
	BlockFileConsolidatorOptionDelete      = "delete"
	BlockFileConsolidatorOptionDisable     = "disable"
	FastChainInitializationKey             = "fast_chain_initialization"
)

Variables

View Source
var CycleAccount []byte
View Source
var DataDirectory string
View Source
var GenesisVerifier []byte
View Source
var LockedAccounts map[string]struct{}
View Source
var TransferAccount []byte

Functions

func EnsureSetup

func EnsureSetup() error

Make sure that our environment is set up correctly and that we have all the info needed to start a node.

func IsLockedAccount

func IsLockedAccount(id []byte) bool

Returns true if id is in the locked accounts list

Types

This section is empty.

Jump to

Keyboard shortcuts

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