# ZK Rollup

## System Requirements

Hardware Configuration

This outlines the necessary hardware specifications for establishing an Airsettle node

| Component                    | Minimum   | Recommended |
| ---------------------------- | --------- | ----------- |
| RAM                          | 4GB       | 8GB         |
| CPU (amd64/x86 architecture) | 2 core    | 4 core      |
| Storage (SSD)                | 50-100 GB | 200-300 GB  |

### Prerequisites & Installation <a href="#prerequisites-and-installation" id="prerequisites-and-installation"></a>

<br>

Our node setup manuals are crafted specifically for Linux distributions with apt compatibility, such as Debian. Moreover, deploying nodes on cloud servers has become a standard approach in the industry.

* [Go ](https://docs.airchains.io/rollups/evm-zk-rollup/system-requirements#go-installation-guide-version-1.20+)v1.20.+
* [jq](https://docs.airchains.io/rollups/evm-zk-rollup/system-requirements#jq-installation-guide)

#### Go Installation Guide (Version 1.20+) <a href="#go-installation-guide-version-1.20" id="go-installation-guide-version-1.20"></a>

<pre><code><strong>wget https://dl.google.com/go/go1.22.1.linux-amd64.tar.gz
</strong></code></pre>

**Step 2: Extract the TAR File**

```
sudo tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
```

**Step 3: Set Up Environment Variables**

```
export PATH=$PATH:/usr/local/go/bin
```

**Step 4: Verify Installation**

<pre><code><strong>go version
</strong></code></pre>

#### \`jq\` Installation Guide <a href="#jq-installation-guide" id="jq-installation-guide"></a>

\
**Step 1: Update Package List**

Begin by updating your package list to ensure you have access to the latest versions available in the repository. Run:

<pre><code><strong>sudo apt-get update
</strong></code></pre>

**Step 2: Install jq**

Next, install `jq` by executing the following command:

```
sudo apt-get install jq
```

**Step 3: Verify Installation**

Once the installation is complete, you can verify it by checking the version of `jq`. Type:

```
jq --version
```

This command will display the installed version of `jq`, confirming its successful installation.

**install library**

```
sudo apt install -y curl git jq lz4 build-essential cmake perl automake autoconf libtool wget libssl-dev
```

## Create an EVM ZK Rollup

#### &#x20; <a href="#id-1.-clone-github-repositories" id="id-1.-clone-github-repositories"></a>

#### **1. Clone GitHub Repositories** <a href="#id-1.-clone-github-repositories" id="id-1.-clone-github-repositories"></a>

```
git clone https://github.com/airchains-network/evm-station.git
git clone https://github.com/airchains-network/tracks.git
```

#### 2. Setting Up and Running the EVM Station <a href="#id-2.-setting-up-and-running-the-evm-station" id="id-2.-setting-up-and-running-the-evm-station"></a>

\
I**nstalling Dependencies**

After cloning the repository, navigate into the project directory.

```
cd evm-station
```

Then, tidy up the Go modules to ensure that dependencies are properly managed.

```
go mod tidy
```

**Running the Project**

To run the EVM Station project locally, execute the following command:

```
/bin/bash ./scripts/local-setup.sh
/bin/bash ./scripts/local-start.sh 
```

**Get Your Private Key of EVM Station**

**/bin/bash ./scripts/local-keys.sh**

#### 3. Setting Up DA Keys and Running DA Client <a href="#id-3.-setting-up-da-keys-and-running-da-client" id="id-3.-setting-up-da-keys-and-running-da-client"></a>

Avail

#### Generate DA KEY for Avail <a href="#generate-da-key-for-avail" id="generate-da-key-for-avail"></a>

**Download the Binary to Generate Keys**

```
wget https://github.com/airchains-network/tracks/releases/download/v0.0.2/avail-node
```

```
wget https://github.com/airchains-network/tracks/releases/download/v0.0.2/avail-light
```

```
chmod +x avail-light
```

**Give Permission to the Downloaded Binary**

```
chmod +x ./avail-node
```

**Generate DA Keys For Avail**

**SS58 Address is your DA Keys**

```
  ./avail-node key generate
  
  Secret phrase:     sugar genuine grief already basic lend labor audit bread trip space limb
  Network ID:        substrate
  Secret seed:       0x519ca67ed47173559eb0414b489e727343d2d74743545b4b82037e8be7d61fa4
  Public key (hex):  0xd2748458725a993a7d359bb5d502630455591c75c9d220023f3a38c01a45857b
  Account ID:        0xd2748458725a993a7d359bb5d502630455591c75c9d220023f3a38c01a45857b
  Public key (SS58): 5GpeXSmsEPnwT785KyiCdaXmcttmFqyLkNPEjoTrjThwFhPQ
  SS58 Address:      5GpeXSmsEPnwT785KyiCdaXmcttmFqyLkNPEjoTrjThwFhPQ
```

**Running `avail da` with Custom Identity Configuration**

If you possess a specific seed phrase and wish to use it instead of the generated one, you can either modify the default identity configuration file or pass the seed phrase as a flag.

* To modify the default identity configuration file, navigate to `~/.avail/identity/identity.toml` and edit it using a text editor such as `nano`.

Copy

```
nano ~/.avail/identity/identity.toml
```

* Alternatively, you can create a new identity configuration file and specify your seed phrase. For example:

Copy

```
touch ~/identity.toml
nano ~/identity.toml
```

Then, execute the avail-light with the `--identity` flag and specify the path to your custom identity configuration file:

**Example Identity Configuration**

**Attention:** Using the seed phrase provided below in production environments is strongly discouraged.

Here is an example of the content for the `~/identity.toml` file:

```
avail_secret_seed_phrase = 'sugar genuine grief already basic lend labor audit bread trip space limb'
```

This seed phrase will be used for identity generation during the execution of the `availup.sh` script.

Feel free to customize the identity configuration as needed!

**Running `avail da`**

To execute the `avail da`, use the following command:

Copy

```
./avail-light --network "turing" --app-id 36 --identity ~/identity.toml
```

For obtaining Turing Testnet tokens, please visit the [Faucet-Avail](https://faucet.avail.tools/)

#### 4. Setting Up and Running Tracks <a href="#id-4.-setting-up-and-running-tracks" id="id-4.-setting-up-and-running-tracks"></a>

**Remove Old Data**

Before initiating the setup process, ensure that any old data is removed if present. Use the following command:

Copy

```
sudo rm -rf ~/.tracks
```

**Installing Dependencies**

After cloning the repository, navigate into the project directory.

Copy

```
cd tracks
```

Then, tidy up the Go modules to ensure that dependencies are properly managed.

Copy

```
go mod tidy
```

**Initiate Sequencer**

To initiate the sequencer, execute the following command:

```
go run cmd/main.go init --daRpc "da-rpc" --daKey "daKey" --daType "<da-type>" --moniker "<moniker-name>" --stationRpc "http://127.0.0.1:8545" --stationAPI "http://127.0.0.1:8545" --stationType "evm"
```

Specify the DA type using the `--daType` flag with one of the following options:

* `"avail"` for Avail DA
* `"celestia"` for Celestia DA
* `"eigen"` for Eigen DA
* `"mock"` for Mock DA

The DA keys were defined in the section above when we were setting up the DA. Use the Da Keys Accordingly.

Da Key for Mock-Da is Mock-Key

**List of DA RPC**

For Avail and Celetsia you are running the Node Locally.

* `Eigen:-` **disperser-holesky.eigenda.xyz**
* `Avail:-` **<http://127.0.0.1:7000>**
* `Celestia:-` **<http://127.0.0.1:26658>**
* `MockDA:-` **mock-rpc**

**Create Keys for Junction**

Generate keys for the Junction component using the following command:

Copy

```
go run cmd/main.go keys junction --accountName <account-name> --accountPath $HOME/.tracks/junction-accounts/keys
```

**Fund Keys for Junction Testnet**

Navigate to the Switchyard faucet in the [Airchains Discord](https://discord.gg/Vc8JMMCZ4Z) group and follow the provided steps to obtain Switchyard tokens for funding the keys.

**Initiate Prover**

Initiate the Prover component using the following command:

Copy

```
go run cmd/main.go prover v1EVM
```

**Create Station on Junction**

Create a station on the Junction component with the specified parameters using the following command:

Copy

```
go run cmd/main.go create-station --accountName <account-name> --accountPath $HOME/.tracks/junction-accounts/keys --jsonRPC "https://airchains-testnet-rpc.cosmonautstakes.com/" --info "EVM Track" --tracks <wallet-address> --bootstrapNode "/ip4/192.168.1.24/tcp/2300/p2p/<node_id>"
```

In the `--bootstrapNode` parameter, input your persistence peer. Follow these steps to create your bootstrapNode persistence\_peer with the node ID:

1. Locate the node ID in the `~/.track/config/sequencer.toml` configuration file.
2. Copy the node ID from the configuration file.
3. Insert the copied node ID into the following string format:

Copy

```
"/ip4/<user-ip>/tcp/2300/p2p/<node_id>"
```

Replace `<user-ip>` with your actual IP address and `<node_id>` with the copied node ID.

This ensures that your track ID is correctly linked with the corresponding node ID for persistence\_peer configuration.

**Start Node**

To start the node, execute the following command:

Copy

```
go run cmd/main.go start
```

This sequence sets up the necessary components for managing tracks effectively. Ensure that each step is executed correctly to ensure smooth operation.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://services.xsslabs.tech/airchains-evm-zk-rollup/zk-rollup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
