@clawlabz/clawnetwork 0.1.10 → 0.1.12

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
@@ -975,6 +975,7 @@ function buildUiHtml(cfg: PluginConfig): string {
975
975
  </div>
976
976
  <div class="node-controls">
977
977
  <button class="btn primary" id="startBtn" onclick="doAction('start')">&#x25B6; Start Node</button>
978
+ <button class="btn" id="restartBtn" onclick="doRestart()" style="background:var(--accent);color:#000;font-weight:600">&#x21BB; Restart</button>
978
979
  <button class="btn danger" id="stopBtn" onclick="doAction('stop')">&#x25A0; Stop Node</button>
979
980
  </div>
980
981
  </div>
@@ -1413,6 +1414,19 @@ function buildUiHtml(cfg: PluginConfig): string {
1413
1414
  } catch (e) { toast('Error: ' + e.message); }
1414
1415
  }
1415
1416
 
1417
+ async function doRestart() {
1418
+ toast('Stopping node...');
1419
+ try {
1420
+ await fetch(API + '/api/action/stop', { method: 'POST' });
1421
+ await new Promise(r => setTimeout(r, 2000));
1422
+ toast('Starting node...');
1423
+ const res = await fetch(API + '/api/action/start', { method: 'POST' });
1424
+ const data = await res.json();
1425
+ toast(data.message || 'Restarted');
1426
+ setTimeout(fetchStatus, 2000);
1427
+ } catch (e) { toast('Error: ' + e.message); }
1428
+ }
1429
+
1416
1430
  async function refreshLogs() {
1417
1431
  try {
1418
1432
  const res = await fetch(API + '/api/logs');
@@ -1811,7 +1825,7 @@ async function handle(req, res) {
1811
1825
  newVersion = require('child_process').execFileSync(path.join(binDir, binName), ['--version'], { encoding: 'utf8', timeout: 5000 }).trim();
1812
1826
  } catch {}
1813
1827
 
1814
- json(200, { message: 'Upgraded to ' + newVersion + '. Restart the node from Dashboard.', newVersion });
1828
+ json(200, { message: 'Upgraded to ' + newVersion + '. Click Restart to apply.', newVersion });
1815
1829
  } catch (e) { json(500, { error: e.message }); }
1816
1830
  return;
1817
1831
  }
@@ -2335,6 +2349,8 @@ export default function register(api: OpenClawApi) {
2335
2349
  if (state.running) {
2336
2350
  api.logger?.info?.(`[clawnetwork] node already running (pid=${state.pid}), skipping node start`)
2337
2351
  startHealthCheck(cfg, api)
2352
+ // Start UI dashboard (may have been lost on gateway restart)
2353
+ startUiServer(cfg, api)
2338
2354
  // Still need to ensure heartbeat loop is running (may have been lost on gateway restart)
2339
2355
  const wallet = ensureWallet(cfg.network, api)
2340
2356
  await sleep(5_000)
@@ -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.10",
5
+ "version": "0.1.12",
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.10",
3
+ "version": "0.1.12",
4
4
  "description": "Run a ClawNetwork blockchain node inside OpenClaw. Every agent is a blockchain node.",
5
5
  "type": "module",
6
6
  "license": "MIT",