-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(bitcoin)!: use mempool.space REST API #96
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
0de48ad
to
89bd56d
Compare
6979297
to
543bee1
Compare
1bd8062
to
71c2379
Compare
1be954e
to
238a6f1
Compare
a90952b
to
29075ed
Compare
937e6a5
to
80ecb8b
Compare
It was found that the version of mempool/mempool.js npm package is stuck at v2.3.0 released two years ago and does not support the Raised the relevant issue to them: mempool/mempool.js#191, and will replace it with the npm package officially provided by mempool after a new version is released in the future. (If mempool is not updated, then we can also consider maintaining it ourselves) |
Changes
Use mempool.space API instead of bitcoind and electrs
APIs
getBlockchainInfo
: we can assemble blockchain info by getting the tip block data (but theheaders
field cannot be obtained)sendRawTransaction
: Exactly the same aspostTx
provided by mempool.spaceUsing Electrs as a fallback for mempool.space API
BITCOIN_DATA_PROVIDER
)Error handles
BitcoinClientAPIError
to handle mempool.space and electrs errorEnhance Bitcoin transactions query
after_txid
param to get more transactions (/bitcoin/v1/address/:address/txs?after_txid=xxx
)Wrap recommended fee rates API
/bitcoin/v1/fees/recommended
Healthcheck updates
Remove bitcoind healthcheck and add mempool.space API healthcheck
Env variables
Added
BITCOIN_DATA_PROVIDER
is used to determine which service to use as the primary data provider.BITCOIN_DATA_PROVIDER=mempool
BITCOIN_ELECTRS_API_URL
is optional)BITCOIN_DATA_PROVIDER=electrs
BITCOIN_MEMPOOL_SPACE_API_URL
is optional)Removed
We no longer need bitcoin RPC, we send transactions through mempool.space or our node indirectly through electrs
Known Issues
For issue electrs: return too many history entries when address has to many utxo/transactions record #89, mempool.space provides paging for txs, but no paging for address utxo. Therefore, more than 500 UTXOs will still encounter the problem of too many utxo.Reviews
@Flouse @duanyytop @ShookLyngs @Dawn-githup @yuche