Pipe Network
  • Welcome
  • Getting Started
    • Introduction
    • Architecture
    • Key Features
    • Scalability and Network Growth
    • Opportunities and Use Cases
    • Operating a DevNet CDN PoP Node
    • Performance and fraud detection
  • Nodes
    • DevNet 2
      • Troubleshooting
    • Testnet
    • Mainnet
  • CDN Api
    • Pipe CDN API Documentation
  • Appendix
    • Pipe Network CDN for Solana Snapshots
    • Old Guardian Node
Powered by GitBook
On this page
  • Setup and Configuration Guide for POP Cache Node on Linux
  • 1. System Requirements
  • 2. Preparing Your System
  • Permanently Applying Configurations
  • 3. Installation
  • 4. Configuration
  • 5. Creating a Systemd Service
  • 6. Managing Logs
  • 7. Firewall Configuration
  • 8. Monitoring the POP Cache Node
  • 10. Troubleshooting
  1. Nodes

Testnet

1) Get an Invite code! — Register for the node and provide your contact information and geographic information where the PoP node will be located.

Airtable link: https://airtable.com/apph9N7T0WlrPqnyc/pagSLmmUFNFbnKVZh/form

Setup and Configuration Guide for POP Cache Node on Linux

This guide provides detailed instructions on how to set up and configure the POP Cache Node on Linux systems using the provided binaries.

1. System Requirements

Recommended specifications:

- 4+ CPU cores

- 16GB+ RAM

- SSD storage with 100GB+ available space

- 1Gbps+ network connection

2. Preparing Your System

Create a dedicated user (optional but recommended)

# Switch to root user
sudo su -

# Create a new user 'popcache' with a home directory and bash shell
sudo useradd -m -s /bin/bash popcache

# Add popcache to sudo group
sudo usermod -aG sudo popcache  

Install required dependencies

sudo apt update -y
sudo apt install -y libssl-dev ca-certificates

Optimize system settings for network performance

Run these commands to optimize TCP performance (as mentioned in build.rs):

# System Configuration for Network Performance

This document outlines various system configurations to optimize network performance for POP Cache Nodes. The settings below should be added to improve throughput and reduce latency.

## Configuration Parameters

- **Local Port Range:** Allows a larger range of ephemeral ports.

net.ipv4.ip_local_port_range = 1024 65535


- **Maximum Connections:** Increases the max amount of connections backlog.

net.core.somaxconn = 65535


- **Low Latency Mode:** Enables TCP low latency for better responsiveness.

net.ipv4.tcp_low_latency = 1


- **Fast Open:** Reduces latency at the start of a TCP connection.

net.ipv4.tcp_fastopen = 3


- **Disable Slow Start After Idle:** Ensures there is no restart delay.

net.ipv4.tcp_slow_start_after_idle = 0


- **Window Scaling:** Enables TCP window scaling for better scalability.

net.ipv4.tcp_window_scaling = 1


- **Send/Receive Memory Buffers:** Sets initial and max socket buffer sizes.

net.ipv4.tcp_wmem = 4096 65536 16777216 net.ipv4.tcp_rmem = 4096 87380 16777216


- **Maximum Socket Buffers:** Sets the max amount of socket buffer sizes system-wide.

net.core.wmem_max = 16777216 net.core.rmem_max = 16777216

Permanently Applying Configurations

Create a sysctl configuration file for POP Cache Node

To permanently apply these settings, create a configuration file using the following command:

sudo bash -c 'cat > /etc/sysctl.d/99-popcache.conf << EOL
net.ipv4.ip_local_port_range = 1024 65535
net.core.somaxconn = 65535
net.ipv4.tcp_low_latency = 1
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.core.wmem_max = 16777216
net.core.rmem_max = 16777216
EOL'

Make sure to reload the sysctl configuration

Apply the settings

sudo sysctl -p /etc/sysctl.d/99-popcache.conf

Increase file limits for performance

To set file limits for POP Cache Node, use the following configuration:

# POP Cache Node file limits
sudo bash -c 'cat > /etc/security/limits.d/popcache.conf << EOL
*    hard nofile 65535
*    soft nofile 65535
EOL'

Log out and back in for these changes to take effect.

3. Installation

### Create installation directory

To create a directory named /opt/popcache, use the following command sequence:

sudo mkdir -p /opt/popcache
sudo mkdir -p /opt/popcache/logs
cd /opt/popcache

You'll need the invite code emailed to you.

```

4. Configuration

### Create a configuration file

Generate an empty configuration file (optional):

./pop create-config /opt/popcache

To edit the config.json file using Nano:

  1. Open the terminal.

  2. Type nano /opt/popcache/config.json and press Enter.

  3. Use the arrow keys to navigate and make changes.

  4. Press Ctrl + O to save, then Enter to confirm.

  5. Use Ctrl + X to exit

Insert the following configuration, adjusting values as needed:

{
  "pop_name": "your-pop-name",
  "pop_location": "Your Location, Country",
  "invite_code": "your-invite-code",
  "server": {
    "host": "0.0.0.0",
    "port": 443,
    "http_port": 80,
    "workers": 40
  },
  "cache_config": {
    "memory_cache_size_mb": 4096,
    "disk_cache_path": "./cache",
    "disk_cache_size_gb": 100,
    "default_ttl_seconds": 86400,
    "respect_origin_headers": true,
    "max_cacheable_size_mb": 1024
  },
  "api_endpoints": {
    "base_url": "https://dataplane.pipenetwork.com"
  },
  "identity_config": {
    "node_name": "your-node-name",
    "name": "Your Name",
    "email": "your.email@example.com",
    "website": "https://your-website.com",
    "twitter": "your_twitter_handle",
    "discord": "your_discord_username",
    "telegram": "your_telegram_handle",
    "solana_pubkey": "YOUR_SOLANA_WALLET_ADDRESS_FOR_REWARDS"
  }
}

Validate the config.json:

./pop --validate-config

Configuration tips:

1. **Memory settings**:

- Set `memory_cache_size_mb` based on your available RAM (50-70% of total RAM is a good starting point)

- Example: For a 16GB RAM server, set to 8192-10240

2. **Disk settings**:

- Set `disk_cache_size_gb` based on your available disk space (leave at least 20% free)

- Example: For a 500GB disk, set to 350-400

3. **Worker settings**:

- For best performance, set `workers` to 0 which auto-detects the number of CPU cores

- For specific control, set to the number of CPU cores minus 1

4. **Network binding**:

- Set `server.host` to `0.0.0.0` to bind to all network interfaces

- For security in development, use `127.0.0.1` to only accept local connections

5. **Identity configuration**:

- All fields under `identity_config` are important for proper attribution

- The `solana_pubkey` field is required for receiving rewards

5. Creating a Systemd Service

Create a systemd service file for automatic startup and management:

To edit the popcache service configuration using the nano text editor, run the following command:

sudo nano /etc/systemd/system/popcache.service

Add the following content:

[Unit]
Description=POP Cache Node
After=network.target
[Service]
Type=simple
User=popcache
Group=popcache
WorkingDirectory=/opt/popcache
ExecStart=/opt/popcache/pop
Restart=always
RestartSec=5
LimitNOFILE=65535
StandardOutput=append:/opt/popcache/logs/stdout.log
StandardError=append:/opt/popcache/logs/stderr.log
Environment=POP_CONFIG_PATH=/opt/popcache/config.json

[Install]
WantedBy=multi-user.target

Enable and start the service:

Make sure each command is on a separate line for clarity:

sudo systemd-analyze verify popcache
sudo systemctl start popcache
sudo systemctl enable popcache
sudo systemctl daemon-reload

Check the service status:

sudo systemctl status popcache

6. Managing Logs

View logs in real-time:

# Monitor application logs
tail -f /opt/popcache/logs/stderr.log
tail -f /opt/popcache/logs/stdout.log

# Monitor system service logs
sudo journalctl -u popcache

Log rotation

Create a logrotate configuration:

To edit the configuration file for logrotate related to popcache, enter the command:

sudo nano /etc/logrotate.d/popcache

This command opens the popcache logrotate configuration file in the Nano text editor with superuser permissions, allowing you to make necessary edits for log rotation settings.

Add the following content:

/opt/popcache/logs/*.log {
    daily
    missingok
    rotate 14
    compress
    delaycompress
    notifempty
    create 0640 popcache popcache
    sharedscripts
    postrotate
    systemctl reload popcache >/dev/null 2>&1 || true
    endscript
}

7. Firewall Configuration

Port 443 and 80 must be open from the internet into your pop node through any layers you have in place such as a firewall, and any containerization or virtualization system you may have chosen.

If you're using UFW (Uncomplicated Firewall):

sudo ufw allow 443/tcp
sudo ufw allow 80/tcp
# Allow HTTP and HTTPS traffic

If you're using ip tables directly:

# Allow HTTPS traffic (port 443)
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT

# Allow HTTP traffic (port 80)
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT

8. Monitoring the POP Cache Node

Basic monitoring with the built-in endpoints:

# Check state information
curl http://localhost/state

# Check metrics
curl http://localhost/metrics

# Check the health endpoint
curl http://localhost/health

10. Troubleshooting

If the service fails to start:

1. Check logs for errors:

sudo journalctl -u popcache -n 100

2. Verify permissions:

sudo chmod 755 /opt/popcache/pop
sudo chown -R popcache:popcache /opt

3. Validate your configuration:

./pop --validate-config

Check if ports 80 or 443 are already in use by a competing service:

sudo netstat -tuln | grep -E ':(80|443)'
PreviousTroubleshootingNextMainnet

Last updated 3 days ago

### Download the binary ( )

https://download.pipe.network/