Sunday, December 29, 2024

bitcoind – how to connect with bitcoin node in javascript with out operating an area node

I’m attempting to get some bitcoin community knowledge and I’m utilizing bitcoind-rpc library.
If i simply run their instance:

var run = perform() {
  var bitcore = require('bitcore');
  var RpcClient = require('bitcoind-rpc');
 
  var config = {
    protocol: 'http',
    person: 'person',
    move: 'move',
    host: '127.0.0.1',
    port: '18332',
  };
 
  // config will also be an url, e.g.:
  // var config = 'http://person:[email protected]:18332';
 
  var rpc = new RpcClient(config);
 
  var txids = [];
 
  perform showNewTransactions() {
    rpc.getRawMemPool(perform (err, ret) {
      if (err) {
        console.error(err);
        return setTimeout(showNewTransactions, 10000);
      }
 
      perform batchCall() {
        ret.end result.forEach(perform (txid) {
          if (txids.indexOf(txid) === -1) {
            rpc.getRawTransaction(txid);
          }
        });
      }
 
      rpc.batch(batchCall, perform(err, rawtxs) {
        if (err) {
          console.error(err);
          return setTimeout(showNewTransactions, 10000);
        }
 
        rawtxs.map(perform (rawtx) {
          var tx = new bitcore.Transaction(rawtx.end result);
          console.log('nnn' + tx.id + ':', tx.toObject());
        });
 
        txids = ret.end result;
        setTimeout(showNewTransactions, 2500);
      });
    });
  }
 
  showNewTransactions();
};

I want to supply the info of my native node.

However I’ve issues downloading bitcoin node largely as a result of I should not have sufficient area.

Is there one other means I can entry the node with out downloading full node localy?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles