Skip to main content

An Ethereum simulator for aiding smart contract development.

Project description

# Ethereum Test RPC server

## Ethereum Test RPC

Limited RPC client intended for use with automated testing. Uses [pythereum](https://github.com/ethereum/pyethereum) to run an Ethereum client behind the scenes without the need for mining or networking. The result is an Ethereum client that provides instant results and quick feedback during development.

### Install

Installing is easy, through pip:

` $ pip install eth-testrpc `

Or, to upgrade:

` pip install eth-testrpc --upgrade `

### Run

Installing through pip will make the testrpc command available on your machine:

` $ testrpc `

This will run testrpc on localhost:8545. You can pass through a different port (-p, –port) or domain (-d, –domain).

### Implemented methods

The RPC methods currently implemented are:

  • eth_coinbase

  • eth_accounts

  • eth_gasPrice

  • eth_blockNumber

  • eth_sendTransaction

  • eth_sendRawTransaction

  • eth_call

  • eth_getCompilers

  • eth_compileSolidity

  • eth_getCode (only supports block number “latest”)

  • eth_getBalance

  • eth_getTransactionCount

  • eth_getTransactionByHash

  • eth_getTransactionReceipt

  • eth_newBlockFilter (temporarily removed until implemented in underlying library)

  • eth_newFilter (temporarily removed until implemented in underlying library)

  • eth_getFilterChanges (temporarily removed until implemented in underlying library)

  • eth_uninstallFilter (temporarily removed until implemented in underlying library)

  • web3_sha3

  • web3_clientVersion

There’s also special non-standard methods that aren’t included within the original RPC specification:

  • evm_reset : No params, no return value.

  • evm_snapshot : No params. Returns the integer id of the snapshot created.

  • evm_revert : One optional param. Reverts to the snapshot id passed, or the latest snapshot.

When calling evm_reset, the testrpc will revert the state of its internal chain back to the genesis block and it will act as if no processing of transactions has taken place. Similarly, you can use evm_snapshot and evm_revert methods to save and restore the evm state as desired. Example use cases for these methods are as follows:

  • evm_reset : Run once at the beginning of your test suite.

  • evm_snapshot : Run at the beginning of each test, snapshotting the state of the evm.

  • evm_revert : Run at the end of each test, reverting back to a known clean state.

### Releasing a new version (for eth-testrpc developers)

  • Bump version number in setup.py

  • Add entry to CHANGES.txt

  • Tag the release.

` git tag -s -m "X.X.X Release" vX.X.X git push --tags `

  • Go make the release on github for the tag you just pushed

  • Build and push release to PyPI

` make release `

### License

MIT

### Consensys

This library was originally authored by Consensys and transferred later when it was no longer maintained. A big thanks for them to creating this extremely useful library.

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

eth-testrpc-0.2.1.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

eth_testrpc-0.2.1-py2-none-any.whl (8.5 kB view details)

Uploaded Python 2

File details

Details for the file eth-testrpc-0.2.1.tar.gz.

File metadata

  • Download URL: eth-testrpc-0.2.1.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for eth-testrpc-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f8eb029740f4e258552cf49aae7daef1a7c42e89a02d09d4b756ea1e1d28766f
MD5 0769637b7757d3e01e286f8746c5dae8
BLAKE2b-256 b7e6bcdf82d95f0654edae1547c53d625a85e0fe371204838c8f6a31abfc80ac

See more details on using hashes here.

File details

Details for the file eth_testrpc-0.2.1-py2-none-any.whl.

File metadata

File hashes

Hashes for eth_testrpc-0.2.1-py2-none-any.whl
Algorithm Hash digest
SHA256 c005d14072311bf07e9cc18a7793e1db737d20ea9f8352ab43e52b2b3e1192b2
MD5 d14f4cc7919f6a41e3ce1b3b86df2990
BLAKE2b-256 3b3d6533a5efdb9c0f66c2f9357a3a58548b3bbd67a32bba5db8dee5c0b1ae2d

See more details on using hashes here.

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