1

I want to use RPCs to access a Geth node. Do I have to execute admin.StartRPC on the node in order to activate the RPC server?

sea212
  • 1,820
  • 7
  • 19
Louis
  • 1,155
  • 5
  • 17
  • 29

2 Answers2

1

Instead of admin.startRPC(addr, port), when you start your node (if you are using geth) you can use the rpc flag

geth --rpc - this defaults to localhost:8545

You can also define your own address and port number with these options:

geth --rpc --rpcaddr <ip> --rpcport <portnumber>

geth --rpc --rpccorsdomain "http://localhost:3000"

Documentation

Steven V
  • 1,461
  • 10
  • 15
0

I use something like this: geth --rpcapi eth,net,web3 --rpccorsdomain * --rpc --rpcaddr 0.0.0.0

j4ys0n
  • 193
  • 6