lightnode-sdk 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,6 +16,12 @@ npm install lightnode-sdk viem
16
16
  LightChain's own docs list official SDKs as "soon"; this fills the gap. Not
17
17
  affiliated with LightChain.
18
18
 
19
+ New to blockchain or Node.js? Read the
20
+ [Getting Started guide](../GETTING-STARTED.md) first. It covers wallets, testnet
21
+ vs mainnet, the `.env` file, and your first AI call in about 5 minutes. Then come
22
+ back here for the full reference. The rest of this README assumes you're
23
+ comfortable with TypeScript and a terminal.
24
+
19
25
  ## Five-line "hello world"
20
26
 
21
27
  ```ts
package/dist/add.js CHANGED
@@ -341,7 +341,9 @@ function depsNeeded(template) {
341
341
  return ["lightnode-sdk", "viem", "ws"];
342
342
  if (template === "hono")
343
343
  return ["lightnode-sdk", "viem", "ws"];
344
- return ["lightnode-sdk", "viem", "ws"];
344
+ // The node/script template is run with `npx tsx <file>.ts`, so tsx must be
345
+ // installed too, otherwise `tsx ...` fails with "command not found".
346
+ return ["lightnode-sdk", "viem", "ws", "tsx"];
345
347
  }
346
348
  /**
347
349
  * Implementation called by `lightnode add inference [...]`.
package/dist/cli.js CHANGED
@@ -347,7 +347,7 @@ async function main() {
347
347
  console.log("\nNothing to do - all target files already exist. Pass --force to overwrite.");
348
348
  }
349
349
  else {
350
- console.log(`\nNext steps:`);
350
+ console.log(`\nNext steps (these files were added to your CURRENT folder, not a new project):`);
351
351
  console.log(` 1. ${result.install}`);
352
352
  if (sub === "nft-mint-with-inference" || sub === "inference" || sub === "chat" || sub === "agent") {
353
353
  console.log(` 2. cp .env.example .env (and put a funded ${result.network} PRIVATE_KEY in it)`);
@@ -356,14 +356,14 @@ async function main() {
356
356
  console.log(` 4. Deploy. Vercel Cron fires /api/agent on the schedule in vercel.json`);
357
357
  }
358
358
  else if (sub === "agent") {
359
- console.log(` 3. AGENT_INTERVAL_MS=3600000 tsx agent.ts # or run under pm2/systemd`);
359
+ console.log(` 3. AGENT_INTERVAL_MS=3600000 npx tsx agent.ts # or run under pm2/systemd`);
360
360
  }
361
361
  else if (sub === "chat" && result.template === "nextjs-api") {
362
362
  console.log(` 3. Make sure /api/inference is mounted too (run: npx lightnode add inference)`);
363
363
  console.log(` 4. npm run dev, open /chat`);
364
364
  }
365
365
  else if (sub === "chat") {
366
- console.log(` 3. tsx chat-repl.ts (interactive terminal chat)`);
366
+ console.log(` 3. npx tsx chat-repl.ts (interactive terminal chat)`);
367
367
  }
368
368
  else if (sub === "nft-mint-with-inference" && result.template === "nextjs-api") {
369
369
  console.log(` 3. Make sure /api/inference is mounted too (run: npx lightnode add inference)`);
@@ -376,10 +376,10 @@ async function main() {
376
376
  console.log(` 3. wire inferenceHandler into your Hono app, then start it`);
377
377
  }
378
378
  else if (sub === "nft-mint-with-inference") {
379
- console.log(` 3. tsx nft-metadata.ts "My NFT" "concept goes here"`);
379
+ console.log(` 3. npx tsx nft-metadata.ts "My NFT" "concept goes here"`);
380
380
  }
381
381
  else {
382
- console.log(` 3. tsx lightchain-inference.ts "your prompt"`);
382
+ console.log(` 3. npx tsx lightchain-inference.ts "your prompt"`);
383
383
  }
384
384
  }
385
385
  else {
@@ -388,11 +388,15 @@ async function main() {
388
388
  console.log(` 2. npm run dev, open /lightnode-analytics`);
389
389
  }
390
390
  else {
391
- console.log(` 2. tsx lightnode-analytics.ts`);
391
+ console.log(` 2. npx tsx lightnode-analytics.ts`);
392
392
  }
393
393
  }
394
+ if (result.network === "testnet") {
395
+ console.log(`\nNo wallet yet? Make one: npx lightnode wallet new then fund it free below.`);
396
+ }
394
397
  console.log(`\nFree testnet LCAI: https://lightfaucet.ai`);
395
398
  console.log(`Builder docs: https://lightnode.app/build`);
399
+ console.log(`New to all this? See GETTING-STARTED.md in the lightnode repo.`);
396
400
  }
397
401
  break;
398
402
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lightnode-sdk",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Read-only TypeScript client for LightChain AI: workers, jobs, models, on-chain registration, and per-model network analytics. Independent, community-built (not an official LightChain package).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",