Quick guide to get RGB Node up and running.
- Docker and Docker Compose
- Python 3.12+ (for local development)
- PostgreSQL 15+ (or use Docker)
Copy env.example to .env and update if needed:
cp env.example .envDefault values work for local development.
docker compose up -dThis starts:
- PostgreSQL (port 5432) - Database for refresh queue and watchers
- FastAPI service (port 8000) - Main RGB Node API
- Refresh worker - Background process for wallet state sync
# Check all services are running
docker compose ps
# Check API is accessible
curl http://localhost:8000/docs
# Check database tables
docker compose exec postgres psql -U postgres -d rgb_node -c "\dt"# Using Docker
docker run -d --name postgres-rgb \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=rgb_node \
-p 5432:5432 \
postgres:15-alpine
# Initialize schema
psql -U postgres -d rgb_node < migrations/001_initial_schema.sqlpip install -r requirements.txtuvicorn main:app --reloadpython -m workers.refresh_workerKey variables in .env:
# Network
NETWORK=3 # 1=mainnet, 3=testnet
PROXY_ENDPOINT=rpcs://proxy.iriswallet.com/0.2/json-rpc
INDEXER_URL=tcp://electrum.rgbtools.org:50041
# PostgreSQL
POSTGRES_URL=postgresql://postgres:postgres@localhost:5432/rgb_node
# Worker
REFRESH_INTERVAL=100 # Seconds between invoice refresh checks
MAX_REFRESH_RETRIES=10
POLL_INTERVAL=1 # Seconds between queue pollsRun multiple workers for higher throughput:
docker compose up --scale refresh-worker=3# Using Python script
python scripts/cleanup_tables.py --method truncate
# Or direct SQL
docker compose exec postgres psql -U postgres -d rgb_node -c \
"TRUNCATE TABLE refresh_jobs, refresh_watchers, wallet_locks RESTART IDENTITY CASCADE;"# Active watchers
docker compose exec postgres psql -U postgres -d rgb_node -c \
"SELECT * FROM refresh_watchers WHERE status='watching';"
# Pending jobs
docker compose exec postgres psql -U postgres -d rgb_node -c \
"SELECT COUNT(*) FROM refresh_jobs WHERE status='pending';"# Check PostgreSQL is running
docker compose exec postgres pg_isready -U postgres
# Check connection string
docker compose logs thunderlink-python | grep POSTGRES# Check worker logs
docker compose logs refresh-worker
# Check for stuck jobs
docker compose exec postgres psql -U postgres -d rgb_node -c \
"SELECT * FROM refresh_jobs WHERE status='processing' AND processed_at < NOW() - INTERVAL '5 minutes';"If port 5432 is already in use:
# Stop local PostgreSQL
brew services stop postgresql@15 # macOS
# or
sudo systemctl stop postgresql # Linux
# Or change port in docker-compose.ymlOnce running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
/wallet/sync: Performs immediate wallet sync (does not enqueue background job)/wallet/sync-job: Enqueues a background sync job for processing by workers/wallet/refresh: Manually refresh wallet state/wallet/blindreceive: Create blind receive invoice (triggers background refresh job)/wallet/witnessreceive: Create witness receive invoice (triggers background refresh job)
- See REFRESH_FLOW.md to understand how the refresh system works
- See README.md for API usage and architecture