<p>I want to get blocks on my node with <a href="https://github.com/bitpay/bitcore" rel="nofollow">bitcore</a>.</p>

<p>For example, I'm using peermanager.js and I get transactions:</p>

<pre><code>var handleTx = function(info) {
  var tx = info.message.tx.getStandardizedObject();
  console.log('** TX Received **');
  console.log(tx);
};
</code></pre>

<p>and it's printing transactions.</p>

<p>However, when I use this part:</p>

<pre><code>var handleBlock = function(info) {
  console.log('** Block Received **');
  console.log(info.message);
};
</code></pre>

<p>It doesn't log anything to the console.</p>

CC BY-SA 3.0
2014-12-10T19:41:18.880Z
Can you post the code that registers these as handlers with your PeerManager?
Nick ODell
CC BY-SA 3.0
2014-12-11T06:18:23.340Z
Here is the module https://github.com/bitpay/bitcore
Davit Huroyan
CC BY-SA 3.0
2014-12-12T15:04:23.367Z
I don't believe this is printing transactions. What you are getting is a list of transactions that another peer has available. Also without your code it's impossible to tell how you are using ´handleTx´ and ´handleBlock´ objects.
T9b
CC BY-SA 3.0
2015-01-09T23:06:25.083Z
I stoped to use this library now I use Insight API
https://github.com/bitpay/insight-api
Davit Huroyan
<bitpay><bitcore>
Incoming block handler is never called when using bitcore
Davit Huroyan
# Incoming block handler is never called when using bitcore

(Asked by: username_0 on 2014-12-10)

I want to get blocks on my node with bitcore.
For example, I'm using peermanager.js and I get transactions:
var handleTx = function(info) {
  var tx = info.message.tx.getStandardizedObject();
  console.log('** TX Received **');
  console.log(tx);
};

and it's printing transactions.
However, when I use this part:
var handleBlock = function(info) {
  console.log('** Block Received **');
  console.log(info.message);
};

It doesn't log anything to the console.

**Tags:** bitpay, bitcore

> **Comments:**
> **username_1**: Can you post the code that registers these as handlers with your PeerManager?  
> **username_0**: Here is the module https://github.com/bitpay/bitcore  
> **username_2**: I don't believe this is printing transactions. What you are getting is a list of transactions that another peer has available. Also without your code it's impossible to tell how you are using ´handleTx´ and ´handleBlock´ objects.  
> **username_0**: I stoped to use this library now I use Insight API https://github.com/bitpay/insight-api  

---

## 0 answers

