-
Notifications
You must be signed in to change notification settings - Fork 813
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
Building a blockchain monitor plugin #640
Comments
Yeah that's a perfect use case for a plugin. Re: node crashes etc. I am working on a PR which moves indexing out of the chain and adds a interface which allows one to write custom indexers. Ref #424 https://github.com/tuxcanfly/bcoin/blob/index-plugin/lib/indexer/addrindexer.js If you would like to checkout the branch and give feedback on the new implementation, that would be great. |
👍 writing as indexer plugin You can just implement After last discussion of indexers with @tuxcanfly , it should be possible to run indexer separately from node, which will give you even more flexibility. But this is not implemented yet, still work in progress. If your node goes down or indexer goes down (or both), after starting they will eventually come to the correct state as node syncs and sends this info to indexer. Even in case of block reorganization you should see |
That looks great! In my case I plan to use Postgres to have better querying capabilities and support connecting to DB from different application. Another question I have, is it possible to index mempool transactions? |
On indexer and leveldb. Main indexer class uses leveldb to keep track of chain state, e.g. reorganization happens, indexer was offline and it reconnected and so on.. So it keeps track of bare minimum to simplify API to Mempool already has indexer enabled, currently transactions that are in mempool should show up in indexer endpoints, currently I am working on it to possibly move it outside of the mempool and run it separately, but even if that fails Mempool will have its own endpoints which expose the same info.. Hope to get better results. |
@ranyefet do you still need an open issue for this? All the decs are available on our slack as well if you have more questions: http://bcoin.io/slack-signup.html |
@nodar-chkuaselidze thank you for taking the time to answer my questions! |
Hi,
In our company we’re building a wallet service and we use bcoin as our node.
We need the ability to index coins and transactions that are related to our wallets addresses.
I was thinking of writing a plug-in that will listen for new block events and will check if the tx in the block are relevant for any of the addresses we need to monitor and if so, it will update our Postgres database with the relevant tx and coins.
Does it make sense?
One concern that I have is,what if the node crashes and I missed an event? How can I get the information I need in an efficient way?
The text was updated successfully, but these errors were encountered: