bitcoind – how to hook up with bitcoin node in javascript with out working a neighborhood node

0
74


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',
    cross: 'cross',
    host: '127.0.0.1',
    port: '18332',
  };
 
  // config may also be an url, e.g.:
  // var config = 'http://person:cross@127.0.0.1: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.consequence.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.consequence);
          console.log('nnn' + tx.id + ':', tx.toObject());
        });
 
        txids = ret.consequence;
        setTimeout(showNewTransactions, 2500);
      });
    });
  }
 
  showNewTransactions();
};

I would like to offer the information of my native node.

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

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here