Skip to main content

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

Lido Web3 Multi Provider

Code style: black License: MIT

Provider that switch to other working web3 rpc endpoint if smth is bad with active one.

Install

$ pip install web3-multi-provider

or

$ poetry add web3-multi-provider

Usage

from web3 import Web3
from web3_multi_provider import MultiProvider

w3 = Web3(MultiProvider([  # RPC endpoints list
    'http://127.0.0.1:8000/',
    'https://mainnet.infura.io/v3/...',
    'wss://mainnet.infura.io/ws/v3/...',
]))

last_block = w3.eth.get_block('latest')

For developers

  1. poetry install - to install deps
  2. pre-commit install - to install pre-commit hooks

Tests

poetry run pytest tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

web3_multi_provider-0.5.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Built Distribution

web3_multi_provider-0.5.0-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page