Web3 py with parallel processing

Viewed 190

Recently, I was trying to get all transactions of a specific token with python by getting all Transfer events from the block that the contract deployed. Yet, there are around 2m blocks from the deployed block to the latest block, as we can only get 5000 blocks each time by using the contract.events.Transfer.createFilter(), the whole process takes up to an hour.

As I may want to do the same process for other tokens in the future, is there a way to speed up the program?

Is it possible to do multiprocessing on the contract.events.Transfer.createFilter() so I may get more than 5000 blocks at once and record the transactions parallelly to speed up the process?

0 Answers
Related