@clawlabz/clawnetwork 0.1.22 → 0.1.23
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 +5 -5
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
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.
|
|
10
|
+
const VERSION = '0.1.23'
|
|
11
11
|
const PLUGIN_ID = 'clawnetwork'
|
|
12
12
|
const GITHUB_REPO = 'clawlabz/claw-network'
|
|
13
13
|
const DEFAULT_RPC_PORT = 9710
|
|
@@ -528,10 +528,10 @@ function findAvailablePorts(rpcPort: number, p2pPort: number, api: OpenClawApi):
|
|
|
528
528
|
rpc++
|
|
529
529
|
}
|
|
530
530
|
|
|
531
|
-
// Find available P2P port
|
|
531
|
+
// Find available P2P port (must also differ from RPC port)
|
|
532
532
|
for (let i = 0; i < MAX_TRIES; i++) {
|
|
533
|
-
if (!isPortInUse(p2p)) break
|
|
534
|
-
api.logger?.info?.(`[clawnetwork] P2P port ${p2p} in use, trying ${p2p + 1}...`)
|
|
533
|
+
if (!isPortInUse(p2p) && p2p !== rpc) break
|
|
534
|
+
api.logger?.info?.(`[clawnetwork] P2P port ${p2p} in use or conflicts with RPC, trying ${p2p + 1}...`)
|
|
535
535
|
p2p++
|
|
536
536
|
}
|
|
537
537
|
|
|
@@ -1982,7 +1982,7 @@ function startUiServer(cfg: PluginConfig, api: OpenClawApi): string | null {
|
|
|
1982
1982
|
fs.writeFileSync(scriptPath, fullScript)
|
|
1983
1983
|
|
|
1984
1984
|
try {
|
|
1985
|
-
const child = fork(scriptPath, [String(cfg.uiPort), String(cfg.rpcPort), LOG_PATH], {
|
|
1985
|
+
const child = fork(scriptPath, [String(cfg.uiPort), String(activeRpcPort ?? cfg.rpcPort), LOG_PATH], {
|
|
1986
1986
|
detached: true,
|
|
1987
1987
|
stdio: 'ignore',
|
|
1988
1988
|
})
|
package/openclaw.plugin.json
CHANGED