Nodechain is a service that allows you to create nodes on a blockchain and connect to them natively through APIs. The goal is to allow the user to build their own nodes natively without having to rely on external services.
MIT License
7
stars
5
forks
source link
Feature/method get transaction only returns in wallet transactions #111
The method getTransaction has been standardized to be run for any transaction (not only in-wallet ones).
At first I tought I could make the method work with ElectrumX-ElectRs RPC. This could be useful in a future when issue #110 will be merged, and adds the possibility of disabling bitcoind -txindex, saving precious hard disk space (cool cool cool).
It wasn't that cool... ElectRs does not index block height of a transaction... So, for that reason, we can't remove the -txindex, and it can't work without -txindex. (More on: https://github.com/Blockstream/electrs/pull/36). - my joy in a well :'(
I left the methods and classes that can be used in resolving issue #110, allowing to call ElectRs Rpc directly.
I realized that issue #27 had a lot of disadvantages while I was coding this: If transaction are broken down in senders and destinations, it makes us work with decimal numbers and a lot of potential errors. Not cool. So, instead of "transactions", the getTransaction method now returns "inputs" and "outputs", with "address" and "amount" fields on each one. If i/o is not standard, null is returned.
Fixes #88
Dependencies (if any)
Type of change
[x] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[x] This change requires a documentation update
Good practices to consider
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
[ ] Any dependent changes have been merged and published in downstream modules
Description
The method getTransaction has been standardized to be run for any transaction (not only in-wallet ones).
Fixes #88
Dependencies (if any)
Type of change
Good practices to consider