Allow JSON RPC “batches” for multiwallet #18715

issue jonasschnelli openend this issue on April 21, 2020
  1. jonasschnelli commented at 8:36 am on April 21, 2020: contributor

    Currently, batching RPC requests across wallets does not work due to the fact that each wallet has its own endpoint. This results in relatively slow processing speed if a client queries multiple wallets.

    See discussion in #18453 (this and this).

    There are probably multiple approaches how to improve that:

    • The foreachwallet RPC meta call that takes the actual call/arguments as parameters.
    • A /foreachwallet http endpoint
    • Add allwalletsXXX rpc calls (like getallwalletsbalance or getwalletsbalance
    • … (more?)
  2. jonasschnelli added the label Feature on Apr 21, 2020
  3. jonasschnelli added the label Wallet on Apr 21, 2020
  4. jonasschnelli added the label RPC/REST/ZMQ on Apr 21, 2020
  5. jonatack commented at 1:16 pm on April 21, 2020: contributor
    Yes, I am looking at this and made a twitter poll here for ideas; two suggestions were -rpcwallet=* by @harding here and the ability to specify multiple wallets with -rpcwallet by @jb55 here.
  6. jonatack commented at 1:20 pm on April 21, 2020: contributor
    As a first step, #18594 (edit: merged) is also ready; it adds displaying multiwallet balances for all loaded wallets in -getinfo when more than one wallet is loaded (e.g. multiwallet mode) and -rpcwallet= is not passed.
  7. jb55 commented at 2:25 pm on April 21, 2020: contributor
    • The foreachwallet RPC meta call that takes the actual call/arguments as parameters.
    • A /foreachwallet http endpoint

    :+1: or even /wallets or /allwallets ? (edit: not allwallets, since we want to be able to pass in wallet names as an option)

    • Add allwalletsXXX rpc calls (like getallwalletsbalance or getwalletsbalance

    would this be necessary? I was thinking all you would need is to group the results in an object using the wallet name as a key.

    if you wanted to get more fancy, you could define a way to aggregate the results of each command client-side. Perhaps enabled with a switch.

  8. maflcko commented at 2:42 pm on April 21, 2020: member
    If we add an RPC for this server side, my wish would be to make it a single one, and not duplicate every RPC method from foobar to allwallets_foobar. If there was a single foreachwallet RPC, the list of wallets could be passed in (otherwise it defaults to all wallets).
  9. willcl-ark commented at 3:02 pm on April 10, 2024: contributor

    The feature request didn’t seem to attract much attention in the past. Also, the issue seems not important enough right now to keep it sitting around idle in the list of open issues.

    Pull requests with improvements are always welcome.

  10. willcl-ark closed this on Apr 10, 2024


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-04 22:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me