1

I have an instance of testrpc running:

testrpc -a 1000

when using geth, I'd do this:

geth attach rpc:http://localhost:8545

to link to it.

I have pyethapp installed and would like to do something similar - is this possible?

Looking through the code there is an rpc_client.py file that states:

""" A simple way of interacting to a ethereum node through JSON RPC commands. """

I interpret this as a means to connect to my testrpc simulated node, but I can't figure out which functions to use....

How do you connect to a testrpc simulated node using pyethapp?

1 Answer 1

1

Does it need to be pyethapp, or are you open to any library that allows you to interact with a client?

One option is to connect using web3.py, installed with pip install web3.

From the docs, edited for simplicity:

>>> from web3 import Web3, HTTPProvider
>>> web3 = Web3(HTTPProvider('http://localhost:8545'))
>>> web3.eth.blockNumber
4000000
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.