<p>Either you use some nodejs library which would give you a high level wrapper for the bitcoin core api <code>getrawmempool</code>, or make your script hit your local bitcoin instance in the json-rpc format to get the memorypool data your node has.
The memory pool is basically where the transactions stay before getting confirmed in a block. So your script needs to run in regular intervals of time to keep track of the changes too. </p>

<p><code>url: http://&lt;username&gt;:&lt;password&gt;@localhost:18332/
post data:{"jsonrpc":1,"id":"curltext", "method":"getrawmempool", "payload":[]}</code></p>

<p>The username and password is checked from the bitcoin.conf file in the .bitcoin folder. Change the port number to 8332 in case you are running the mainnet daemon.</p>

CC BY-SA 3.0
2017-05-31T23:34:12.937Z
how do I get my nodejs script to send a json-rpc method?
Satonamo
CC BY-SA 3.0
2017-06-30T12:02:05.290Z
use any request package with which you can post data to any url
Shabahat M. Ayubi
CC BY-SA 3.0
2017-07-01T12:40:23.357Z
Ah okay, I was hoping for some sort of a websocket connection/ ethereum .filter() function sort of a thing. Thanks though!
Satonamo
CC BY-SA 3.0
2017-05-30T10:55:41.663Z
2017-05-30T10:55:41.663Z
Shabahat M. Ayubi
<p>I want to run a private node, and use it to receive realtime unconfirmed transactions data into my nodejs script.</p>

<p>How do I go about this?</p>

<json-rpc><nodes><bitcore><query>
how to get realtime new transaction data in nodejs from bitcore
Satonamo
# how to get realtime new transaction data in nodejs from bitcore

(Asked by: username_0 on 2017-05-29)

I want to run a private node, and use it to receive realtime unconfirmed transactions data into my nodejs script.

How do I go about this?

**Tags:** json-rpc, nodes, bitcore, query


---

## 1 answers

### Answer by username_1 on 2017-05-30. Score: 1 | Accepted answer

Either you use some nodejs library which would give you a high level wrapper for the bitcoin core api `getrawmempool`, or make your script hit your local bitcoin instance in the json-rpc format to get the memorypool data your node has.
The memory pool is basically where the transactions stay before getting confirmed in a block. So your script needs to run in regular intervals of time to keep track of the changes too.

`url: http://:@localhost:18332/
post data:{"jsonrpc":1,"id":"curltext", "method":"getrawmempool", "payload":[]}`

The username and password is checked from the bitcoin.conf file in the .bitcoin folder. Change the port number to 8332 in case you are running the mainnet daemon.

> **Comments:**
> **username_0**: how do I get my nodejs script to send a json-rpc method?  
> **username_1**: use any request package with which you can post data to any url  
> **username_0**: Ah okay, I was hoping for some sort of a websocket connection/ ethereum .filter() function sort of a thing. Thanks though!  

---

