Web3py provider that makes it easy to switch between different blockchain nodes to make sure application will be be online if main blockchain node will be unavailable.
Project description
Web3 Multi Provider
Provider that switch to other working web3 rpc endpoint if smth is bad with active one.
Install
$ pip install web3-multi-provider
or
$ pertry add web3-multi-provider
Usage
from web3 import Web3
from web3_multi_provider import MultiHTTPProvider
w3 = Web3(MultiHTTPProvider([ # RPC endpoints list
'https://mainnet.infura.io/v3/...', # RPC endpoint 2
'http://127.0.0.1:8000/', # RPC endpoint 1
]))
last_block = w3.eth.get_block('latest')
For developers
poetry install
- to install depspre-commit install
- to install pre-commit hooks
Tests
poetry run pytest tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for web3-multi-provider-0.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f05261d19c1d247b9e493b948feb98299b3965c744b98c6ec03effe5d33cdfe |
|
MD5 | d506e86930d2c86bd7d4c100c8c672a6 |
|
BLAKE2b-256 | 496f6c1cb92d67533a83a7bf55c15991a89516e642771548725b776e01a6b5d3 |
Close
Hashes for web3_multi_provider-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd13dc1b921275636c0dcb10dcda997c326e65a9ddbf77fd5fe2a8816ded16e2 |
|
MD5 | 4b71b4461edca10a3fb75cb3f1e46e1f |
|
BLAKE2b-256 | 7a95c83e128046eb63bbda9a2c9f0f43cef835e26886d9316b90d45515d37a98 |