Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Limited RPC client intended for use with automated testing. Uses pythereum 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.
Installing is easy, through pip:
$ pip install eth-testrpc
Or, to upgrade:
pip install eth-testrpc --upgrade
Or, to install with gevent threads
pip install eth-testrpc[gevent]
And then set the environment variable TESTRPC_THREADING_BACKEND=gevent
Installing through pip will make the testrpc-py
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).
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)eth_protocolVersion
( see rpc_configure
)eth_syncing
( see rpc_configure
)eth_mining
( see rpc_configure
)web3_sha3
web3_clientVersion
net_version
(see rpc_configure
)net_listening
(see rpc_configure
)net_peerCount
(see rpc_configure
)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.TestRPC also exposes the evm_mine
method for advancing the test evm by some
number of blocks.
evm_mine
: Optionally supply an integer for the number of blocks to mine. Default is 1 block. No return value.TestRPC exposes the testing_timeTravel
method for fast-forwarding to a future timestamp.
testing_timeTravel
: Takes an integer timestamp that must be greater than the timestamp of the current latest block.TestRPC exposes the rpc_configure
method which can be used to modify the
static values returned by the following endpoints.
eth_protocolVersion
(default 63
)eth_syncing
(default False
)eth_mining
(default True
)net_version
(default 1
)net_listening
(default False
)net_peerCount
(default 0
)homestead_block_number
(default 0
)dao_fork_block_number
(default 0
)anti_dos_fork_block_number
(default 0
)clearing_fork_block_number
(default 0
)The rpc_configure
takes two parameters.
key
: string representing the rpc method on which you want to change the return value.value
: the value that should be returned by the endpoint.The homestead
, dao
, anti_dos
and clearing
fork configurations determine
which block number the respective fork rules should come into effect. All
default to 0
.
TestRPC uses a default gas limit of 4000000. To change this set the
environment variable TESTRPC_GAS_LIMIT
to the desired value.
setup.py
CHANGES.txt
git tag -s -m "X.X.X Release" vX.X.X
git push --tags
make release
MIT
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.
FAQs
An Ethereum simulator for aiding smart contract development.
We found that eth-testrpc demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.