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

electrum rpc batch request not working #516

Open
greenaddress opened this issue Aug 5, 2024 · 1 comment · May be fixed by Blockstream/electrs#108
Open

electrum rpc batch request not working #516

greenaddress opened this issue Aug 5, 2024 · 1 comment · May be fixed by Blockstream/electrs#108

Comments

@greenaddress
Copy link
Collaborator

greenaddress commented Aug 5, 2024

I tried to send an electrum rpc batch request for blockchain.transaction.get with several txid and I don't think I ever got a response back.

Either is not implemented at all or there's a bug. Works on original electrs, electrumx and fulcrum.
Example request that failed:

[{"jsonrpc":"2.0","id":"2","method":"blockchain.transaction.get","params":["a0d1ec3d3b821c86f36dcea5767b92e952c7337e1ad2b591467d9c9e61e70b06"]},{"jsonrpc":"2.0","id":"2-1","method":"blockchain.transaction.get","params":["83b54434a7dd45db6e06c519381a57dda30e8173c15a8232fa3dd9216cbe4940"]}]

For example in bash

echo '[{"jsonrpc":"2.0","id":"2","method":"blockchain.transaction.get","params":["a0d1ec3d3b821c86f36dcea5767b92e952c7337e1ad2b591467d9c9e61e70b06"]},{"jsonrpc":"2.0","id":"2","method":"blockchain.transaction.get","params":["83b54434a7dd45db6e06c519381a57dda30e8173c15a8232fa3dd9216cbe4940"]}]' | nc bitcoin.aranguren.org 50001

you get

[{"id":"2","jsonrpc":"2.0","result":"01000000000101ec04e0ff2e79933145aaf9e4965908d21e2fd1962401b688b44c4228d3031ff70100000000ffffffff0300e1f50500000000220020b2014722cac7f707df13577d1604519cd642e8ccbda1da36cf42f628d33aa3db93ae9d0000000000160014dc6bf86354105de2fcd9868a2b0376d6731cb92f78c10900000000001600141ba5f0f9bdca2230a2ec1a057730cb299142461c0248304502210097a1679ddc306a4c524508db2faa121fa6e65286941f5426bb2f0575b60e06c702202ab74bc9701682880f891226dd94e1198604f7a3a5b512535b7b74845520fb0d012102174ee672429ff94304321cdae1fc1e487edf658b34bd1d36da03761658a2bb0900000000"},{"id":"2","jsonrpc":"2.0","result":"01000000000102cbdb01e3cd3ce618d005d9feb2e4836b1642bed26e5af2362c5b7cbac7ebe9ce0100000000ffffffff48b586904f328cc26a3cd1460f44323f522e382cf7ac15313228bd640e4601d00100000000ffffffff0200a3e111000000001600142baf69a6e9726896e2dfa8276f3896e470637bd35db8dc1900000000220020f98feeabd03d66869199e8378eccc3c9e750db5f714a7b267805a6dc81bbe7050400483045022100d5fd46fe8f9fd345753d37efed67978f1b7fa9caff8452e46f1ad8df2671f66802205400515475f818662b4208f0bb82762192826394d0510339260b292ad394ac6d0148304502210087a9b498decece4201c686371643e894d02e367c4555f5c3101f9c793d4b385c022028f334c3cad645b365ea9a4a6634fa641c6e2752d332b50885c8f99d55cf21c101695221033ad6b7e0ff538ced53e678772e9ef900bd6c42a1ab2b5ac9fef4422f08cb5a9a21037eba9a31559eff1a4b5e0a77558ba450a24038c3a2d761d3d57807a4241cdea52103f751c8926da63a4f4f1f3b92c932a9ce5c48d47035395ee36c4d902ffd43e7fc53ae0400483045022100b701879cf231cf7409a752ee653fe81d591fe4f3a75a9b6b1fc7de9d70b45d5602203ee2efa698ad738ac1ce9e3860806dbb39dd4b086ecb88595f22aba3b82933db0147304402207ecfed58b86298e7383b5964845a60e6d118ad66286963cc25e7643d6fe9491602202fbef453f246db720e7b813fa805a8729a97dcc43a1760aaf4d7bc1e385e02dc01695221033ad6b7e0ff538ced53e678772e9ef900bd6c42a1ab2b5ac9fef4422f08cb5a9a21037eba9a31559eff1a4b5e0a77558ba450a24038c3a2d761d3d57807a4241cdea52103f751c8926da63a4f4f1f3b92c932a9ce5c48d47035395ee36c4d902ffd43e7fc53ae00000000"}]

with

echo '[{"jsonrpc":"2.0","id":"2","method":"blockchain.transaction.get","params":["a0d1ec3d3b821c86f36dcea5767b92e952c7337e1ad2b591467d9c9e61e70b06"]},{"jsonrpc":"2.0","id":"2","method":"blockchain.transaction.get","params":["83b54434a7dd45db6e06c519381a57dda30e8173c15a8232fa3dd9216cbe4940"]}]' | nc electrum.blockstream.info  50001

we get nothing (it just returns)

for other non batched requests it works as expected

echo '{"jsonrpc": "2.0", "method": "server.version", "id": 0}' | nc electrum.blockstream.info 50001
{"id":0,"jsonrpc":"2.0","result":["electrs-esplora 0.4.1","1.4"]}
@greenaddress
Copy link
Collaborator Author

Related #428

@RCasatta RCasatta linked a pull request Sep 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant