archy/BACKEND_STARTUP_FIX.md
Dorian 1c024c5d64 Update archipelago: API, auth, container, parmanode, performance, security
- API handler, RPC, and server updates
- Auth and coding rules
- Container data manager, dev orchestrator, health monitor, podman client
- Parmanode script runner
- Performance resource manager
- Security container policies and secrets manager
- Add build scripts and documentation
2026-01-27 22:27:17 +00:00

2.7 KiB

Backend Startup Fix

Problems Found

  1. Last Warning: One more unused HashMap import in container/src/podman_client.rs
  2. Backend Crash: Permission denied when trying to create /var/lib/archipelago

Root Cause

The backend default configuration tries to create /var/lib/archipelago which requires root permissions. In development, we need to use /tmp/archipelago-dev instead.

Fixes Applied

1. Removed Last Warning

File: core/container/src/podman_client.rs

  • Removed unused std::collections::HashMap import

Result: ZERO warnings now! 🎉

2. Fixed Backend Startup

File: scripts/dev-start.sh

  • Added environment variable exports before starting backend
  • Sets ARCHIPELAGO_DATA_DIR=/tmp/archipelago-dev
  • Sets dev mode and other required configs

Also Created: setup-env.sh (optional script to create .env file)

How to Run Now

Quick Start (Automatic)

cd /Users/dorian/Projects/archy
./scripts/dev-start.sh

Choose option 2 (Full stack)

The script now automatically:

  • Sets all required environment variables
  • Uses /tmp/archipelago-dev (no permissions needed)
  • Starts backend with correct config
  • Waits for backend to be ready
  • Starts frontend

Alternative: Manual Setup (Optional)

If you want a persistent .env file:

./setup-env.sh
./scripts/dev-start.sh

Environment Variables Set

ARCHIPELAGO_DATA_DIR=/tmp/archipelago-dev
ARCHIPELAGO_DEV_DATA_DIR=/tmp/archipelago-dev
ARCHIPELAGO_DEV_MODE=true
ARCHIPELAGO_BIND=127.0.0.1:5959
ARCHIPELAGO_LOG_LEVEL=debug
ARCHIPELAGO_PORT_OFFSET=10000
ARCHIPELAGO_BITCOIN_SIMULATION=mock

Test It

  1. Rebuild (to remove last warning):

    ./clean-rebuild.sh
    

    Expected: ZERO warnings!

  2. Start dev server:

    ./scripts/dev-start.sh
    

    Choose option 2

  3. Check backend log:

    tail -f /tmp/archipelago-backend.log
    

    Should see:

    🚀 Starting Archipelago Bitcoin Node OS
    📁 Data directory: /tmp/archipelago-dev
    🌐 Server listening on http://127.0.0.1:5959
    📡 RPC API: http://127.0.0.1:5959/rpc/v1
    🔌 WebSocket: ws://127.0.0.1:5959/ws
    
  4. Open browser:

    http://localhost:8100
    

What Changed

Before

  • Backend tried to use /var/lib/archipelago (permission denied)
  • Crashed immediately on startup
  • Dev server hung waiting for port 5959

After

  • Backend uses /tmp/archipelago-dev (always writable)
  • Starts successfully in ~1 second
  • Dev server detects backend and starts frontend
  • Full stack is live!

All issues resolved! Your Bitcoin Node OS is ready to run! 🚀