2

I am using the Expanse version of go-ethereum to play with Expanse. I am exposing the RPC port over the 'net, and connecting to it using "geth attach" from another computer. None of the commands that I am used to using at the console are working. For example:

> admin.peers
ReferenceError: 'admin' is not defined
    at <anonymous>:1:1

And the same problem happens using curl.

When I enter this:

curl -X POST --data '{"jsonrpc":"2.0","method":"miner_start","params":[4],"id":74}' localhost:8545

I get this reply:

{"jsonrpc":"2.0","id":74,"error":{"code":-32601,"message":"The method miner_start does not exist/is not available"}}

I probably have a very simple option turned off but there are so many "rpc" this and thats that I am kind of getting lost. Any ideas?

Thank you.

1

Most of the commands available at the console (ipc) are not available over rpc for security reasons. If you know your rpc connection cannot be accessed by anyone other than yourself, launch geth with the following flags to expose the additional APIs:

geth --rpc --rpcapi web3,eth,personal,miner,net,txpool

Add any additional APIs you need to the parameters of --rpcapi.

  • You should add admin for admin.peers to work. – Ismael Jul 16 '17 at 6:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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