<p>Since you mention nodejs you might be interested in bcoin:</p>
<p><a href="https://bcoin.io/" rel="nofollow noreferrer">https://bcoin.io/</a></p>
<p><a href="https://github.com/bcoin-org/bcoin/" rel="nofollow noreferrer">https://github.com/bcoin-org/bcoin/</a></p>
<p>Bcoin is modular and configurable in weird ways. See this other answer on how bcoin can be modified to download arbitrary blocks even in pruned mode:</p>
<p><a href="https://bitcoin.stackexchange.com/questions/96254/how-do-i-get-old-blocks-while-running-a-pruned-node/96258#96258">How do I get old blocks while running a pruned node?</a></p>

CC BY-SA 4.0
2021-09-13T14:24:35.510Z
2021-09-13T14:24:35.510Z
pinhead
<p>I am trying to get some bitcoin network data and I am using bitcoind-rpc library.
If i just run their example:</p>
<pre><code>var run = function() {
  var bitcore = require('bitcore');
  var RpcClient = require('bitcoind-rpc');
 
  var config = {
    protocol: 'http',
    user: 'user',
    pass: 'pass',
    host: '127.0.0.1',
    port: '18332',
  };
 
  // config can also be an url, e.g.:
  // var config = 'http://user:pass@127.0.0.1:18332';
 
  var rpc = new RpcClient(config);
 
  var txids = [];
 
  function showNewTransactions() {
    rpc.getRawMemPool(function (err, ret) {
      if (err) {
        console.error(err);
        return setTimeout(showNewTransactions, 10000);
      }
 
      function batchCall() {
        ret.result.forEach(function (txid) {
          if (txids.indexOf(txid) === -1) {
            rpc.getRawTransaction(txid);
          }
        });
      }
 
      rpc.batch(batchCall, function(err, rawtxs) {
        if (err) {
          console.error(err);
          return setTimeout(showNewTransactions, 10000);
        }
 
        rawtxs.map(function (rawtx) {
          var tx = new bitcore.Transaction(rawtx.result);
          console.log('\n\n\n' + tx.id + ':', tx.toObject());
        });
 
        txids = ret.result;
        setTimeout(showNewTransactions, 2500);
      });
    });
  }
 
  showNewTransactions();
};
</code></pre>
<p>I need to provide the data of my local node.</p>
<p>But I have problems downloading bitcoin node mostly because I do not have enough space.</p>
<p>Is there another way I can access the node without downloading full node localy?</p>

CC BY-SA 4.0
2021-09-12T15:46:34.293Z
The RPC interface is way of interacting with **your** Bitcoin node. If you don't run one, then no, you can't just use someone else's. But as @Prayank says, you can run a pruned node, which has lower disk requirements. There are other solutions **if** you're willing to trust someone else's node, but they involve other protocols than RPC.
Pieter Wuille
<bitcoin-core><bitcoind><nodejs>
how to connect to bitcoin node in javascript without running a local node
user1386985
# how to connect to bitcoin node in javascript without running a local node

(Asked by: username_0 on 2021-09-11)

I am trying to get some bitcoin network data and I am using bitcoind-rpc library.
If i just run their example:
var run = function() {
  var bitcore = require('bitcore');
  var RpcClient = require('bitcoind-rpc');
 
  var config = {
    protocol: 'http',
    user: 'user',
    pass: 'pass',
    host: '127.0.0.1',
    port: '18332',
  };
 
  // config can also be an url, e.g.:
  // var config = 'http://user:pass@127.0.0.1:18332';
 
  var rpc = new RpcClient(config);
 
  var txids = [];
 
  function showNewTransactions() {
    rpc.getRawMemPool(function (err, ret) {
      if (err) {
        console.error(err);
        return setTimeout(showNewTransactions, 10000);
      }
 
      function batchCall() {
        ret.result.forEach(function (txid) {
          if (txids.indexOf(txid) === -1) {
            rpc.getRawTransaction(txid);
          }
        });
      }
 
      rpc.batch(batchCall, function(err, rawtxs) {
        if (err) {
          console.error(err);
          return setTimeout(showNewTransactions, 10000);
        }
 
        rawtxs.map(function (rawtx) {
          var tx = new bitcore.Transaction(rawtx.result);
          console.log('\n\n\n' + tx.id + ':', tx.toObject());
        });
 
        txids = ret.result;
        setTimeout(showNewTransactions, 2500);
      });
    });
  }
 
  showNewTransactions();
};

I need to provide the data of my local node.
But I have problems downloading bitcoin node mostly because I do not have enough space.
Is there another way I can access the node without downloading full node localy?

**Tags:** bitcoin-core, bitcoind, nodejs

> **Comments:**
> **username_1**: The RPC interface is way of interacting with **your** Bitcoin node. If you don't run one, then no, you can't just use someone else's. But as @Prayank says, you can run a pruned node, which has lower disk requirements. There are other solutions **if** you're willing to trust someone else's node, but they involve other protocols than RPC.  

---

## 1 answers

### Answer by username_2 on 2021-09-13. Score: 0

Since you mention nodejs you might be interested in bcoin:

<https://bcoin.io/>

<https://github.com/bcoin-org/bcoin/>

Bcoin is modular and configurable in weird ways. See this other answer on how bcoin can be modified to download arbitrary blocks even in pruned mode:

[How do I get old blocks while running a pruned node?](https://bitcoin.stackexchange.com/questions/96254/how-do-i-get-old-blocks-while-running-a-pruned-node/96258#96258)


---

