Skip to content
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

Feature: query for spending transaction input txid+index #788

Open
antonilol opened this issue Nov 2, 2022 · 2 comments
Open

Feature: query for spending transaction input txid+index #788

antonilol opened this issue Nov 2, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@antonilol
Copy link
Contributor

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

this would allow home node runners running mempool and electrs to click the red arrows on the right to go to the spending transactions of that specific tx output

Describe the solution you'd like
A clear and concise description of what you want to happen.

a way to query the already indexed spending data

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

blockstream/electrs - way too heavy for my home node
stopping electrs to read the db - not feasible to constantly stop and start, and having to make something to read the db
making my own spending tx indexer - it would cost additional storage and time

Additional context
Add any other context or screenshots about the feature request here.

#777

btw: i am willing to contribute to this, i just have to find some free time to learn Rust

@antonilol antonilol added the enhancement New feature or request label Nov 2, 2022
@romanz
Copy link
Owner

romanz commented Nov 3, 2022

Could you please try #454?

It can be tested using:

$ echo '{"jsonrpc": "2.0", "method": "blockchain.outpoint.subscribe", "params": ["d2684048acb9e03041a4fbb9621d09dd854af5c07545c32fa724b2a06eb969d5", 1], "id": 0}' | netcat 127.0.0.1 50001
{"id":0,"jsonrpc":"2.0","result":{"height":760861,"spender_height":0,"spender_txhash":"f37332e4a895182742f9d722c01927fb1142fd28c680ef8c13a6d18bf6f6b34d"}}

$ echo '{"jsonrpc": "2.0", "method": "blockchain.outpoint.subscribe", "params": ["b6c2962349a45ca661f1004fc077e3eb2b093e7baebdbce081c2f23b1605dfa8", 0], "id": 0}' | netcat 127.0.0.1 50001
{"id":0,"jsonrpc":"2.0","result":{"height":761571,"spender_height":761576,"spender_txhash":"2f5a8119c16a5b1262b784d2715e9b91c4c480b00bff87281e71b74f16c3d469"}}

$ echo '{"jsonrpc": "2.0", "method": "blockchain.outpoint.subscribe", "params": ["b6c2962349a45ca661f1004fc077e3eb2b093e7baebdbce081c2f23b1605dfa8", 1], "id": 0}' | netcat 127.0.0.1 50001
{"id":0,"jsonrpc":"2.0","result":{"height":761571,"spender_height":761573,"spender_txhash":"8eaba51c919990713debb33d0d45807274aa023d668c48c0c3733a9d6033c0a0"}}

$ echo '{"jsonrpc": "2.0", "method": "blockchain.outpoint.subscribe", "params": ["a435a4c3c3ec511967fc81b109c35c336c75900d930187040dcab8149366f996", 0], "id": 0}' | netcat 127.0.0.1 50001
{"id":0,"jsonrpc":"2.0","result":{"height":761576}}

@antonilol
Copy link
Contributor Author

That works! thanks, i get the right txid, but could there be an easier way to just get the data, instead of having to subscribe, check if spending data is returned and then unsubscribe?

would it be possible to also return the input index?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants