mirror of
https://github.com/janoside/btc-rpc-explorer.git
synced 2026-08-13 12:33:13 +02:00
upgrade zeromq
This commit is contained in:
parent
9eedde212f
commit
4b9bf30a5f
3 changed files with 1318 additions and 654 deletions
29
app.js
29
app.js
|
|
@ -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
1941
npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue