Create an EVM Rollup

Highly Recommended - Opt for Quicklaunch

We strongly advise utilizing the Quicklaunch option for creating a new Rollup, as opposed to manually following the detailed steps. Quicklaunch streamlines the process, ensuring simplicity and efficiency. Save time and reduce complexities by opting for Quicklaunch to set up your new Rollup seamlessly.

1. Clone GitHub Repositories

Start by cloning the necessary repositories from GitHub. Use the following commands in your terminal:

git clone https://github.com/airchains-network/rollup-evm
git clone https://github.com/airchains-network/evm-sequencer-node
git clone https://github.com/airchains-network/da-client
git clone https://github.com/airchains-network/settlement_layer_calls_api

2. Configuration Setup

Create a "config" directory in the sibling directory of the previously cloned GitHub repositories and create a config.json file containing the chain's configuration details.

project-directory/

    ├── config/
    │   └── config.json

    ├── rollup-evm/
    ├── evm-sequencer-node/
    ├── da-client/
    ├── settlement_layer_calls_api/

Use the mkdir command to create a new directory named "config":

mkdir config

Navigate into the newly created 'config' directory:

cd config

Open a new config.json file using the nano text editor:

nano config.json

In the nano editor, input the following configuration details:

{
  "chainInfo": {
    "chainID": "aircosmic_5501-1107",
    "key":     "dummy",
    "moniker": "test-evm-rollup"
  }
}

Replace the values as necessary to match your specific chain configuration.

After entering the configuration details, save and exit the file by pressing CTRL + X, then Y, and finally Enter.

3. Initialize a New Chain

To initiate the new chain, follow these commands:

Switch to the 'rollup-evm' directory, which you cloned earlier. Use the command:

cd rollup-evm

Run the go mod tidy command to ensure all the Go modules are updated and tidy:

go mod tidy

Finally, run the setup script provided in the 'rollup-evm' directory. This script will initialize the new chain with the configuration you've set:

sh setup.sh

4. Setup Sequencer

Open your terminal and navigate to the evm-sequencer-node directory using the cd command. If this directory exists, you can use the following command:

cd evm-sequencer-node

Next, you want to create a new file named .env. You can use the nano text editor for this:

nano .env

This command opens the nano text editor with a new file named .env.

Inside the .env file, add the following line:

DA_CLIENT_RPC=http://localhost:5050/<da-option>

Replace <da-option> with the specific option you need, whether it's avail or celestia.

To save the changes in nano, press Ctrl + O, then press Enter. To exit, press Ctrl + X.

Alternatively, if you are using a different text editor, follow the appropriate steps to save and exit.

5. Starting DA Client

Navigate back to the ../da-client directory:

cd ../da-client

Run the following commands to tidy up and start the DA Client in the background:

go mod tidy
nohup go run cmd/main.go &

This will run the go run cmd/main.go command in the background and keep it running even if the terminal is closed.

6. Starting Settlement Client

Navigate back to the ../settlement_layer_calls_api directory:

cd ../settlement_layer_calls_api

Run the following commands to tidy up and start the Settlement Client in the background:

go mod tidy
nohup go run main.go &

This will run the go run main.go command in the background and keep it running even if the terminal is closed.

Please note that using nohup in this way will detach the process from the terminal, but you might want to redirect the output to a log file to monitor any logs or errors. For example:

nohup go run cmd/main.go > da-client.log 2>&1 &
nohup go run main.go > settlement-client.log 2>&1 &

This will redirect both the standard output and standard error to log files (da-client.log and settlement-client.log). Adjust the filenames as needed.

7. Starting Chain

Navigate back to the ../rollup-evm directory:

cd ../rollup-evm

Run the following command to start the chain using the provided shell script:

sh start-chain.sh

Additionally, to run the process in the background and detach it from the terminal, you can use:

nohup sh start-chain.sh > chain.log 2>&1 &

This will run the start-chain.sh script in the background and log both standard output and standard error to a file named chain.log.

8. Starting Sequencer

Navigate back to the ../evm-sequencer-node directory:

cd ../evm-sequencer-node

Run the following command to start the sequencer:

go run main.go

To run the sequencer process in the background and keep it running even if the terminal is closed, use:

nohup go run main.go > sequencer.log 2>&1 &

This will run the main.go file in the background and log both standard output and standard error to a file named sequencer.log.

These commands are assuming a Unix-like environment. If you are using a different environment, you might need to adjust the commands accordingly.

Last updated