I have a running geth node and by using geth account new
command I created a new account:
$ geth account list
Account #0: {47978a69f410d0f...} ...
Nevertheless, when using json rpc call to list my ether accounts a null result is obtained:
$ curl -X POST --data
'{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":1}' http://127.0.0.1:8545
{"jsonrpc":"2.0","id":1,"result":[]}
Why is that? Any hint? Thanks in advance!
I launched geth with the following command:
$geth --rpc --rpcapi "db,eth,net,web3" --rpcport "8545" --testnet
--etherbase "0x47978a6...."
Is it possible that geth working on testnet gets confused on json rpc calls? Do I need to specify somehow in these calls to use testnet and not mainnet?
id:0
or removeid
param.$ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[],"id":0}' http://127.0.0.1:8545 {"jsonrpc":"2.0","id":0,"result":[]}
$ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_accounts","params":[]}' http://127.0.0.1:8545 {"jsonrpc":"2.0","error":{"code":-32700,"message":"missing request id"}}´
eth.accounts[]
is the index of the wallets that you are querying, in your case0
, the coinbase.