From 094e3d787580832364abb1edf66ee4dab1a36776 Mon Sep 17 00:00:00 2001 From: Sky Young Date: Wed, 8 Jan 2020 16:09:37 -0700 Subject: [PATCH] Add proper paramaters for Regtest --- lib/protocol/networks.js | 97 ++++++++++++++++++++++++++++++++++------ 1 file changed, 83 insertions(+), 14 deletions(-) diff --git a/lib/protocol/networks.js b/lib/protocol/networks.js index 4dab9541..96a4fcb8 100644 --- a/lib/protocol/networks.js +++ b/lib/protocol/networks.js @@ -810,7 +810,7 @@ regtest.type = 'regtest'; regtest.seeds = []; -regtest.magic = 0xfabfb5da; +regtest.magic = 0xdab5bffa; regtest.port = 17412; @@ -833,14 +833,14 @@ regtest.genesis = { // @TODO: Add Genesis Block hex for Flo Regtest regtest.genesisBlock = '010000000000000000000000000000000000000000000000000000000000000000000' - + '000d9ced4ed1130f7b7faad9be25323ffafa33232a17c3edf6cfd97bee6bafbdd97da' - + 'e5494dffff7f200000000001010000000100000000000000000000000000000000000' - + '00000000000000000000000000000ffffffff4804ffff001d0104404e592054696d65' - + '732030352f4f63742f32303131205374657665204a6f62732c204170706c65e280997' - + '320566973696f6e6172792c2044696573206174203536ffffffff0100f2052a010000' - + '004341040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3e' - + 'b4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9ac' - + '00000000'; + + '00000232baba7291c9d844bb24867aafe453ea7e290685612552d595adc8d0c0f738d' + + 'b5bd51ffff7f200000000001020000000100000000000000000000000000000000000' + + '00000000000000000000000000000ffffffff4904ffff001d010441536c617368646f' + + '74202d203137204a756e652032303133202d205361756469204172616269612053657' + + '420546f2042616e2057686174734170702c20536b797065ffffffff0100e40b540200' + + '00004341040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d' + + '3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9' + + 'ac000000001d746578743a466c6f72696e636f696e2067656e6573697320626c6f636b'; regtest.pow = { limit: new BN( @@ -852,9 +852,77 @@ regtest.pow = { '0000000000000000000000000000000000000000000000000000000000000000', 'hex' ), - targetTimespan: 3.5 * 24 * 60 * 60, + targetSpacing: 40, - retargetInterval: 2016, + + /** + * Desired retarget period in seconds. + * @const {Number} + * @default + */ + + targetTimespan_Version1: 60 * 60, + targetTimespan_Version2: 15 * 40, + targetTimespan_Version3: 6 * 40, + + /** + * Retarget interval in blocks. + * @const {Number} + * @default + */ + + retargetInterval_Version1: (60 * 60) / 40, + retargetInterval_Version2: 15, + retargetInterval_Version3: 1, + + /** + * Average retarget interval in blocks. + * @const {Number} + * @default + */ + + averagingInterval_Version1: (60 * 60) / 40, + averagingInterval_Version2: 15, + averagingInterval_Version3: 6, + + /** + * Average retarget interval in blocks. + * @const {Number} + * @default + */ + + averagingIntervalTimespan_Version1: (60 * 60) / 40, + averagingIntervalTimespan_Version2: 15, + averagingIntervalTimespan_Version3: 6, + + /** + * Adjust Target Timespan Max. + * @const {Number} + * @default + */ + + adjustUp_Version1: 75, + adjustUp_Version2: 75, + adjustUp_Version3: 2, + + /** + * Adjust Target Timespan Min. + * @const {Number} + * @default + */ + + adjustDown_Version1: 300, + adjustDown_Version2: 300, + adjustDown_Version3: 3, + + /** + * Block Heights that each difficulty algorithm should be used + * @const {Number} + * @default + */ + blockHeight_Version2: 208440, + blockHeight_Version3: 426000, + targetReset: true, noRetargeting: true }; @@ -892,7 +960,7 @@ regtest.deployments = { segwit: { name: 'segwit', bit: 1, - startTime: -1, + startTime: 0, timeout: 0xffffffff, threshold: -1, window: -1, @@ -927,8 +995,9 @@ regtest.keyPrefix = { }; regtest.addressPrefix = { - pubkeyhash: 0x6f, - scripthash: 0xc4, + pubkeyhash: 0x73, + scripthash: 0xc6, + scripthash2: 0x3a, witnesspubkeyhash: 0x03, witnessscripthash: 0x28, bech32: 'rflo'