Local forks

Blocktorch supports local Hardhat forks either from your machine or you can choose to use a managed hardhat solution from blocktorch. Once the fork is added to your blocktorch project, we start indexing the data.

All features of blocktorch can be fully leveraged for your specific fork. You can also enable other developers from your team or for example security auditors you work together with to access your local fork data to make use of all features like step-debugging, monitoring and searching.

The data like logs from your local fork persists in your blocktorch project, even if you let your hardhat instance die. You can leverage this data as you develop and test your smart contracts.

Adding your local fork to blocktorch

Step 1: Navigate to "Nodes" >> "Hardhat forks"

Step 2: Click "Add RPC"

Step 3: Add your fork by choosing "Hardhat Fork" if you run Hardhat yourself for example locally on your machine or "Managed Hardhat Fork" if you want to make use of our service to spin the Hardhat fork in the cloud for you.

pageSetup Hardhat forkpageSetup managed Hardhat Fork

New to Hardhat?

Hardhat forks are a powerful feature used in blockchain development that allow developers to simulate a local copy of an existing blockchain, such as the Ethereum mainnet, for development and testing purposes. This enables developers to test their smart contracts under real network conditions without the risk of losing real assets or impacting the live blockchain.

Why Use Hardhat Forks?

  • Testing in Real Conditions: Replicate the current state of the Ethereum mainnet (or any other network) to test how contracts interact with existing contracts and conditions.

  • Cost-Efficient: Experiment and debug without spending real Ether or tokens.

  • Speed and Convenience: Accelerate development cycles by running tests locally and avoiding network congestion and delays.

Alternatives to Hardhat?

Anvil from Foundry

Last updated