Cover photo

Stone Keyboard. Fuel Node

Introduction

What is a Fuel Node? A Fuel node on the blockchain, or “client”, is software that downloads and maintains a copy of the blockchain. It verifies the authenticity of each block and transaction, ensuring that its copy is always up-to-date and synchronized with the network.

Consensus Mechanism The Fuel Network uses Proof of Authority (PoA) in its beta testnets.

  • Validators: Selected entities responsible for creating blocks and validating transactions based on their reputation.

  • Advantages of PoA: Fast transaction times and energy efficiency.

Node Installation

Preparing the Environment

Upgrade Packages

sudo apt-get update && sudo apt-get upgrade -y

Install wget and curl

Install rustup

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

Installing Fuel Toolchain

Install Fuel Toolchain

curl https://install.fuel.network | sh
post image

Update Environment

source /home/(user)/.bashrc
post image

Check Fuel Version

fuelup --version
post image

Verify Installation

Ensure you have the latest toolchain:

fuelup show
post image

Obtaining a Sepolia API Key (Ethereum Testnet)

Register on Alchemy

Get your personalized Sepolia ETH RPC API keys:

https://www.alchemy.com/

Test the API

Send the first request to test the API:

curl https://eth-mainnet.g.alchemy.com/v2/AvlIDj-8eJlcz2NfOK1iMbR5iK1MnAtO \
-X POST -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"alchemy_getAssetTransfers","params":[{"fromBlock":"0x0","category":["external","erc20","erc721"],"fromAddress":"0x646d3C0367f91c6sCcf7532A91Ef425BEcdfB34E"}],"id":0}'
post image

Generating a New P2P Key

Run Keygen

fuel-core-keygen new --key-type peering
post image

Chain Configuration

Create Configuration Folder

git clone https://github.com/FuelLabs/chain-configuration chain-configuration
mkdir .fuel-sepolia-testnet 
cp -r chain-configuration/ignition/* ~/.fuel-sepolia-testnet/

Node Initialization and Start

Start the Node

fuel-core run \
--service-name=<your_node>-sepolia-testnet-node \
--keypair <P2P key> \
--relayer https://eth-sepolia.g.alchemy.com/v2/<ETH RPC API> \
--ip=0.0.0.0 --port=4000 --peering-port=30333 \
--db-path ~/.fuel-sepolia-testnet \
--snapshot ~/.fuel-sepolia-testnet \
--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
post image

Creating a Service with SystemD

SystemD facilitates automatic and reliable management of the Fuel node, improving operational stability and efficiency.

Automation and Supervision

Create the Service

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 stonekeyboard-sepolia-testnet \
--keypair <P2P key> \
--relayer https://eth-sepolia.g.alchemy.com/v2/<ETH RPC API> \
--ip=0.0.0.0 --port=5000 --peering-port=40444 \
--db-path $HOME/.fuel-sepolia-testnet \
--snapshot $HOME/.fuel-sepolia-testnet \
--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
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target 
EOF

Reload and Start the Service

sudo systemctl daemon-reload
sudo systemctl enable fueld
sudo systemctl start fueld
sudo systemctl status fueld.service
post image

View Logs

sudo journalctl -u fueld -f -o cat
post image

Connect Your Node to the Fuel Wallet

Log in to your Fuel wallet account and click on the top part where it indicates the network, then click on "+Add new network" and type in the address of your node:

http://ip_node:4000/v1/graphql

Click on "+Add" to complete the setup.