mirror of
https://github.com/Routstr/routstrd.git
synced 2026-10-05 20:38:22 +00:00
chagned command names and version for routsrd sdk and more
This commit is contained in:
@@ -29,7 +29,7 @@ curl -fsSL https://bun.com/install | bash
|
||||
cd routstrd
|
||||
bun install
|
||||
bun link
|
||||
routstrd init
|
||||
routstrd onboard
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -39,7 +39,7 @@ routstrd init
|
||||
Initialize routstrd (creates config directory and sets up cocod):
|
||||
|
||||
```sh
|
||||
routstrd init
|
||||
routstrd onboard
|
||||
```
|
||||
|
||||
This will:
|
||||
@@ -52,17 +52,17 @@ This will:
|
||||
Start the background daemon:
|
||||
|
||||
```sh
|
||||
routstrd daemon
|
||||
routstrd start
|
||||
```
|
||||
|
||||
With custom port:
|
||||
```sh
|
||||
routstrd daemon --port 9000
|
||||
routstrd start --port 9000
|
||||
```
|
||||
|
||||
With specific provider:
|
||||
```sh
|
||||
routstrd daemon --provider https://your-provider.com
|
||||
routstrd start --provider https://your-provider.com
|
||||
```
|
||||
|
||||
### CLI Commands
|
||||
@@ -150,7 +150,7 @@ bun run start
|
||||
|
||||
Run daemon:
|
||||
```sh
|
||||
bun run daemon
|
||||
bun run start
|
||||
```
|
||||
|
||||
Typecheck:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"name": "routstrd",
|
||||
"dependencies": {
|
||||
"@cashu/cashu-ts": "^3.1.1",
|
||||
"@routstr/sdk": "^0.1.6",
|
||||
"@routstr/sdk": "^0.1.7",
|
||||
"applesauce-core": "^5.1.0",
|
||||
"applesauce-relay": "^5.1.0",
|
||||
"better-sqlite3": "^11.7.2",
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
"@noble/hashes": ["@noble/hashes@2.0.1", "", {}, "sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw=="],
|
||||
|
||||
"@routstr/sdk": ["@routstr/sdk@0.1.6", "", { "dependencies": { "@cashu/cashu-ts": "^3.1.1", "applesauce-core": "^5.1.0", "applesauce-relay": "^5.1.0", "rxjs": "^7.8.1", "zustand": "^5.0.5" }, "optionalDependencies": { "better-sqlite3": "^11.7.2" }, "peerDependencies": { "typescript": ">=5.0.0" } }, "sha512-+A8SIF6itDuUtCkxmlTcgTma4aoq5sl+F+/aL0zFw7fIh9ed3rQ8aPE6Vjys3W2Up4jZRCqY+EZesYIekJtfmQ=="],
|
||||
"@routstr/sdk": ["@routstr/sdk@0.1.7", "", { "dependencies": { "@cashu/cashu-ts": "^3.1.1", "applesauce-core": "^5.1.0", "applesauce-relay": "^5.1.0", "rxjs": "^7.8.1", "zustand": "^5.0.5" }, "optionalDependencies": { "better-sqlite3": "^11.7.2" }, "peerDependencies": { "typescript": ">=5.0.0" } }, "sha512-2BnlbibYZ19Tf/fGVTt9MXZyPIu7csMIPaUlQXrI5zKcEFlOm5d0ar439euNdaE/i4dld0KOiUaH5ye7+sCYqw=="],
|
||||
|
||||
"@scure/base": ["@scure/base@2.0.0", "", {}, "sha512-3E1kpuZginKkek01ovG8krQ0Z44E3DHPjc5S2rjJw9lZn3KSQOs8S7wqikF/AH7iRanHypj85uGyxk0XAyC37w=="],
|
||||
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"start": "bun src/index.ts",
|
||||
"daemon": "bun src/index.ts daemon",
|
||||
"start": "bun src/index.ts start",
|
||||
"lint": "tsc --noEmit",
|
||||
"test": "bun test"
|
||||
},
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@cashu/cashu-ts": "^3.1.1",
|
||||
"@routstr/sdk": "^0.1.6",
|
||||
"@routstr/sdk": "^0.1.7",
|
||||
"applesauce-core": "^5.1.0",
|
||||
"applesauce-relay": "^5.1.0",
|
||||
"better-sqlite3": "^11.7.2",
|
||||
|
||||
+5
-5
@@ -140,23 +140,23 @@ program
|
||||
.description("Routstr daemon - Manage routstr processes")
|
||||
.version(cliVersion, "--version", "output the version number");
|
||||
|
||||
// Init - initialize the daemon
|
||||
// Onboard - initialize the daemon
|
||||
program
|
||||
.command("init")
|
||||
.command("onboard")
|
||||
.description("Initialize routstrd (creates config directory and initializes cocod)")
|
||||
.action(async () => {
|
||||
await initDaemon();
|
||||
});
|
||||
|
||||
// Daemon - start the background daemon
|
||||
// Start - start the background daemon
|
||||
program
|
||||
.command("daemon")
|
||||
.command("start")
|
||||
.description("Start the background daemon")
|
||||
.option("--port <port>", "Port to listen on")
|
||||
.option("-p, --provider <provider>", "Default provider to use")
|
||||
.action(async (options: { port?: string; provider?: string }) => {
|
||||
if (!(await checkCocodInstalled())) {
|
||||
logger.error("cocod is not installed. Run 'routstrd init' first to install cocod.");
|
||||
logger.error("cocod is not installed. Run 'routstrd onboard' first to install cocod.");
|
||||
process.exit(1);
|
||||
}
|
||||
const config = await loadConfig();
|
||||
|
||||
@@ -687,6 +687,11 @@ async function main(): Promise<void> {
|
||||
);
|
||||
|
||||
if (isStream) {
|
||||
res.statusCode = response.status;
|
||||
response.headers.forEach((value, key) => {
|
||||
res.setHeader(key, value);
|
||||
});
|
||||
|
||||
const body = response.body;
|
||||
if (body) {
|
||||
const nodeReadable = Readable.fromWeb(
|
||||
|
||||
Reference in New Issue
Block a user