mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-08-09 11:04:36 +00:00
The secret-key docs still said ROUTSTR_SECRET_KEY was required and that the node would not start without it. Update the README, .env.example, and the provider docs (configuration, quickstart, deployment) to the current behaviour: the key is optional; when unset the node generates one beside the database, so it persists on the same volume as the data, and prints a one-time back-it-up notice; set it explicitly to manage the key yourself. Switch the generation and reset snippets to `uv run python`, and add the containerised reset variant. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
129 lines
3.2 KiB
Markdown
129 lines
3.2 KiB
Markdown
# Quick Start
|
|
|
|
Start earning Bitcoin by selling AI access in under 5 minutes.
|
|
|
|
## What You'll Build
|
|
|
|
A **Routstr Provider Node** acts as a gateway that:
|
|
|
|
1. **Connects** to upstream AI providers (OpenAI, Anthropic, OpenRouter, etc.)
|
|
2. **Accepts** Bitcoin payments via Cashu eCash
|
|
3. **Serves** AI requests to clients on the network
|
|
|
|
You bring the API keys, Routstr handles the billing, payments, and client management.
|
|
|
|
!!! tip "Future: Node-to-Node Routing"
|
|
In future versions, you'll be able to run a node that connects to other Routstr nodes—eliminating the need to configure upstream providers yourself. For now, you'll need your own API credentials.
|
|
|
|
---
|
|
|
|
## Prerequisites
|
|
|
|
- [Docker](https://docs.docker.com/get-docker/) installed
|
|
- API credentials from at least one AI provider (OpenAI, Anthropic, OpenRouter, etc.)
|
|
|
|
---
|
|
|
|
## 1. Prepare Configuration
|
|
|
|
Create a `.env` file in the root of the project to store your secrets:
|
|
|
|
```bash
|
|
# Initial Admin Password
|
|
ADMIN_PASSWORD=mysecretpassword
|
|
|
|
# Encrypts node secrets at rest. Optional — if unset, the node generates a key on
|
|
# first start and prints it once (back it up).
|
|
ROUTSTR_SECRET_KEY=
|
|
|
|
# Node Identity
|
|
NAME="My AI Node"
|
|
DESCRIPTION="Fast access to models"
|
|
NSEC=yournsec
|
|
|
|
# Lightning Payouts
|
|
RECEIVE_LN_ADDRESS=yourname@wallet.com
|
|
|
|
```
|
|
|
|
## 2. Start the Node
|
|
|
|
The recommended way to run Routstr is using Docker Compose, which handles the node, the UI, and optional services like Tor.
|
|
|
|
```bash
|
|
docker compose up -d
|
|
```
|
|
|
|
Verify it's running:
|
|
|
|
```bash
|
|
curl http://localhost:8000/v1/info
|
|
```
|
|
|
|
### Build from Source (Optional)
|
|
|
|
If you've cloned the repository and want to build the images yourself:
|
|
|
|
```bash
|
|
docker compose build
|
|
docker compose up -d
|
|
```
|
|
|
|
---
|
|
|
|
## 3. Configure via Dashboard
|
|
|
|
Open the **Admin Dashboard** at [http://localhost:8000/admin/](http://localhost:8000/admin/).
|
|
|
|
!!! note "Login"
|
|
Use the `ADMIN_PASSWORD` you defined in your `.env` file to log in. If you didn't set one, the dashboard will prompt you to set one on first visit.
|
|
|
|
### Connect Your AI Providers
|
|
|
|
1. Navigate to **Settings** → **Upstream**
|
|
2. Enter your upstream URL (e.g., `https://api.openai.com/v1`)
|
|
3. Enter your API key
|
|
4. Save
|
|
|
|
### Set Your Profit Margin
|
|
|
|
1. Go to **Settings** → **Pricing**
|
|
2. Configure your markup (default is 10%)
|
|
3. Optionally set a fixed price per request instead
|
|
|
|
### Secure the Dashboard
|
|
|
|
1. Go to **Settings** → **Admin**
|
|
2. Set a strong password
|
|
3. Save and re-login
|
|
|
|
---
|
|
|
|
## 3. Start Earning
|
|
|
|
Once configured, your node is live. Clients pay you in Bitcoin (via Cashu tokens) for every AI request.
|
|
|
|
### Monitor Your Earnings
|
|
|
|
The dashboard shows:
|
|
|
|
- **Total Wallet**: All Bitcoin held by your node
|
|
- **User Balances**: Funds belonging to active client sessions
|
|
- **Your Balance**: Your profit (`Total - User Balances`)
|
|
|
|
### Withdraw Profits
|
|
|
|
1. Go to **Withdraw** in the dashboard
|
|
2. Select amount and mint
|
|
3. Generate a Cashu token
|
|
4. Redeem to your Lightning wallet
|
|
|
|
---
|
|
|
|
## Next Steps
|
|
|
|
- **[Deployment](deployment.md)**: Production setup with Docker Compose and Tor
|
|
- **[Dashboard Guide](dashboard.md)**: Full reference for all dashboard features
|
|
- **[Pricing](pricing.md)**: Configure pricing strategies and per-model overrides
|
|
- **[Discovery](discovery.md)**: Announce your node on Nostr for clients to find you
|