Prepare the server
Copy # Add superuser
adduser lgtn
Copy # Add user to sudo group
usermod -aG sudo lgtn
# Switch to the new user by using the command:
su lgtn
cd /home/lgtn
Automatic Installation
Copy source <(curl -s https://raw.githubusercontent.com/NodersUA/Scripts/main/fleek-lightning)
After staking, start the node:
Copy sudo systemctl daemon-reload && \
sudo systemctl enable lightning
sudo mkdir -p /var/log/lightning
sudo touch /var/log/lightning/output.log
sudo touch /var/log/lightning/diagnostic.log
sudo systemctl restart lightning.service
Copy # Check logs
tail -fn100 /var/log/lightning/output.log
tail -fn100 /var/log/lightning/diagnostic.log
Manual Installation
Open ports:
Copy # Open ports
sudo ufw allow 4200:4299/tcp
Copy sudo ufw allow 4300:4399/udp
Update, upgrade and install requirements:
Copy sudo apt-get update && \
sudo apt-get upgrade -y && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# press 1) Proceed with installation (default)
Copy source "$HOME/.cargo/env"
Copy rustup default stable-x86_64-unknown-linux-gnu && \
sudo apt-get install build-essential -y && \
sudo apt-get install cmake clang pkg-config libssl-dev gcc-multilib -y && \
sudo apt-get install protobuf-compile
Clone repository and build:
Copy git clone -b testnet-alpha-1 https://github.com/fleek-network/lightning.git ~/fleek-network/lightning && \
cd ~/fleek-network/lightning && \
cargo clean && cargo update && cargo +stable build --release
Copy sudo ln -s ~/fleek-network/lightning/target/release/lightning-node /usr/local/bin/lgtn
Key generator
Backup your keys from `/home/lgtn/.lightning/keystore/`
Config.toml
Copy sed -i "s|~/.lightning|/home/lgtn/.lightning|g" "/home/lgtn/.lightning/config.toml"
Create a service:
Copy sudo tee /etc/systemd/system/lightning.service > /dev/null <<EOF
[Unit]
Description=Fleek Network Node lightning service
[Service]
Type=simple
MemoryHigh=32G
RestartSec=15s
Restart=always
ExecStart=lgtn -c /home/lgtn/.lightning/config.toml run
StandardOutput=append:/var/log/lightning/output.log
StandardError=append:/var/log/lightning/diagnostic.log
Environment=TMPDIR=/var/tmp
[Install]
WantedBy=multi-user.target
EOF
Copy sudo chmod 644 /etc/systemd/system/lightning.service
Open the Metamask settings
, located in the drop-down (top-right menu options). Set the following property values:
Network Name: Fleek Network Testnet
RPC URL: https://rpc.testnet.fleek.network/rpc/v0
Once Connect Wallet
is ready, proceed to Mint tFLK
and wait until the balance of the account in your Metamask increases. You need to have tFLK
before proceeding. Be patient.
Once tFLK
balance is available, click in the Stake
button. You'll be required to provided the following details from your node:
You can get the details quickly by running the node details script in the terminal connected to your machine or server where the node is set up and running, as follows:
Copy curl https://get.fleek.network/node_details | bash
Restart the service:
Copy sudo systemctl daemon-reload && \
sudo systemctl enable lightning
sudo mkdir -p /var/log/lightning
sudo touch /var/log/lightning/output.log
sudo touch /var/log/lightning/diagnostic.log
sudo systemctl restart lightning.service
Copy # Check logs
tail -fn100 /var/log/lightning/output.log
tail -fn100 /var/log/lightning/diagnostic.log