How to run a local Nitro dev node
Overview
This page provides step-by-step instructions for setting up and running a local Nitro node in --dev
mode. This mode is ideal for developers who want to quickly test contracts using a single node, as it offers a simpler and faster setup compared to more complex environments.
While some teams use nitro-testnode
for testing cross-layer messaging, which involves launching both Geth as L1 and Nitro as L2, this setup can be more complex and time-consuming. If your primary goal is to test contracts on a local node without needing cross-layer interactions, Nitro's --dev
mode offers a lightweight and efficient alternative.
However, if you need more advanced functionality—such as cross-layer messaging, working with both L1 and L2 chains, or testing interactions between different layers—nitro-testnode
is the preferred option. The testnode setup allows you to simulate a full L1-L2 environment, which is critical for those scenarios. See here for instructions.
Note that Nitro --dev
mode is ideal for Stylus contract testing, as it is much lighter and faster to set up than the full nitro-testnode environment.