{"id":135,"date":"2026-03-21T22:47:19","date_gmt":"2026-03-21T14:47:19","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/gateway-pairing\/"},"modified":"2026-03-21T23:28:54","modified_gmt":"2026-03-21T15:28:54","slug":"gateway-pairing","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/gateway-pairing\/","title":{"rendered":"\u7f51\u5173 \u7f51\u5173\u62e5\u6709\u7684\u914d\u5bf9"},"content":{"rendered":"<h1>Gateway \u7f51\u5173 \u7f51\u5173\u62e5\u6709\u7684\u914d\u5bf9<\/h1>\n<h1>Gateway \u7f51\u5173 \u7f51\u5173\u62e5\u6709\u7684\u914d\u5bf9\uff08\u9009\u9879 B\uff09<\/h1>\n<p>\u5728 Gateway \u7f51\u5173 \u7f51\u5173\u62e5\u6709\u7684\u914d\u5bf9\u4e2d\uff0c<strong>Gateway \u7f51\u5173 \u7f51\u5173<\/strong>\u662f\u5141\u8bb8\u54ea\u4e9b\u8282\u70b9\u52a0\u5165\u7684\u552f\u4e00\u4fe1\u606f\u6e90\u3002UI\uff08macOS \u5e94\u7528\u3001\u672a\u6765\u7684\u5ba2\u6237\u7aef\uff09\u53ea\u662f\u5ba1\u6279\u6216\u62d2\u7edd\u5f85\u5904\u7406\u8bf7\u6c42\u7684\u524d\u7aef\u3002<\/p>\n<p><strong>\u91cd\u8981\uff1a<\/strong>WS \u8282\u70b9\u5728 <code>connect<\/code> \u671f\u95f4\u4f7f\u7528<strong>\u8bbe\u5907\u914d\u5bf9<\/strong>\uff08\u89d2\u8272 <code>node<\/code>\uff09\u3002<code>node.pair.*<\/code> \u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u914d\u5bf9\u5b58\u50a8\uff0c<strong>\u4e0d\u4f1a<\/strong>\u9650\u5236 WS \u63e1\u624b\u3002\u53ea\u6709\u663e\u5f0f\u8c03\u7528 <code>node.pair.*<\/code> \u7684\u5ba2\u6237\u7aef\u4f7f\u7528\u6b64\u6d41\u7a0b\u3002<\/p>\n<h2>\u6982\u5ff5<\/h2>\n<ul>\n<li><strong>\u5f85\u5904\u7406\u8bf7\u6c42<\/strong>\uff1a\u4e00\u4e2a\u8282\u70b9\u8bf7\u6c42\u52a0\u5165\uff1b\u9700\u8981\u5ba1\u6279\u3002<\/li>\n<li><strong>\u5df2\u914d\u5bf9\u8282\u70b9<\/strong>\uff1a\u5df2\u6279\u51c6\u7684\u8282\u70b9\uff0c\u5e26\u6709\u5df2\u9881\u53d1\u7684\u8ba4\u8bc1\u4ee4\u724c\u3002<\/li>\n<li><strong>\u4f20\u8f93\u5c42<\/strong>\uff1aGateway \u7f51\u5173 \u7f51\u5173 WS \u7aef\u70b9\u8f6c\u53d1\u8bf7\u6c42\u4f46\u4e0d\u51b3\u5b9a\u6210\u5458\u8d44\u683c\u3002\uff08\u65e7\u7248 TCP \u6865\u63a5\u652f\u6301\u5df2\u5f03\u7528\/\u79fb\u9664\u3002\uff09<\/li>\n<\/ul>\n<h2>\u914d\u5bf9\u5de5\u4f5c\u539f\u7406<\/h2>\n<ol>\n<li>\u8282\u70b9\u8fde\u63a5\u5230 Gateway \u7f51\u5173 \u7f51\u5173 WS \u5e76\u8bf7\u6c42\u914d\u5bf9\u3002<\/li>\n<li>Gateway \u7f51\u5173 \u7f51\u5173\u5b58\u50a8\u4e00\u4e2a<strong>\u5f85\u5904\u7406\u8bf7\u6c42<\/strong>\u5e76\u53d1\u51fa <code>node.pair.requested<\/code>\u3002<\/li>\n<li>\u4f60\u5ba1\u6279\u6216\u62d2\u7edd\u8be5\u8bf7\u6c42\uff08CLI \u6216 UI\uff09\u3002<\/li>\n<li>\u5ba1\u6279\u540e\uff0cGateway \u7f51\u5173 \u7f51\u5173\u9881\u53d1\u4e00\u4e2a<strong>\u65b0\u4ee4\u724c<\/strong>\uff08\u91cd\u65b0\u914d\u5bf9\u65f6\u4ee4\u724c\u4f1a\u8f6e\u6362\uff09\u3002<\/li>\n<li>\u8282\u70b9\u4f7f\u7528\u8be5\u4ee4\u724c\u91cd\u65b0\u8fde\u63a5\uff0c\u73b0\u5728\u662f&#8221;\u5df2\u914d\u5bf9&#8221;\u72b6\u6001\u3002<\/li>\n<\/ol>\n<p>\u5f85\u5904\u7406\u8bf7\u6c42\u5728 <strong>5 \u5206\u949f<\/strong>\u540e\u81ea\u52a8\u8fc7\u671f\u3002<\/p>\n<h2>CLI \u5de5\u4f5c\u6d41\u7a0b\uff08\u652f\u6301\u65e0\u5934\u6a21\u5f0f\uff09<\/h2>\n<p><code>bash  theme={\"theme\":{\"light\":\"min-light\",\"dark\":\"min-dark\"}}<br \/>\nopenclaw nodes pending<br \/>\nopenclaw nodes approve &lt;requestId&gt;<br \/>\nopenclaw nodes reject &lt;requestId&gt;<br \/>\nopenclaw nodes status<br \/>\nopenclaw nodes rename --node &lt;id|name|ip&gt; --name \"Living Room iPad\"<\/code><\/p>\n<p><code>nodes status<\/code> \u663e\u793a\u5df2\u914d\u5bf9\/\u5df2\u8fde\u63a5\u7684\u8282\u70b9\u53ca\u5176\u529f\u80fd\u3002<\/p>\n<h2>API \u63a5\u53e3\uff08Gateway \u7f51\u5173 \u7f51\u5173\u534f\u8bae\uff09<\/h2>\n<p>\u4e8b\u4ef6\uff1a<\/p>\n<ul>\n<li><code>node.pair.requested<\/code> \u2014 \u521b\u5efa\u65b0\u7684\u5f85\u5904\u7406\u8bf7\u6c42\u65f6\u53d1\u51fa\u3002<\/li>\n<li><code>node.pair.resolved<\/code> \u2014 \u8bf7\u6c42\u88ab\u6279\u51c6\/\u62d2\u7edd\/\u8fc7\u671f\u65f6\u53d1\u51fa\u3002<\/li>\n<\/ul>\n<p>\u65b9\u6cd5\uff1a<\/p>\n<ul>\n<li><code>node.pair.request<\/code> \u2014 \u521b\u5efa\u6216\u590d\u7528\u5f85\u5904\u7406\u8bf7\u6c42\u3002<\/li>\n<li><code>node.pair.list<\/code> \u2014 \u5217\u51fa\u5f85\u5904\u7406 + \u5df2\u914d\u5bf9\u7684\u8282\u70b9\u3002<\/li>\n<li><code>node.pair.approve<\/code> \u2014 \u6279\u51c6\u5f85\u5904\u7406\u8bf7\u6c42\uff08\u9881\u53d1\u4ee4\u724c\uff09\u3002<\/li>\n<li><code>node.pair.reject<\/code> \u2014 \u62d2\u7edd\u5f85\u5904\u7406\u8bf7\u6c42\u3002<\/li>\n<li><code>node.pair.verify<\/code> \u2014 \u9a8c\u8bc1 <code>{ nodeId, token }<\/code>\u3002<\/li>\n<\/ul>\n<p>\u6ce8\u610f\u4e8b\u9879\uff1a<\/p>\n<ul>\n<li><code>node.pair.request<\/code> \u5bf9\u6bcf\u4e2a\u8282\u70b9\u662f\u5e42\u7b49\u7684\uff1a\u91cd\u590d\u8c03\u7528\u8fd4\u56de\u76f8\u540c\u7684\u5f85\u5904\u7406\u8bf7\u6c42\u3002<\/li>\n<li>\u5ba1\u6279<strong>\u603b\u662f<\/strong>\u751f\u6210\u65b0\u7684\u4ee4\u724c\uff1b<code>node.pair.request<\/code> \u6c38\u8fdc\u4e0d\u4f1a\u8fd4\u56de\u4ee4\u724c\u3002<\/li>\n<li>\u8bf7\u6c42\u53ef\u4ee5\u5305\u542b <code>silent: true<\/code> \u4f5c\u4e3a\u81ea\u52a8\u5ba1\u6279\u6d41\u7a0b\u7684\u63d0\u793a\u3002<\/li>\n<\/ul>\n<h2>\u81ea\u52a8\u5ba1\u6279\uff08macOS \u5e94\u7528\uff09<\/h2>\n<p>\u5f53\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\u65f6\uff0cmacOS \u5e94\u7528\u53ef\u4ee5\u9009\u62e9\u5c1d\u8bd5<strong>\u9759\u9ed8\u5ba1\u6279<\/strong>\uff1a<\/p>\n<ul>\n<li>\u8bf7\u6c42\u6807\u8bb0\u4e3a <code>silent<\/code>\uff0c\u4e14<\/li>\n<li>\u5e94\u7528\u53ef\u4ee5\u4f7f\u7528\u76f8\u540c\u7528\u6237\u9a8c\u8bc1\u5230 Gateway \u7f51\u5173 \u7f51\u5173\u4e3b\u673a\u7684 SSH \u8fde\u63a5\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u9759\u9ed8\u5ba1\u6279\u5931\u8d25\uff0c\u5219\u56de\u9000\u5230\u6b63\u5e38\u7684&#8221;\u6279\u51c6\/\u62d2\u7edd&#8221;\u63d0\u793a\u3002<\/p>\n<h2>\u5b58\u50a8\uff08\u672c\u5730\uff0c\u79c1\u6709\uff09<\/h2>\n<p>\u914d\u5bf9\u72b6\u6001\u5b58\u50a8\u5728 Gateway \u7f51\u5173 \u7f51\u5173\u72b6\u6001\u76ee\u5f55\u4e0b\uff08\u9ed8\u8ba4 <code>~\/.openclaw<\/code>\uff09\uff1a<\/p>\n<ul>\n<li><code>~\/.openclaw\/nodes\/paired.json<\/code><\/li>\n<li><code>~\/.openclaw\/nodes\/pending.json<\/code><\/li>\n<\/ul>\n<p>\u5982\u679c\u4f60\u8986\u76d6\u4e86 <code>OPENCLAW_STATE_DIR<\/code>\uff0c<code>nodes\/<\/code> \u6587\u4ef6\u5939\u4f1a\u968f\u4e4b\u79fb\u52a8\u3002<\/p>\n<p>\u5b89\u5168\u6ce8\u610f\u4e8b\u9879\uff1a<\/p>\n<ul>\n<li>\u4ee4\u724c\u662f\u673a\u5bc6\u4fe1\u606f\uff1b\u5c06 <code>paired.json<\/code> \u89c6\u4e3a\u654f\u611f\u6587\u4ef6\u3002<\/li>\n<li>\u8f6e\u6362\u4ee4\u724c\u9700\u8981\u91cd\u65b0\u5ba1\u6279\uff08\u6216\u5220\u9664\u8282\u70b9\u6761\u76ee\uff09\u3002<\/li>\n<\/ul>\n<h2>\u4f20\u8f93\u5c42\u884c\u4e3a<\/h2>\n<ul>\n<li>\u4f20\u8f93\u5c42\u662f<strong>\u65e0\u72b6\u6001\u7684<\/strong>\uff1b\u5b83\u4e0d\u5b58\u50a8\u6210\u5458\u8d44\u683c\u3002<\/li>\n<li>\u5982\u679c Gateway \u7f51\u5173 \u7f51\u5173\u79bb\u7ebf\u6216\u914d\u5bf9\u88ab\u7981\u7528\uff0c\u8282\u70b9\u65e0\u6cd5\u914d\u5bf9\u3002<\/li>\n<li>\u5982\u679c Gateway \u7f51\u5173 \u7f51\u5173\u5904\u4e8e\u8fdc\u7a0b\u6a21\u5f0f\uff0c\u914d\u5bf9\u4ecd\u7136\u9488\u5bf9\u8fdc\u7a0b Gateway \u7f51\u5173 \u7f51\u5173\u7684\u5b58\u50a8\u8fdb\u884c\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Gateway \u7f51\u5173 \u7f51\u5173\u62e5\u6709\u7684\u914d\u5bf9 Gateway \u7f51\u5173 \u7f51\u5173\u62e5\u6709\u7684\u914d\u5bf9\uff08\u9009\u9879 B\uff09 \u5728 Gateway \u7f51 [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-135","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=135"}],"version-history":[{"count":2,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/135\/revisions"}],"predecessor-version":[{"id":818,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/135\/revisions\/818"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}