Get from zero to a running StreamPay UI with funded testnet accounts in one command.
- Node.js 18+
curl- Internet access (for Stellar Friendbot)
# 1. Copy the env template
cp .env.testnet.example .env.testnet
# 2. Fill in NEXT_PUBLIC_API_URL (point to your local backend)
# Leave STELLAR_SEED_SECRET_KEY empty — the script generates it.
# 3. Run the bring-up script
bash scripts/stellar-dev.sh
# 4. Copy the printed secret key into .env.testnet
# (the script prints it; never commit it)
# 5. Start the frontend
npm run devOpen http://localhost:3000 and connect your testnet wallet.
Time to first successful stream in UI: ~2 minutes.
scripts/stellar-dev.sh:
- Checks
NODE_ENV— refuses to run ifNODE_ENV=production. - Loads
.env.testnetif present. - Validates recommended env vars and warns about missing ones.
- Generates fresh Ed25519 keypairs (no external SDK required).
- Funds each account via Friendbot.
- Runs
scripts/seed-streams.jsto POST fixture streams to the local API.
scripts/seed-streams.js:
- POSTs three sample streams (monthly salary, weekly stipend, quarterly grant) to
NEXT_PUBLIC_API_URL/streams. - Skips gracefully if the API is not running (non-fatal).
See .env.testnet.example for the full list. Key variables:
| Variable | Default | Description |
|---|---|---|
STELLAR_NETWORK |
testnet |
Network identifier |
STELLAR_HORIZON_URL |
https://horizon-testnet.stellar.org |
Horizon endpoint |
STELLAR_FRIENDBOT_URL |
https://friendbot.stellar.org |
Friendbot for funding |
STELLAR_SEED_SECRET_KEY |
(generated) | Testnet secret key — never commit |
STELLAR_SEED_PUBLIC_KEY |
(generated) | Testnet public key |
NEXT_PUBLIC_API_URL |
http://localhost:4000 |
Backend API URL |
NEXT_PUBLIC_STELLAR_ASSET_CODE |
XLM |
Asset for streams |
ACCOUNTS_TO_CREATE |
2 |
Number of test accounts |
- No default seed phrases. Keys are generated fresh on every run.
- Never commit keys.
.env.testnetis in.gitignore. The script prints a warning next to every secret key. - Production guard. The script exits immediately if
NODE_ENV=production. - Testnet only. These accounts have no real value. Do not reuse testnet keys on mainnet.
- No PII. Fixture streams use placeholder recipient addresses.
Friendbot rate-limits requests. Wait 30 seconds and retry, or fund manually:
curl "https://friendbot.stellar.org?addr=<YOUR_PUBLIC_KEY>"The seed script is non-fatal. Start your backend first, then re-run:
NEXT_PUBLIC_API_URL=http://localhost:4000 node scripts/seed-streams.jsThe script refuses to run in production. Unset or change NODE_ENV:
NODE_ENV=development bash scripts/stellar-dev.shThe script requires Node.js 18+. Check your version:
node --versionIf STELLAR_HORIZON_URL is unreachable, the script still generates keys and prints them. Fund accounts manually via Friendbot or Stellar Laboratory.
Three sample streams are seeded by scripts/seed-streams.js:
| Memo | Amount | Asset |
|---|---|---|
| fixture: monthly salary | 10.0000000 | XLM |
| fixture: weekly stipend | 5.5000000 | XLM |
| fixture: quarterly grant | 100.0000000 | XLM |
Recipient addresses are placeholders. Replace them with real testnet addresses for end-to-end testing.
Running a local Soroban node is out of scope for this initial setup. The current flow uses the public Stellar testnet. A follow-up issue will add Docker Compose support for a fully offline local environment.