Skip to content

Getting Started

Set up a new Stratos Vault instance using stratos-init.


Prerequisites

  • Node.js 18+ installed
  • Wrangler CLI installed and authenticated (npm i -g wrangler && wrangler login)
  • Cloudflare account with Pages and D1 access
  • Canton participant reachable (directly or via tunnel)

Installation with stratos-init

The stratos-init toolkit provisions a fully isolated Stratos Vault instance in a single interactive session.

Run the Wizard

bash
cd stratos-init
./scripts/init-instance.sh

The wizard prompts for:

PromptExampleDescription
Cloudflare accountSelect from listWhich Cloudflare account to deploy to
Instance nameprod, client-acmeUsed for folder and database naming
Target directory../wallet-prodWhere the instance files will live
Organization nameAcme CorpDisplayed in the wallet UI
Themepurple, teal, blueUI color theme
RP IDwallet.acme.comYour domain (required for WebAuthn)
RP NameAcme WalletDisplay name for passkey prompts
Splice Hostp2.cantondefi.comCanton Splice validator
Canton JSON Hostp2-json.cantondefi.comCanton JSON API endpoint
Canton Auth Secret(hidden)JWT signing secret
Superadmin usernameadminInitial superadmin login
Superadmin password(hidden)Initial superadmin password

What It Creates

The script performs 7 automated steps:

[1/7] Copying project files to ../wallet-prod/
[2/7] Creating D1 database 'wallet-prod'...
[3/7] Generating wrangler.toml...
[4/7] Applying database schema...
[5/7] Creating superadmin user...
[6/7] Seeding default assets and RPC endpoints...
[7/7] Installing npm dependencies...

After completion, you have a ready-to-deploy instance:

wallet-prod/
├── wrangler.toml          # Instance configuration
├── schema.sql             # Database schema
├── src/                   # Frontend source
├── functions/             # API endpoints
├── scripts/               # Utility scripts
└── package.json

The wizard then offers to build and deploy immediately.

Deploy an Existing Instance

bash
cd wallet-prod
./scripts/deploy.sh

This builds (npm run build) and deploys to Cloudflare Pages.


Canton Connectivity

If your Canton participant is on a private network, expose it via Cloudflare Tunnel:

bash
./SETUP_TUNNEL.sh
OptionUse Case
Quick TunnelTemporary URL for testing — starts immediately
Named TunnelPersistent production tunnel with custom domain

For named tunnels, the script:

  1. Authenticates with Cloudflare
  2. Creates a tunnel (canton-tunnel)
  3. Configures ingress rules for port 2903
  4. Routes DNS to your domain

After setup, update SPLICE_HOST in wrangler.toml to the tunnel domain.


First Login

Navigate to your instance URL and access the superadmin panel:

https://wallet.acme.com → Superadmin login

Use the credentials you set during init-instance.sh. If using defaults, login with superadmin / admin123! and change the password immediately.


Multiple Instances

Run separate instances for different environments or clients:

bash
# Production
./scripts/init-instance.sh   # Enter: prod

# Staging
./scripts/init-instance.sh   # Enter: staging

# Result:
# ../wallet-prod/
# ../wallet-staging/

Each instance has its own D1 database, configuration, domain, and Cloudflare Pages project — fully isolated.


Updating an Instance

To deploy code updates:

bash
cd wallet-prod
git pull origin main          # Get latest code
npm install                   # Update dependencies
npm run build                 # Build
wrangler pages deploy dist    # Deploy

Schema migrations (when new tables are added):

bash
wrangler d1 execute wallet-prod --remote --file=schema.sql

Security Checklist

After initial setup:

  • [ ] Change default superadmin password
  • [ ] Limit is_superadmin privilege to essential staff only
  • [ ] Configure production RPC endpoints (replace defaults)
  • [ ] Set RP_ID to your production domain
  • [ ] Store API keys (cwp_*) securely — they cannot be retrieved
  • [ ] Review audit logs regularly for unusual activity
  • [ ] Set appropriate rate limits on API endpoints

Next Steps

Enterprise-grade multi-chain wallet infrastructure.