I know I should be able to get it, but does anyone know how to get the private keys associated with the web3.eth.accounts from the testrpc?
Much thanks and upvotes to the wise sage with the answer.
The easiest way to find out accounts' private keys is simply just scroll up to the top in terminal. You will see something like this (obviously with different addresses and private keys):
i am fairly certain the web3 rpc protocol doesn't allow you pass private keys around, however here are a few workarounds:
check the console output of testrpc
, they are listed there.
if you use a fixed seed testrpc -s <some-seed-value>
you will always get the same test accounts (so you could copy the private keys to your test code/etc)
you can pass in private keys you've generated.
testrpc --account="<privatekey>,balance"
you can start testrpc
with accounts unlocked, which might suit what you are doing better, eg if you want to send transactions.
testrpc --secure -u 0 -u 1
more at (https://github.com/ethereumjs/testrpc)