Skip to main content

Custom Ethereum client and utilities used by XChainPY clients

Project description

xchainpy/xchainpy_ethereum

Ethereum Module for XChainPy Clients

Install

Python 3.8-3.9 tested

python setup.py install

you might need to include nimble in your path to install faster-than-requests,

export PATH=/home/[username]/.nimble/bin:$PATH
pip install faster-than-requests --isolated --disable-pip-version-check --no-cache-dir --no-binary :all:

Modules

  • client - Custom client for communicating with ethereum-lib

Following dependencies have to be installed into your project

faster-than-requests==20.10.19
web3==5.16.0
websockets==8.1

Service Providers

This package uses Infura WSS API, head to https://infura.io/ to get your own websocket token. In addition, if you want to interact with non-ERC20 token, head to https://etherscan.io/ to get your etherscan token.

Initialize mainnet client:

client = Client(phrase="mnemonimic", network="wss://mainnet.infura.io/ws/v3/...", network_type="mainnet", ether_api="...")

Initialize ropsten(testnet) client:

client = Client(phrase="mnemonimic", network="wss://ropsten.infura.io/ws/v3/...", network_type="ropsten", ether_api="...")

You can generate mnemonic phrase using crypto.py, head to test/test_ropsten_client.py to see a more comprehensive way to using this client.

Tests

These packages needed to run tests:

  • pytest pip install pytest
  • pytest-asyncio pip install pytest-asyncio

How to run test ?

cd test/

Ropsten

$ pytest test_ropsten_client.py

Mainnet

$ pytest test_mainnet_client.py

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

xchainpy_ethereum-0.2.1.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xchainpy_ethereum-0.2.1-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file xchainpy_ethereum-0.2.1.tar.gz.

File metadata

  • Download URL: xchainpy_ethereum-0.2.1.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for xchainpy_ethereum-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e5e52e4dbaad93ca64a7deee64ce66349e8bdef051712b2f4e47e7543fbfcdda
MD5 70e147182851debea7b3d5524fc93ed6
BLAKE2b-256 e2c6f40b5bdcb016da554e6bebe0acde9c4007f0abdf79aa6d8818584cbea4fc

See more details on using hashes here.

File details

Details for the file xchainpy_ethereum-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: xchainpy_ethereum-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for xchainpy_ethereum-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ff3e2d2ee33d97ad3e5e932b64b41c9f02f1bb1505387c2368d17dab3f0ba0e
MD5 fef9d7e77dcbff27e0005e0c0ce59b4d
BLAKE2b-256 6f1f86b57a07769c87f61ecdec3cd17e64bf96a834b08227f7e8f03a24196a44

See more details on using hashes here.

Supported by

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