jvstein / bitcoin-prometheus-exporter

Prometheus exporter for Bitcoin Core nodes
BSD 3-Clause "New" or "Revised" License
71 stars 37 forks source link

Make it work with different utxo blockchains #28

Closed kalkov closed 2 years ago

kalkov commented 2 years ago

Background

The original exporter supported only bitcoin core blockchain, the other ones that I tested - bitcoinabc and litecoin were having failing RPC calls and the exporter would not proceed further. The reason was that all calls were into a single function and if one of them fails the other ones won't be executed. That made the exporter unusable for UTXO blockchains besides bitcoin core.

Implementation

Every RPC call and the setting of corresponding prometheus metrics was moved into separate function. Error handling was refactored to be per RPC call and the ability to control which calls will be executed by supplying env vars was added. This adds flexibility to decide what data do you want to get which improves speed and adds support to much more UTXO blockchains.