Fork a local node #5147
Unanswered
marcello33
asked this question in
Troubleshooting
Replies: 1 comment 5 replies
-
I believe regular nodes allow forking of the latest 256 blocks, but you'll need an archive node to fork anything older than that. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I have a running Ethereum
goerli
node on my linux system, with its HTTP server on default portlocalhost:8545
For testing reasons, and given the deprecation of
goerli
, I'd like to keep that state and fork the chain usinghardhat
.My goeli node is completely synced
And responding to requests
I am running
hardhat
versionv2.22.3
And I initialized a
hardhat
project withnpx hardhat init
and have this configs file:Since the node is running on
localhost
, together with the--fork
option, I believe I also have to specify thehostname
(which is still gonna be my local machine, hence127.0.0.1
), and a new port (to avoid it to default to8545
, where the original testnetgoerli
node is running, hence9545
).However, when I try to fork it, with the following command
npx hardhat node --fork http://127.0.0.1:8545 --hostname 127.0.0.1 --port 9545
I get this error:
Am I doing something wrong here? Can anyone please help?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions