Hello,
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 = bitcore.services.Bitcoin;
var Node = bitcore.Node;
var configuration = {
network: 'testnet',
services: [{
name: 'bitcoind',
module: Bitcoin,
config: {
connect: [{
rpchost: 'example.com',
rpcport: 3332,
rpcuser: 'myuser',
rpcpassword: 'mypass',
zmqpubrawtx: 'tcp://example.com:3333'
}]
}
}]
};
var node = new Node(configuration);
console.log(node);
Output is:
Node {
configPath: undefined,
errors: { Error: [Function: err], RPCError: [Function: err] },
log: Logger { formatting: true, debug: [Function] },
network:
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. https://github.com/bitpay/bitcore-node/issues/491