Feat/regtest network (#11)

Feat/regtest network
This commit is contained in:
Thomas Shufps
2023-12-03 20:45:21 -05:00
committed by GitHub
parent 8075c83fe2
commit f7303d73af
7 changed files with 141 additions and 9 deletions
+13 -1
View File
@@ -392,9 +392,21 @@ export class StratumV1Client {
];
}
const networkConfig = this.configService.get('NETWORK');
let network;
if (networkConfig === 'mainnet') {
network = bitcoinjs.networks.bitcoin;
} else if (networkConfig === 'testnet') {
network = bitcoinjs.networks.testnet;
} else if (networkConfig === 'regtest') {
network = bitcoinjs.networks.regtest;
} else {
throw new Error('Invalid network configuration');
}
const job = new MiningJob(
this.configService.get('NETWORK') === 'mainnet' ? bitcoinjs.networks.bitcoin : bitcoinjs.networks.testnet,
network,
this.stratumV1JobsService.getNextId(),
payoutInformation,
jobTemplate