Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flag provided but not defined: -rpc

Tags:

geth

Am starting off in blockchain development using the book Mastering Blockchain - A deep dive into distributed ledgers, consensus protocols, smart contracts, DApps, cryptocurrencies, Ethereum,

Am using WSL with geth version 1.10.9.

$geth version
Geth
Version: 1.10.9-stable
Git Commit: eae3b1946a276ac099e0018fc792d9e8c3bfda6d
Architecture: amd64
Go Version: go1.17
Operating System: linux
GOPATH=
GOROOT=go

Am trying to start geth, but am getting the error that the --rpc flag is not defined.

This is the command I am trying to run:

geth --datadir ~/etherprivate/ --networkid 786 --rpc --rpcapi 'web3,eth,net,debug,personal' --rpccorsdomain '*'

Any help on how I can solve it?

like image 432
Samuel IZABAYO Avatar asked Feb 19 '26 20:02

Samuel IZABAYO


2 Answers

The latest versions of Geth (after 1.10.8-stable) do not support --rpc but fortunately, as you can see in the Command-line Options, it has been replaced by the --http option. So your command should look like this:

geth --datadir ~/etherprivate/ --networkid 786 --http --http.api 'web3,eth,net,debug,personal' --http.corsdomain '*'

With all rpc options replaced by their http equivalent:

  • --rpc => --http
  • --rpcapi => --http.api
  • --rpccorsdomain => --http.corsdomain
like image 109
Benjamin Azoulay Avatar answered Feb 21 '26 10:02

Benjamin Azoulay


It appears 1.10.9-stable version has a problem and is returning a -rpc error. GETH 1.10.8-stable version works fine when running the geth command with --rpc

like image 36
HSudler Avatar answered Feb 21 '26 08:02

HSudler