@clawlabz/clawnetwork 0.1.21 → 0.1.22

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/index.ts CHANGED
@@ -7,7 +7,7 @@ declare function setInterval(fn: () => void, ms: number): unknown
7
7
  declare function clearInterval(id: unknown): void
8
8
  declare function fetch(url: string, init?: Record<string, unknown>): Promise<{ status: number; ok: boolean; text: () => Promise<string>; json: () => Promise<unknown> }>
9
9
 
10
- const VERSION = '0.1.21'
10
+ const VERSION = '0.1.22'
11
11
  const PLUGIN_ID = 'clawnetwork'
12
12
  const GITHUB_REPO = 'clawlabz/claw-network'
13
13
  const DEFAULT_RPC_PORT = 9710
@@ -505,12 +505,14 @@ function isNodeRunning(): { running: boolean; pid: number | null } {
505
505
  return { running: false, pid: null }
506
506
  }
507
507
 
508
- /** Check if a TCP port is in use by any process */
508
+ /** Check if a TCP port is in use via nc -z (works across users, no bind needed) */
509
509
  function isPortInUse(port: number): boolean {
510
510
  try {
511
- execFileSync('lsof', ['-ti', `:${port}`], { timeout: 3000, encoding: 'utf8' })
512
- return true
513
- } catch { return false }
511
+ execFileSync('nc', ['-z', '127.0.0.1', String(port)], { timeout: 2000, stdio: 'ignore' })
512
+ return true // connection succeeded → something is listening
513
+ } catch {
514
+ return false // connection refused → port is free
515
+ }
514
516
  }
515
517
 
516
518
  /** Find available ports starting from the configured ones, skipping occupied ports */
@@ -2,7 +2,7 @@
2
2
  "id": "clawnetwork",
3
3
  "name": "ClawNetwork Node",
4
4
  "description": "Run a ClawNetwork blockchain node inside OpenClaw. Every agent is a node.",
5
- "version": "0.1.21",
5
+ "version": "0.1.22",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawlabz/clawnetwork",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Run a ClawNetwork blockchain node inside OpenClaw. Every agent is a blockchain node.",
5
5
  "type": "module",
6
6
  "license": "MIT",