-
Notifications
You must be signed in to change notification settings - Fork 3
Add submitpackage method to docs #1
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
base: master
Are you sure you want to change the base?
Conversation
add hint on order of transactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this 🙏
* Value: Indicating the result of the package submission | ||
* `errors` | ||
* Type: Optional[List[Dict]] | ||
* Value: Error message and txid (NOT wtxid) of transactions that were not accepted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: the bitcoind response lists both txid and wtxid - although it keys results based on wtxid. In this use case either one is sufficient. There can be no collision of txids within a package.
The electrum protocol uses txids generally, I think we can keep to that and do the same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good, I don't see any issue with using txid
either.
If *verbose* is :const:`true`: | ||
|
||
The Bitcoin Core daemon result according to its RPC API documentation. | ||
Note that the exact structure and semantics can depend on the bitcoind version, | ||
and hence the electrum protocol can make no guarantees about it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect most clients to want the default, simple, verbose=false option.
However, AFAICT it does not cost a server implementation ~anything to offer the rich bitcoind response. The server has to call the submitpackage
bitcoind RPC anyway. (Contrast this with e.g. blockchain.transaction.get
, where the verbose=false
option is implemented by e.g. esplora without calling bitcoind, while the verbose=true
option must call bitcoind)
Having access to the full bitcoind result can be useful e.g. if you trust the server, or for quick scripts. And maybe also for some unforeseen use-cases where the verbose=false
response is not sufficient, the rich result can be used a stopgap.
So I think we can also add this verbose=true
variant. (with this explicit caveat that its structure is not guaranteed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Adds the submitpackage method to the protocol documentation.
See e-x implementation in spesmilo/electrumx#288
Note that the function signature contains a semicolon after [raw_txs]; as sphinx otherwise shows it incorrectly as [raw_txs,] in the generated html.