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: add blockchain.outpoint Electrum 1.5 methods in p2p branch #444

Open
Pantamis opened this issue Jul 22, 2021 · 6 comments
Open
Labels
1.5 enhancement New feature or request

Comments

@Pantamis
Copy link
Contributor

Pantamis commented Jul 22, 2021

The p2p branch uses a db compatible with version 1.5 of Electrum protocol, one of the new features of 1.5 is the outpoint subscription methods to get the spending transaction of an tx output.

I forked btc-rpc-explorer to add a link to spending transaction of an output to the explorer display using this method, like what blockstream.info explorer does. I would like to test it.

It seems that blockchain.outpoint.subscribe was already implemented in outpoint-RPC branch back in nov 2020 but didn't made it to p2p. Could you "merge" it with p2p ? (I guess that some glue code may be needed)

Do we need the unsubscribe method in current electrs implementation to properly avoid flood of subscriptions/notifications ?

Thanks !

@Pantamis Pantamis added the enhancement New feature or request label Jul 22, 2021
@romanz romanz added the 1.5 label Jul 23, 2021
@romanz
Copy link
Owner

romanz commented Jul 23, 2021

Sounds good, but I prefer adding it when spesmilo/electrumx#90 is officially merged.

@Pantamis
Copy link
Contributor Author

Pantamis commented Jul 23, 2021

Ok, I understand.

I never coded in rust but is it possible to simply cherry pick the content of the last commit in outpoint-rpc branch and apply it to current p2p one to make it work ?

The files are not the same but taking the diff of last commit of outpoint branch of rpc.rs and apply it on electrum.rs could make it works, didn't it ?

I am just searching a quick way for me to try ^^' (if I have something working I will submit a PR you can merge once Electrum 1.5 is merged too)

@romanz
Copy link
Owner

romanz commented Jul 23, 2021

Please note that the outpoint-rpc branch doesn't implement the notification mechanism specified here:
https://github.com/spesmilo/electrumx/pull/90/files#diff-ffa7e37c618564f8c58d9072b5ef234e6e9b2cdf1d71d16be7dc356146cb475fR648-R655
It was a "WIP" implementation that I put on hold, waiting for the official Electrum 1.5 protocol release.

@Pantamis
Copy link
Contributor Author

Ok, so if I understand well, it will just return the "current" status of the outpoint, that's why you don't need to unsubscribe to notifications.

@Pantamis
Copy link
Contributor Author

Pantamis commented Jul 24, 2021

Could you take a look at what I tried in #446 ?

I couldn't test it properly for now because I can't increase verbosity with config file and I don't know how to make a request locally to test the method.

Thanks for your help !

@romanz
Copy link
Owner

romanz commented Aug 13, 2021

Many thanks for the contribution!
I have pushed a bit different implementation at #454, including the subscription and notification mechanism.

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

No branches or pull requests

2 participants