Skip to main content

An Ethereum simulator for aiding smart contract development.

Project description

## Etheruem 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

To install testrpc, follow these steps. It’s recommended you perform these within a virtualenv.

  1. $ git clone https://github.com/Consensys/testrpc (clone this repository)

  2. cd testrpc

  3. $ pip install -r requirements.txt

### Run

cd into your clone of this repository, then type:

` $ python testrpc.py `

### 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

  • eth_getFilterChanges (only supports block filters)

  • eth_uninstallFilter

  • 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.

### License

MIT

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.1.11.tar.gz (6.4 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for eth-testrpc-0.1.11.tar.gz
Algorithm Hash digest
SHA256 07e361984cf4c23c4c1841e60b0968b9671d862f927de7c05c0d94e4291654d6
MD5 3290bedeb46c6d45b564b50ba06edc44
BLAKE2b-256 aaec967158e4168be974bd20987e3ec8d63b09f300dd7d19432c46bd5da30cd3

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