Posts

Showing posts with the label rawtx & rawblock ZMQ at the same time?

rawtx & rawblock ZMQ at the same time?

rawtx & rawblock ZMQ at the same time? I need your opinion, do you mind ? :) I'm bulding a javascript layer on top of bitcoind. I have bitcoind running on my server with rpc & zmq enabled. daemon=1 rpcallowip=0.0.0.0/0 rpcuser=xxxxxxxx rpcpassword=xxxxxxxxx server=1 rest=1 zmqpubhashblock=tcp://*:28332 zmqpubhashtx=tcp://*:28332 zmqpubrawblock=tcp://*:28332 zmqpubrawtx=tcp://*:28332 rpcworkqueue=100 My program goal is to listen for rawblock and rawtx ZMQ channels. This is my zmq client: const socket = ZMQ.socket('sub') socket.connect('tcp://myserverip:28332') socket.on('message', (channel, data) => { console.log(channel.toString()) }) So here is what happens : subscribing to rawtx alone works, I receive the tx flow (approx 2.5tx per second) socket.subscribe('rawtx') subscribing to rawblock alone also works, I receive blocks (approx 1block per 10minutes) socket.subscribe('rawblock') But here is my problem, whe...