introduce poolOptions for legacy, p2sh and bech32 keys (#604)
* [MPOS] pass share difficulty to MySQL ++ Additionally to the changes on master we are removing the MPOS difficulty multiplier here. MPOS has been updated (currently development branch) to handle low difficulties nicely. * add config for chaincoin * remove redundant * introduce poolOptions for p2sh and bech32 keys and add coin.json examples
This commit is contained in:
parent
0b238adccd
commit
2061e666c9
25
coins/00_example.json
Normal file
25
coins/00_example.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "Example",
|
||||
"symbol": "EXM",
|
||||
"algorithm": "x99",
|
||||
"peerMagic": "0f0f0f0f",
|
||||
"peerMagicTestnet": "f0f0f0f0",
|
||||
|
||||
"mainnet": {
|
||||
"bech32": "ex",
|
||||
"bip32": {
|
||||
"public": "0f0f0f0f"
|
||||
},
|
||||
"pubKeyHash": "00",
|
||||
"scriptHash": "ff"
|
||||
},
|
||||
|
||||
"testnet": {
|
||||
"bech32": "tex",
|
||||
"bip32": {
|
||||
"public": "f0f0f0f0"
|
||||
},
|
||||
"pubKeyHash": "0f",
|
||||
"scriptHash": "f0"
|
||||
}
|
||||
}
|
||||
@ -3,5 +3,23 @@
|
||||
"symbol": "CHC",
|
||||
"algorithm": "c11",
|
||||
"peerMagic": "a3d27a03",
|
||||
"peerMagicTestnet": "fbc21102"
|
||||
"peerMagicTestnet": "fbc21102",
|
||||
|
||||
"mainnet": {
|
||||
"bech32": "chc",
|
||||
"bip32": {
|
||||
"public": "0488b21e"
|
||||
},
|
||||
"pubKeyHash": "1c",
|
||||
"scriptHash": "04"
|
||||
},
|
||||
|
||||
"testnet": {
|
||||
"bech32": "tchc",
|
||||
"bip32": {
|
||||
"public": "043587cf"
|
||||
},
|
||||
"pubKeyHash": "50",
|
||||
"scriptHash": "2c"
|
||||
}
|
||||
}
|
||||
|
||||
11
init.js
11
init.js
@ -147,6 +147,17 @@ var buildPoolConfigs = function(){
|
||||
var coinProfile = JSON.parse(JSON.minify(fs.readFileSync(coinFilePath, {encoding: 'utf8'})));
|
||||
poolOptions.coin = coinProfile;
|
||||
poolOptions.coin.name = poolOptions.coin.name.toLowerCase();
|
||||
if (coinProfile.mainnet) {
|
||||
poolOptions.coin.mainnet.bip32.public = Buffer.from(coinProfile.mainnet.bip32.public, 'hex').readUInt32LE(0);
|
||||
poolOptions.coin.mainnet.pubKeyHash = Buffer.from(coinProfile.mainnet.pubKeyHash, 'hex').readUInt8(0);
|
||||
poolOptions.coin.mainnet.scriptHash = Buffer.from(coinProfile.mainnet.scriptHash, 'hex').readUInt8(0);
|
||||
}
|
||||
if (coinProfile.testnet) {
|
||||
poolOptions.coin.testnet.bip32.public = Buffer.from(coinProfile.testnet.bip32.public, 'hex').readUInt32LE(0);
|
||||
poolOptions.coin.testnet.pubKeyHash = Buffer.from(coinProfile.testnet.pubKeyHash, 'hex').readUInt8(0);
|
||||
poolOptions.coin.testnet.scriptHash = Buffer.from(coinProfile.testnet.scriptHash, 'hex').readUInt8(0);
|
||||
}
|
||||
|
||||
|
||||
if (poolOptions.coin.name in configs){
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@ var net = require('net');
|
||||
|
||||
var MposCompatibility = require('./mposCompatibility.js');
|
||||
var ShareProcessor = require('./shareProcessor.js');
|
||||
var Stratum = require('stratum-pool');
|
||||
|
||||
module.exports = function(logger){
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
"url": "https://github.com/zone117x/node-open-mining-portal.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"stratum-pool": "git://github.com/zone117x/node-stratum-pool.git",
|
||||
"stratum-pool": "git://github.com/zone117x/node-stratum-pool.git -b dev",
|
||||
"dateformat": "1.0.12",
|
||||
"node-json-minify": "*",
|
||||
"redis": "0.12.1",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user