Skip to main content

Release Test coverage MIT License

ethereumd-proxy

Proxy client-server for Ethereum node using JSON-RPC interface.

Why?

Mostly popular cryptocurrencies usually are forks of Bitcoin and all of them support Bitcoin protocol for communication with their full nodes. Ethereum go hard by own way and made own API for that. This library is a proxy to Ethereum node which implement many API methods like in bitcoind. Also it have signals like blocknotify and walletnotify. All these features are implemented by ethereumd-proxy using polling and other techniques behind the scene.

Installation

Python 3.5+ required.

First you need Geth/Parity or any other ethereum node (for listening). Tested on Geth 1.6.7 and used in production.

Installation

$ pip install ethereumd-proxy

Usage

It is the same as bitcoin-cli. Except it is not a node runner, just simple proxy for listening actual node.

Available command list:

$ ethereum-cli -help

To start proxy server use:

$ ethereum-cli -datadir=<path_to_your_dir_with_node_and_ethereum.conf> -daemon

To stop server:

$ ethereum-cli -datadir=<path_to_your_dir_with_node_and_ethereum.conf> stop

Also can be used as python client connector:

import asyncio
import ethereumd

loop = asyncio.get_event_loop()

async def go():
    client = await ethereumd.create_ethereumd_proxy(
        'http://localhost:8545', loop=loop)

    val = await client.validateaddress('0x6cace0528324a8afc2b157ceba3cdd2a27c4e21f')
    print(val)  # will print {'isvalid': True, 'address': '0x6cace0528324a8afc2b157ceba3cdd2a27c4e21f', 'scriptPubKey': 'hex', 'ismine': False, 'iswatchonly': False, 'isscript': False, 'pubkey': '0x6cace0528324a8afc2b157ceba3cdd2a27c4e21f', 'iscompressed': False, 'timestamp': None}

    address = await client.getnewaddress(passphrase='admin')
    print(address)  # will print address like '0x137dd92be1d986eb3af023d0fb6fa8436c3ee5f8'

loop.run_until_complete(go())

Implemented JSON-RPC methods

Util

Wallet

Blockchain

validateaddress

getbalance

getblockhash

estimatefee

settxfee

getdifficulty

listaccounts

getblockcount

gettransaction

getbestblockhash

sendfrom

getblock

sendtoaddress

walletlock

walletpassphrase

getnewaddress

Planned add more methods as soon as possible. Read help of some method first before use!

Sample of ethereum.conf

#
# ETHEREUMD-PROXY options (for controlling a running proxy process)
#

# Local server address for ethereumd-proxy RPC:
#ethpconnect=127.0.0.1

# Local server port for ethereumd-proxy RPC:
#ethpport=9500

#
# JSON-RPC options (for controlling a running ethereum process)
#

# You can use go-ethereum to send commands to ethereum
# running on another host using this option:
#rpcconnect=127.0.0.1

# Listen for RPC connections on this TCP port:
#rpcport=8545

# Listen for RPC connections on this unix/ipc socket:
#ipcconnect=~/.ethereum/geth/geth.ipc

#
# Signals options (for controlling a script management process)
#

# Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)
#walletnotify=
# Execute command when the best block changes (%s in cmd is replaced by block hash)
#blocknotify=
# Execute command when a relevant alert is received (%s in cmd is replaced by message)
# TODO: add notification of long fork
#alertnotify=

Copy it to your datadir folder or use direct path to it.

TODO

  • Add more RPC methods;

  • Track orphaned blocks;

Changes

0.3.0 (2017-10-01)

  • Integrated aioethereum library;

  • Fixed not worked tests;

  • Add new tests;

0.2.0 (2017-08-31)

  • Added new RPC methods:

    • getblockhash;

    • validateaddress;

    • estimatefee;

    • listsinceblock;

    • walletpassphrase;

    • walletlock;

    • getnewaddress;

    • sendfrom;

  • Added some methods optimizations;

0.1.2 (2017-08-09)

  • Increased testcov to 77%;

  • Added more tests for methods;

  • Fix error with alernotify;

0.1.1 (2017-07-31)

  • Added tests and codecov;

0.1 (2017-07-25)

  • Added cli for proxy RPC server;

  • Some bug fixes in API;

  • Added new RPC methods:

    • getbalance;

    • settxfee;

    • listaccounts;

    • gettransaction;

    • getdifficulty;

    • getblockcount;

    • getbestblockhash;

    • getblock;

    • sendtoaddress;

0.1a (2017-07-22)

  • Initial release

  • Added RPC methods:

    • gettransaction;

    • getblock;

    • listaccounts;

Metadata

Release files for ethereumd-proxy 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ethereumd-proxy 0.3.0
File Size Uploaded Provenance Actions
ethereumd-proxy-0.3.0.tar.gz 132.5 kB Without provenance Details for ethereumd-proxy-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ethereumd-proxy 0.3.0
File Interpreter ABI Platform Actions
ethereumd_proxy-0.3.0-py3-none-any.whl Python 3 none any Details for ethereumd_proxy-0.3.0-py3-none-any.whl

Total release size: 273.6 kB

Release files / ethereumd-proxy-0.3.0.tar.gz

Download URL ethereumd-proxy-0.3.0.tar.gz
Size 132.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0e2d85a8ef1ecb67f9e87cb387f5ccd0a8ddbcfad716496770c8c66d01f77c38
BLAKE2b-256 checksum
How to use checksums
87e4c23b568b2dae5923a1fb3a6d0536d4770630013fef9b79fa55bfd47488d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ethereumd_proxy-0.3.0-py3-none-any.whl

Download URL ethereumd_proxy-0.3.0-py3-none-any.whl
Size 141.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2aa1f289cdf9b21298456d7374462aa110d17267be4cb685a3566765c3459af2
BLAKE2b-256 checksum
How to use checksums
3d9818eb4fa433da85e77f9939ef70df16c10d81498fc81449fab4ca521fc7fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for ethereumd-proxy 0.3.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page