bitcore-node icon indicating copy to clipboard operation
bitcore-node copied to clipboard

bitpay's server not returning histories

Open karelbilek opened this issue 9 years ago • 7 comments

Hello,

I have this small and simple script. The reply never arrives.

<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script>
<script>
console.log("Starting!");
var socket = io("https://insight.bitpay.com");
socket.send({
  method: "getAddressHistory", 
  params: [
    ["1JAd7XCBzGudGpJQSDSfpmJhiygtLQWaGL"], 
    {
      from: 0,
      to: 50,
      queryMempool: true,
      start: 429632,
      end: 0
    }
  ]
}, function (reply) {
  console.log("Reply was ", reply);
})
</script>

The script works (meaning, the reply arrives) with other public bitcore addresses - localbitcoinschain.com, bitcore2.mytrezor.com. Where is the problem?

karelbilek avatar Sep 13 '16 17:09 karelbilek

The script is here

  • https://github.com/runn1ng/socketio-bitpay
  • http://www.karelbilek.com/socketio-bitpay/ (see console logs)

karelbilek avatar Sep 13 '16 17:09 karelbilek

Yes, those methods are only available when running a local node.

braydonf avatar Sep 13 '16 18:09 braydonf

By "available when running a local node", you mean some additional configuration on Bitpay's servers which prevent other services to abusing your servers? If I understand that right, you're primarily focused on providing Insight web UI for public and you do not aim in providing general block explorer which would be used by another applications. Is that position strict or are you willing to whitelist some other services under some conditions?

When we choose Bitcore as our backend solution for TREZOR, one of reason was that there're other public servers providing faillover for our company-provided servers (which are publicly available without any restriction).

slush0 avatar Sep 14 '16 11:09 slush0

Primarily, it was not already a part of the insight api, so it wasn't enabled. It was a new feature that we added as an idea to extend the capabilities of the existing websocket connection, and to be able to use the bitcore-node API with different processes. If it's useful, perhaps it should be enabled in some capacity.

braydonf avatar Sep 14 '16 14:09 braydonf

It would be amazing to reconsider it and make that call publicly available even in some limited capacity. Thanks!

slush0 avatar Sep 14 '16 14:09 slush0

@slush0 what would be your decision criteria for selecting an alternative server?

martindale avatar Sep 19 '16 10:09 martindale

Unavailability / temporary downtime of main server.

slush0 avatar Sep 19 '16 13:09 slush0