Closed larrysalibra closed 7 years ago
@larrysalibra can we use the explorer for now?
We can, but @jcnelson needs to write a driver for it. Not sure how hard that is.
It could be a driver for the Insight API (https://github.com/bitpay/insight-api) which is what the explorer uses, with the url pointing to our explorer deployment.
Yeah I have a hunch that'll be the easiest.
It wouldn't be too difficult (the biggest time-sink would be the trial-and-error in testing it), but not sure if it's something I can commit to this sprint. It only needs two functions: get_unspents(:address)
and broadcast_transaction(:transaction)
. Even if we could only get get_unspents(:address)
to work, it would suffice to fulfill the blockchain_reader
responsibility.
I ran into this issue while getting UTXOs for the registrar.
My solution was to modify pybitcoin (the registrar still uses it for RPC calls to bitcoind) to support 0 confirmation UTXOs and use a bitcoind node that watches the addresses I'm interested in.
This solution is not really applicable here but just pointing out that a reliable UTXO provider has been a major pain point for the registrar as well and a good solution to it can be very helpful.
We should also think about what happens when the UTXO provider goes down (individual calls to APIs like Blockcypher have failed for me either because of some temporary error or because of exceeding their rate limits).
The other issue to keep in mind is when broadcasting transactions different providers and API providers have different checks on which transactions will they accept. For certain corner cases (e.g., with low TX fees) I had to run bitcoind nodes that had very low dust fee limits etc and which could accept a wider range of transactions and relay them to the network.
Moving this out of APIv1 milestone. We're not going to implement our own UTXO provider anytime soon 😄
I have added support for using https://explorer.blockstack.org's insight API as a UTXO provider. It supports zero-conf UTXOs. This is now the default provider in rc-0.14.2
.
While debugging #297, @jcnelson & I discovered that Blockstack Core's current default UTXO provider, Blockcypher, has a bug where it doesn't display UTXOs for unconfirmed transactions:
Might be time to start running our own UTXO service if we want to support zero conf transactions with core.
This will prevent users of the Blockstack Portal from depositing bitcoin and immediately buying a name. @shea256