NEW

CCIP is now live for all developers. See what's new.

Chainlink Local Architecture

Chainlink Local is a library that you can import into your development environment (e.g., Hardhat, Foundry, or RemixIDE) to use Chainlink services locally. It supports two primary modes for local testing: With and without forking. This enables you to test Chainlink smart contracts and services, such as CCIP, either in a clean local blockchain state or by using a forked state from a live blockchain.

User contracts tested with Chainlink Local can be deployed to test networks without any modifications.

Local Testing (Without Forking)

In this mode, you work with mock contracts on a locally running development blockchain node, such as Hardhat, Anvil (Foundry), or RemixIDE.

How it works: Simply import the Chainlink Local library and deploy a set of Chainlink smart contracts to a blank Hardhat/Anvil network EVM state as part of your tests. You can then deploy your smart contracts and start testing using them.

Chainlink Local Architecture (Without Forking)

Local Testing (With Forking)

In this mode, you work with deployed Chainlink smart contracts using one or multiple forked networks. This setup provides a more realistic testing environment by incorporating the state of a live blockchain.

How it works: In your test scripts, you will fork one or multiple testnets to create locally running blockchain network(s). Chainlink Local provides the necessary interfaces to interact with the forked Chainlink services and utilities for testing in a forked environment. For example, in CCIP, Chainlink Local provides a utility function that helps you switch from one fork (e.g., source chain) to another fork (e.g., destination chain).

Chainlink Local Architecture (With Forking)

Stay updated on the latest Chainlink news