trufflesuite / truffle-hdwallet-provider

HD Wallet-enabled Web3 provider
MIT License
400 stars 167 forks source link

Too Many Requests error #110

Open visopsys opened 3 years ago

visopsys commented 3 years ago

Hi,

I am connecting to a private RPC network with limit 10 request/s and I get the following error message though we do not have any transaction:

/home/ubuntu/api-server/node_modules/@trufflesuite/web3-provider-engine/subproviders/rpc.js:53
        })()
          ^
Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: Too Many Requests
    at /home/ubuntu/api-server/node_modules/@trufflesuite/web3-provider-engine/subproviders/rpc.js:51:23
    at Request._callback (/home/ubuntu/api-server/node_modules/@trufflesuite/web3-provider-engine/subproviders/rpc.js:53:11)
    at Request.self.callback (/home/ubuntu/api-server/node_modules/request/request.js:185:22)
    at Request.emit (events.js:315:20)
    at Request.<anonymous> (/home/ubuntu/api-server/node_modules/request/request.js:1154:10)
    at Request.emit (events.js:315:20)
    at IncomingMessage.<anonymous> (/home/ubuntu/api-server/node_modules/request/request.js:1076:12)
    at Object.onceWrapper (events.js:421:28)
    at IncomingMessage.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
    at PollingBlockTracker._performSync (/home/ubuntu/api-server/node_modules/eth-block-tracker/src/polling.js:51:24)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

It seems that each HDWalletProvider has a PollingBlockTracker which polls a network every 20s. If I have many HDWalletProvider instances, this might create lots of unnecessary pollings that triggers 429 error from the network. I have lots of users and I create many HDWalletProvider, one HDWalletProvider for each user.

Any solution for this polling issue?

muneebzubairkhan commented 3 years ago

I have same problem when I run,

truffle develop

it says too many requests

crazylitdev commented 2 years ago

any solutions for this yet?

TristonH55 commented 2 years ago

I am also having same issue. and solved it with the help of truffles (Alexander Dan) made a short video hope it helps others. https://www.youtube.com/watch?v=zBQnkHSiPQ8