How to Run a Relay Node
This guide provides a step-by-step walkthrough for setting up a relay node, which can help resolve connectivity issues between network peers.
Ensure that you meet the system requirements.
Step 1: Compile the Binary
Navigate to the project directory and compile the source code:
cd avail-light-relay
cargo build --release # Compile the project in release mode
Upon successful compilation, the binary will be located at target/release/avail-light-relay
.
Step 2: Deploy the Binary
If you've compiled the binary locally, transfer it to your server using scp
or another secure method.
Step 3: Create and Edit the Configuration File
On your server, navigate to the directory where you've placed the binary. Create and edit a config.yaml
file:
touch config.yaml # Create a new config.yaml file
nano config.yaml # Open the file in a text editor
To avoid conflicts between nodes, especially if they are running on the same machine or network, consider the following:
libp2p_port
: This could potentially cause a conflict if multiple nodes are running on the same machine and trying to bind to the same port. Each node on the same machine should have a unique port.secret_key
: If this is used for cryptographic operations like signing messages, then using the same key across different nodes could be a security risk and could also lead to logical errors in the network operation.
Use the following example configuration:
log_level: 'INFO' # Logging level
log_format_json: false # Log format
secret_key: { seed: 'unique_seed' } # Secret key setting
libp2p_port: 39000 # libp2p port
libp2p_identify_protocol: '/avail_kad/id/1.0.0' # libp2p protocol
For more advanced configurations, consult the Configuration Reference.