Files
tri-pi/docs/RELAY_NODE.md
T
Krystie aa8382abe4 feat: configure TRI-PI as Tor relay node
Transform TRI-PI from simple wallet to full relay node:

Config changes (triangles.conf.template):
- Increased dbcache to 100MB for better performance
- Added onlynet=tor for Tor-only connectivity
- Added par=1 for single-threaded verification (lower CPU)
- Reduced checkblocks to 100 for faster startup
- Enhanced documentation explaining relay node behavior

Documentation:
- README.md: Updated to emphasize relay node functionality
- docs/RELAY_NODE.md: Comprehensive guide on relay operation,
  network architecture, resource usage, and scaling

Each Pi now:
- Accepts incoming connections from other nodes
- Relays transactions across the network
- Relays blocks to help nodes sync
- Operates entirely over Tor (.onion address)
- Strengthens network decentralization

Resource usage optimized for Raspberry Pi while maintaining
full relay capability.
2026-03-28 18:24:52 -07:00

3.0 KiB

TRI-PI as a Relay Node

Your Raspberry Pi runs a full Triangles node that strengthens the network by:

  • Accepting incoming connections from other nodes
  • Relaying transactions across the network
  • Relaying blocks to help nodes sync
  • Operating entirely over Tor for privacy and accessibility

What It Does

Each TRI-PI device:

  1. Syncs the blockchain (~3GB, one-time)
  2. Creates a Tor hidden service (.onion address)
  3. Accepts connections from other Triangles nodes
  4. Relays transactions submitted by other wallets
  5. Relays blocks to help new nodes sync
  6. Stakes coins (optional, earns rewards)

Network Architecture

        [Tor Network]
             |
    ┌────────┼────────┐
    |        |        |
Pi Node 1  Pi Node 2  Pi Node 3
abc.onion  def.onion  ghi.onion
    |        |        |
 [Relay]  [Relay]  [Relay]
    └────────┴────────┘
   Strengthen Network

Resource Usage

Disk: ~3-4GB (blockchain + indexes)
RAM: ~200-400MB (with 100MB cache)
CPU: Low (single-threaded validation)
Network: Variable (depends on peer count)

Benefits of Running Multiple Pis

  1. Network decentralization - More nodes = stronger network
  2. Geographic distribution - Deploy worldwide via Tor
  3. Redundancy - Network survives if some nodes go offline
  4. Privacy - All connections over Tor onion routing
  5. Censorship resistance - No public IP, no ISP blocking

How Other Nodes Connect

Your Pi's .onion address is automatically:

  • Generated by Tor when first started
  • Advertised to the Triangles network
  • Added to peer discovery mechanisms

Other nodes can:

  • Discover your Pi through peer exchange
  • Connect directly via your .onion address
  • Request blocks and transactions from you
  • Relay their own transactions through you

Configuration

See /etc/triangles/triangles.conf:

listen=1                    # Accept incoming connections
maxconnections=32          # Support up to 32 peers
torhiddenservice=1         # Create .onion address
onlynet=tor                # Only Tor connections

Finding Your Onion Address

After Tor starts, your .onion address is available at:

# Via the web dashboard
curl -s http://127.0.0.1:8080/api/status | jq -r '.onion'

# Or directly from the file
cat /var/lib/tor/tri-pi/hostname

Adding Your Pi to Other Nodes

To manually connect other Triangles nodes to your Pi:

# In their triangles.conf
addnode=your-pi-address.onion

Performance Expectations

Initial sync: 2-5 days (depending on Pi model and network)
Daily sync: ~1-10 minutes (catching up new blocks)
Relay load: Minimal (a few KB/s typically)

Scaling the Network

Deploy multiple Pis to create a resilient relay infrastructure:

  • Each Pi syncs independently
  • Each Pi has its own wallet
  • Each Pi strengthens the network
  • Total decentralization over Tor

No central point of failure!