How can I connect to a remote Bitcoin node?
It's really hard to understand how to connect to a remote Bitcoin node I have yet. I'm trying with something like this but without success:
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?
@michelem09 this is how we connect to an external bitcoin node (our bitcore-node.json config file):
{
"network": "livenet",
"port": 3001,
"services": [
"bitcoind",
"insight-api",
"insight-ui",
"web"
],
"servicesConfig": {
"bitcoind": {
"connect": [
{
"rpcuser": "bitcoin",
"rpcpassword": "local321",
"zmqpubrawtx": "tcp://127.0.0.1:28332"
}
]
}
}
}
In our case, the bitcoind node is running on localhost. If you specify rpchost it should connect to another address.
Is it possible to configure bitcore node in such a manner to sync with my own coin, so that i can integrate it with insight UI. Please reply. I am stuck here, whenever i hit bitcore-node start command , it starts bitcoind and sync with bitcoin block chain
Hello!
I have the same issue and can't connect to the node wich runnig locally.
I've tried to use configuration like:
{
"network": "testnet",
"services": [
"bitcoind"
],
"servicesConfig": {
"bitcoind": {
"connect": [{
"rpcuser": "bitcoin",
"rpcpassword": "local321",
"zmqpubrawtx": "tcp://127.0.0.1:28332"
}]
}
}
}
The result is:
/bitcoin/node_modules/bitcore-node/lib/node.js:156
addToStack(service.module.dependencies);
^
TypeError: Cannot read property 'dependencies' of undefined
at addToStack (/bitcoin/node_modules/bitcore-node/lib/node.js:156:32)
at Node.getServiceOrder (/bitcoin/node_modules/bitcore-node/lib/node.js:167:3)
at Node.start (/bitcoin/node_modules/bitcore-node/lib/node.js:253:28)
at Object.<anonymous> (/bitcoin/index.js:39:6)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Function.Module.runMain (module.js:665:10)
Also, I've tried configuration like:
{
network : "testnet",
services : [
{
name : "bitcoind",
module : Bitcoin,
config : {
connect : {
rpcuser : "bitcoin",
rpcpassword : "local321",
zmqpubrawtx : "tcp://127.0.0.1:28332"
}
}
}
]
}
And result is only one line in console:
[2017-10-02T14:14:38.156Z] info: Starting bitcoind
What am I doing wrong?
Check your debug.log.
@LordotU Use this code inside config object:
connect: [{
rpchost: "127.0.0.1",
rpcport: 18332,
rpcuser: "bitcoin",
rpcpassword: "local321",
zmqpubrawtx: "tcp://127.0.0.1:28332"
}]
same issue..
same issue somebody help~~
Hi
If you want then i can configure it for you. but it will be chargeble.
On Mon, Oct 22, 2018 at 9:21 AM mapleChain [email protected] wrote:
same issue somebody help~~
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bitpay/bitcore-node/issues/491#issuecomment-431732924, or mute the thread https://github.com/notifications/unsubscribe-auth/AejxOblGhk0ir5WuRDJE53dNhI8BnTVPks5unUDEgaJpZM4LPB7b .
-- R's/Md Raja 9971609873 "The Quieter you become the more you are able to hear..."
@qld-cf Just use the bitpay/bitcore v8.0.0 branch (here), it should work out of the box, let me know if you can't make it work!