Create a SVM 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-svm
git clone https://github.com/airchains-network/svm-sequencer-node
git clone https://github.com/airchains-network/da-client
git clone https://github.com/airchains-network/settlement_layer_calls_api
project-directory/

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

2. Initialize a New Chain

To initiate the new chain, follow these commands:

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

cd rollup-svm

Run the setup script provided in the 'rollup-svm' directory. This script will initialize the new chain with the configuration you've set:

sh setup.sh

Executing the setup.sh shell file will initialize the chain with its default settings. The initialization process may take 15-20 minutes to build properly. Please be patient during this time.

Make sure to allow sufficient time for the setup to complete before expecting the chain to be fully operational.

4. Setup Sequencer

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

cd svm-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-svm directory:

cd ../rollup-svm

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 ../svm-sequencer-node directory:

cd ../svm-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