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
?
--rpc???
were deprecated some time ago, they have--http.
equivalents. In particular to use--http.api
to enable required apis.