Programmatically connect to a custom Bitcoin node

(Michele Marcucci) #1

I’m trying to connect to my (not-bitcore-managed) Bitcoin node from my Node.js app, but I can’t get it running.

I’m trying with something like this:

var bitcore = require('bitcore-node');
var Bitcoin =;
var Node = bitcore.Node;

var configuration = {
	network: 'testnet',
	services: [{
		name: 'bitcoind',
		module: Bitcoin,
		config: {
			connect: [{
				rpchost: '',
				rpcport: 3332,
				rpcuser: 'myuser',
				rpcpassword: 'mypass',
				zmqpubrawtx: 'tcp://'

var node = new Node(configuration);

Output is:

Node {
      configPath: undefined,
      errors: { Error: [Function: err], RPCError: [Function: err] },
      log: Logger { formatting: true, debug: [Function] },
       Network {
         name: 'testnet',
         alias: 'regtest',
         pubkeyhash: 111,
         privatekey: 239,
         scripthash: 196,
         xpubkey: 70617039,
         xprivkey: 70615956,
         port: [Getter],
         networkMagic: [Getter],
         dnsSeeds: [Getter] },
      services: {},
      _unloadedServices: [ { name: 'bitcoind', module: [Object], config: [Object] } ],
      port: undefined,
      https: undefined,
      httpsOptions: undefined }

And as you can see there isn’t any services: {} active.

What am I missing?

I opened also a Github issue before I found this forum.