From 532f4bab7c18cd16a7e67011cd3a17a12602d7c1 Mon Sep 17 00:00:00 2001 From: redshift <213178690+1ftredsh@users.noreply.github.com> Date: Mon, 9 Mar 2026 22:58:29 +0000 Subject: [PATCH] chagned command names and version for routsrd sdk and more --- README.md | 12 ++++++------ bun.lock | 4 ++-- package.json | 4 ++-- src/cli.ts | 10 +++++----- src/daemon.ts | 5 +++++ 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 6f9832b..9356419 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/bun.lock b/bun.lock index 2a7ebf4..a145b0d 100644 --- a/bun.lock +++ b/bun.lock @@ -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=="], diff --git a/package.json b/package.json index 5de9a60..8d8a207 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/cli.ts b/src/cli.ts index 0b21666..978f492 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -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 to listen on") .option("-p, --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(); diff --git a/src/daemon.ts b/src/daemon.ts index db7e14b..2d44172 100644 --- a/src/daemon.ts +++ b/src/daemon.ts @@ -687,6 +687,11 @@ async function main(): Promise { ); 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(