LayerKit lets you deploy LayerZero into rollups like Optimism with just one command in just a few minutes. This helps developers easily test and build cross-chain dApps with full flexibility
LayerKit is a developer toolkit designed for rapid and flexible deployment of LayerZero into rollups so that they can exchange messages with Ethereum (or with other rollups / chains in the future). It enables application development and testing directly on local versions of Ethereum and Optimism (running Geth and Lighthouse nodes). With a simple one-command setup, LayerKit deploys fully connected LayerZero components in under 10 minutes - including endpoints, MessageLib (ULN302), Executor, DVN, PriceFeed, and Worker on each chain. The package is very modular, allowing users to use custom MessageLibs or DVNs as required. Furthermore, the Optimism and Ethereum network can be configured with a high degree of control. Additionally, it provides a Blockscout explorer for both chains, allowing easy tracking of blockchain activity.
LayerKit uses kurtosis packages to orchestrate the deployment process of LayerZero components across Ethereum and Optimism networks. It leverages the Ethereum and Optimism packages developed by the Ethereum Foundation to set up both networks in isolated environments. Each network is spun up with its own Blockscout block explorer.
Once the Ethereum and Optimism networks are running, the necessary chain details (e.g. pre-funded keys, RPC) are retrieved. To facilitate LayerZero deployment on the Optimism layer 2, tokens are bridged to Optimism using the built-in token bridge.
Next, LayerKit deploys the core LayerZero components:
Once the contracts are deployed, LayerKit configures the system by:
The DVN contract can easily be swapped out for an alternative and in future work this will be even more parameterised to allow for easier DVN development.
These deployment steps were derived by looking at the deployed contracts on various mainnets and testnets as there is no documentation for this. Most of the contracts deployed are the same ones as on mainnet. Only the price feed and DVN contracts are mocked ones as it would not be feasible to deploy the full version.