Sending RPC calls asynchronously

0

I have ubuntu server running Bitcoin core v0.16.

I'm sending RPC calls asynchronously using Guzzle (PHP library), but, e.g., if I'm importing 1000 address using importmulti command, any further requests are waits until that command finish.

Even though I have set rpcthreads=100 rpcworkqueue=50 and I've powerful server.

Adam

Posted 2018-04-02T00:06:44.973

Reputation: 3 215

Answers

2

importmulti is a completely blocking RPC call, no amount of CPU power or RPC threads will prevent it from being blocking. You need to create applications which do not use this command if it is an option.

Anonymous

Posted 2018-04-02T00:06:44.973

Reputation: 10 054

Do you think that if I imported each address separately using guzzle (to send it asynchronously) will rpcthreads=100, rpcworkqueue=50 have the effect?Adam 2018-04-02T08:08:56.890

No, the RPC blocks the entire bitcoind, it can't even respond to network connections during this time.Anonymous 2018-04-02T14:33:22.613

Shouldn't we disable wallet locking especially when we're importing watch-only addresses? https://github.com/bitcoin/bitcoin/issues/12858

Adam 2018-04-02T14:35:19.697

No, as watch only keys still require a rescan.Anonymous 2018-04-02T17:19:09.597