@fibscope/agent 0.1.0 → 0.1.1

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.
Files changed (3) hide show
  1. package/README.md +11 -1
  2. package/index.mjs +3 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -75,7 +75,7 @@ The agent pushes to `POST /agent/v1/report` with:
75
75
 
76
76
  ```json
77
77
  {
78
- "agentVersion": "0.1.0",
78
+ "agentVersion": "0.1.1",
79
79
  "chain": "testnet",
80
80
  "collectedAt": 1710000000000,
81
81
  "node": {},
@@ -105,6 +105,16 @@ Collection and transmission are independent loops:
105
105
 
106
106
  The local status file is `.fiber/agent-status.json`.
107
107
 
108
+ ## Run FNN With PM2
109
+
110
+ Create the working directory, install setup and PM2, then run the setup process under PM2 with one command:
111
+
112
+ ```bash
113
+ mkdir -p "$HOME/fibscope" && cd "$HOME/fibscope" && npm install -g pm2 @fibscope/setup && rm -f "$(npm prefix -g)/bin/fnn" && FIBER_SECRET_KEY_PASSWORD='<your-password>' pm2 start "$(command -v setup)" --name fiber-testnet --interpreter node -- --network testnet --rpc-host 127.0.0.1 --rpc-port 8227 --p2p-port 8228 && pm2 save
114
+ ```
115
+
116
+ The Agent Setup page generates this command from a masked password field. The `fnn` link removal avoids confusing the package helper with the downloaded Fiber binary.
117
+
108
118
  ## NPM Usage
109
119
 
110
120
  ```powershell
package/index.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  import { createInterface } from "node:readline/promises";
4
4
  import { stdin as input, stdout as output } from "node:process";
5
5
  import { chmod, mkdir, readFile, writeFile } from "node:fs/promises";
6
- import { existsSync, readFileSync } from "node:fs";
6
+ import { existsSync, readFileSync, realpathSync } from "node:fs";
7
7
  import { randomBytes } from "node:crypto";
8
8
  import { dirname, join, resolve } from "node:path";
9
9
  import { pathToFileURL } from "node:url";
@@ -32,7 +32,7 @@ import { recommend } from "./lib/bridge/recommendation.mjs";
32
32
  import { virtualizePayment } from "./lib/route/route.mjs";
33
33
  import { chooseFnnInstance, describeFnnInstance, discoverFnnInstances, rpcResponds } from "./lib/fnn-discovery.mjs";
34
34
 
35
- const AGENT_VERSION = "0.1.0";
35
+ const AGENT_VERSION = "0.1.1";
36
36
  const DEFAULT_CONFIG_PATH = ".fiber/agent.json";
37
37
  const DEFAULT_STATUS_PATH = ".fiber/agent-status.json";
38
38
  const DEFAULT_PUSH_INTERVAL_MS = 15_000;
@@ -3227,7 +3227,7 @@ async function promptLine(label) {
3227
3227
  }
3228
3228
  }
3229
3229
 
3230
- if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
3230
+ if (process.argv[1] && import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {
3231
3231
  const { command, options } = parseArgs(process.argv.slice(2));
3232
3232
  const commands = { init, start, once, status, help };
3233
3233
  if (!commands[command]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fibscope/agent",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "Fibscope Agent for Fiber node owners.",
6
6
  "bin": {