0

When running the command

sudo docker run -d --name ethereum -p 8545:8545 -p 30303:30303 ethereum/client-go --rpc --rpcaddr "0.0.0.0" --rpcapi="db,eth,net,web3,personal" --rpccorsdomain "*" --dev

the container closes almost immediately. Removing all the "rpc" to leave

sudo docker run -d --name ethereum -p 8545:8545 -p 30303:30303 ethereum/client-go

the container runs in the background as expected. Why is this so and how can I keep the container running long enough to exec on it?

siya
  • 7
  • 2
  • 4
  • Run it in the foreground by removing `-d` and look for errors – Andy Ray Aug 30 '22 at 16:55
  • Oops! Seems the issue is that the "rpc flag is used but not defined". I'm following a guide online and there's not much info on how to define the rpc flag – siya Aug 30 '22 at 17:03
  • The easiest way is to use the standard library [`flag`](https://pkg.go.dev/flag) package in your `main.go` file, though there are several other similar libraries. Can you [edit] the question to include the application source code you're running? – David Maze Aug 30 '22 at 23:41

2 Answers2

0

After running command in foreground as @Andy Ray suggested, it turns out the issue with the rpc flag was due to it being replaced with the http flag as outlined in this answer.

siya
  • 7
  • 2
  • 4
0

Please use below link. RPC has been updated with http in the latest version.

docker run -d --name ethereum -p 8545:8545 -p 30303:30303 ethereum/client-go --http --http.addr "0.0.0.0" --http.api="db,geth,net,web3,personal" --http.corsdomain "*" --dev
Rohit
  • 188
  • 2
  • 18