MultiProviderWeb3Factory
Documentation for eth_defi.provider.multi_provider.MultiProviderWeb3Factory Python class.
- class MultiProviderWeb3Factory
Bases:
objectNeeded to pass RPC URL as
Web3FactoryAllows creating web3 connections from a config line in multiprocessing worker pools
Attributes summary
Skip the per-worker
eth_chainIdprovider cross-check.Parent-verified chain ID to seed into each worker when
skip_verificationis set, preserving the runtime switchover chain-id safety check.Optional accumulator shared by parent-process worker threads.
Methods summary
__init__(rpc_url[, retries, hint, ...])- __init__(rpc_url, retries=6, hint='', skip_verification=False, expected_chain_id=None, rpc_request_stats=None)
- skip_verification
Skip the per-worker
eth_chainIdprovider cross-check.Defaults to
Falseso a stand-alone factory behaves likecreate_multi_provider_web3(). Set toTruewhen this factory is handed to a multiprocessing worker pool: the parent process has already verified the chain ID, and re-verifying in every worker multiplieseth_chainIdload on the primary provider and can itself trigger HTTP 429 rate limiting.
- expected_chain_id
Parent-verified chain ID to seed into each worker when
skip_verificationis set, preserving the runtime switchover chain-id safety check.
- rpc_request_stats
Optional accumulator shared by parent-process worker threads.