Usage:
from __future__ import annotations
import asyncio
import sys
from os import environ as os_env
from python_socks import ProxyType
from web3 import AsyncWeb3
from web3_proxy import AdvAsyncHTTPProvider
async def main() -> None:
# NOTE: You can parse using func from `aiohttp_socks` lib
addr = os_env['PADDR']
logpass = os_env['PLOGPASS']
phost, pport = addr.split(':')
puser, ppasswd = logpass.split(':')
print('Connecting to:', phost, pport, puser, ppasswd)
provider = AdvAsyncHTTPProvider(
endpoint_uri='https://eth.drpc.org',
proxy_conn_kwargs={
# 'proxy_type': ProxyType.HTTP,
'proxy_type': ProxyType.SOCKS5,
'host': phost,
'port': pport,
'username': puser,
'password': ppasswd,
},
)
w3 = AsyncWeb3(provider)
block_number = await w3.eth.get_block_number()
print(f'Block number is {block_number}')
# NOTE: You can have warning of unclosed session after execution end
# due internal proxy connector..
if __name__ == '__main__':
async_loop = asyncio.get_event_loop()
async_loop.run_until_complete(main())
print('Complete!')
Metadata
Release files for web3-proxy 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| web3_proxy-0.0.1.tar.gz | 11.6 kB | Without provenance | Details for web3_proxy-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| web3_proxy-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for web3_proxy-0.0.1-py3-none-any.whl |
Total release size: 24.4 kB
Release files / web3_proxy-0.0.1.tar.gz
| Download URL | web3_proxy-0.0.1.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec323c3593d45bc2b3fb0fce71cecdd5a915517e8bf711e72d446ff2e5189525
|
|
BLAKE2b-256 checksum How to use checksums |
c62be09260432a75d8d79d544d2e95b267044a765751e62af0f499ca775c09a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 PyPy/7.3.10 Linux/6.9.9-1-MANJARO
|
Release files / web3_proxy-0.0.1-py3-none-any.whl
| Download URL | web3_proxy-0.0.1-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
593e0049eb67306b9b410701e2f5540577ee711a1fdff04eb100d03706c00605
|
|
BLAKE2b-256 checksum How to use checksums |
2c20ec833b716b7747923125eddbf4a8cc76c93aab6a5d9453089e7b63e1ff60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 PyPy/7.3.10 Linux/6.9.9-1-MANJARO
|
Security for web3-proxy 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.