mirror of
https://github.com/benjamin-wilson/public-pool.git
synced 2025-03-29 19:22:43 +01:00
multi port
This commit is contained in:
parent
ff6d446c12
commit
fb8715c23d
@ -15,7 +15,7 @@ BITCOIN_RPC_TIMEOUT=10000
|
||||
# BITCOIN_ZMQ_HOST="tcp://192.168.1.100:3000"
|
||||
|
||||
API_PORT=3334
|
||||
STRATUM_PORT=3333
|
||||
STRATUM_PORTS=3333,3332,3331,3330
|
||||
|
||||
#optional telegram bot
|
||||
#TELEGRAM_BOT_TOKEN=
|
||||
|
@ -33,12 +33,15 @@ export class StratumV1Service implements OnModuleInit {
|
||||
if (process.env.NODE_APP_INSTANCE == '0') {
|
||||
await this.clientService.deleteAll();
|
||||
}
|
||||
this.startSocketServer();
|
||||
|
||||
setTimeout(() => {
|
||||
process.env.STRATUM_PORTS.split(',').forEach(port =>{
|
||||
this.startSocketServer(parseInt(port));
|
||||
});
|
||||
}, 1000 * 10)
|
||||
|
||||
}
|
||||
|
||||
private startSocketServer() {
|
||||
private startSocketServer(port: number) {
|
||||
const server = new Server(async (socket: Socket) => {
|
||||
|
||||
//10 min
|
||||
@ -78,8 +81,8 @@ export class StratumV1Service implements OnModuleInit {
|
||||
|
||||
});
|
||||
|
||||
server.listen(process.env.STRATUM_PORT, () => {
|
||||
console.log(`Stratum server is listening on port ${process.env.STRATUM_PORT}`);
|
||||
server.listen(port, () => {
|
||||
console.log(`Stratum server is listening on port ${port}`);
|
||||
});
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user