Skip to main content
Fix port
Source Link

First, you should make sure you are using a fairly new geth version. I tested on my recently downloaded version from the official download site

My local version is

$ ./geth version
Geth
Version: 1.9.25-stable
Git Commit: e7872729012a4871397307b12cc3f4772ffcbec6
Git Commit Date: 20201211
Architecture: amd64
Protocol Versions: [65 64 63]
Go Version: go1.15.6
Operating System: linux
GOPATH=
GOROOT=go

Second, you should make sure you use the new flags, the ones you listed are deprecated and will be removed in the future.

--rpc --rpcport 8545 --rpcaddr 0.0.0.0 --rpccorsdomain "*" --rpcapi "eth,web3"

Should be replaced with

--http --http.port 8545 --http.addr 0.0.0.0 --http.corsdomain '*' --http.api 'eth,web3'

Lastly, you also need to enable http.vhosts and allow any or only your domain.

You can do this with

--http.vhosts '*'

When you start the node, you should see this line

INFO [02-17|14:32:16.975] HTTP server started                      endpoint=[::]:75458545 cors=* vhosts=*

Even after this line was displayed in the console, you still might not be able to connect to it right away.

After the node boots up, which can take a while, you will be able to connect to it.

First, you should make sure you are using a fairly new geth version. I tested on my recently downloaded version from the official download site

My local version is

$ ./geth version
Geth
Version: 1.9.25-stable
Git Commit: e7872729012a4871397307b12cc3f4772ffcbec6
Git Commit Date: 20201211
Architecture: amd64
Protocol Versions: [65 64 63]
Go Version: go1.15.6
Operating System: linux
GOPATH=
GOROOT=go

Second, you should make sure you use the new flags, the ones you listed are deprecated and will be removed in the future.

--rpc --rpcport 8545 --rpcaddr 0.0.0.0 --rpccorsdomain "*" --rpcapi "eth,web3"

Should be replaced with

--http --http.port 8545 --http.addr 0.0.0.0 --http.corsdomain '*' --http.api 'eth,web3'

Lastly, you also need to enable http.vhosts and allow any or only your domain.

You can do this with

--http.vhosts '*'

When you start the node, you should see this line

INFO [02-17|14:32:16.975] HTTP server started                      endpoint=[::]:7545 cors=* vhosts=*

Even after this line was displayed in the console, you still might not be able to connect to it right away.

After the node boots up, which can take a while, you will be able to connect to it.

First, you should make sure you are using a fairly new geth version. I tested on my recently downloaded version from the official download site

My local version is

$ ./geth version
Geth
Version: 1.9.25-stable
Git Commit: e7872729012a4871397307b12cc3f4772ffcbec6
Git Commit Date: 20201211
Architecture: amd64
Protocol Versions: [65 64 63]
Go Version: go1.15.6
Operating System: linux
GOPATH=
GOROOT=go

Second, you should make sure you use the new flags, the ones you listed are deprecated and will be removed in the future.

--rpc --rpcport 8545 --rpcaddr 0.0.0.0 --rpccorsdomain "*" --rpcapi "eth,web3"

Should be replaced with

--http --http.port 8545 --http.addr 0.0.0.0 --http.corsdomain '*' --http.api 'eth,web3'

Lastly, you also need to enable http.vhosts and allow any or only your domain.

You can do this with

--http.vhosts '*'

When you start the node, you should see this line

INFO [02-17|14:32:16.975] HTTP server started                      endpoint=[::]:8545 cors=* vhosts=*

Even after this line was displayed in the console, you still might not be able to connect to it right away.

After the node boots up, which can take a while, you will be able to connect to it.

Source Link

First, you should make sure you are using a fairly new geth version. I tested on my recently downloaded version from the official download site

My local version is

$ ./geth version
Geth
Version: 1.9.25-stable
Git Commit: e7872729012a4871397307b12cc3f4772ffcbec6
Git Commit Date: 20201211
Architecture: amd64
Protocol Versions: [65 64 63]
Go Version: go1.15.6
Operating System: linux
GOPATH=
GOROOT=go

Second, you should make sure you use the new flags, the ones you listed are deprecated and will be removed in the future.

--rpc --rpcport 8545 --rpcaddr 0.0.0.0 --rpccorsdomain "*" --rpcapi "eth,web3"

Should be replaced with

--http --http.port 8545 --http.addr 0.0.0.0 --http.corsdomain '*' --http.api 'eth,web3'

Lastly, you also need to enable http.vhosts and allow any or only your domain.

You can do this with

--http.vhosts '*'

When you start the node, you should see this line

INFO [02-17|14:32:16.975] HTTP server started                      endpoint=[::]:7545 cors=* vhosts=*

Even after this line was displayed in the console, you still might not be able to connect to it right away.

After the node boots up, which can take a while, you will be able to connect to it.