You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
4.2 KiB

  1. package config
  2. import "github.com/satori/go.uuid"
  3. import "github.com/deroproject/derosuite/crypto"
  4. // all global configuration variables are picked from here
  5. var BLOCK_TIME = uint64(120)
  6. // we are ignoring leap seconds from calculations
  7. // coin emiision related settings
  8. var COIN_MONEY_SUPPLY = uint64(18446744073709551615) // 2^64-1
  9. var COIN_EMISSION_SPEED_FACTOR = uint64(20)
  10. var COIN_DIFFICULTY_TARGET = uint64(120) // this is a feeder to emission formula
  11. var COIN_FINAL_SUBSIDY_PER_MINUTE = uint64(300000000000) // 0.3 DERO per minute = 157680 per year roughly
  12. var CRYPTONOTE_REWARD_BLOCKS_WINDOW = uint64(100) // last 100 blocks are used to create
  13. var MAX_CHAIN_HEIGHT = uint64(2147483648) // 2^31
  14. // we use this for scheduled hardforks
  15. var CURRENT_BLOCK_MAJOR_VERSION = 6
  16. var CURRENT_BLOCK_MINOR_VERSION = 6
  17. var CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE = uint64(300000) // after this block size , reward calculated differently
  18. // consider last 30 blocks for calculating difficulty
  19. var DIFFICULTY_BLOCKS_COUNT_V2 = 30
  20. const PROJECT_NAME = "dero"
  21. const POOLDATA_FILENAME = "poolstate.bin"
  22. //const CRYPTONOTE_BLOCKCHAINDATA_FILENAME "data.mdb" // these decisions are made by storage layer
  23. //#define CRYPTONOTE_BLOCKCHAINDATA_LOCK_FILENAME "lock.mdb"
  24. const P2P_NET_DATA_FILENAME = "p2pstate.bin"
  25. // we can have number of chains running for testing reasons
  26. type CHAIN_CONFIG struct {
  27. Name string
  28. Network_ID uuid.UUID // network ID
  29. Public_Address_Prefix uint64
  30. Public_Address_Prefix_Integrated uint64
  31. P2P_Default_Port uint32
  32. RPC_Default_Port uint32
  33. Genesis_Nonce uint32
  34. Genesis_Block_Hash crypto.Hash
  35. Genesis_Tx string
  36. }
  37. var Mainnet = CHAIN_CONFIG{Name: "mainnet",
  38. Network_ID: uuid.FromBytesOrNil([]byte{0x59, 0xd7, 0xf7, 0xe9, 0xdd, 0x48, 0xd5, 0xfd, 0x13, 0x0a, 0xf6, 0xe0, 0x9a, 0xec, 0xb9, 0x23}),
  39. Public_Address_Prefix: 0xc8ed8, //for dERo
  40. Public_Address_Prefix_Integrated: 0xa0ed8, //for dERi
  41. P2P_Default_Port: 18090,
  42. RPC_Default_Port: 18091,
  43. Genesis_Nonce: 10000,
  44. Genesis_Block_Hash: crypto.Hash([32]byte{0x36, 0x2d, 0x61, 0x48, 0xd6, 0x83, 0x08, 0x2d,
  45. 0x94, 0x2e, 0x53, 0xdd, 0xb5, 0x0d, 0xaf, 0x54,
  46. 0x6a, 0x10, 0x92, 0xda, 0x76, 0x98, 0x2d, 0x5b,
  47. 0xd4, 0xf1, 0x3d, 0x0d, 0xf0, 0x74, 0xec, 0x2f}),
  48. Genesis_Tx: "" +
  49. "02" + // version
  50. "3c" + // unlock time
  51. "01" + // vin length
  52. "ff" + // vin #1
  53. "00" + // height gen input
  54. "01" + // vout length
  55. "ffffffffffff07" + // output #1 amount
  56. "02" + // output 1 type
  57. "0bf6522f9152fa26cd1fc5c022b1a9e13dab697f3acf4b4d0ca6950a867a1943" + // output #1 key
  58. "21" + // extra length in bytes
  59. "01" + // extra pubkey tag
  60. "1d92826d0656958865a035264725799f39f6988faa97d532f972895de849496d" + // tx pubkey
  61. "00", // RCT signature none
  62. }
  63. var Testnet = CHAIN_CONFIG{Name: "testnet",
  64. Network_ID: uuid.FromBytesOrNil([]byte{0x59, 0xd7, 0xf7, 0xe9, 0xdd, 0x48, 0xd5, 0xfd, 0x13, 0x0a, 0xf6, 0xe0, 0x9a, 0xec, 0xb9, 0x24}),
  65. Public_Address_Prefix: 0x6cf58, // for dETo
  66. Public_Address_Prefix_Integrated: 0x44f58, //for dETi
  67. P2P_Default_Port: 28090,
  68. RPC_Default_Port: 28091,
  69. Genesis_Nonce: 10001,
  70. Genesis_Block_Hash: crypto.Hash([32]byte{0x63, 0x34, 0x12, 0xde, 0x21, 0xea, 0xcb, 0xf0,
  71. 0x03, 0xe0, 0xfb, 0x9b, 0x7f, 0xcb, 0xca, 0x97,
  72. 0x6d, 0xff, 0xd4, 0x3e, 0x3f, 0x06, 0x9e, 0x55,
  73. 0xfa, 0xf1, 0xc5, 0xb4, 0x46, 0x2b, 0x59, 0x3a}),
  74. Genesis_Tx: "" +
  75. "02" + // version
  76. "3c" + // unlock time
  77. "01" + // vin length
  78. "ff" + // vin #1
  79. "00" + // height gen input
  80. "01" + // vout length
  81. "ffffffffffff07" + // output #1 amount
  82. "02" + // output 1 type
  83. "0bf6522f9152fa26cd1fc5c022b1a9e13dab697f3acf4b4d0ca6950a867a1943" + // output #1 key
  84. "21" + // extra length in bytes
  85. "01" + // extra pubkey tag
  86. "1d92826d0656958865a035264725799f39f6988faa97d532f972895de849496d" + // tx pubkey
  87. "00", // RCT signature none
  88. }
  89. // on init this variable is updated to setup global config in 1 go
  90. //var Current_Config CHAIN_CONFIG
  91. func init() {
  92. //Current_Config = Mainnet // default is mainnnet
  93. //Current_Config = Testnet // default is mainnnet
  94. }