question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I noticed there is no support for json-rpc batching:

$ echo '[{"id": 1, "method": "blockchain.scripthash.get_balance", "params": ["716decbe1660861c3d93906cb1d98ee68b154fd4d23aed9783859c1271b52a9c"]}, {"id": 2, "method": "blockchain.scripthash.get_balance", "params": ["9f23070df9a696196571f1be061059dea4076d72ee6b321aff3b749967c6f5b7"]}]' | timeout 2 openssl s_client -quiet  -connect 69.64.32.45:50666  2>/dev/null
$ 

in EPS logs: ERROR:2020-04-01 14:47:03,607: IOError: OSError('Bad client query, no "method"',)

while electrumx has it:

$ echo '[{"id": 1, "method": "blockchain.scripthash.get_balance", "params": ["716decbe1660861c3d93906cb1d98ee68b154fd4d23aed9783859c1271b52a9c"]}, {"id": 2, "method": "blockchain.scripthash.get_balance", "params": ["9f23070df9a696196571f1be061059dea4076d72ee6b321aff3b749967c6f5b7"]}]' | timeout 2 openssl s_client -quiet  -connect electrum1.bluewallet.io:443 2>/dev/null
[{"jsonrpc": "2.0", "result": {"confirmed": 51432, "unconfirmed": 0}, "id": 1}, {"jsonrpc": "2.0", "result": {"confirmed": 1217111, "unconfirmed": 0}, "id": 2}]

any plans to add it? bluewallet relies on batching a lot

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chris-belchercommented, Apr 2, 2020

@Overtorment This is probably the most relevant part: https://github.com/chris-belcher/electrum-personal-server/blob/master/electrumpersonalserver/server/common.py#L115-L142 It is the code which reads data from the client, parses it into json and passes that json to the handle_query() method. Probably the needed fix is to use something like if isinstance(query, list): to check if the query is batched. The callback method send_reply_fun() needs to be edited to store replies into a list which is an output buffer, and at the end of each loop iteration that output buffer can be sent to the client. That should be enough to support batching I think.

1reaction
ncoelhocommented, Apr 2, 2020

Thanks for the reply @chris-belcher

Just to give you some context, this is not related to Lightning. EPS/Electrs/ElectrumX are starting to come as service installed by default by the “node in the box” startups (nodl, mynode, etc). And we started to notice many users complaining that their connection to Bluewallet/EPS was failing (we promote full node usage heavily), but working for ElectrumX users. So we decided to look deeper into it and stumble upon this issue.

Gonna link to the issues we got on our repo (many others on twitter/telegram) just give a sense of “demand” 😄

https://github.com/BlueWallet/BlueWallet/issues/936 https://github.com/BlueWallet/BlueWallet/issues/861 https://github.com/BlueWallet/BlueWallet/issues/813 https://github.com/BlueWallet/BlueWallet/issues/876 https://github.com/BlueWallet/BlueWallet/issues/579

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is Batching and How Can I Use It to Get More Done?
Batching lets you complete similar tasks at the same time, and in so doing, increase your productivity. Learn how and get started.
Read more >
How to Use Batching to Become More Productive - Full Focus
Batching is setting aside an intentional amount of time for intentional tasks and making an intentional effort to not allow the distractions or...
Read more >
definition of batching by The Free Dictionary
1. To live as a bachelor. ; 2. To live in the manner of a bachelor, as when one's spouse or partner is...
Read more >
What Does Batching Mean and What Does It Have to Do With ...
Batching is grouping similar tasks that require the same resources, in order to do them together, avoiding interruptions.
Read more >
Methods of Batching Concrete - The Constructor
The process of measuring ingredients or materials to prepare concrete mix is known as batching of concrete. Batching can be done by two ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found