1

I've set up a local geth node, and started it like so:

/usr/bin/geth --http --http.port 8545 --http.addr 0.0.0.0 --http.corsdomain '*' $ARGS

From the machine I'm trying to connect with, I can reach the local node like so:

curl --data '{"method":"eth_syncing","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST http://192.168.178.42:8545

Yet when I enter a new MetaMask network with rpc URL: http://192.168.178.42:8545/ and chainId 1, MetaMask responds with "Could not fetch chain ID. Is your RPC URL correct?".

What could be going wrong?

Just checked the Chrome console and found something interesting:

initSentry.js:8 Failed to fetch the chainId from the endpoint. Error: chain not synced beyond EIP-155 replay-protection fork block
  at r.jsonRpcRequest (ui.js:152)
  at async v.validateChainIdOnSubmit (ui.js:152)
  at async chrome-extension:/nkbihfbeogaeaoehlefnkodbefgpgknn/ui.js:152

Geth version: 1.10.2-stable-97d11b01

Went to check the sync state:

{
  currentBlock: 12315274,
  highestBlock: 12315377,
  knownStates: 662281856,
  pulledStates: 662253791,
  startingBlock: 12313270
}

That's current block 12,315,274. Fork block for EIP-155 is 2,675,000. Why would get say it isn't synched when calling eth_chainId?

2
  • Command line options --rpc??? were deprecated some time ago, they have --http. equivalents. In particular to use --http.api to enable required apis.
    – Ismael
    Apr 27 at 3:01
  • 1
    My bad, changed those in the config didn't update the question. Editing!
    – alextes
    Apr 28 at 10:39
0

Although I have the blocks from after the fork, it seems my state trie is still out of sync, and until it catches up, this node is out of sync and unusable.

At this point I have no clue to figure out progress on syncing the state trie.

You can read more on it here: https://github.com/ethereum/go-ethereum/issues/15001#issuecomment-370732526

0

Been pulling the last of my hair out most of the day with this issue, and I thought I would tell you how to fix it in case someone else comes across this thread.

You have to add the following when running geth:

--http.vhosts "*"

the documentation describes it as such: "Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. (default: "localhost")"

I am running a Private Geth Network with my own genesis file so it never sees the internet....Please note that * allows everything to connect (but I am not sure if you can even see anything as its private genesis file and private clientID)

1
  • Although this sounds like it could be the answer to some question, I'm quite certain it isn't the answer to mine 😅. As shown in the question metamask was communicating with the node just fine, the problem was it being unable to fetch the chainId. The answer as to why I've already given.
    – alextes
    May 31 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.