# ✅ Fuel Node

## Fuel Node Setup Guide

### **Recommended Hardware Requirements** <a href="#recommended-hardware-requirements" id="recommended-hardware-requirements"></a>

```
- Memory: 12 GB
- CPU: 8 cores
- Disk: 100 GB NVME SSD
```

### **Preparation** <a href="#preparation" id="preparation"></a>

Update packages

```bash
sudo apt-get update && sudo apt-get upgrade –y
```

Install essential packages

```bash
sudo apt install git wget curl lz4 build-essential -y
```

Install Rustup

```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

Configure your current shell

```bash
. "$HOME/.cargo/env"
```

Check rustc version

```bash
rustup --version
```

\*\*\*Result\*\*\*

```bash
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.79.0 (129f3b996 2024-06-10)`
```

### Installation <a href="#installation" id="installation"></a>

**Install fuelup**

```bash
curl https://install.fuel.network | sh
```

add fuelup to path

```bash
export PATH="${HOME}/.fuelup/bin:${PATH}"
```

Check fuelup version

```bash
fuelup --version
```

\*\*\*Result\*\*\*

```
fuelup 0.25.1
```

Generate P2P key and save your secret key somewhere safe

```bash
fuel-core-keygen new --key-type peering
```

\*\*\*Result\*\*\*

```bash
{"peer_id":"16Uiu2HAmU3UZczJCRqdWcgyDL2r3qEqDa9psDXwg1gDCP6kCy9na",
"secret":"098b29f38f0b8a2fd67d441128675e058d7710a90698588101547a86fe3eeb85",
"type":"peering"}
```

Create a data directory and clone chain-configuration file

```bash
mkdir .fueld
git clone https://github.com/FuelLabs/chain-configuration chain-configuration && cp -r $HOME/chain-configuration/ignition/* $HOME/.fueld/
```

**Create systemd service for fuel (edit your own node's name, secret key and sepolia rpc)**

```bash
sudo tee /etc/systemd/system/fueld.service > /dev/null << EOF
[Unit]
Description=Fuel Node Beta-5
After=network.target

[Service]
User=$USER
Type=simple
ExecStart=$(which fuel-core run) \
--service-name={your node's name} \
--keypair {P2P-secret-key} \
--relayer {sepolia-rpc} \
--ip=0.0.0.0 --port=4000 --peering-port=30333 \
--db-path $HOME/.fueld \
--snapshot $HOME/.fueld \
--utxo-validation --poa-instant false --enable-p2p \
--reserved-nodes /dns4/p2p-testnet.fuel.network/tcp/30333/p2p/16Uiu2HAmDxoChB7AheKNvCVpD4PHJwuDGn8rifMBEHmEynGHvHrf \
--sync-header-batch-size 100 \
--enable-relayer \
--relayer-v2-listening-contracts=0x01855B78C1f8868DE70e84507ec735983bf262dA \
--relayer-da-deploy-height=5827607 \
--relayer-log-page-size=500 \
--sync-block-stream-buffer-size 30

Restart=on-failure
RestartSec=5s
StartLimitBurst=3
StartLimitIntervalSec=10s
TimeoutStartSec=60s
TimeoutStopSec=60s
LimitNOFILE=65535
WatchdogSec=3600s
ExecStartPre=/bin/sleep 10

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

Reload, Enable and Start the fueld service

```bash
sudo systemctl daemon-reload && \
sudo systemctl enable fueld && \
sudo systemctl start fueld && \
sudo journalctl -u fueld -f -o cat
```

to check the logs again

```bash
sudo journalctl -u fueld -f -o cat
```

to restart the node

```bash
sudo systemctl restart fueld && sudo journalctl -u fueld -f -o cat
```

### Download Snapshot <a href="#download-snapshot" id="download-snapshot"></a>

Updated at Block #3862556

**Stop the fueld.service**

```bash
sudo systemctl stop fueld
```

**Download latest snapshot**

Install aria2 download utility

```bash
sudo apt install aria2
```

Download the snapshot

```bash
aria2c -x 16 -s 16 -k 1M -d /tmp -o snapshot.tar.lz4 http://109.199.108.37/fuel-sepolia-snapshot.tar.lz4 && \
lz4 -dc /tmp/snapshot.tar.lz4 | tar -xf - -C $HOME/.fueld && \
rm -rf $HOME/.fueld/on_chain && \
mv -f $HOME/.fueld/.fuel-sepolia-testnet/on_chain $HOME/.fueld/
```

**Restart the service and check the log**

```bash
sudo systemctl restart fueld && sudo journalctl -u fueld -f -o cat
```


---

# 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://docs.apexnodes.dev/fuel-node.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.
