freewil / bitcoin-testnet-box

Create your own private bitcoin testnet
MIT License
602 stars 280 forks source link

Problems connecting to testnet from node-bitcoin #13

Closed davesag closed 10 years ago

davesag commented 10 years ago

I've got your bitcoin-testnet-box running (nice one) and had to modify the bitcoin.conf files slightly to allow incoming RPC calls by adding rpcallowip=192.168.59.103 where 192.168.59.103 is the IP of my VM as seen from my Mac.

I'm trying a simple test from my Node.js app to check that I have the connections right etc,

var bitcoin = require('bitcoin'),
    client = new bitcoin.Client({
      host: "192.168.59.103",
      port: 49155,
      user: "admin1",
      pass: "123"
    });

describe("Core Wallet Functions", function() {

  it("can get the current bitcoin difficulty", function(done){
    client.getDifficulty(function(err, difficulty){
      console.log("got response", err, difficulty);
      expect(err).to.equal(null);
      expect(difficulty).to.equal(1);
      done();
    });
  });
});

but I get an error response { [Error: Invalid params, response status code: 403] code: -32602 }

I've written this up over at StackOverflow - see http://stackoverflow.com/questions/25116608/how-to-connect-to-a-bitcoin-testnet-running-in-a-docker-container/

I'm hoping you can assist. Thanks Dave

freewil commented 10 years ago

Looks like you've received some help via StackOverflow, closing.

davesag commented 10 years ago

Yes thanks @freewil - all sorted late last night.