Skip to content

Latest commit

 

History

History
144 lines (103 loc) · 3.15 KB

File metadata and controls

144 lines (103 loc) · 3.15 KB

ACP Deployment Scripts

One-click deployment scripts for the ACP consensus API.

The public landing page (axiomprotocol.org) is maintained in a separate repository and is not part of this protocol repo. These scripts deploy only the consensus API / Worker.

🚀 Quick Deploy Options

Platform Command Best For
Cloudflare Workers ./cloudflare-worker.sh Edge deployment, low latency
Google Apps Script Copy Code.gs Free tier, no CLI needed

☁️ Cloudflare Workers

Requirements: Node.js 18+, wrangler CLI

cd scripts/deploy
chmod +x cloudflare-worker.sh
./cloudflare-worker.sh

What it does:

  1. Installs wrangler if missing
  2. Logs you into Cloudflare
  3. Creates KV namespace for metrics
  4. Prompts for OpenRouter API key
  5. Deploys worker globally

Result: https://acp-consensus.<your-subdomain>.workers.dev


📄 Google Apps Script

Requirements: Google Account only (no CLI needed!)

Option A: Copy & Paste (2 minutes)

  1. Go to script.google.com
  2. Create new project
  3. Delete default code
  4. Copy entire google-apps-script/Code.gs
  5. Paste and save
  6. Add script property: OPENROUTER_API_KEY = your key
  7. Deploy → Web app → Anyone

See google-apps-script/README.md for details.

Option B: clasp CLI

npm install -g @google/clasp
clasp login
clasp create --type webapp --title "ACP Consensus"
cp google-apps-script/Code.gs Code.gs
clasp push
clasp deploy

🔐 Required Secrets

All platforms need an OpenRouter API key:

  1. Get key at openrouter.ai/keys
  2. Set as environment variable or secret depending on platform
Platform How to Set
Cloudflare wrangler secret put OPENROUTER_API_KEY
Google Apps Script Project Settings → Script Properties

🌐 Custom Domain Setup

Cloudflare Workers

# In wrangler.toml add:
routes = [
  { pattern = "api.yourdomain.com/*", zone_name = "yourdomain.com" }
]

Google Apps Script

  • No custom domain support (uses script.google.com URLs)

📊 Platform Comparison

Feature Cloudflare Google Apps Script
Free Tier 100k req/day 20k req/day
Custom Domain
Edge Locations 300+ Limited
Cold Start ~0ms ~500ms
Execution Limit 50ms CPU 6 min
Best For API Prototyping

🛠 Troubleshooting

Cloudflare

# Check deployment status
wrangler tail

# View logs
wrangler logs

Google Apps Script

  • Check Executions in Apps Script dashboard
  • View → Logs for console output

📁 File Structure

scripts/deploy/
├── README.md              # This file
├── cloudflare-worker.sh   # Cloudflare one-click
└── google-apps-script/
    ├── Code.gs            # Full GAS implementation
    └── README.md          # GAS-specific instructions

🔗 Related