# Run Sequencer Validator

## H**ardware Requirements**

<table><thead><tr><th>Node Type</th><th width="155">CPU</th><th width="160">RAM</th><th>Storage</th></tr></thead><tbody><tr><td>Mainnet</td><td>8</td><td>16 GB</td><td>1 TB (SSD or NVME)</td></tr></tbody></table>

## Port Configuration

By default, the following ports are required for Fuel to function properly:

* **Sequencer**: 26656, 26657, 9090, 1317
* **Sidecar**: 8080
* **Ethereum**: 8545, 8546

These modules exchange data with each other, so if you change the ports, you need to update the settings in other places:

🔹 If you change the ports for the Sequencer → update the launch settings in the Sidecar configuration.\
🔹 If you change the port for the Sidecar → update the settings in the Sequencer configuration.\
🔹 If you change the Ethereum ports → update the launch parameters for the Sidecar.

**Important**: If you do not make these changes, the modules will not be able to connect to each other.

***

## Server preparation

1. **Update your system packages:**

```
sudo apt update && sudo apt upgrade -y
```

2. **Install essential dependencies**:.

```
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential bsdmainutils git make ncdu gcc git jq chrony liblz4-tool -y
```

3. **Install Go** 1.23.1 (required for building Stargaze):

```
ver="1.23.1"
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm "go$ver.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version
```

***

## **Run an Ethereum Full Node**

For optimal Sequencer performance, you need to run your own Ethereum Mainnet node. Using third-party Ethereum services is **not recommended**.

**Ethereum Node Configuration:**

```bash
--syncmode=snap  
--gcmode=full  
```

**Recommended Guide for Setting Up an Ethereum Node:**

* [**Official Guide**](https://ethdocker.com/Usage/QuickStart/)
* [**BlockPro Guide**](https://service.block-pro.net/mainnet/fuel/ethereum-mainnet-full-node)

***

## **Download and Set Up the Sequencer**

Now, download the binary and the initial configuration file for the Sequencer.

#### **1. Download the Sequencer Binary:**

```bash
cd $HOME  
wget -O fuelsequencerd https://github.com/FuelLabs/fuel-sequencer-deployments/releases/download/seq-mainnet-1.2-improved-sidecar/fuelsequencerd-seq-mainnet-1.2-improved-sidecar-linux-amd64  
chmod +x fuelsequencerd  
mv ~/fuelsequencerd ~/go/bin/
```

Check the binary version:

```bash
fuelsequencerd version
```

**Expected output:**

```
seq-mainnet-1.2-improved-sidecar
```

#### **2. Initialize Node Directory and Set Name:**

```bash
fuelsequencerd init <node-name> --chain-id seq-mainnet-1  
```

#### **3. Download Configuration Files:**

Download the **genesis.json** file to the configuration directory:

```bash
wget -O $HOME/.fuelsequencer/config/genesis.json https://files.block-pro.net/mainnet/fuel/genesis.json  
```

Download the **addrbook.json** file to the configuration directory:

```bash
wget -O $HOME/.fuelsequencer/config/addrbook.json https://files.block-pro.net/mainnet/fuel/addrbook.json  
```

#### **4. Configure `app.toml`**

Open the **app.toml** file in `~/.fuelsequencer/config/app.toml` and update the following parameters:

**Set the minimum gas price:**

```toml
minimum-gas-prices = "10fuel"
```

**In the `[sidecar]` section, ensure that:**

```toml
enabled = true  
address = "localhost:8080"  
```

#### **5. Configure `config.toml`**

Open the **config.toml** file and apply the following settings:

**In the `[p2p]` section, set the persistent peers:**

```toml
persistent_peers = "c92a832384b2b676c5b0f317acfb6c0d49846e80@fuel-mainnet-peer.block-pro.net:60756,b3052ca64950786499d56ade68593a555e383ad4@fuel-mainnet-peer.itrocket.net:63656,d48507eb9c8fc6cab278da8b64548496134562dc@141.95.11.200:26656,9584099276b4baf2d6fdf07d4eb9dec40564bba5@185.107.68.171:26656,bbb5f1939278b75efbc213067cc8226591353fc4@65.108.133.32:26656,5d75cca90b178f2b782ce57b0067c0ec8512354c@65.109.70.89:41656,0d7efe1a993e548acccba23358de50a87f5ac841@176.103.222.150:26656,445952b74b508ba5915f3c2f0a8d169a409f174b@57.129.64.92:26656,9bc530d3715a57b4e4f987e75343a67a747b4626@95.217.204.58:29656,9eb2801d1dde4b9ff0be3427092cc2548e973d71@176.103.222.162:26656,40369a07f904d01262141353b5b8fcc8fae2b9da@65.109.53.189:26656,9ad948216644797315b9dfd4851abc2a87235f29@37.27.129.24:14656"
```

**In the `[mempool]` section, set:**

```toml
max_tx_bytes = 1258291  
max_txs_bytes = 23068672  
```

#### **6. Configure Pruning**

To optimize data storage, set the following pruning parameters:

```bash
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.fuelsequencer/config/app.toml  
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.fuelsequencer/config/app.toml  
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"19\"/" $HOME/.fuelsequencer/config/app.toml  
```

#### **7. Run the Sequencer Using `systemd`**

To run the Sequencer as a background service, use `systemd`.

Create a **service file** for the Sequencer:

```bash
sudo tee /etc/systemd/system/fuelsequencerd.service > /dev/null <<EOF
[Unit]
Description=Sequencer Node
After=network-online.target

[Service]
User=$USER
WorkingDirectory=$HOME/.fuelsequencer
ExecStart=$(which fuelsequencerd) start --home $HOME/.fuelsequencer
Restart=on-failure
RestartSec=5
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF
```

Reload `systemd` and start the service:

```bash
sudo systemctl daemon-reload  
sudo systemctl enable fuelsequencerd  
sudo systemctl restart fuelsequencerd && sudo journalctl -u fuelsequencerd -fo cat  
```

#### **8. Run Sidecar**

To run Sidecar as a background service, configure it with `systemd`.

Create a **service file** for Sidecar:

```bash
sudo tee /etc/systemd/system/sidecard.service > /dev/null <<EOF
[Unit]
Description=Sidecar
After=network-online.target

[Service]
User=$USER
WorkingDirectory=$HOME/.fuelsequencer
ExecStart=$HOME/go/bin/fuelsequencerd start-sidecar \
    --host "0.0.0.0" \
    --sequencer_grpc_url "127.0.0.1:9090" \
    --eth_ws_url "ws://127.0.0.1:8546" \
    --eth_rpc_url "http://127.0.0.1:8545" \
    --eth_contract_address "0xBa0e6bF94580D49B5Aaaa54279198D424B23eCC3"
Restart=on-failure
RestartSec=5
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF
```

Reload `systemd` and start the service:

```bash
sudo systemctl daemon-reload  
sudo systemctl enable sidecard  
sudo systemctl restart sidecard && sudo journalctl -u sidecard -fo cat  
```

Now your **Sequencer and Sidecar** are set up and running in the background! 🚀

## Launching a Fuel Validator

#### 1. Creating a Wallet

To run a validator, you will need a Sequencer address. You can create a new wallet using the following command:

```
fuelsequencerd keys add <NAME>
```

Or restore it from a mnemonic phrase:

```
fuelsequencerd keys add <NAME> --recover
```

After executing the command, you will see an address like `fuelsequencer1l7qk9umswg65av0zygyymgx5yg0fx4g0dpp2tl` and a mnemonic phrase. Save it in a secure place!

#### Generating an Ethereum-Compatible Address

To obtain an Ethereum-compatible address, run the following command:

```
fuelsequencerd keys parse <ADDRESS>
```

You will get an output like this:

```
bytes: FF8162F37072354EB1E222084DA0D4221E93550F
human: fuelsequencer
```

Add `0x` before `bytes`, and you will get the required address:

```
0xFF8162F37072354EB1E222084DA0D4221E93550F
```

#### 2. Funding Your Account

To operate a validator, you need to fund your account with FUEL tokens and ETH for gas fees.

#### Important Addresses:

* **FUEL Token:** `0x675B68AA4d9c2d3BB3F0397048e62E6B7192079c`
* **Sequencer Interface (Bridge):** `0xca0c6B264f0F9958Ec186eb2EAa208966187D866`

#### Approving Tokens

Before funding your wallet, you need to allow the Fuel Token Contract to execute transactions. To do this:

1. Open the **Etherscan** contract for the FUEL token.
2. Use the `approve` function (`0x095ea7b3`).
3. In the **Spender** field, enter:

   ```
   0xca0c6B264f0F9958Ec186eb2EAa208966187D866
   ```
4. In the **Value (uint256)** field, specify the number of tokens, adding 9 extra zeros.
5. For unlimited approval, enter:

   ```
   0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
   ```

<figure><img src="/files/1PbQhNNP9LzmdcpBr424" alt=""><figcaption></figcaption></figure>

#### Bridging Tokens (Transferring to Sequencer)

1. Open the **Sequencer Interface (Bridge)** on Etherscan.
2. Connect your Ethereum wallet (click **Connect to Web3**).
3. Use the `depositFor` function (`0x36efd6f`).
4. In the **Amount (uint256)** field, enter the number of tokens, adding 9 extra zeros.
5. In the **Recipient address** field, enter your Ethereum-compatible address (e.g., `0xFF8162F37072354EB1E222084DA0D4221E93550F`).
6. Click **Write**, confirm the transaction.

<figure><img src="/files/itSQPkFiBI63T8bKYfsu" alt=""><figcaption></figcaption></figure>

The transaction will take approximately 20 minutes.

#### Checking Your Balance

Once the transfer is complete, check your balance in the [block explorer](https://mainnet.block-pro.net/fuel) by entering your Sequencer address.

<figure><img src="/files/73recbAw5uC1CSz9njsn" alt=""><figcaption></figcaption></figure>

#### 3. Creating a Validator

To create a validator, you need at least **1 FUEL** plus additional tokens to cover fees.

#### Creating the Validator Configuration

Create a file called **validator.json** and add the following content:

```json
{
 "pubkey": {"@type":"/cosmos.crypto.ed25519.PubKey","key":"<PUBKEY>"},
 "amount": "1000000000fuel",
 "moniker": "<VALIDATOR_NAME>",
 "identity": "<OPTIONAL>",
 "website": "<YOUR_WEBSITE>",
 "security": "<YOUR_EMAIL>",
 "details": "<ADDITIONAL_INFO>",
 "commission-rate": "0.05",
 "commission-max-rate": "0.10",
 "commission-max-change-rate": "0.01",
 "min-self-delegation": "1"
}
```

#### Getting Your Public Key

Run the following command:

```
fuelsequencerd tendermint show-validator
```

Copy the key and paste it into the `pubkey` field in `validator.json`.

#### Running the Validator Creation Command

Execute the following command to create your validator:

```
fuelsequencerd tx staking create-validator path/to/validator.json \
    --from <WALLET_NAME> \
    --gas auto \
    --gas-prices 10fuel \
    --gas-adjustment 1.5 \
    --chain-id seq-mainnet-1
```

#### 4. Verifying the Setup

Once the validator is launched:

* **The Sequencer should show the block synchronization process.**
* **The Sidecar will display event processing requests.**

🎉 Congratulations! Your Fuel validator is now successfully running.

## Delete node

1. **Stop the Stargaze service**:

```
sudo systemctl stop fuelsequencerd
sudo systemctl disable fuelsequencerd
```

2. **Remove systemd service**:

```
sudo rm -rf /etc/systemd/system/fuelsequencerd.service
sudo systemctl daemon-reload
```

3. **Remove the Stargaze node and data**:

```
cd $HOME
sudo rm $(which fuelsequencerd)
sudo rm -rf $HOME/.fuelsequencer
rm -rf $(which fuelsequencerd)
```


---

# 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://service.block-pro.net/mainnet/fuel/run-sequencer-validator.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.
