Adds cvm-server/ directory with complete ContextVM server implementation: - server.ts: Full MCP server with 5 tools (find_spots, find_events, find_coaches, find_gear, get_community_stats) using @contextvm/sdk - bootstrap.sh: One-command VPS setup script (Bun, PM2, firewall, keygen) - skatespots-cvm.service: systemd unit for production deployment - .env.example: Environment variable template - DEPLOY.md: Step-by-step deploy guide for LNVPS VPS - package.cvm.json: Dependencies manifest The server aggregates data from goskatespots.nostr1.com and other relays, deduplicates addressable events, and exposes structured JSON tools that AI agents can discover and call via the ContextVM/Nostr protocol (CEP-6). Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
4.6 KiB
SkateSpots CVM Server — VPS Deploy Guide
Everything below runs on your LNVPS server over SSH. Shakespeare prepared all the files. You just copy-paste.
1. SSH into your VPS
ssh root@YOUR_VPS_IP
LNVPS will email/show you the IP and root password after purchase.
2. Run the bootstrap script (one command)
This installs Bun, Node, PM2, firewall, fail2ban, creates the skate user,
and generates your CVM server Nostr keypair.
bash <(curl -fsSL https://raw.githubusercontent.com/YOUR_REPO/main/cvm-server/bootstrap.sh)
Or if you haven't pushed to git yet, paste the contents of bootstrap.sh
directly into your SSH terminal.
3. Note down your keys
The bootstrap script prints something like:
PRIVATE KEY (hex) — goes in .env as CVM_SERVER_NSEC_HEX
a1b2c3d4e5f6...
NPUB (bech32) — share this so agents can find you
npub1abc123...
Copy both somewhere safe (password manager, notes). You need the hex key in step 4.
4. Switch to the skate user and set up the project
su - skate
cd ~/skatespots-cvm
Copy the project files (one of these options):
Option A — clone from git (after you push):
git clone YOUR_REPO_URL .
Option B — create files manually:
# Copy server.ts, package.cvm.json contents from your local machine
# Easiest: use scp from your local terminal
# scp -r ./cvm-server/* root@YOUR_VPS_IP:/home/skate/skatespots-cvm/
5. Rename package file and install dependencies
cd ~/skatespots-cvm
cp package.cvm.json package.json
bun install
6. Create your .env file
cp .env.example .env
nano .env
Fill in:
CVM_SERVER_NSEC_HEX=PASTE_YOUR_HEX_KEY_FROM_STEP_3_HERE
NOSTR_RELAYS=wss://goskatespots.nostr1.com,wss://relay.ditto.pub,wss://wotr.relatr.xyz
CVM_RELAY=wss://relay.contextvm.net
LOG_LEVEL=info
Save: Ctrl+X → Y → Enter
7. Test it runs
bun run server.ts
You should see:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛹 SkateSpots CVM Server
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Data relays : wss://goskatespots.nostr1.com, ...
Server npub : abc123...
✅ Server running — listening for agents on Nostr
Verify discovery:
nak req -k 11316 -a abc123... wss://relay.contextvm.net
Press Ctrl+C to stop, then move to step 8.
8. Install as a systemd service (runs forever, survives reboots)
# Back to root for this
exit # leaves skate user, back to root
sudo cp /home/skate/skatespots-cvm/skatespots-cvm.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable skatespots-cvm
sudo systemctl start skatespots-cvm
# Check it started
sudo systemctl status skatespots-cvm
You should see ● skatespots-cvm.service — active (running) ✅
9. Watch the live logs
sudo journalctl -u skatespots-cvm -f
10. Verify it's discoverable on Nostr
Install nak (Nostr Army Knife):
# Option A — go binary (fastest)
apt install -y golang-go
go install github.com/fiatjaf/nak@latest
export PATH=$PATH:~/go/bin
# Option B — npx (no install needed)
npx @nostr-army-knife/nak req -k 11316 -a YOUR_SERVER_PUBKEY wss://relay.contextvm.net
Run the discovery query:
nak req -k 11316 -a YOUR_SERVER_PUBKEY wss://relay.contextvm.net
If you get back a JSON event listing your server's tools → it works! 🎉
Any AI agent anywhere in the world can now call:
find_spots— query skate spotsfind_events— query upcoming eventsfind_coaches— find coaches/filmers/editorsfind_gear— browse the marketplaceget_community_stats— live counts
Useful commands after deploy
# Check service status
sudo systemctl status skatespots-cvm
# Restart after code changes
sudo systemctl restart skatespots-cvm
# Live logs
sudo journalctl -u skatespots-cvm -f
# Stop
sudo systemctl stop skatespots-cvm
# Update server.ts and restart
scp server.ts root@YOUR_VPS_IP:/home/skate/skatespots-cvm/
ssh root@YOUR_VPS_IP "systemctl restart skatespots-cvm"
File layout on the VPS
/home/skate/skatespots-cvm/
├── server.ts ← the CVM server (main file)
├── package.json ← dependencies
├── .env ← your secret key + relay config (never commit!)
├── node_modules/ ← installed by bun install
└── skatespots-cvm.service ← systemd unit (copied to /etc/systemd/system/)