upgrade zeromq

This commit is contained in:
Dan Janosik 2024-11-17 19:31:21 -05:00
parent 9eedde212f
commit 4b9bf30a5f
No known key found for this signature in database
GPG key ID: 70C0B166321C0AF8
3 changed files with 1318 additions and 654 deletions

29
app.js
View file

@ -581,20 +581,31 @@ async function onRpcConnectionVerified(getnetworkinfo, getblockchaininfo) {
if (false) {
var zmq = require("zeromq");
var sock = zmq.socket("sub");
sock.connect("tcp://192.168.1.1:28333");
console.log("Worker connected to port 28333");
sock.on("message", function(topic, message) {
console.log(Buffer.from(topic).toString("ascii") + " - " + Buffer.from(message).toString("hex"));
});
monitorNewTransactions().catch(err => console.error(err));
//sock.subscribe('rawtx');
}
}
async function monitorNewTransactions() {
const zmq = require("zeromq");
const sock = new zmq.Subscriber();
sock.connect("tcp://ubuntu:28333");
console.log("Worker connected to port 28333");
// Subscribe to all topics (use sock.subscribe("specific_topic") for specific topics)
sock.subscribe();
for await (const [topic, message] of sock) {
console.log(
topic.toString("ascii") +
" - " +
message.toString("hex")
);
}
}
async function loadDifficultyHistory(tipBlockHeight=null) {
if (!tipBlockHeight) {
let getblockchaininfo = await coreApi.getBlockchainInfo();

1941
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load diff

View file

@ -73,7 +73,7 @@
"serve-favicon": "^2.5.0",
"simple-git": "^3.18.0",
"tiny-secp256k1": "^2.2.1",
"zeromq": "^5.3.1"
"zeromq": "^6.1.2"
},
"optionalDependencies": {
"event-loop-stats": "^1.4.1"