I want to learn how to use the GETH console.

  1. What does command "geth --rpc" do?
  2. Why are so many entries generated?
  3. What is it syncing?
  4. If it is a syncing process, when or what message means the process is finished?
  5. If I closed the console window or turn off computer, will syncing process pause or I will have to start from point 0 next time I execute the command?

2 Answers 2

  1. geth --rpc starts the rpc interface. The rpc interface is required to be able to connect with clients (websites, for example) that want to access the Ethereum blockchain. Use options --rpcaddress and --rpcport to set address and port of the rpc interface. With --rpcapi you can limit access via rpc to certain apis. Also, --rpccorsdomain has to be set in many cases such that the calling domain is allowed, if you set it to "*" you allow every domain.

  2. geth logs every action it does, so you always know about the sync state, connection issues with peers, and transactions that are sent to your node.

  3. syncing means that you bring your local copy of the blockchain up to date. This is required to be able to participate in the blockchain. When syncing, information on the state of the blockchain and on prior transactions are copied to your node.

  4. if you have geth running, open a different shell and run geth attach. geth then connects to the already running geth process and starts the geth console. Enter eth on the geth console and look for the syncing entry. If your node is syncing, the entry shows true.

  5. you can interrupt and restart the sync any time, it will resume where it was stopped before. Note that if you stop a geth node that is in sync, it will have to sync again after you restart it, since the blockchain continues to evolve while your node is turned off.

  • Does it still have place in 2022? Current list of command flags doesn't count it. I am working on issue with connect to my node on VM from host machine and this might a potential issue in case the flag is still required.
    – Gleichmut
    Nov 28, 2022 at 9:30

--rpc has been replaced with --http. You can find more details here https://stackoverflow.com/questions/69463898/flag-provided-but-not-defined-rpc/69643321#69643321

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.