{"id":244835,"date":"2023-08-30T04:28:26","date_gmt":"2023-08-29T20:28:26","guid":{"rendered":"https:\/\/www.idc.net\/help\/244835\/"},"modified":"2023-08-30T04:28:26","modified_gmt":"2023-08-29T20:28:26","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8truffle-l2-box%e6%a1%a5%e6%8e%a5%e5%8c%ba%e5%9d%97%e9%93%be%e7%bd%91%e7%bb%9c","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/244835\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528Truffle L2 Box\u6865\u63a5\u533a\u5757\u94fe\u7f51\u7edc"},"content":{"rendered":"<p>\u8bd1\u8005 | \u674e\u777f<\/p>\n<p>\u5ba1\u6821 | \u5b59\u6dd1\u5a1f<\/p>\n<p>\u4f17\u6240\u5468\u77e5\uff0c\u8bb8\u591a\u533a\u5757\u94fe\u90fd\u5b58\u5728\u53ef\u6269\u5c55\u6027\u548c\u62e5\u585e\u95ee\u9898\u3002\u8fd9\u4e9b\u95ee\u9898\u6709\u5e7f\u6cdb\u7684\u5f71\u54cd\uff0c\u4ece\u4ea4\u6613\u65f6\u95f4\u53d8\u6162\uff0c\u5230\u4ea4\u6613\u8d39\u7528\u589e\u52a0\uff0c\u4ee5\u53ca\u7528\u6237\u4f53\u9a8c\u4e0b\u964d\u3002<\/p>\n<p>\u4e00\u79cd\u89e3\u51b3\u65b9\u6848\u662f\u4f7f\u7528L2\uff08\u7b2c\u4e8c\u5c42\uff09\u533a\u5757\u94fe\u4f7fWeb3\u6210\u4e3a\u591a\u94fe\u3002\u4ee5\u592a\u574aL2\uff08\u4f8b\u5982Optimism\u3001Arbitrum\u548cPolygon\uff09\u6784\u5efa\u5728\u4ee5\u592a\u574a\u7f51\u7edc\u4e4b\u4e0a\uff0c\u4f46\u6bd4\u4ee5\u592a\u574a\u66f4\u5feb\uff0c\u66f4\u4fbf\u5b9c\u3002\u7136\u800c\uff0c\u4f5c\u4e3a\u4e00\u79cd\u6743\u8861\uff0c\u5b83\u4eec\u901a\u5e38\u4e0d\u5982\u4ee5\u592a\u574a\u5b89\u5168\u3002\u8fd9\u5c31\u662fL2\u5904\u7406\u65e5\u5e38\u7528\u6237\u6d3b\u52a8\uff0c\u540c\u65f6\u4ecd\u7136\u4f9d\u8d56\u4ee5\u592a\u574aL1\u4f5c\u4e3a\u5b89\u5168\u3001\u53bb\u4e2d\u5fc3\u5316\u7ed3\u7b97\u548c\u6570\u636e\u53ef\u7528\u6027\u5c42\u7684\u5e55\u540e\u57fa\u7840\u7684\u539f\u56e0\u3002 &nbsp;<\/p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u4ec5\u4ee5\u592a\u574a\u4e0a\u5c31\u6709\u8bb8\u591aL2\uff0c\u6bcf\u4e2aL2\u90fd\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u7f51\u7edc\uff0c\u6709\u81ea\u5df1\u7684\u7ec6\u5fae\u5dee\u522b\u548c\u4f53\u9a8c\u3002\u6784\u5efa\u548c\u4f7f\u7528\u5728\u8fd9\u4e9b\u7f51\u7edc\u548c\u4ee5\u592a\u574aL1\u4e4b\u95f4\u4e92\u64cd\u4f5c\u548c\u79fb\u52a8\u7684dApp\u53ef\u80fd\u662f\u4e4f\u5473\u548c\u56f0\u96be\u7684\uff0c\u800c\u4e14\u5bf9\u7528\u6237\u548c\u5f00\u53d1\u4eba\u5458\u6765\u8bf4\u4e5f\u662f\u7cdf\u7cd5\u7684\u4f53\u9a8c\u3002<\/p>\n<p>\u73b0\u5728\u9700\u8981\u7684\u662fWeb3\u6210\u4e3a\u4e00\u79cd\u591a\u94fe\u4f53\u9a8c\uff0c\u6d88\u8d39\u8005\u4e0d\u9700\u8981\u77e5\u9053\u4ed6\u4eec\u4f7f\u7528\u7684\u662f\u54ea\u6761\u533a\u5757\u94fe(\u5766\u7387\u5730\u8bf4\u4e0d\u5728\u4e4e)\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u4f9d\u8d56\u4efb\u4f55\u6700\u652f\u6301\u4ed6\u4eecdApp\u9700\u6c42\u7684\u7f51\u7edc\u3002\u901a\u8fc7\u8f6c\u79fb\u5230\u533a\u5757\u94fe\u7684\u591a\u94fe\u4e92\u8054\u7f51\uff0cWeb3\u4e3a\u6bcf\u4e2a\u53c2\u4e0e\u8005\u63d0\u4f9b\u4e86\u66f4\u597d\u7684\u4f53\u9a8c\u3002 &nbsp;<\/p>\n<p>\u4e0d\u5e78\u7684\u662f\uff0c\u5141\u8bb8dApp\u5728\u533a\u5757\u94fe\u4e4b\u95f4\u79fb\u52a8\u662f\u4e00\u9879\u8270\u5de8\u7684\u6280\u672f\u6311\u6218\u3002\u672c\u6587\u5c06\u7814\u7a76\u4e00\u79cd\u89e3\u51b3\u65b9\u6848\u2014\u2014\u4f7f\u7528Infura RPC\u7aef\u70b9\u548cTruffle Box\u8fdb\u884c\u6784\u5efa\uff0c\u5e76\u65e0\u7f1d\u5730\u6865\u63a5\u8fd9\u4e9b\u7f51\u7edc\u3002\u5177\u4f53\u6765\u8bf4\uff0c \u5c06\u4f7f\u7528Optimism Bridge\u7684Truffle Box\u5728\u4ee5\u592a\u574aGoerli\u6d4b\u8bd5\u7f51\u4e0a\u521b\u5efa\u4e00\u4e2a\u9879\u76ee\uff0c\u5e76\u8fde\u63a5\u5230Optimism Goerli\u3002 &nbsp;<\/p>\n<h3>\u4f7f\u7528Infura\u548cTruffle Boxes\u8fd0\u884c\u591a\u94fedApp<\/h3>\n<h4>Truffle Boxes<\/h4>\n<p>\u4f5c\u4e3a\u793a\u4f8b\u89e3\u51b3\u65b9\u6848\u7684\u6838\u5fc3\uff0c\u5c06\u4f9d\u8d56\u4e8e\u6765\u81eaConsenSys\u7684\u201c\u5feb\u6377\u201d\u6837\u677f\u6587\u4ef6(\u4f8b\u5982\u5408\u7ea6\u3001\u5e93\u3001\u6a21\u5757\uff0c\u751a\u81f3\u662f\u529f\u80fd\u9f50\u5168\u7684dApp)\uff0c\u4f01\u4e1a\u53ef\u4ee5\u4f7f\u7528\u5b83\u4eec\u6765\u6784\u5efa\u81ea\u5df1\u7684dApp\u3002\u5bf9\u4e8e\u591a\u94fe\u89e3\u51b3\u65b9\u6848\uff0c\u5b83\u4eec\u6784\u5efa\u5728\u8bb8\u591aL2\u7f51\u7edc\u7684Infura RPC\u8282\u70b9\u4e4b\u4e0a\u3002<\/p>\n<p>\u5982\u4e0a\u6240\u8ff0\uff0c\u7279\u522b\u4f9d\u8d56Optimism Bridge\u7684Truffle Box\u3002Truffle Box\u5305\u542bL1\u548cL2\u4e0eOptimism Bridge\u4ea4\u4e92\u6240\u9700\u7684\u6240\u6709\u5408\u7ea6\uff0c\u4ee5\u53ca\u4e00\u7ec4\u7528\u4e8e\u5728\u5c42\u4e4b\u95f4\u90e8\u7f72\u3001\u8c03\u7528\u51fd\u6570\u548c\u4f20\u9012\u6d88\u606f\/\u503c\u7684\u8fc1\u79fb\u3002\u5b83\u751a\u81f3\u6709\u4e00\u4e2a\u8f85\u52a9\u811a\u672c\uff0c\u53ef\u4ee5\u5b8c\u6210\u9700\u8981\u7684\u6240\u6709\u64cd\u4f5c\u3002\u53ea\u9700\u8981\u6253\u5f00Truffle Box\u5c31\u80fd\u5f97\u5230\u9700\u8981\u7684\u4e00\u5207! Truffle Box\u5305\u62ec\uff1a <\/p>\n<ul>\n<li>\u901a\u8fc7Optimism Bridge\u53d1\u9001\u6d88\u606f\u7684L1\u5408\u7ea6\u3002<\/li>\n<li>\u4ece\u4ee5\u592a\u574a\u5411OptimismBridge\u53d1\u9001\u6d88\u606f\u7684\u8fc1\u79fb\u3002<\/li>\n<li>\u901a\u8fc7Optimism Bridge\u53d1\u9001\u6d88\u606f\u7684L2\u5408\u7ea6\u3002 &nbsp;<\/li>\n<li>\u4eceOptimismBridge\u5411\u4ee5\u592a\u574a\u53d1\u9001\u6d88\u606f\u7684\u8fc1\u79fb\u3002<\/li>\n<li>\u81ea\u52a8\u7f16\u8bd1\u5951\u7ea6\u3001\u8fd0\u884c\u8fc1\u79fb\u548c\u53d1\u9001\u6d88\u606f\u7684\u811a\u672c\u3002 &nbsp;<\/li>\n<li>\u901a\u8fc7Optimism Bridge\u81ea\u52a8\u53d1\u9001ETH\u548cDAO\u7684\u811a\u672c\u3002<\/li>\n<\/ul>\n<p>\u6ce8\uff1a\u6865\u63a5\uff08Bridge\uff09\u662f\u4e00\u79cd\u5de5\u5177\uff0c\u5141\u8bb8\u72ec\u7acb\u7684\u533a\u5757\u94fe\u5f7c\u6b64\u901a\u4fe1\uff0c\u5e76\u53d1\u9001\u4ee4\u724c\u3001NFT\u7b49\u3002<\/p>\n<h4>\u5148\u51b3\u6761\u4ef6<\/h4>\n<p>\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u9700\u8981\u5177\u5907\u4ee5\u4e0b\u5148\u51b3\u6761\u4ef6\uff1a<\/p>\n<ul>\n<li>Node.js\u53ca\u5176\u5305\u7ba1\u7406\u5668NPM\u3002<\/li>\n<\/ul>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u7ec8\u7aef\u547d\u4ee4\u9a8c\u8bc1\u5df2\u7ecf\u5b89\u88c5\u4e86Node.js: &nbsp;<\/p>\n<pre><span>node<\/span> <span style=\"color: #d73a49\">-<\/span><span>v<\/span> <span style=\"color: #d73a49\">&amp;&amp;<\/span> <span>npm<\/span> <span style=\"color: #d73a49\">-<\/span><span>v<\/span><\/pre>\n<ul>\n<li>Infura\u5e10\u6237 &nbsp;<\/li>\n<li>MetaMask\u8d26\u6237 &nbsp;<\/li>\n<li>\u57fa\u672c\u4e86\u89e3JavaScript\u548cSolidity &nbsp;<\/li>\n<\/ul>\n<h3>\u6b65\u9aa41\uff1a\u521b\u5efa\u7528\u4e8e\u8bbf\u95ee\u7f51\u7edc\u7684Infura\u5e10\u6237 &nbsp;<\/h3>\n<p>\u5728\u5b8c\u6210\u5148\u51b3\u6761\u4ef6\u540e\uff0c\u767b\u5f55Infura\u7f51\u7ad9\uff08\u6216\u6ce8\u518c\u65b0\u5e10\u6237\uff09\u3002<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<p>\u5728\u6210\u529f\u6ce8\u518c\u4e4b\u540e\uff0c\u9875\u9762\u91cd\u5b9a\u5411\u5230Infura\u4eea\u8868\u677f\uff0c\u5728\u90a3\u91cc\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684API\u5bc6\u94a5\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<p>\u70b9\u51fb\u201cCreate a New Key\u201d\u6309\u94ae\uff0c\u586b\u5199\u6240\u9700\u4fe1\u606f\u3002 &nbsp;<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<p>\u5728\u521b\u5efaAPI\u5bc6\u94a5\u540e\uff0c\u9879\u76eeID\u5c06\u663e\u793a\u5728\u4eea\u8868\u677f\u7684API key\u90e8\u5206\u4e0b\u9762\uff0c\u5982\u4e0b\u9762\u6240\u793a\u3002\u590d\u5236\u5e76\u4fdd\u5b58\u5728\u67d0\u4e2a\u5730\u65b9\uff0c\u5c06\u5728\u672c\u6559\u7a0b\u7684\u540e\u9762\u7528\u5230\u5b83\u3002<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<h3>\u6b65\u9aa42\uff1a\u8bbe\u7f6e\u548c\u5b89\u88c5 &nbsp;<\/h3>\n<p>\u63a5\u4e0b\u6765\uff0c\u5c06\u8bbe\u7f6eTruffle Optimism Bridge Box\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728\u9009\u62e9\u7684\u4efb\u4f55\u76ee\u5f55\u4e2d\u8fd0\u884cunbox\u547d\u4ee4\u3002<\/p>\n<pre><span>npx<\/span> <span>truffle<\/span> <span>unbox<\/span> <span>optimism<\/span><span style=\"color: #d73a49\">-<\/span><span>bridge<\/span> <span style=\"color: #d73a49\">&lt;<\/span><span>DIRECTORY_NAME<\/span><span style=\"color: #d73a49\">&gt;<\/span><\/pre>\n<p>\u7528\u9009\u62e9\u7684\u76ee\u5f55\u540d\u66ff\u6362&lt;DIRECTORY_NAME&gt;\u3002\u6216\u8005\uff0c\u53ef\u4ee5\u5168\u5c40\u5b89\u88c5Truffle\u5e76\u8fd0\u884cunbox\u547d\u4ee4\u3002<\/p>\n<pre><span>npm<\/span> <span>install<\/span> <span style=\"color: #d73a49\">-<\/span><span>g<\/span> <span>truffle<\/span><br><span>truffle<\/span> <span>unbox<\/span> <span>optimism<\/span><span style=\"color: #d73a49\">-<\/span><span>bridge<\/span> <span style=\"color: #d73a49\">&lt;<\/span><span>DIRECTORY_NAME<\/span><span style=\"color: #d73a49\">&gt;<\/span><\/pre>\n<p>\u8be5\u547d\u4ee4\u5e94\u8be5\u4e0b\u8f7d\u5e76\u8fd0\u884cnpminstall\u4f5c\u4e3aunbox\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\u3002<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<p>\u73b0\u5728\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5c06\u76ee\u5f55\u66f4\u6539\u4e3a\u521a\u521a\u521b\u5efa\u7684\u65b0\u76ee\u5f55\u3002<\/p>\n<pre><span>cd<\/span> <span>truffle<\/span><span style=\"color: #d73a49\">-<\/span><span>bridge<\/span><span style=\"color: #d73a49\">-<\/span><span>demo<\/span><\/pre>\n<p>\u6ce8\uff1atruffle-bridge-demo\u662f\u521b\u5efa\u7684\u76ee\u5f55\u7684\u540d\u79f0\u3002 &nbsp;<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<p>\u5e94\u8be5\u5f97\u5230\u7c7b\u4f3c\u4e8e\u4e0b\u9762\u6240\u793a\u7684\u7ed3\u679c\u3002<\/p>\n<p>.dotenv npm\u5305\u5df2\u7ecf\u5b89\u88c5\uff0c\u4f46\u662f\u9700\u8981\u5728\u5f00\u7bb1\u540e\u521b\u5efa\u7684.env\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e00\u4e9b\u4fe1\u606f\u3002truulu -config.ovm.js\u6587\u4ef6\u671f\u671b\u5728.env\u6587\u4ef6\u4e2d\u5b58\u5728\u4e00\u4e2aGOERLI_MNEMONIC\u503c\uff0c\u7528\u4e8e\u5728\u4ee5\u592a\u574aGoerli\u548cOptimism Goerli\u6d4b\u8bd5\u7f51\u4e0a\u8fd0\u884c\u547d\u4ee4\uff0c\u5e76\u671f\u671bINFURA_KEY\u8fde\u63a5\u5230\u7f51\u7edc\u3002<\/p>\n<pre><span>GOERLI_MNEMONIC<\/span><span style=\"color: #d73a49\">=<\/span><span style=\"color: #690\">\"&lt;your-wallet-mnemonic&gt;\"<\/span><br><span>INFURA_KEY<\/span><span style=\"color: #d73a49\">=<\/span><span style=\"color: #690\">\"&lt;your-infura-key&gt;\"<\/span><\/pre>\n<p>\u5c06&lt;your-infura-key&gt;\u66ff\u6362\u4e3a\u4e4b\u524d\u4eceInfura\u4eea\u8868\u677f\u4e2d\u83b7\u5f97\u7684\u4fe1\u606f\u3002\u3010\u6ce8\u610f\uff1a\u6c38\u8fdc\u4e0d\u8981\u4e0e\u4efb\u4f55\u4eba\u5206\u4eab\u79c1\u94a5(\u52a9\u8bb0\u7b26)\uff0c\u5e76\u59a5\u5584\u4fdd\u7ba1\u3011\u3002\u5c06&lt;your-wallet-mnemonic&gt;\u66ff\u6362\u4e3a\u52a9\u8bb0\u7b26\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<p>\u8981\u4eceMetamask\u4e2d\u68c0\u7d22\u52a9\u8bb0\u7b26\uff0c\u5355\u51fbMetamask\u4e0a\u6240\u793a\u7684\u56fe\u6807\u3002<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u5355\u51fbExport Private Key\u6309\u94ae\u590d\u5236\u52a9\u8bb0\u7b26\u3002<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<p>Git\u5ffd\u7565\u4e86\u8fd9\u4e2a\u9879\u76ee\u4e2d\u7684.env\u6587\u4ef6\uff0c\u4ee5\u5e2e\u52a9\u4fdd\u62a4\u79c1\u6709\u6570\u636e\u3002\u907f\u514d\u5c06\u79c1\u94a5\u6cc4\u9732\u7ed9GitHub\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u5b89\u5168\u5b9e\u8df5\u3002<\/p>\n<h3>\u6b65\u9aa43\uff1a\u4f7f\u7528Truffle L2 Boxes\u6865\u63a5<\/h3>\n<p>\u5f53\u6253\u5f00\u9879\u76ee\u7684\u76d2\u5b50\u65f6\uff0c\u521b\u5efa\u4e86\u9879\u76ee\u7684\u6240\u6709\u5fc5\u8981\u5408\u540c\u548c\u811a\u672c\u3002\u5728\u4e0b\u4e00\u6b65\u4e2d\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5404\u4e2a\u5408\u7ea6\u548c\u8fc1\u79fb\uff0c\u4ee5\u7406\u89e3\u6865\u63a5\u548c\u4ea4\u4e92\u662f\u5982\u4f55\u5728\u7f51\u7edc\u4e4b\u95f4\u53d1\u751f\u7684\u3002<\/p>\n<p>\u5408\u7ea6contract\/ethereum\/GreeterL1.sol\u5c55\u793a\u4e86\u5982\u4f55\u901a\u8fc7Optimism&nbsp;bridge\u5c06\u6d88\u606f\u4eceL1\u53d1\u9001\u5230L2\u3002<\/p>\n<pre><span style=\"color: #6a737d\">\/\/SPDX-License-Identifier: Unlicense<\/span><br><span style=\"color: #6a737d\">\/\/ This contract runs on L1, and controls a Greeter on L2.<\/span><br><span>pragma<\/span> <span>solidity<\/span> <span style=\"color: #d73a49\">^<\/span><span style=\"color: #005cc5\">0.8<\/span><span style=\"color: #005cc5\">.0<\/span>;<br><span style=\"color: #d73a49\">import<\/span> { <span style=\"color: #005cc5\">ICrossDomainMessenger<\/span> } <span style=\"color: #d73a49\">from<\/span><br>    <span style=\"color: #690\">\"@eth-optimism\/contracts\/libraries\/bridge\/ICrossDomainMessenger.sol\"<\/span>;<br><span>contract<\/span> <span>GreeterL1<\/span> {<br>    <span>address<\/span> <span>crossDomainMessengerAddr<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #005cc5\">0x5086d1eEF304eb5284A0f6720f79403b4e9bE294<\/span>;<br>    <span>address<\/span> <span>greeterL2Addr<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #005cc5\">0xC0836cCc8FBa87637e782Dde6e6572aD624fb984<\/span>;<br>    <span style=\"color: #d73a49\">function<\/span> <span style=\"color: #005cc5\">setGreeting<\/span>(<span style=\"color: #005cc5\">string<\/span> <span>calldata<\/span> <span>_greeting<\/span>) <span>public<\/span> {<br>        <span>bytes<\/span> <span>memory<\/span> <span>message<\/span>;<br>        <span>message<\/span> <span style=\"color: #d73a49\">=<\/span> <span>abi<\/span>.<span style=\"color: #005cc5\">encodeWithSignature<\/span>(<span style=\"color: #690\">\"setGreeting(string)\"<\/span>,<br>            <span>_greeting<\/span>);<br>        <span>ICrossDomainMessenger<\/span>(<span>crossDomainMessengerAddr<\/span>).<span style=\"color: #005cc5\">sendMessage<\/span>(<br>            <span>greeterL2Addr<\/span>,<br>            <span>message<\/span>,<br>            <span style=\"color: #005cc5\">1000000<\/span>   <span style=\"color: #6a737d\">\/\/ within the free gas limit amount<\/span><br>        );<br>    }      <span style=\"color: #6a737d\">\/\/ function setGreeting<\/span><br>}          <span style=\"color: #6a737d\">\/\/ contract GreeterL1<\/span><\/pre>\n<p>\u8fc1\u79fbmigrations\/3_set_L2_greeting.js\u4f7f\u7528\u4e0a\u9762\u7684\u5408\u7ea6\u4ece\u4ee5\u592a\u574a\u53d1\u9001\u6d88\u606f\u7ed9optimistic\u3002<\/p>\n<pre><span style=\"color: #d73a49\">var<\/span> <span style=\"color: #005cc5\">Greeter<\/span> <span style=\"color: #d73a49\">=<\/span> <span>artifacts<\/span>.<span style=\"color: #005cc5\">require<\/span>(<span style=\"color: #690\">\"GreeterL1\"<\/span>);<br><span style=\"color: #6a737d\">\/**<\/span><br><span style=\"color: #6a737d\"> * Set L2 Greeting<\/span><br><span style=\"color: #6a737d\"> * Run this migration on L1 to update the L1 greeting.<\/span><br><span style=\"color: #6a737d\"> *\/<\/span><br><span>module<\/span>.<span style=\"color: #005cc5\">exports<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #d73a49\">async<\/span> <span style=\"color: #d73a49\">function<\/span> (<span style=\"color: #005cc5\">deployer<\/span>) {<br>  <span>console<\/span>.<span style=\"color: #005cc5\">log<\/span>(<span style=\"color: #690\">\"Updating the L2 Greetings contract from L1!\"<\/span>);<br>  <span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">instance<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #d73a49\">await<\/span> <span>Greeter<\/span>.<span style=\"color: #005cc5\">deployed<\/span>();<br>  <span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">tx<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #d73a49\">await<\/span> <span style=\"color: #005cc5\">instance<\/span>.<span style=\"color: #005cc5\">setGreeting<\/span>(<span style=\"color: #690\">\"Greetings from Truffle!\"<\/span>);<br>  <span>console<\/span>.<span style=\"color: #005cc5\">log<\/span>(<span style=\"color: #690\">`Greeter txn confirmed on L1! ${<\/span><span style=\"color: #005cc5\">tx<\/span>.<span style=\"color: #005cc5\">receipt<\/span>.<span style=\"color: #005cc5\">transactionHash<\/span><span style=\"color: #690\">}<\/span><span style=\"color: #690\">`<\/span>);<br>  <span>console<\/span>.<span style=\"color: #005cc5\">log<\/span>(<span style=\"color: #690\">`Bridging message to L2 Greeter contract...`<\/span>);<br>  <span>console<\/span>.<span style=\"color: #005cc5\">log<\/span>(<br>    <span style=\"color: #690\">`In about 1 minute, check the Greeter contract \"read\" function: https:\/\/goerli-optimism.etherscan.io\/address\/0xC0836cCc8FBa87637e782Dde6e6572aD624fb984#readContract`<\/span><br>  );<br>};<\/pre>\n<p>\u63a5\u4e0b\u6765\uff0ccontracts\/optimism\/GreeterL2.sol\u5408\u7ea6\u901a\u8fc7Optimism bridge\u5411\u53e6\u4e00\u4e2a\u65b9\u5411\uff08L2-&gt;L1\uff09\u53d1\u9001\u6d88\u606f\u3002<\/p>\n<pre><span style=\"color: #690\">\/SPDX-License-Identifier: Unlicense<\/span><br><span style=\"color: #6a737d\">\/\/ This contract runs on L2, and controls a Greeter on L1.<\/span><br><span>pragma<\/span> <span>solidity<\/span> <span style=\"color: #d73a49\">^<\/span><span style=\"color: #005cc5\">0.8<\/span><span style=\"color: #005cc5\">.0<\/span>;<br><span style=\"color: #d73a49\">import<\/span> { <span style=\"color: #005cc5\">ICrossDomainMessenger<\/span> } <span style=\"color: #d73a49\">from<\/span><br>    <span style=\"color: #690\">\"@eth-optimism\/contracts\/libraries\/bridge\/ICrossDomainMessenger.sol\"<\/span>;<br><span>contract<\/span> <span>GreeterL2<\/span> {<br>    <span>address<\/span> <span>crossDomainMessengerAddr<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #005cc5\">0x4200000000000000000000000000000000000007<\/span>;<br>    <span>address<\/span> <span>greeterL1Addr<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #005cc5\">0x7fA4D972bB15B71358da2D937E4A830A9084cf2e<\/span>;<br>    <span style=\"color: #d73a49\">function<\/span> <span style=\"color: #005cc5\">setGreeting<\/span>(<span style=\"color: #005cc5\">string<\/span> <span>calldata<\/span> <span>_greeting<\/span>) <span>public<\/span> {<br>        <span>bytes<\/span> <span>memory<\/span> <span>message<\/span>;<br>        <span>message<\/span> <span style=\"color: #d73a49\">=<\/span> <span>abi<\/span>.<span style=\"color: #005cc5\">encodeWithSignature<\/span>(<span style=\"color: #690\">\"setGreeting(string)\"<\/span>,<br>            <span>_greeting<\/span>);<br>        <span>ICrossDomainMessenger<\/span>(<span>crossDomainMessengerAddr<\/span>).<span style=\"color: #005cc5\">sendMessage<\/span>(<br>            <span>greeterL1Addr<\/span>,<br>            <span>message<\/span>,<br>            <span style=\"color: #005cc5\">1000000<\/span>   <span style=\"color: #6a737d\">\/\/ irrelevant here<\/span><br>        );<br>    }      <span style=\"color: #6a737d\">\/\/ function setGreeting<\/span><br>}          <span style=\"color: #6a737d\">\/\/ contract GreeterL2<\/span><\/pre>\n<p>\u8fc1\u79fbmigrations\/4_set_L1_greeting.js\u4f7f\u7528\u4e0a\u8ff0\u5408\u7ea6\u5c06\u6d88\u606f\u4eceOptimism\u53d1\u9001\u5230\u4ee5\u592a\u574a\u3002<\/p>\n<pre><span>require<\/span>(<span style=\"color: #690\">\"dotenv\"<\/span>).<span style=\"color: #005cc5\">config<\/span>();<br><span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">sdk<\/span> <span style=\"color: #d73a49\">=<\/span> <span>require<\/span>(<span style=\"color: #690\">\"@eth-optimism\/sdk\"<\/span>);<br><span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">ethers<\/span> <span style=\"color: #d73a49\">=<\/span> <span>require<\/span>(<span style=\"color: #690\">\"ethers\"<\/span>);<br><span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">Greeter<\/span> <span style=\"color: #d73a49\">=<\/span> <span>artifacts<\/span>.<span style=\"color: #005cc5\">require<\/span>(<span style=\"color: #690\">\"GreeterL2\"<\/span>);<br><span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">goerliMnemonic<\/span> <span style=\"color: #d73a49\">=<\/span> <span>process<\/span>.<span style=\"color: #005cc5\">env<\/span>[<span style=\"color: #690\">\"GOERLI_MNEMONIC\"<\/span>];<br><span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">infuraKey<\/span> <span style=\"color: #d73a49\">=<\/span> <span>process<\/span>.<span style=\"color: #005cc5\">env<\/span>[<span style=\"color: #690\">\"INFURA_KEY\"<\/span>];<br><span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">sleep<\/span> <span style=\"color: #d73a49\">=<\/span> (<span style=\"color: #005cc5\">milliseconds<\/span>) <span style=\"color: #d73a49\">=&gt;<\/span> {<br>  <span style=\"color: #d73a49\">return<\/span> <span style=\"color: #d73a49\">new<\/span> <span>Promise<\/span>((<span style=\"color: #005cc5\">resolve<\/span>) <span style=\"color: #d73a49\">=&gt;<\/span> <span>setTimeout<\/span>(<span style=\"color: #005cc5\">resolve<\/span>, <span style=\"color: #005cc5\">milliseconds<\/span>));<br>};<br><span style=\"color: #6a737d\">\/**<\/span><br><span style=\"color: #6a737d\"> * Set L1 Greeting<\/span><br><span style=\"color: #6a737d\"> * Run this migration on L1 to update the L1 greeting.<\/span><br><span style=\"color: #6a737d\"> *\/<\/span><br><span>module<\/span>.<span style=\"color: #005cc5\">exports<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #d73a49\">async<\/span> <span style=\"color: #d73a49\">function<\/span> (<span style=\"color: #005cc5\">deployer<\/span>) {<br>  <span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">newGreeting<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #690\">\"Greetings from Truffle!\"<\/span>; <span style=\"color: #6a737d\">\/\/&lt;---- CHANGE THIS VALUE TO YOUR NAME!!!<\/span><br>  <span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">instance<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #d73a49\">await<\/span> <span>Greeter<\/span>.<span style=\"color: #005cc5\">deployed<\/span>();<br>  <span>console<\/span>.<span style=\"color: #005cc5\">log<\/span>(<span style=\"color: #690\">\"Updating the L1 Greetings contract from L2!\"<\/span>);<br>  <span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">tx<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #d73a49\">await<\/span> <span style=\"color: #005cc5\">instance<\/span>.<span style=\"color: #005cc5\">setGreeting<\/span>(<span style=\"color: #005cc5\">newGreeting<\/span>);<br>  <span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">txHash<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #005cc5\">tx<\/span>.<span style=\"color: #005cc5\">receipt<\/span>.<span style=\"color: #005cc5\">transactionHash<\/span>;<br>  <span>console<\/span>.<span style=\"color: #005cc5\">log<\/span>(<span style=\"color: #690\">`Greeter txn confirmed on L2! ${<\/span><span style=\"color: #005cc5\">txHash<\/span><span style=\"color: #690\">}<\/span><span style=\"color: #690\">`<\/span>);<br>  <span>console<\/span>.<span style=\"color: #005cc5\">log<\/span>(<br>    <span style=\"color: #690\">`Bridging message to L1 Greeter contract.\\n This will take at least 1-5 min...`<\/span><br>  );<br>  <span style=\"color: #6a737d\">\/\/ Set providers for Optimism sdk<\/span><br>  <span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">l1Provider<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #d73a49\">new<\/span> <span>ethers<\/span>.<span style=\"color: #005cc5\">providers<\/span>.<span style=\"color: #005cc5\">JsonRpcProvider<\/span>(<br>    <span style=\"color: #690\">\"https:\/\/goerli.infura.io\/v3\/\"<\/span> <span style=\"color: #d73a49\">+<\/span> <span>infuraKey<\/span><br>  );<br>  <span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">l2Provider<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #d73a49\">new<\/span> <span>ethers<\/span>.<span style=\"color: #005cc5\">providers<\/span>.<span style=\"color: #005cc5\">JsonRpcProvider<\/span>(<br>    <span style=\"color: #690\">\"https:\/\/optimism-goerli.infura.io\/v3\/\"<\/span> <span style=\"color: #d73a49\">+<\/span> <span>infuraKey<\/span><br>  );<br>  <span style=\"color: #6a737d\">\/\/ Connect an L1 signer<\/span><br>  <span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">wallet<\/span> <span style=\"color: #d73a49\">=<\/span> <span>ethers<\/span>.<span style=\"color: #005cc5\">Wallet<\/span>.<span style=\"color: #005cc5\">fromMnemonic<\/span>(<span>goerliMnemonic<\/span>);<br>  <span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">l1Signer<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #005cc5\">wallet<\/span>.<span style=\"color: #005cc5\">connect<\/span>(<span style=\"color: #005cc5\">l1Provider<\/span>);<br>  <span style=\"color: #6a737d\">\/\/ Initialize sdk messenger<\/span><br>  <span style=\"color: #d73a49\">const<\/span> <span style=\"color: #005cc5\">crossChainMessenger<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #d73a49\">new<\/span> <span>sdk<\/span>.<span style=\"color: #005cc5\">CrossChainMessenger<\/span>({<br>    <span style=\"color: #005cc5\">l1ChainId<\/span>: <span style=\"color: #005cc5\">5<\/span>,<br>    <span style=\"color: #005cc5\">l2ChainId<\/span>: <span style=\"color: #005cc5\">420<\/span>,<br>    <span style=\"color: #005cc5\">l1SignerOrProvider<\/span>: <span style=\"color: #005cc5\">l1Signer<\/span>,<br>    <span style=\"color: #005cc5\">l2SignerOrProvider<\/span>: <span style=\"color: #005cc5\">l2Provider<\/span>,<br>  });<br>  <span style=\"color: #d73a49\">let<\/span> <span style=\"color: #005cc5\">statusReady<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #905\">false<\/span>;<br>  <span style=\"color: #6a737d\">\/\/ Sleep for 1 min during L2 -&gt; L1 bridging<\/span><br>  <span style=\"color: #d73a49\">await<\/span> <span>sleep<\/span>(<span style=\"color: #005cc5\">60000<\/span>); <span style=\"color: #6a737d\">\/\/ 60 seconds<\/span><br>  <span style=\"color: #6a737d\">\/\/ Poll the L1 msg status<\/span><br>  <span style=\"color: #d73a49\">while<\/span> (<span style=\"color: #d73a49\">!<\/span><span style=\"color: #005cc5\">statusReady<\/span>) {<br>    <span style=\"color: #d73a49\">let<\/span> <span style=\"color: #005cc5\">status<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #905\">null<\/span>;<br>    <span style=\"color: #005cc5\">status<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #d73a49\">await<\/span> <span style=\"color: #005cc5\">crossChainMessenger<\/span>.<span style=\"color: #005cc5\">getMessageStatus<\/span>(<span style=\"color: #005cc5\">txHash<\/span>);<br>    <span style=\"color: #005cc5\">statusReady<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #005cc5\">status<\/span> <span style=\"color: #d73a49\">==<\/span> <span>sdk<\/span>.<span style=\"color: #005cc5\">MessageStatus<\/span>.<span style=\"color: #005cc5\">READY_FOR_RELAY<\/span>;<br>    <span style=\"color: #d73a49\">if<\/span> (<span style=\"color: #d73a49\">!<\/span><span style=\"color: #005cc5\">statusReady<\/span>) {<br>      <span>console<\/span>.<span style=\"color: #005cc5\">log<\/span>(<br>        <span style=\"color: #690\">\"Message not yet received on L1.\\n Retrying in 10 seconds...\"<\/span><br>      );<br>      <span style=\"color: #d73a49\">await<\/span> <span>sleep<\/span>(<span style=\"color: #005cc5\">10000<\/span>); <span style=\"color: #6a737d\">\/\/ 10 seconds<\/span><br>    }<br>  }<br>  <span>console<\/span>.<span style=\"color: #005cc5\">log<\/span>(<span style=\"color: #690\">\"Message received! Finalizing...\"<\/span>);<br>  <span style=\"color: #6a737d\">\/\/ Open the message on L1<\/span><br>  <span>finalize<\/span> <span style=\"color: #d73a49\">=<\/span> <span style=\"color: #d73a49\">await<\/span> <span style=\"color: #005cc5\">crossChainMessenger<\/span>.<span style=\"color: #005cc5\">finalizeMessage<\/span>(<span style=\"color: #005cc5\">txHash<\/span>);<br>  <span>console<\/span>.<span style=\"color: #005cc5\">log<\/span>(<br>    <span style=\"color: #690\">`Message finalized. Check the L1 Greeter contract \"read\" function: https:\/\/goerli.etherscan.io\/address\/0x7fA4D972bB15B71358da2D937E4A830A9084cf2e#readContract`<\/span><br>  );<br>};<\/pre>\n<p>\u5728\u811a\u672c\u76ee\u5f55\u4e2d\uff0c\u8fd8\u6709goerli_bridge_message.mjs\u548cgoerli_bridge_value.js\u6765\u81ea\u52a8\u5316\u7f16\u8bd1\u5408\u7ea6\u3001\u8fd0\u884c\u8fc1\u79fb\u548c\u53d1\u9001\u6d88\u606f\u7684\u8fc7\u7a0b\u3002<\/p>\n<h3>\u6b65\u9aa44\uff1a\u5b8c\u6210Ethereum Goerli\u548cOptimism Goerli\u4e4b\u95f4\u7684\u5408\u7ea6\u7f16\u8bd1\u3001\u8fc1\u79fb\u548c\u6865\u63a5<\/h3>\n<p>\u63a5\u4e0b\u6765\uff0c\u5c06\u628a\u5408\u7ea6\u90e8\u7f72\u5230Goerli\u3002\u52a9\u624b\u811a\u672c\u4fc3\u8fdb\u4e86Ethereum Goerli\u548cOptimism Goerli\u4e4b\u95f4\u7684\u7f16\u8bd1\u3001\u8fc1\u79fb\u548c\u6865\u63a5\u6d88\u606f\u3002\u5728\u8fd9\u4e9b\u7f51\u7edc\u4e0a\uff0c\u9700\u8981\u6d4b\u8bd5\u7f51ETH\u6765\u4f7f\u7528\u5b83\u3002\u8fd8\u9700\u8981\u5c06Optimism\u63d2\u4ef6\u6dfb\u52a0\u5230Infura\u5e10\u6237\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u5c06\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u542f\u52a8\u9879\u76ee\u3002<\/p>\n<pre><span>npm<\/span> <span>run<\/span> <span>deploy<\/span><\/pre>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2aURL\uff0c\u7528\u4e8e\u5728\u5b8c\u6210\u8fc1\u79fb\u540e\u786e\u8ba4(\u901a\u8fc7Etherscan)\u6865\u63a5\u6d88\u606f\u3002<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<p>\u5728\u7b2c\u56db\u6b21\u8fc1\u79fb\u5b8c\u6210\u540e\uff0c\u5c06\u63d0\u4f9b\u4e00\u4e2a\u901a\u8fc7Etherscan\u786e\u8ba4\u6865\u63a5\u6d88\u606f\u7684\u94fe\u63a5\u3002<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<h3>\u6b65\u9aa45\uff1a\u7528\u5757\u8d44\u6e90\u7ba1\u7406\u5668\u5728Goerli\u6d4b\u8bd5\u7f51\u4e0a\u9a8c\u8bc1\u9879\u76ee\u662f\u5426\u6210\u529f<\/h3>\n<p>\u5df2\u7ecf\u6210\u529f\u5730\u8bbe\u7f6e\u3001\u5b89\u88c5\u3001\u6784\u5efa\u3001\u90e8\u7f72\u4e86\u524d\u9762\u6253\u5f00\u7684\u9879\u76ee\u3002\u63a5\u4e0b\u6765\uff0c\u5c06\u5728Goerli Ethereum\u6d4b\u8bd5\u7f51\u4e0a\u9a8c\u8bc1\u8be5\u9879\u76ee\u3002<\/p>\n<p>\u8f6c\u5230Goerli Etherscan\u5757\u8d44\u6e90\u7ba1\u7406\u5668\uff0c\u5e76\u7c98\u8d34txn\u5730\u5740<\/p>\n<p>0xbcc1746a9ebbfcfb71665225c1a353a8c8dc9a1aa528a3babcb5b046d615a353\uff0c\u8be5\u5730\u5740\u5728\u90e8\u7f72\u65f6\u5728CLI\u4e0a\u663e\u793a\u3002<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<p style=\"text-align: center\">\n<p style=\"text-align:center\">\n<\/p>\n<p>\u200b\u200bhttps:\/\/goerli-optimism.etherscan.io\/tx\/0xbcc1746a9ebbfcfb71665225c1a353a8c8dc9a1aa528a3babcb5b046d615a353\u200b\u200b<\/p>\n<h3>\u7ed3\u8bba<\/h3>\n<p>\u5982\u679c\u5e0c\u671b\u7528\u6237\u548c\u5f00\u53d1\u4eba\u5458\u7684\u4f53\u9a8c\u6301\u7eed\u6539\u5584\uff0c\u90a3\u4e48\u591a\u94feWeb3\u4e16\u754c\u662f\u81f3\u5173\u91cd\u8981\u7684\u3002\u4e3a\u4e86\u5b9e\u73b0\u8fd9\u4e00\u70b9\uff0c\u9700\u8981\u8ba9dApp\u5728\u533a\u5757\u94fe\u4e4b\u95f4\u5feb\u901f\u65e0\u7f1d\u5730\u901a\u4fe1\u3002\u5e0c\u671b\u4f7f\u7528Optimism Bridge Truffle Box\u7684\u4f8b\u5b50\u80fd\u7ed9\u4e00\u4e2a\u76f8\u5bf9\u7b80\u5355\u5feb\u901f\u7684\u5165\u95e8\u65b9\u6cd5\u3002\u8981\u4e86\u89e3\u66f4\u591a\u4fe1\u606f\uff0c\u53ef\u4ee5\u67e5\u770b\u5b98\u65b9\u6587\u6863\u3002<\/p>\n<p><strong>\u539f\u6587\u6807\u9898\uff1a<\/strong>\u200b\u200b<strong>Using Truffle L2 Boxes to Bridge Blockchain Networks<\/strong>\u200b\u200b<strong>\uff0c\u4f5c\u8005\uff1aJohn Vester<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8bd1\u8005 | \u674e\u777f \u5ba1\u6821 | \u5b59\u6dd1\u5a1f \u4f17\u6240\u5468\u77e5\uff0c\u8bb8\u591a\u533a\u5757\u94fe\u90fd\u5b58\u5728\u53ef\u6269\u5c55\u6027\u548c\u62e5\u585e\u95ee\u9898\u3002\u8fd9\u4e9b\u95ee\u9898\u6709\u5e7f\u6cdb\u7684\u5f71\u54cd\uff0c\u4ece\u4ea4\u6613\u65f6 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":244836,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[200988],"tags":[],"class_list":["post-244835","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-200988"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/244835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=244835"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/244835\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media\/244836"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=244835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=244835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=244835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}