itns-sidechain/lib/protocol/networks.js

821 lines
16 KiB
JavaScript
Raw Normal View History

2016-08-23 23:26:50 -07:00
/*!
* network.js - bitcoin networks for bcoin
* Copyright (c) 2014-2015, Fedor Indutny (MIT License)
2017-02-03 22:47:26 -08:00
* Copyright (c) 2014-2017, Christopher Jeffrey (MIT License).
2016-08-23 23:26:50 -07:00
* https://github.com/bcoin-org/bcoin
*/
'use strict';
/**
2017-02-03 22:47:26 -08:00
* @module protocol/networks
2016-08-23 23:26:50 -07:00
*/
2017-11-17 00:49:02 -08:00
const BN = require('bn.js');
2017-02-03 22:47:26 -08:00
2017-06-29 20:54:07 -07:00
const network = exports;
2016-08-23 23:26:50 -07:00
/**
* Network type list.
2017-02-03 22:47:26 -08:00
* @memberof module:protocol/networks
2016-08-23 23:26:50 -07:00
* @const {String[]}
* @default
*/
network.types = ['main', 'testnet', 'regtest', 'simnet'];
2016-08-23 23:26:50 -07:00
/**
2017-02-03 22:47:26 -08:00
* Mainnet
2016-08-23 23:26:50 -07:00
* @static
2017-02-03 22:47:26 -08:00
* @lends module:protocol/networks
2016-08-23 23:26:50 -07:00
* @type {Object}
*/
const main = {};
2016-08-23 23:26:50 -07:00
/**
* Symbolic network type.
* @const {String}
* @default
*/
main.type = 'main';
/**
* Default DNS seeds.
2016-08-23 23:26:50 -07:00
* @const {String[]}
* @default
*/
main.seeds = [
2017-12-31 15:08:01 -08:00
'127.0.0.1'
2016-08-23 23:26:50 -07:00
];
/**
* Packet magic number.
* @const {Number}
* @default
*/
2017-12-31 15:08:01 -08:00
main.magic = 0xebf10ad8;
2016-08-23 23:26:50 -07:00
/**
* Default network port.
* @const {Number}
* @default
*/
2017-12-31 15:08:01 -08:00
main.port = 12038;
2016-08-23 23:26:50 -07:00
/**
* Checkpoint block list.
* @const {Object}
*/
2018-01-02 20:24:56 -08:00
main.checkpointMap = {};
2016-08-23 23:26:50 -07:00
2017-01-19 04:35:12 -08:00
/**
* Last checkpoint height.
* @const {Number}
* @default
*/
2017-12-31 15:08:01 -08:00
main.lastCheckpoint = 0;
2016-08-23 23:26:50 -07:00
/**
2018-01-05 03:17:44 -08:00
* Reward halving interval.
2016-08-23 23:26:50 -07:00
* @const {Number}
* @default
*/
2018-01-05 03:17:44 -08:00
main.halvingInterval = 875000;
2016-08-23 23:26:50 -07:00
/**
* Genesis block header.
2017-12-30 03:49:28 -08:00
* @const {Object}
2016-08-23 23:26:50 -07:00
*/
main.genesis = {
2017-12-31 15:08:01 -08:00
version: 0,
hash: '278c36df6a34966988b0c35c369124cc65bd909fdadedfd57390d2228cdb7f6b',
2016-08-23 23:26:50 -07:00
prevBlock: '0000000000000000000000000000000000000000000000000000000000000000',
2017-07-31 00:34:42 -07:00
merkleRoot:
'268372f68cc865c35d9af886886bc301969cfe5901f357759d03e33a7ab722aa',
2017-12-31 15:08:01 -08:00
witnessRoot:
'6c91741305d5863ca4fb95cad7f8c41bb06d82e6e3a1515e12b40be90d230836',
trieRoot:
'03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314',
2018-01-02 20:24:56 -08:00
time: 1514765688,
bits: 0x207fffff,
nonce: Buffer.from('00000000000000000000000000000000', 'hex'),
solution: new Uint32Array(42),
2016-10-24 10:52:28 -07:00
height: 0
2016-08-23 23:26:50 -07:00
};
/**
* The network's genesis block in a hex string.
* @const {String}
*/
2017-12-31 15:08:01 -08:00
main.genesisBlock = ''
+ '0000000000000000000000000000000000000000000000000000000000000000'
+ '00000000268372f68cc865c35d9af886886bc301969cfe5901f357759d03e33a'
+ '7ab722aa6c91741305d5863ca4fb95cad7f8c41bb06d82e6e3a1515e12b40be9'
+ '0d23083603170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf'
+ '4c111314787d495a00000000ffff7f2000000000000000000000000000000000'
2017-12-31 15:08:01 -08:00
+ '2a00000000000000000000000000000000000000000000000000000000000000'
+ '0000000000000000000000000000000000000000000000000000000000000000'
+ '0000000000000000000000000000000000000000000000000000000000000000'
+ '0000000000000000000000000000000000000000000000000000000000000000'
+ '0000000000000000000000000000000000000000000000000000000000000000'
+ '0000000000000000000100000000010000000000000000000000000000000000'
+ '000000000000000000000000000000ffffffff013830312f4e6f762f32303137'
+ '2045464620746f204943414e4e3a20446f6e2774205069636b20557020746865'
+ '2043656e736f7227732050656effffffff0100b4c404000000000014197a438a'
+ '75ceee7e58a03ebab3eabf9afd8080c2000000000000';
2016-08-23 23:26:50 -07:00
/**
* POW-related constants.
* @enum {Number}
* @default
*/
2018-01-02 20:24:56 -08:00
main.pow = {};
2016-08-23 23:26:50 -07:00
2018-01-02 20:24:56 -08:00
/**
* Default target.
* @const {BN}
*/
2016-08-23 23:26:50 -07:00
2018-01-02 20:24:56 -08:00
main.pow.limit = new BN(
'7fffff0000000000000000000000000000000000000000000000000000000000',
'hex'
);
2018-01-02 20:24:56 -08:00
/**
* Compact pow limit.
* @const {Number}
* @default
*/
2018-01-02 20:24:56 -08:00
main.pow.bits = 0x207fffff;
2017-01-08 23:05:54 -08:00
2018-01-02 20:24:56 -08:00
/**
* Minimum chainwork for best chain.
* @const {BN}
*/
2017-01-08 23:05:54 -08:00
2018-01-02 20:24:56 -08:00
main.pow.chainwork = new BN(
'0000000000000000000000000000000000000000000000000000000000000000',
'hex'
);
2016-08-23 23:26:50 -07:00
2018-01-02 20:24:56 -08:00
/**
* Retarget window in blocks.
* @const {Number}
* @default
*/
2016-08-23 23:26:50 -07:00
2018-01-02 20:24:56 -08:00
main.pow.targetWindow = 20;
2016-08-23 23:26:50 -07:00
2018-01-02 20:24:56 -08:00
/**
* Average block time.
* @const {Number}
* @default
*/
2016-08-23 23:26:50 -07:00
2018-01-02 20:24:56 -08:00
main.pow.targetSpacing = 10 * 60 / 4;
2018-01-02 20:24:56 -08:00
/**
* Desired retarget period in seconds.
* @const {Number}
* @default
*/
2018-01-02 20:24:56 -08:00
main.pow.targetTimespan = main.pow.targetWindow * main.pow.targetSpacing;
2016-08-23 23:26:50 -07:00
2018-01-02 20:24:56 -08:00
/**
* Minimum actual time.
* @const {Number}
* @default
*/
2016-08-23 23:26:50 -07:00
2018-01-02 20:24:56 -08:00
main.pow.minActual = ((main.pow.targetTimespan * (100 - 16)) / 100) >>> 0;
2016-08-23 23:26:50 -07:00
2018-01-02 20:24:56 -08:00
/**
* Maximum actual time.
* @const {Number}
* @default
*/
main.pow.maxActual = ((main.pow.targetTimespan * (100 + 32)) / 100) >>> 0;
/**
* Whether to reset target if a block
* has not been mined recently.
* @const {Boolean}
* @default
*/
main.pow.targetReset = false;
/**
* Do not allow retargetting.
* @const {Boolean}
* @default
*/
main.pow.noRetargeting = false;
2016-08-23 23:26:50 -07:00
/**
2017-12-31 15:08:01 -08:00
* Cuckoo-related constants.
2016-08-23 23:26:50 -07:00
* @enum {Number}
* @default
*/
2017-12-31 15:08:01 -08:00
main.cuckoo = {
bits: 30, // 4GB
size: 42,
2018-01-02 20:24:56 -08:00
ease: 50
2017-12-31 15:08:01 -08:00
};
2017-12-31 15:08:01 -08:00
/**
* Block constants.
* @enum {Number}
* @default
*/
2017-12-31 15:08:01 -08:00
main.block = {
2016-08-23 23:26:50 -07:00
/**
* Safe height to start pruning.
*/
2018-01-02 20:24:56 -08:00
pruneAfterHeight: 1000 * 4,
2016-10-22 14:17:27 -07:00
/**
* Safe number of blocks to keep.
*/
2018-01-02 20:24:56 -08:00
keepBlocks: 288 * 4,
2016-08-23 23:26:50 -07:00
/**
* Age used for the time delta to
* determine whether the chain is synced.
*/
maxTipAge: 24 * 60 * 60,
/**
* Height at which block processing is
* slow enough that we can output
* logs without spamming.
*/
2018-01-02 20:24:56 -08:00
slowHeight: 0
2016-08-23 23:26:50 -07:00
};
/**
* For versionbits.
* @const {Number}
* @default
*/
2018-01-05 03:17:44 -08:00
main.activationThreshold = 1916 * 4;
2016-08-23 23:26:50 -07:00
/**
* Confirmation window for versionbits.
* @const {Number}
* @default
*/
2018-01-05 03:17:44 -08:00
main.minerWindow = 2016 * 4;
2016-08-23 23:26:50 -07:00
/**
* Deployments for versionbits.
* @const {Object}
* @default
*/
main.deployments = {
2017-07-21 11:42:09 -07:00
testdummy: {
name: 'testdummy',
bit: 28,
startTime: 1199145601, // January 1, 2008
timeout: 1230767999, // December 31, 2008
threshold: -1,
window: -1,
required: false,
force: true
2016-08-23 23:26:50 -07:00
}
};
2016-11-23 15:18:38 -08:00
/**
* Deployments for versionbits (array form, sorted).
* @const {Array}
* @default
*/
main.deploys = [
main.deployments.testdummy
];
2016-08-23 23:26:50 -07:00
/**
* Key prefixes.
* @enum {Number}
* @default
*/
main.keyPrefix = {
2016-10-21 01:33:06 -07:00
privkey: 0x80,
2016-08-23 23:26:50 -07:00
xpubkey: 0x0488b21e,
xprivkey: 0x0488ade4,
2016-09-08 17:43:58 -07:00
xpubkey58: 'xpub',
2017-05-13 18:36:26 -07:00
xprivkey58: 'xprv',
2016-09-08 17:43:58 -07:00
coinType: 0
2016-08-23 23:26:50 -07:00
};
/**
* {@link Address} prefixes.
* @enum {Number}
*/
main.addressPrefix = {
2018-01-05 12:58:39 -08:00
bech32: 'hs'
2016-08-23 23:26:50 -07:00
};
/**
* Default value for whether the mempool
* accepts non-standard transactions.
* @const {Boolean}
* @default
*/
main.requireStandard = true;
/**
* Default http port.
* @const {Number}
* @default
*/
2018-01-02 20:24:56 -08:00
main.rpcPort = 12037;
2016-08-23 23:26:50 -07:00
2017-10-26 11:58:50 -07:00
/**
* Default wallet port.
* @const {Number}
* @default
*/
2018-01-02 20:24:56 -08:00
main.walletPort = 12039;
2017-10-26 11:58:50 -07:00
2016-08-23 23:26:50 -07:00
/**
* Default min relay rate.
2016-08-23 23:26:50 -07:00
* @const {Rate}
* @default
*/
2016-12-08 02:11:33 -08:00
main.minRelay = 1000;
2016-08-23 23:26:50 -07:00
/**
* Default normal relay rate.
* @const {Rate}
* @default
*/
2017-02-22 11:38:37 -08:00
main.feeRate = 100000;
2016-08-23 23:26:50 -07:00
/**
* Maximum normal relay rate.
* @const {Rate}
* @default
*/
2017-02-22 11:38:37 -08:00
main.maxFeeRate = 400000;
2016-08-23 23:26:50 -07:00
/**
* Whether to allow self-connection.
* @const {Boolean}
*/
main.selfConnect = false;
/**
* Whether to request mempool on sync.
* @const {Boolean}
*/
main.requestMempool = false;
/*
2018-01-02 20:24:56 -08:00
* Testnet
2016-08-23 23:26:50 -07:00
*/
const testnet = {};
2016-08-23 23:26:50 -07:00
testnet.type = 'testnet';
testnet.seeds = [
2018-01-02 20:24:56 -08:00
'127.0.0.1'
2016-08-23 23:26:50 -07:00
];
2018-01-02 20:24:56 -08:00
testnet.magic = 0x8efa1fbe;
2016-08-23 23:26:50 -07:00
2018-01-02 20:24:56 -08:00
testnet.port = 13038;
testnet.checkpointMap = {};
testnet.lastCheckpoint = 0;
2016-08-23 23:26:50 -07:00
2018-01-05 03:17:44 -08:00
testnet.halvingInterval = 875000;
2016-08-23 23:26:50 -07:00
testnet.genesis = {
2018-01-02 20:24:56 -08:00
version: 0,
hash: 'a126bf34683dfe1b17646b2d3472d4ebbb20a4b246014f788e8bb6a0badfd7d8',
2016-08-23 23:26:50 -07:00
prevBlock: '0000000000000000000000000000000000000000000000000000000000000000',
2017-07-31 00:34:42 -07:00
merkleRoot:
'268372f68cc865c35d9af886886bc301969cfe5901f357759d03e33a7ab722aa',
2018-01-02 20:24:56 -08:00
witnessRoot:
'6c91741305d5863ca4fb95cad7f8c41bb06d82e6e3a1515e12b40be90d230836',
trieRoot:
'03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314',
2018-01-02 20:24:56 -08:00
time: 1514765689,
bits: 0x207fffff,
nonce: Buffer.from('00000000000000000000000000000000', 'hex'),
solution: new Uint32Array(18),
2016-10-24 10:52:28 -07:00
height: 0
2016-08-23 23:26:50 -07:00
};
2018-01-02 20:24:56 -08:00
testnet.genesisBlock = ''
+ '0000000000000000000000000000000000000000000000000000000000000000'
+ '00000000268372f68cc865c35d9af886886bc301969cfe5901f357759d03e33a'
+ '7ab722aa6c91741305d5863ca4fb95cad7f8c41bb06d82e6e3a1515e12b40be9'
+ '0d23083603170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf'
+ '4c111314797d495a00000000ffff7f2000000000000000000000000000000000'
2018-01-02 20:24:56 -08:00
+ '1200000000000000000000000000000000000000000000000000000000000000'
+ '0000000000000000000000000000000000000000000000000000000000000000'
+ '0000000000000000000100000000010000000000000000000000000000000000'
+ '000000000000000000000000000000ffffffff013830312f4e6f762f32303137'
+ '2045464620746f204943414e4e3a20446f6e2774205069636b20557020746865'
+ '2043656e736f7227732050656effffffff0100b4c404000000000014197a438a'
+ '75ceee7e58a03ebab3eabf9afd8080c2000000000000';
2018-01-02 20:24:56 -08:00
testnet.pow = {};
testnet.pow.limit = new BN(
'7fffff0000000000000000000000000000000000000000000000000000000000',
'hex'
);
testnet.pow.bits = 0x207fffff;
testnet.pow.chainwork = new BN(
'0000000000000000000000000000000000000000000000000000000000000000',
'hex'
);
testnet.pow.targetWindow = 20;
testnet.pow.targetSpacing = 10 * 60 / 4;
testnet.pow.targetTimespan =
testnet.pow.targetWindow * testnet.pow.targetSpacing;
testnet.pow.minActual = ((testnet.pow.targetTimespan * (100 - 16)) / 100) >>> 0;
testnet.pow.maxActual = ((testnet.pow.targetTimespan * (100 + 32)) / 100) >>> 0;
testnet.pow.targetReset = true;
testnet.pow.noRetargeting = false;
2017-12-31 15:08:01 -08:00
testnet.cuckoo = {
2018-01-02 20:24:56 -08:00
bits: 16,
size: 18,
ease: 50
2017-12-31 15:08:01 -08:00
};
2016-08-23 23:26:50 -07:00
testnet.block = {
2018-01-02 20:24:56 -08:00
pruneAfterHeight: 1000 * 4,
keepBlocks: 10000 * 4,
2016-08-23 23:26:50 -07:00
maxTipAge: 24 * 60 * 60,
2018-01-02 20:24:56 -08:00
slowHeight: 0
2016-08-23 23:26:50 -07:00
};
2018-01-05 03:17:44 -08:00
testnet.activationThreshold = 1512 * 4;
2016-08-23 23:26:50 -07:00
2018-01-05 03:17:44 -08:00
testnet.minerWindow = 2016 * 4;
2016-08-23 23:26:50 -07:00
testnet.deployments = {
2017-07-21 11:42:09 -07:00
testdummy: {
name: 'testdummy',
bit: 28,
startTime: 1199145601, // January 1, 2008
timeout: 1230767999, // December 31, 2008
threshold: -1,
window: -1,
required: false,
force: true
2016-08-23 23:26:50 -07:00
}
};
2016-11-23 15:18:38 -08:00
testnet.deploys = [
testnet.deployments.testdummy
];
2016-08-23 23:26:50 -07:00
testnet.keyPrefix = {
2016-10-21 01:33:06 -07:00
privkey: 0xef,
2016-08-23 23:26:50 -07:00
xpubkey: 0x043587cf,
xprivkey: 0x04358394,
2016-09-08 17:43:58 -07:00
xpubkey58: 'tpub',
2017-05-13 18:36:26 -07:00
xprivkey58: 'tprv',
2016-09-08 17:43:58 -07:00
coinType: 1
2016-08-23 23:26:50 -07:00
};
testnet.addressPrefix = {
2018-01-05 12:58:39 -08:00
bech32: 'ts'
2016-08-23 23:26:50 -07:00
};
testnet.requireStandard = false;
2018-01-02 20:24:56 -08:00
testnet.rpcPort = 13037;
2016-08-23 23:26:50 -07:00
2018-01-02 20:24:56 -08:00
testnet.walletPort = 13039;
2017-10-26 11:58:50 -07:00
2016-12-08 02:11:33 -08:00
testnet.minRelay = 1000;
2016-08-23 23:26:50 -07:00
testnet.feeRate = 20000;
testnet.maxFeeRate = 60000;
2018-01-02 20:24:56 -08:00
testnet.selfConnect = true;
2016-08-23 23:26:50 -07:00
testnet.requestMempool = false;
/*
* Regtest
*/
const regtest = {};
2016-08-23 23:26:50 -07:00
regtest.type = 'regtest';
regtest.seeds = [
'127.0.0.1'
];
2018-01-02 20:24:56 -08:00
regtest.magic = 0xbcf173aa;
2016-08-23 23:26:50 -07:00
2018-01-02 20:24:56 -08:00
regtest.port = 14038;
2016-08-23 23:26:50 -07:00
2017-01-21 03:01:18 -08:00
regtest.checkpointMap = {};
2017-01-19 04:35:12 -08:00
regtest.lastCheckpoint = 0;
2016-08-23 23:26:50 -07:00
regtest.halvingInterval = 150;
regtest.genesis = {
2018-01-02 20:24:56 -08:00
version: 0,
hash: 'efad42980aeca59254a17f8ea40df2f5dc43db6a020c5e60a4e620e953aa6d99',
2016-08-23 23:26:50 -07:00
prevBlock: '0000000000000000000000000000000000000000000000000000000000000000',
2017-07-31 00:34:42 -07:00
merkleRoot:
'268372f68cc865c35d9af886886bc301969cfe5901f357759d03e33a7ab722aa',
2018-01-02 20:24:56 -08:00
witnessRoot:
'6c91741305d5863ca4fb95cad7f8c41bb06d82e6e3a1515e12b40be90d230836',
trieRoot:
'03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314',
2018-01-02 20:24:56 -08:00
time: 1514765690,
bits: 0x207fffff,
nonce: Buffer.from('00000000000000000000000000000000', 'hex'),
solution: new Uint32Array(18),
2016-10-24 10:52:28 -07:00
height: 0
2016-08-23 23:26:50 -07:00
};
2018-01-02 20:24:56 -08:00
regtest.genesisBlock = ''
+ '0000000000000000000000000000000000000000000000000000000000000000'
+ '00000000268372f68cc865c35d9af886886bc301969cfe5901f357759d03e33a'
+ '7ab722aa6c91741305d5863ca4fb95cad7f8c41bb06d82e6e3a1515e12b40be9'
+ '0d23083603170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf'
+ '4c1113147a7d495a00000000ffff7f2000000000000000000000000000000000'
2018-01-02 20:24:56 -08:00
+ '1200000000000000000000000000000000000000000000000000000000000000'
+ '0000000000000000000000000000000000000000000000000000000000000000'
+ '0000000000000000000100000000010000000000000000000000000000000000'
+ '000000000000000000000000000000ffffffff013830312f4e6f762f32303137'
+ '2045464620746f204943414e4e3a20446f6e2774205069636b20557020746865'
+ '2043656e736f7227732050656effffffff0100b4c404000000000014197a438a'
+ '75ceee7e58a03ebab3eabf9afd8080c2000000000000';
2018-01-02 20:24:56 -08:00
regtest.pow = {};
regtest.pow.limit = new BN(
'7fffff0000000000000000000000000000000000000000000000000000000000',
'hex'
);
regtest.pow.bits = 0x207fffff;
regtest.pow.chainwork = new BN(
'0000000000000000000000000000000000000000000000000000000000000000',
'hex'
);
regtest.pow.targetWindow = 20;
regtest.pow.targetSpacing = 10 * 60 / 4;
regtest.pow.targetTimespan =
regtest.pow.targetWindow * regtest.pow.targetSpacing;
regtest.pow.minActual = ((regtest.pow.targetTimespan * (100 - 16)) / 100) >>> 0;
regtest.pow.maxActual = ((regtest.pow.targetTimespan * (100 + 32)) / 100) >>> 0;
regtest.pow.targetReset = true;
regtest.pow.noRetargeting = true;
2016-08-23 23:26:50 -07:00
2017-12-31 15:08:01 -08:00
regtest.cuckoo = {
2018-01-02 20:24:56 -08:00
bits: 16,
size: 18,
ease: 50
2017-12-31 15:08:01 -08:00
};
2016-08-23 23:26:50 -07:00
regtest.block = {
2018-01-02 20:24:56 -08:00
pruneAfterHeight: 1000 * 4,
keepBlocks: 10000 * 4,
maxTipAge: 0xffffffff,
slowHeight: 0
2016-08-23 23:26:50 -07:00
};
2018-01-05 03:17:44 -08:00
regtest.activationThreshold = 108 * 4;
2016-08-23 23:26:50 -07:00
2018-01-05 03:17:44 -08:00
regtest.minerWindow = 144 * 4;
2016-08-23 23:26:50 -07:00
regtest.deployments = {
2017-07-21 11:42:09 -07:00
testdummy: {
name: 'testdummy',
bit: 28,
startTime: 0,
timeout: 0xffffffff,
threshold: -1,
window: -1,
required: false,
force: true
2016-08-23 23:26:50 -07:00
}
};
2016-11-23 15:18:38 -08:00
regtest.deploys = [
regtest.deployments.testdummy
];
2016-08-23 23:26:50 -07:00
regtest.keyPrefix = {
2017-05-13 18:35:17 -07:00
privkey: 0x5a,
xpubkey: 0xeab4fa05,
xprivkey: 0xeab404c7,
xpubkey58: 'rpub',
2017-05-13 18:36:26 -07:00
xprivkey58: 'rprv',
2016-09-08 17:43:58 -07:00
coinType: 1
2016-08-23 23:26:50 -07:00
};
regtest.addressPrefix = {
2018-01-05 12:58:39 -08:00
bech32: 'rs'
2016-08-23 23:26:50 -07:00
};
regtest.requireStandard = false;
2018-01-02 20:24:56 -08:00
regtest.rpcPort = 14037;
2016-08-23 23:26:50 -07:00
2018-01-02 20:24:56 -08:00
regtest.walletPort = 14039;
2017-10-26 11:58:50 -07:00
2016-12-08 02:11:33 -08:00
regtest.minRelay = 1000;
2016-08-23 23:26:50 -07:00
regtest.feeRate = 20000;
regtest.maxFeeRate = 60000;
2016-08-23 23:26:50 -07:00
regtest.selfConnect = true;
regtest.requestMempool = true;
2016-09-08 17:43:58 -07:00
/*
2018-01-02 20:24:56 -08:00
* Simnet
2016-09-08 17:43:58 -07:00
*/
const simnet = {};
2016-09-08 17:43:58 -07:00
simnet.type = 'simnet';
simnet.seeds = [
'127.0.0.1'
];
2018-01-02 20:24:56 -08:00
simnet.magic = 0x473bd012;
2016-09-08 17:43:58 -07:00
2018-01-02 20:24:56 -08:00
simnet.port = 15038;
2016-09-08 17:43:58 -07:00
2017-01-21 03:01:18 -08:00
simnet.checkpointMap = {};
2016-09-08 17:43:58 -07:00
2017-01-19 04:35:12 -08:00
simnet.lastCheckpoint = 0;
2016-09-08 17:43:58 -07:00
2018-01-05 03:17:44 -08:00
simnet.halvingInterval = 875000;
2016-09-08 17:43:58 -07:00
simnet.genesis = {
2018-01-02 20:24:56 -08:00
version: 0,
hash: 'b185fff116006d8099bc50fa072f2beed6c077be0ec9160d2f5a6401a2dfdeb6',
2016-09-08 17:43:58 -07:00
prevBlock: '0000000000000000000000000000000000000000000000000000000000000000',
2017-07-31 00:34:42 -07:00
merkleRoot:
'268372f68cc865c35d9af886886bc301969cfe5901f357759d03e33a7ab722aa',
2018-01-02 20:24:56 -08:00
witnessRoot:
'6c91741305d5863ca4fb95cad7f8c41bb06d82e6e3a1515e12b40be90d230836',
trieRoot:
'03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314',
2018-01-02 20:24:56 -08:00
time: 1514765691,
bits: 0x207fffff,
nonce: Buffer.from('00000000000000000000000000000000', 'hex'),
solution: new Uint32Array(18),
2016-10-24 10:52:28 -07:00
height: 0
2016-09-08 17:43:58 -07:00
};
2018-01-02 20:24:56 -08:00
simnet.genesisBlock = ''
+ '0000000000000000000000000000000000000000000000000000000000000000'
+ '00000000268372f68cc865c35d9af886886bc301969cfe5901f357759d03e33a'
+ '7ab722aa6c91741305d5863ca4fb95cad7f8c41bb06d82e6e3a1515e12b40be9'
+ '0d23083603170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf'
+ '4c1113147b7d495a00000000ffff7f2000000000000000000000000000000000'
2018-01-02 20:24:56 -08:00
+ '1200000000000000000000000000000000000000000000000000000000000000'
+ '0000000000000000000000000000000000000000000000000000000000000000'
+ '0000000000000000000100000000010000000000000000000000000000000000'
+ '000000000000000000000000000000ffffffff013830312f4e6f762f32303137'
+ '2045464620746f204943414e4e3a20446f6e2774205069636b20557020746865'
+ '2043656e736f7227732050656effffffff0100b4c404000000000014197a438a'
+ '75ceee7e58a03ebab3eabf9afd8080c2000000000000';
2018-01-02 20:24:56 -08:00
simnet.pow = {};
simnet.pow.limit = new BN(
'7fffff0000000000000000000000000000000000000000000000000000000000',
'hex'
);
simnet.pow.bits = 0x207fffff;
simnet.pow.chainwork = new BN(
'0000000000000000000000000000000000000000000000000000000000000000',
'hex'
);
simnet.pow.targetWindow = 20;
simnet.pow.targetSpacing = 10 * 60 / 4;
simnet.pow.targetTimespan =
simnet.pow.targetWindow * simnet.pow.targetSpacing;
simnet.pow.minActual = ((simnet.pow.targetTimespan * (100 - 16)) / 100) >>> 0;
simnet.pow.maxActual = ((simnet.pow.targetTimespan * (100 + 32)) / 100) >>> 0;
simnet.pow.targetReset = true;
simnet.pow.noRetargeting = false;
2016-09-08 17:43:58 -07:00
2017-12-31 15:08:01 -08:00
simnet.cuckoo = {
2018-01-02 20:24:56 -08:00
bits: 16,
size: 18,
ease: 50
2017-12-31 15:08:01 -08:00
};
2016-09-08 17:43:58 -07:00
simnet.block = {
2018-01-02 20:24:56 -08:00
pruneAfterHeight: 1000 * 4,
keepBlocks: 10000 * 4,
maxTipAge: 0xffffffff,
2016-09-08 17:43:58 -07:00
slowHeight: 0
};
2018-01-05 03:17:44 -08:00
simnet.activationThreshold = 75 * 4;
2016-09-08 17:43:58 -07:00
2018-01-05 03:17:44 -08:00
simnet.minerWindow = 100 * 4;
2016-09-08 17:43:58 -07:00
simnet.deployments = {
2017-07-21 11:42:09 -07:00
testdummy: {
name: 'testdummy',
bit: 28,
startTime: 1199145601, // January 1, 2008
timeout: 1230767999, // December 31, 2008
threshold: -1,
window: -1,
required: false,
force: true
2016-09-08 17:43:58 -07:00
}
};
2016-11-23 15:18:38 -08:00
simnet.deploys = [
simnet.deployments.testdummy
];
2016-09-08 17:43:58 -07:00
simnet.keyPrefix = {
2016-10-21 01:33:06 -07:00
privkey: 0x64,
2016-09-08 17:43:58 -07:00
xpubkey: 0x0420bd3a,
xprivkey: 0x0420b900,
xpubkey58: 'spub',
2017-05-13 18:36:26 -07:00
xprivkey58: 'sprv',
2016-09-08 17:43:58 -07:00
coinType: 115
};
simnet.addressPrefix = {
2018-01-05 12:58:39 -08:00
bech32: 'ss'
2016-09-08 17:43:58 -07:00
};
simnet.requireStandard = false;
2018-01-02 20:24:56 -08:00
simnet.rpcPort = 15037;
2016-09-08 17:43:58 -07:00
2018-01-02 20:24:56 -08:00
simnet.walletPort = 15039;
2017-10-26 11:58:50 -07:00
2016-12-08 02:11:33 -08:00
simnet.minRelay = 1000;
2016-09-08 17:43:58 -07:00
simnet.feeRate = 20000;
simnet.maxFeeRate = 60000;
2018-01-02 20:24:56 -08:00
simnet.selfConnect = true;
2016-09-08 17:43:58 -07:00
simnet.requestMempool = false;
/*
* Expose
*/
network.main = main;
network.testnet = testnet;
network.regtest = regtest;
network.simnet = simnet;