shruggr / bottle-upload

7 stars 5 forks source link

Insight API v3 update for UTXOs & Uploader #6

Closed RoyMurphy closed 5 years ago

RoyMurphy commented 5 years ago

The v3 API was only partially entered. *To check: Current API key works with v3 Dev docs indicate ../addrs/.. is depracated for ../addr/..

derekm commented 5 years ago

Does this PR work for you, @RoyMurphy?

I'm getting a 404 on the new URL, not sure if it's because my new address hasn't been seen by the Insight API yet.

RoyMurphy commented 5 years ago

I hadn't had the opportunity to test Derek as BitIndex was down all of last night on both production and testnet versions. The only difference is that I generated a new v3 API key. With one v3 API instance being initiated in the current code, this may enough to give errors but as yet I haven't tested.

shruggr commented 5 years ago

I didn't realize that there were different API keys for the different versions of BitIndex. Have you guys tested this now that BitIndex is back?

shruggr commented 5 years ago

I was able to upload with the previous code after my last batch of updates.

RoyMurphy commented 5 years ago

Yes, as soon as BitIndex came back I popped in a 42.5MB video. It only worked after I throttled the cache by pausing requests in network dev tools. I think the async method is too much for today's browser cache limitations for bigger files, so throttling the upload worked for me on the 4th attempt. The process was sluggish but once it got to actually uploading it worked a treat.

ghost commented 5 years ago

@RoyMurphy @shruggr @derekm There is no need to change API keys.

API keys work across all versions.

Something else is at play here.

ghost commented 5 years ago

Also, no api_key is needed for any of the API calls except just the xpub related calls.

Make sure to set Content-Type: application/json (that could be the problem above)

ghost commented 5 years ago

See: http://g.recordit.co/JsN0PvodZM.gif

ghost commented 5 years ago

You can also see the direct examples in the BitIndex-SDK: https://github.com/BitIndex/bitindex-sdk/blob/master/lib/api-client.ts#L638

The correct paths are there. All the unit tests past as of recently, so whatever is in there is correct

RoyMurphy commented 5 years ago

Additional commit added for the 'Content-Type': 'application/json', declaration.