Bitcoin testnet connection with node.js Api

I can connect mainnet but can’t testnet.I use bitcoin-core npm package.

my client configration:

var client = new Client({
network:’testnet’,
host:’x.x.x.x’,
port:’18332′,
wallet: ‘x.dat’,
username:’xxxx’,
password:’xxxxx’,
headers:true
});

my bitcoin.conf:

printtoconsole=1
rpcuser=xxxxx
rpcpassword=xxxxx
rpcbind=x.x.x.x
rpcallowip=y.y.y.y
txindex=1
server=1
testnet=1
listen=1
rpcport=18332
disablewallet=0

ERROR:Unhandled rejection Error: connect ECONNREFUSED x.x.x.x:18332
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14)

y.y.y.y is my node.js api IP. x.x.x.x is my bitcoin node IP.

I try connect docker container.

Source link

Leave a Comment

Your email address will not be published.