From f944b8fcf3d52001615da6371b48afc5c345c77c Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Thu, 15 Feb 2024 13:40:30 +0800 Subject: [PATCH 01/58] Translate README.md to Chinese --- .idea/.gitignore | 5 +++++ .idea/modules.xml | 8 ++++++++ .idea/v3-docs.iml | 12 ++++++++++++ .idea/vcs.xml | 6 ++++++ README.md | 24 ++++++++++++------------ 5 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/modules.xml create mode 100644 .idea/v3-docs.iml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..b58b603f --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..bc40d3d2 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/v3-docs.iml b/.idea/v3-docs.iml new file mode 100644 index 00000000..24643cc3 --- /dev/null +++ b/.idea/v3-docs.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 952f9def..dc9e4d14 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,36 @@ -# Website +# 网站 -This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website generator. +该网站使用现代静态网站生成器[Docusaurus 3](https://docusaurus.io/)制作。 -## Generated Content +## 生成的内容 -The `static` directory includes generated content. Please ask @yorhodes for assistance if you need to update this content. +`static`目录包含生成的内容。如果需要更新此内容,请询问 @yorhodes 寻求帮助。 -Most of this is simply serialized content from `@hyperlane-xyz` NPM packages (see `devDependencies`). Eventually this should be part of the build process. +其中大部分来自 `@hyperlane-xyz` NPM 包的序列化内容(请参见`devDependencies`)。最终,这将成为构建过程的一部分。 -### Installation +### 安装 ``` $ yarn ``` -### Local Development +### 本地开发 ``` $ yarn start ``` -This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. +该命令启动本地开发服务器并打开浏览器窗口。大多数更改都会实时反映,而无需重启服务器。 -### Build +### 构建 ``` $ yarn build ``` -This command generates static content into the `build` directory and can be served using any static contents hosting service. +该命令可在 `build` 目录中生成静态内容,并可使用任何静态内容托管服务进行托管。 -### Deployment +### 部署 -Vercel Github Action is used to deploy the website. The action is triggered on every push to the `main` branch. +使用 Vercel Github Action 来部署网站。该操作在每次推送到`main`分支时触发。 From ddaac5f2c1a5c7ddf91213bddb4137a4d515c4a1 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Thu, 15 Feb 2024 14:03:37 +0800 Subject: [PATCH 02/58] Translate your-first-message.mdx to Chinese --- docs/your-first-message.mdx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/your-first-message.mdx b/docs/your-first-message.mdx index b3a51f6b..0f979de1 100644 --- a/docs/your-first-message.mdx +++ b/docs/your-first-message.mdx @@ -8,23 +8,23 @@ import { } from "@site/src/components/AddressTable"; import MessageQuickstart from "@site/src/components/MessageQuickstart"; -# Send your first interchain message +# 发送您的第一条链间消息 -This tutorial demonstrates how to [send](./reference/messaging/send.mdx) an interchain message to a pre-deployed `TestRecipient` contract. +本教程演示如何 [发送](./reference/messaging/send.mdx)链间消息到预先部署的 "TestRecipient "合约。 -Sending a message is a simple matter of calling `Mailbox.dispatch`. Make sure you have an account with funds on the origin chain. +发送信息只需调用 `Mailbox.dispatch`方法。请确保您的账户在原始链上有资金。 -:::tip -You can watch the progress of your message on [explorer.hyperlane.xyz](https://explorer.hyperlane.xyz/) by searching for the **transaction hash** of your `Mailbox.dispatch` call. +:::提示 +你可以在[explorer.hyperlane.xyz](https://explorer.hyperlane.xyz/)上通过搜索你的`Mailbox.dispatch`调用的**transaction hash**来查看消息的进度。 ::: -## Check the result +## 查看结果 -The `TestRecipient` has the following [handle](./reference/messaging/receive.mdx) implementation: +`TestRecipient`具有以下处理[handle](./reference/messaging/receive.mdx)实现: @@ -35,12 +35,12 @@ The `TestRecipient` has the following [handle](./reference/messaging/receive.mdx -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 -Check the logs to see your message delivery! +查看日志,了解信息的发送情况!git
Testnet `TestRecipient` Addresses From a8643f3d535c544f1cb16830d7ae4b676819c60b Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Thu, 15 Feb 2024 14:20:38 +0800 Subject: [PATCH 03/58] intro.mdx to Chinese --- docs/intro.mdx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/intro.mdx b/docs/intro.mdx index 0ec7df38..c2dedd81 100644 --- a/docs/intro.mdx +++ b/docs/intro.mdx @@ -1,15 +1,15 @@ -# Choosing Hyperlane +# 选择Hyperlane -Hyperlane is the first universal and permissionless interoperability layer built for the modular blockchain stack. +Hyperlane是为模块化区块链堆栈构建的第一个通用且无需许可的互操作层。 -Anyone can permissionlessly [deploy hyperlane](./deploy-hyperlane.mdx) to any blockchain environment, whether it is a layer 1, rollup, or app-chain, allowing that chain to communicate seamlessly with any other chain on which Hyperlane has been deployed. +任何人都可以无需许可地将[部署 hyperlane](./deploy-hyperlane.mdx)到任何区块链环境中,无论是1层、Rollup还是应用链,都可以让该链与部署了 Hyperlane 的任何其他链进行无缝通信。 -Hyperlane is designed with modularity in mind. Notably, its [interchain security modules](./protocol/ISM/modular-security.mdx) give developers control over their security model, allowing them to configure, compose, and customize security according to the needs of their application. +Hyperlane的设计考虑到了模块化。特别是,其[跨链安全模块](./protocol/ISM/modular-security.mdx)使开发人员能够控制其安全模型,允许他们根据应用程序的需求配置、组合和定制安全性。 -Using Hyperlane, developers can build Interchain Applications - apps that span multiple blockchains. We have implementations for many execution environments and are compatible with all leading rollup frameworks. +使用 Hyperlane,开发人员可以构建跨链应用程序--跨越多个区块链的应用程序。我们拥有适用于多种执行环境的实施方案,并与所有领先的rollup框架兼容。 -Some pre-built examples that can be deployed out of the box include: +开箱即用的一些预构建示例包括: -1. Warp Routes, which allow native, `ERC20`, and `ERC721` tokens to move seamlessly across chains -2. Interchain accounts, which allows an account on one chain (e.g. a DAO) to make smart contract calls on remote chains -3. Interchain queries, which allow an account on one chain to make view calls on remote chains \ No newline at end of file +1. Warp Routes, 允许原生、ERC20和ERC721代币在链之间无缝移动 +2. Interchain accounts, 允许一个链上的账户(例如DAO)在远程链上调用智能合约 +3. Interchain queries, 允许一个链上的账户在远程链上进行视图调用 \ No newline at end of file From 4bb4d755ae0aabdda99aa7d5fb266c99a7b4209b Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Thu, 15 Feb 2024 15:28:30 +0800 Subject: [PATCH 04/58] faq.mdx to Chinese --- docs/faq.mdx | 66 ++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 35 deletions(-) diff --git a/docs/faq.mdx b/docs/faq.mdx index ecab3867..eaeb1570 100644 --- a/docs/faq.mdx +++ b/docs/faq.mdx @@ -1,96 +1,92 @@ -# Frequently Asked Questions +# 常见问答
- **What is Hyperlane?** + **Hyperlane 是什么?**
-
Hyperlane is the first universal and permissionless interoperability framework built for the modular blockchain stack. -Anyone can [Deploy Hyperlane](./deploy-hyperlane.mdx) to any blockchain environment, whether it is a layer 1, rollup, or app-chain, allowing that chain to communicate seamlessly with any other chain on which Hyperlane has been deployed.
+
Hyperlane是为模块化区块链堆栈构建的第一个通用且无需许可的互操作层。任何人都可以无需许可地将[部署 hyperlane](./deploy-hyperlane.mdx)到任何区块链环境中,无论是1层、Rollup还是应用链,都可以让该链与部署了 Hyperlane 的任何其他链进行无缝通信。
- **What are the benefits of using Hyperlane for blockchain developers?** + **区块链开发者使用Hyperlane有什么好处?**
-
Hyperlane offers benefits for both blockchain and dapp developers. -For blockchain developers, a Hyperlane deployment expands accessibility to users, assets, and valuable state from other connected blockchains on which Hyperlane has been deployed. -For dapp developers, Hyperlane provides seamless connectivity across multiple blockchains, allowing developers to create interchain network effects and liquidity and users to interact with applications from their preferred chain.
+
Hyperlane为区块链和应用程序开发者都带来了好处。对于区块链开发者来说,Hyperlane的部署扩大了从其他已部署Hyperlane的区块链获取用户、资产和有价值状态的可能性。对于dapp开发者来说,Hyperlane提供了跨多个区块链的无缝连接,允许开发者创建跨链网络效应和流动性,用户能够从他们偏好的链上与应用程序进行交互。
- **How is Hyperlane secured?** + **Hyperlane如何确保安全?**
-
Hyperlane is secured by its modular security stack featuring Interchain Security Modules (ISMs). Developers can configure various pre-built ISMs, compose them with each other, or even create custom ISMs based on their application's needs. -A modular approach to security ensures that Hyperlane will continue to stay up to the latest industry advances in security models.
+
Hyperlane通过其模块化安全堆栈(具有链间安全模块(ISM))来确保安全。开发人员可以配置各种预置的 ISM,将它们相互组合,甚至根据应用程序的需要创建自定义的ISM。模块化的安全方法确保了Hyperlane在安全模型方面不断跟上行业的最新发展。
- **Who are the Hyperlane validators?** + **谁是 Hyperlane 验证者?**
-
Hyperlane is secured with a modular security stack featuring ISMs. There is no protocol-enshrined security model, let alone validator set. That said, most Hyperlane deployments are configured with a Default ISM, which specifies the security model to use if the message recipient has not specified an ISM override.
+
Hyperlane采用以ISM为特色的模块化安全堆栈来确保安全。没有协议规定的安全模型,更没有验证程序集。尽管如此,大多数Hyperlane部署都配置有一个默认的ISM,该ISM指定了如果消息接收者未指定ISM覆盖时要使用的安全模型。
- **What can I build with Hyperlane?** + **我可以用Hyperlane构建什么?**
-
Hyperlane's [Messaging interface](./reference/messaging/messaging-interface.mdx) allows dapp developers to send arbitrary bytes between smart contracts on different chains. This can be used to create interchain applications, dapps which span multiple chains. For inspiration, take a look at some of the pre-built applications built on top of Hyperlane, including: Warp Routes, which lets users move tokens from one chain to another; Interchain Accounts: which lets users make interchain function calls; Interchain Queries: which lets users make interchain view calls
+
Hyperlane的[消息传递接口](./reference/messaging/messaging-interface.mdx)允许dapp开发者在不同链上的智能合约之间发送任意字节。这可用于创建跨链应用程序,即跨越多个链的dapp。要想获得灵感,可以查看一些构建在Hyperlane之上的预构建应用程序,包括Warp Routes:允许用户将代币从一条链转移到另一条链;Interchain Accounts:允许用户进行跨链函数调用;Interchain Queries:允许用户进行跨链视图调用。
- **Where is Hyperlane deployed?** + **Hyperlane在哪里部署?**
-
A list of known deployments can be found at the [contract addresses](./reference/contract-addresses.mdx) page
+
[contract addresses](./reference/contract-addresses.mdx)页面上有一份已部署的清单。
- **What happens when I send a message on Hyperlane?** + **在 Hyperlane上发送消息时会发生什么?**
-
See the [send](./reference/messaging/send.mdx) and [receive](./reference/messaging/receive.mdx) pages for more details. In summary, an application calls the `dispatch()` function on the origin chain, inserting the message into the Mailbox's Merkle tree. A Hyperlane Relayer observes the dispatched messages and assemble metadata for the recipient's Interchain Security Module (ISM). A relayer delivers the message to the recipient by calling `Mailbox.process()`. The verifies the message with the recipient’s ISM, and calls `recipient.handle()` to deliver the message.
+
详情请参阅[send](./reference/messaging/send.mdx) 和 [receive](./reference/messaging/receive.mdx) 页面。简而言之,一个应用程序在原始链上调用 "dispatch() "函数,将消息插入邮箱的默克尔树中。Hyperlane中继观察到分发的消息,并为接收方的Interchain安全模块(ISM)组装元数据。中继器通过调用 "Mailbox.process() "将消息传递给接收方。中继器接收方使用其ISM验证消息,并调用`recipient.handle()`来传递消息。
- **How can I see the status of a message I have sent?** + **如何查看已发送信息的状态?**
-
Paste an address or transaction hash into the search bar of the [Hyperlane Message Explorer](./explorer.mdx) to view details about a message’s status and history. If the message has failed to send for some reason, there will be error messages indicating what may have gone wrong. See [Explorer Debugging](./guides/developer-tips/explorer-debugging.mdx) for more information on how to debug an undelivered message
+
在[Hyperlane消息浏览器](./explorer.mdx)的搜索栏中粘贴地址或交易哈希值,可查看消息的状态和历史详情。如果消息因某种原因发送失败,将提示可能出现的问题。有关如何调试未传递消息的更多信息,请参阅[浏览器调试](./guides/developer-tips/explorer-debugging.mdx)。
- **Does sending interchain messages with Hyperlane mean live chat & text?** + **使用Hyperlane发送链间消息是否意味着实时聊天和短信?**
-
Hyperlane is a protocol designed to allow smart contracts on different chains to interact with each other. When we refer to message-passing, it’s the sending of arbitrary bytes between smart contracts rather than peer-to-peer or text messaging. There are several web3 projects that are suited to the chat use case; consider [XMTP](https://xmtp.org/), [Push](https://push.org/), or [Orbis](https://useorbis.com/) for this type of messaging.
+
Hyperlane是一种协议,旨在允许不同链上的智能合约相互交互。我们所说的消息传递是指在智能合约之间发送任意字节,而不是点对点或文本消息。有几个web3项目适合聊天用例;考虑使用 [XMTP](https://xmtp.org/)、[Push](https://push.org/) 或 [Orbis](https://useorbis.com/),以实现这种类型的消息传递。
- **Is Hyperlane a token bridge?** + **Hyperlane是代币桥吗?**
-
Not exactly. Hyperlane is a general message passing (GMP) protocol that allows communication between blockchains. Token bridges are just one of many types of applications that can be built on top of Hyperlane!
+
不完全是。Hyperlane是一种通用消息传递(GMP)协议,允许区块链之间进行通信。代币桥只是在Hyperlane基础上构建的多种应用之一!
- **I’m a developer. How can my team build with Hyperlane?** + **我是一名开发人员。我的团队如何使用 Hyperlane 进行构建?**
-
If you’re reading this FAQ, you’ve found the docs which is a great place to start. That said, we know that questions arise during implementation, and we’re happy to help you on your way. The Hyperlane community is regularly active in the [Discord](http://discord.gg/hyperlane). Feedback from developers directly influences the product roadmap.
+
如果您正在阅读本常见问题解答,那么您已经找到了文档,这是一个很好的开始。尽管如此,我们知道在实施过程中会出现一些问题,我们很乐意在您使用过程中为您提供帮助。Hyperlane社区经常在 [Discord](http://discord.gg/hyperlane) 上保持活跃。开发人员的反馈会直接影响产品路线图。
- **What is Abacus Works?** + **Abacus Works 是什么?**
-
Abacus Works is the name of a legal identity working on Hyperlane. You may encounter some references to Abacus in older posts and repositories. Hyperlane rebranded from Abacus to Hyperlane in Fall 2022.
+
Abacus Works 是从事 Hyperlane 开发的合法机构的名称。您可能会在较早的文章和资源库中遇到一些关于 Abacus 的引用。Hyperlane 于 2022 年秋季从 Abacus 更名为 Hyperlane。
- **How can I join the Hyperlane community?** + **如何加入 Hyperlane 社区?**
-
You can join the [Discord](http://discord.gg/hyperlane) or follow Hyperlane [Twitter](http://twitter.com/hyperlane_xyz) where you can find a growing community of developers and enthusiasts to chat about the interchain future.
+
您可以加入[Discord](http://discord.gg/hyperlane)或关注 Hyperlane [Twitter](http://twitter.com/hyperlane_xyz),在这里您可以找到一个由开发人员和爱好者组成的不断壮大的社区,一起畅谈跨链的未来。
- **I'm interested in working on Hyperlane, where can I see job openings?** + **我有兴趣在 Hyperlane 工作,在哪里可以看到职位空缺?**
-
Check out our open roles [here](https://www.hyperlane.xyz/crew).
+
查看我们的空缺职位 [此处](https://www.hyperlane.xyz/crew)。
- **How can I contribute to improve this documentation?** + **我如何才能为改进本文档做出贡献?**
-
You can make a PR to edit this documentation directly via the [docs repo](https://github.com/hyperlane-xyz).
+
您可以通过 [docs repo](https://github.com/hyperlane-xyz)直接提交 PR 来编辑此文档。
\ No newline at end of file From ed173fcae4deec28b774e937e5796d69d9bff5f5 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Thu, 15 Feb 2024 15:29:52 +0800 Subject: [PATCH 05/58] faq.mdx to Chinese --- docs/faq.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/faq.mdx b/docs/faq.mdx index eaeb1570..175fb7a5 100644 --- a/docs/faq.mdx +++ b/docs/faq.mdx @@ -67,19 +67,19 @@
- **Abacus Works 是什么?** + **Abacus Works是什么?**
-
Abacus Works 是从事 Hyperlane 开发的合法机构的名称。您可能会在较早的文章和资源库中遇到一些关于 Abacus 的引用。Hyperlane 于 2022 年秋季从 Abacus 更名为 Hyperlane。
+
Abacus Works 是从事Hyperlane开发的合法机构的名称。您可能会在较早的文章和资源库中遇到一些关于 Abacus 的引用。Hyperlane 于 2022 年秋季从 Abacus 更名为 Hyperlane。
- **如何加入 Hyperlane 社区?** + **如何加入Hyperlane社区?**
-
您可以加入[Discord](http://discord.gg/hyperlane)或关注 Hyperlane [Twitter](http://twitter.com/hyperlane_xyz),在这里您可以找到一个由开发人员和爱好者组成的不断壮大的社区,一起畅谈跨链的未来。
+
您可以加入[Discord](http://discord.gg/hyperlane)或关注Hyperlane [Twitter](http://twitter.com/hyperlane_xyz),在这里您可以找到一个由开发人员和爱好者组成的不断壮大的社区,一起畅谈跨链的未来。
- **我有兴趣在 Hyperlane 工作,在哪里可以看到职位空缺?** + **我有兴趣在Hyperlane工作,在哪里可以看到职位空缺?**
查看我们的空缺职位 [此处](https://www.hyperlane.xyz/crew)。
From 2c10b8b53d6cc0426798c007d9d4b7718f34f6c9 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Thu, 15 Feb 2024 16:31:15 +0800 Subject: [PATCH 06/58] explorer.mdx to Chinese --- docs/explorer.mdx | 44 ++++++++++++++++++------------------- docs/faq.mdx | 16 +++++++------- docs/your-first-message.mdx | 6 ++--- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/docs/explorer.mdx b/docs/explorer.mdx index fc4f4d29..a80b7e77 100644 --- a/docs/explorer.mdx +++ b/docs/explorer.mdx @@ -1,41 +1,41 @@ -# Explorer +# 区块信息浏览器 -The [Hyperlane Explorer](https://explorer.hyperlane.xyz/) can be used to find messages on any network with a Hyperlane deployment. Drill down into messages for more details about their properties and status. +[Hyperlane Explorer](https://explorer.hyperlane.xyz/) 可以用于查找任何部署了Hyperlane的链上的信息。深入了解信息,以获取有关其属性和状态的更多详细信息。 -Messages to/from [core chains](./reference/domains.mdx) will searchable by transaction hash, message ID, or sender/recipient address. For other chains, the explorer can be configured to search for messages by providing it a chain config. +to/from[core chains](./reference/domains.mdx)的信息将可以通过交易哈希、信息ID或发送者/接收者地址进行搜索。对于其他链,可以通过提供链配置来配置区块信息浏览器以搜索信息。 -### Searching for messages +### 搜索信息 -The [Hyperlane Explorer](https://explorer.hyperlane.xyz/) supports searching for messages using any of the following values: +[Hyperlane Explorer](https://explorer.hyperlane.xyz/) 支持使用以下任何值搜索邮件: -- Hash of the transaction that initiated the message (origin tx) -- Hash of the transaction that delivered message (destination tx) -- Address of the account that sent the origin transaction -- Address of the account that sent the destination transaction -- Address of the message sender -- Address of the message recipient -- ID of the message +- 发起信息的交易的哈希值(原始链的tx) +- 传递信息的交易的哈希值(目标链tx) +- 原始链交易的发送账户地址 +- 目标链交易的接收账户地址 +- 信息发送者地址 +- 信息接收者地址 +- 信息ID -To search, enter your query into the top search bar. You can use the Origin Chain, Destination Chain, and Time filter options to narrow down your search. +要进行搜索,请在顶部的搜索栏中输入您的查询。您可以使用 "原始链"、"目标链 "和 "时间 "过滤选项来缩小搜索范围。 ![Explorer search bar](../static/img/explorersearchbar.png) -:::info +:::信息 -Note, by default the explorer will only find message on [core Hyperlane chains](./reference/domains.mdx). +注意,默认情况下,区块信息浏览器只能在[Hyperlane 核心链](./reference/domains.mdx)上查找信息。 -To view messages send to and/or from other chains, see [configuring PI Chains](./guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx). +要查看发送到其他链和/或来自其他链的信息,请参阅[配置 PI 链](./guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx)。 ::: -### Permissionless Interoperability +### 无需许可的互操作性 -The explorer UI and REST API can be configured to search for messages on any chain with a Hyperlane deployment. See [configuring PI Chains](./guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx) for details. +可对资源管理器用户界面和 REST API 进行配置,以便在任何部署了 Hyperlane 的链上搜索信息。详情请参见[配置 PI 链](./guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx)。 -### Debugging Messages +### 调试信息 -If you're trying to debug a problem with message delivery, the [explorer debugging](./guides/developer-tips/explorer-debugging.mdx) page has useful tips. +如果您正在尝试调试信息传送问题,[explorer 调试](./guides/developer-tips/explorer-debugging.mdx) 页面提供了有用的提示。 -### API Reference +### 应用程序接口参考 -The explorer's data can be accessed programmatically via the [REST API](./guides/developer-tips/explorer-debugging/rest-api.mdx) or [GraphQL API](./guides/developer-tips/explorer-debugging/graphql-api.mdx). The REST API is recommended because it exposes a simpler interface for message data. +可以通过 [REST API](./guides/developer-tips/explorer-debugging/rest-api.mdx) 或 [GraphQL API](./guides/developer-tips/explorer-debugging/graphql-api.mdx) 以编程方式访问区块信息浏览器的数据。推荐使用 REST API,因为它为信息数据提供了一个更简单的接口。 diff --git a/docs/faq.mdx b/docs/faq.mdx index 175fb7a5..475ce06b 100644 --- a/docs/faq.mdx +++ b/docs/faq.mdx @@ -21,13 +21,13 @@
**谁是 Hyperlane 验证者?**
-
Hyperlane采用以ISM为特色的模块化安全堆栈来确保安全。没有协议规定的安全模型,更没有验证程序集。尽管如此,大多数Hyperlane部署都配置有一个默认的ISM,该ISM指定了如果消息接收者未指定ISM覆盖时要使用的安全模型。
+
Hyperlane采用以ISM为特色的模块化安全堆栈来确保安全。没有协议规定的安全模型,更没有验证程序集。尽管如此,大多数Hyperlane部署都配置有一个默认的ISM,该ISM指定了如果信息接收者未指定ISM覆盖时要使用的安全模型。
**我可以用Hyperlane构建什么?**
-
Hyperlane的[消息传递接口](./reference/messaging/messaging-interface.mdx)允许dapp开发者在不同链上的智能合约之间发送任意字节。这可用于创建跨链应用程序,即跨越多个链的dapp。要想获得灵感,可以查看一些构建在Hyperlane之上的预构建应用程序,包括Warp Routes:允许用户将代币从一条链转移到另一条链;Interchain Accounts:允许用户进行跨链函数调用;Interchain Queries:允许用户进行跨链视图调用。
+
Hyperlane的信息[传递接口](./reference/messaging/messaging-interface.mdx)允许dapp开发者在不同链上的智能合约之间发送任意字节。这可用于创建跨链应用程序,即跨越多个链的dapp。要想获得灵感,可以查看一些构建在Hyperlane之上的预构建应用程序,包括Warp Routes:允许用户将代币从一条链转移到另一条链;Interchain Accounts:允许用户进行跨链函数调用;Interchain Queries:允许用户进行跨链视图调用。
@@ -37,27 +37,27 @@
- **在 Hyperlane上发送消息时会发生什么?** + **在 Hyperlane上发送信息时会发生什么?**
-
详情请参阅[send](./reference/messaging/send.mdx) 和 [receive](./reference/messaging/receive.mdx) 页面。简而言之,一个应用程序在原始链上调用 "dispatch() "函数,将消息插入邮箱的默克尔树中。Hyperlane中继观察到分发的消息,并为接收方的Interchain安全模块(ISM)组装元数据。中继器通过调用 "Mailbox.process() "将消息传递给接收方。中继器接收方使用其ISM验证消息,并调用`recipient.handle()`来传递消息。
+
详情请参阅[send](./reference/messaging/send.mdx) 和 [receive](./reference/messaging/receive.mdx) 页面。简而言之,一个应用程序在原始链上调用 "dispatch() "函数,将信息插入邮箱的默克尔树中。Hyperlane中继观察到分发的信息,并为接收方的Interchain安全模块(ISM)组装元数据。中继器通过调用 "Mailbox.process() "将信息传递给接收方。中继器接收方使用其ISM验证信息,并调用`recipient.handle()`来传递信息。
**如何查看已发送信息的状态?**
-
在[Hyperlane消息浏览器](./explorer.mdx)的搜索栏中粘贴地址或交易哈希值,可查看消息的状态和历史详情。如果消息因某种原因发送失败,将提示可能出现的问题。有关如何调试未传递消息的更多信息,请参阅[浏览器调试](./guides/developer-tips/explorer-debugging.mdx)。
+
在[Hyperlane信息浏览器](./explorer.mdx)的搜索栏中粘贴地址或交易哈希值,可查看信息的状态和历史详情。如果信息因某种原因发送失败,将提示可能出现的问题。有关如何调试未传递信息的更多信息,请参阅[浏览器调试](./guides/developer-tips/explorer-debugging.mdx)。
- **使用Hyperlane发送链间消息是否意味着实时聊天和短信?** + **使用Hyperlane发送链间信息是否意味着实时聊天和短信?**
-
Hyperlane是一种协议,旨在允许不同链上的智能合约相互交互。我们所说的消息传递是指在智能合约之间发送任意字节,而不是点对点或文本消息。有几个web3项目适合聊天用例;考虑使用 [XMTP](https://xmtp.org/)、[Push](https://push.org/) 或 [Orbis](https://useorbis.com/),以实现这种类型的消息传递。
+
Hyperlane是一种协议,旨在允许不同链上的智能合约相互交互。我们所说的信息传递是指在智能合约之间发送任意字节,而不是点对点或文本信息。有几个web3项目适合聊天用例;考虑使用 [XMTP](https://xmtp.org/)、[Push](https://push.org/) 或 [Orbis](https://useorbis.com/),以实现这种类型的信息传递。
**Hyperlane是代币桥吗?**
-
不完全是。Hyperlane是一种通用消息传递(GMP)协议,允许区块链之间进行通信。代币桥只是在Hyperlane基础上构建的多种应用之一!
+
不完全是。Hyperlane是一种通用信息传递(GMP)协议,允许区块链之间进行通信。代币桥只是在Hyperlane基础上构建的多种应用之一!
diff --git a/docs/your-first-message.mdx b/docs/your-first-message.mdx index 0f979de1..027f49bc 100644 --- a/docs/your-first-message.mdx +++ b/docs/your-first-message.mdx @@ -8,9 +8,9 @@ import { } from "@site/src/components/AddressTable"; import MessageQuickstart from "@site/src/components/MessageQuickstart"; -# 发送您的第一条链间消息 +# 发送您的第一条链间信息 -本教程演示如何 [发送](./reference/messaging/send.mdx)链间消息到预先部署的 "TestRecipient "合约。 +本教程演示如何 [发送](./reference/messaging/send.mdx)链间信息到预先部署的 "TestRecipient "合约。 @@ -19,7 +19,7 @@ import MessageQuickstart from "@site/src/components/MessageQuickstart"; :::提示 -你可以在[explorer.hyperlane.xyz](https://explorer.hyperlane.xyz/)上通过搜索你的`Mailbox.dispatch`调用的**transaction hash**来查看消息的进度。 +你可以在[explorer.hyperlane.xyz](https://explorer.hyperlane.xyz/)上通过搜索你的`Mailbox.dispatch`调用的**transaction hash**来查看信息的进度。 ::: ## 查看结果 From 1d84fc45f8a5efaf35a7aab212478fb25370e72d Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Thu, 15 Feb 2024 16:43:24 +0800 Subject: [PATCH 07/58] deploy-hyperlane-troubleshooting.mdx to Chinese --- docs/deploy-hyperlane-troubleshooting.mdx | 26 +++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/deploy-hyperlane-troubleshooting.mdx b/docs/deploy-hyperlane-troubleshooting.mdx index 08396766..ec4e143d 100644 --- a/docs/deploy-hyperlane-troubleshooting.mdx +++ b/docs/deploy-hyperlane-troubleshooting.mdx @@ -1,12 +1,12 @@ # Troubleshooting -## Chain configuration +## 链配置 -Within your working directory, you may find a `config/` folder containing a `chains.yaml` file. This `chains.yaml` configuration file allows you to describe chain metadata for use in Hyperlane deployments or apps. +在您的工作目录中,可能会发现一个包含 `chains.yaml` 文件的 `config/` 文件夹。通过该 `chains.yaml` 配置文件,您可以描述链元数据,以便在 Hyperlane 部署或应用程序中使用。 -You can define a full configuration for any new chain in this file. The metadata that can be configured is defined in this [example configuration](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/chain-config.yaml). You can also find the chain metadata schema at [chainMetadataTypes.ts](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/metadata/chainMetadataTypes.ts). +您可以在此文件中为任何新链定义完整配置。可配置的元数据在此[配置示例](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/chain-config.yaml)中定义。您还可以在 [chainMetadataTypes.ts](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/metadata/chainMetadataTypes.ts) 中找到链元数据模式。 -Here's an example configuration for two local anvil chains: +下面是两个本地anvil chains的配置示例: ```yaml --- @@ -30,7 +30,7 @@ anvil2: - http: http://localhost:8555 ``` -You can also extend a core chain config by providing the fields to be overridden: +您还可以通过提供要重写的字段来扩展核心链配置: ```yaml --- @@ -39,11 +39,11 @@ sepolia: confirmations: 2 ``` -### Override RPC URLs +### 重写 RPC URL -You can override the RPC urls by extending the core chain config. +您可以通过扩展核心链配置来覆盖 RPC 网址。 -In the example below, you can see how to define an array of RPCs and also adjust the retry parameters for any of them. +在下面的示例中,你可以看到如何定义 RPC 数组,以及如何调整其中任何一个 RPC 的重试参数。 ```yaml --- @@ -62,9 +62,9 @@ sepolia: maxRequests: 10 ``` -### Override transaction settings +### 覆盖交易设置 -Transaction overrides are any properties to include when forming transaction requests. For example: +事务重载是在形成事务请求时包含的任何属性。例如 - `gasPrice`: number | string - `maxFeePerGas`: number | string @@ -73,7 +73,7 @@ Transaction overrides are any properties to include when forming transaction req - `type`: number - `ccipReadEnabled`: boolean -In the example below we're using a gas price of 7 gwei, hardcoding the nonce, and setting a maximum value for the base and priority fees. +在下面的示例中,我们使用的燃料价格为7gwei,对 nonce 进行了硬编码,并为基本费和优先费设置了最大值。 ```yaml --- @@ -85,8 +85,8 @@ sepolia: nonce: 1337 ``` -:::warning +:::警告 -If you are overriding the nonce in the chain configuration, ensure you are updating the value on successful transactions. +如果要覆盖链配置中的 nonce,请确保在交易成功时更新该值。 ::: From 6c272d90850f9d316975263eba5e13114523356b Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Thu, 15 Feb 2024 17:29:08 +0800 Subject: [PATCH 08/58] deploy-hyperlane.mdx to Chinese --- docs/deploy-hyperlane.mdx | 78 +++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/docs/deploy-hyperlane.mdx b/docs/deploy-hyperlane.mdx index 520a8fa6..a523b4a7 100644 --- a/docs/deploy-hyperlane.mdx +++ b/docs/deploy-hyperlane.mdx @@ -4,78 +4,78 @@ import DeployContractsPartial from "/docs/partials/deploy-hyperlane/_deploy-cont import SendTestMessagesPartial from "/docs/partials/deploy-hyperlane/_send-test-messages.mdx"; import DeployWarpRoutePartial from "/docs/partials/deploy-hyperlane/_deploy-warp-route.mdx"; -# Get Started +# 立即开始 -Hyperlane can be deployed by anyone to any chain. -This guide covers sending your first interchain message from a new EVM chain. By the end of this guide you will have deployed and configured your Mailbox smart contract and off-chain agents, allowing developers to send interchain messages to and from your chain. +任何人都可以在任何链上部署 Hyperlane。 +本指南涵盖从新 EVM 链发送第一条链间信息。在本指南结束时,您将部署并配置好邮箱智能合约和链外代理,从而允许开发人员向您的链发送链间消息或从您的链发送链间消息。 -:::note +:::备注 -This guide has been specifically made to demonstrate how to connect a chain that _already has Hyperlane on it_ to a new chain that does _not_ have Hyperlane. +本指南专门用于演示如何将已有Hyperlane的链连接到没有Hyperlane的新链上。 ::: -## Overview +## 概览 -There are five steps in this guide: +本指南共有五个步骤: -1. [Set up keys](#1-set-up-keys) that you will use to deploy contracts and run validators and relayer. -2. [Deploy contracts](#2-deploy-contracts) to the local chain and to every remote chain with which the local chain will be able to send and receive messages. -3. [Run validators and relayer ](#3-run-validators-relayer) using [Kurtosis](https://cloud.kurtosis.com). Validators provide the signatures needed for the Interchain Security Modules you deployed in step 2. The relayer will deliver messages between chains you deployed contracts to. -4. [Send a test message](#4-send-test-messages) to confirm that your relayer is able to deliver messages to and from each pair of chains -5. [Deploy a warp route](#5-optional-deploy-a-warp-route) to send token value, not just messages, across chains +1. [Set up keys](#1-set-up-keys) 您将使用它来部署合同、运行验证器和中继器。 +2. [Deploy contracts](#2-deploy-contracts) 到本地链以及本地链可以收发信息的所有远程链。 +3. [Run validators and relayer ](#3-run-validators-relayer) 使用 [Kurtosis](https://cloud.kurtosis.com)。验证器为您在步骤 2 中部署的链间安全模块提供所需的签名。中继器将在已部署合约的链之间传递信息。 +4. [Send a test message](#4-send-test-messages) 以确认中继器能够在每对链之间传递信息 +5. [Deploy a warp route](#5-optional-deploy-a-warp-route) 跨链发送标令牌 -## Getting Started +## 立即开始 -## 1. Set up keys +## 1. 设置密钥 -## 2. Deploy contracts +## 2. 部署合约 -## 3. Run validators and relayer +## 3. 运行验证器和中继器 -:::note +:::备注 -This section covers how to 1-click deploy agents using a third party. To run the Hyperlane agent binaries yourself, follow the [Local Agents guide](guides/deploy-hyperlane-local-agents.mdx). +本节介绍如何使用第三方一键部署代理。要自行运行 Hyperlane 代理二进制文件,请遵循[本地代理指南](guides/deploy-hyperlane-local-agents.mdx)。 ::: -We've partnered with [Kurtosis](https://www.kurtosis.com/) to provide a single-click validator and relayer deployment in the cloud. You'll receive a one-month trial during which your validator and relayer run in Kurtosis Cloud for free. After your trial ends, you'll need to either run your validator and relayer yourself or purchase a Kurtosis Cloud subscription. +我们与 [Kurtosis](https://www.kurtosis.com/) 合作,在云中提供一键式验证器和中继器部署。您将获得为期一个月的试用期,在此期间,您的验证器和中继器将在 Kurtosis Cloud 中免费运行。试用结束后,您需要自行运行验证器和中继器,或者购买 Kurtosis Cloud 订阅。 -To get started, use the `deploy kurtosis-agents` command to generate a link for configuring your Kurtosis deployment. +要开始使用,请使用 `deploy kurtosis-agents` 命令生成一个链接,用于配置 Kurtosis 部署。 ```bash hyperlane deploy kurtosis-agents ``` -Follow the prompts and then click on the Kurtosis Cloud link output by the command. +按照提示操作,然后点击命令输出的 Kurtosis Cloud 链接。 -If this is your first time using Kurtosis Cloud, you'll need to sign in with Google and Kurtosis will provision a remote cloud instance for your validator and relayer in roughly 2 minutes. +如果这是您第一次使用 Kurtosis Cloud,您需要使用Google登录 ,Kurtosis 会在大约 2 分钟内为您的验证器和中继器提供一个远程云实例。 ![Get excited](../static/img/kurtosis-get-excited.png) -A prefilled configuration screen will pop up with all your relayer and validator information from Steps 1 and 2. +将弹出一个预填配置屏幕,其中包含步骤 1 和 2 中的所有中继器和验证器信息。 -:::note +:::备注 -If you are having issues deploying agents on Kurtosis Cloud through the CLI, you can manually enter this information by: +如果您在通过 CLI 在 Kurtosis Cloud 上部署代理时遇到问题,可以通过以下方式手动输入此信息: -1. Signing into [Kurtosis Cloud](https://cloud.kurtosis.com/). -1. Clicking `Run` on the [Hyperlane Package](https://cloud.kurtosis.com/gateway/ips/18-206-3-164/ports/9711/catalog/github.com%2Fkurtosis-tech%2Fhyperlane-package). -1. Filling in the configuration modal. +1. 登录 [Kurtosis Cloud](https://cloud.kurtosis.com/)。 +1. 点击[Hyperlane 软件包](https://cloud.kurtosis.com/gateway/ips/18-206-3-164/ports/9711/catalog/github.com%2Fkurtosis-tech%2Fhyperlane-package)上的 "run"。 +1. 填写配置模块。 ::: -The last step will be to input your `Validator Key` from Step 2. The screenshots below show an example prefilled configuration. +最后一步是输入步骤 2 中的 "验证密钥"。下面的截图显示了一个预填充配置示例。 -:::warning +:::警告 -The Kurtosis team is still building the secrets functionality of Kurtosis Cloud, so for now do not enter any sensitive information (e.g. your private keys) into Kurtosis! Only testing and non-sensitive values should be used. +Kurtosis 团队仍在构建 Kurtosis Cloud 的保密功能,因此目前请勿在 Kurtosis 中输入任何敏感信息(例如您的私钥)!只能使用测试值和非敏感值。 ::: @@ -83,30 +83,30 @@ The Kurtosis team is still building the secrets functionality of Kurtosis Cloud, ![Example Configuration Two](../static/img/kurtosis-example-config-two.png) -Click `Run` to deploy your relayer and validator! +单击 "run"部署中继器和验证器! -Once the configuration finishes executing successfully, you'll see a green check mark. Congratulations! You've now deployed your own relayer and validator with Kurtosis! +配置成功执行后,您将看到一个绿色的"running"标记。恭喜您 您现在已经使用 Kurtosis 部署了自己的中继器和验证器! ![Success](../static/img/kurtosis-success.png) -You can see information about your relayer and validator deployment, including logs, by navigating to the `Overview` tab. +通过导航到 `Overview`选项卡,可以查看中继器和验证器部署的相关信息,包括日志。 ![Enclave Overview](../static/img/kurtosis-enclave-overview.png) ![Validator Logs](../static/img/kurtosis-validator-logs.png) -For issues with Kurtosis, please file an [issue on the Kurtosis Github repository](https://github.com/kurtosis-tech/kurtosis/issues/new/choose). For questions or discussion, use the [Github Discussions section of the Kurtosis repository](https://github.com/kurtosis-tech/kurtosis/discussions/new?category=q-a) or visit [the Kurtosis Discord server](https://discord.com/invite/jJFG7XBqcY). +有关 Kurtosis 的问题,请提交 [Kurtosis Github repository](https://github.com/kurtosis-tech/kurtosis/issues/new/choose)。如有问题或讨论,请使用 [Kurtosis 仓库的 Github 讨论区](https://github.com/kurtosis-tech/kurtosis/discussions/new?category=q-a) 或访问 [Kurtosis Discord 服务器](https://discord.com/invite/jJFG7XBqcY)。 -:::info +:::信息 -Kurtosis offers a one-month free trial of Kurtosis Cloud for running your relayer and validator, but when your trial expires you'll need to add a payment method to continue running your Hyperlane deployment. View subscription prices [here](https://kurtosis.com/pricing) and payment method information [here](https://cloud.kurtosis.com/payment-method). +Kurtosis 提供一个月的 Kurtosis Cloud 免费试用期,用于运行您的中继器和验证器,但试用期结束后,您需要添加付款方式才能继续运行您的 Hyperlane 部署。查看订阅价格 [此处](https://kurtosis.com/pricing) 和支付方式信息 [此处](https://cloud.kurtosis.com/payment-method)。 ::: -## 4. Send test messages +## 4. 发送测试信息 -## 5. (Optional) Deploy a Warp Route +## 5. (可选) 部署一个Warp Route From f55c9f0934be5289295811bd02a32d1acf665c7d Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Thu, 15 Feb 2024 17:55:40 +0800 Subject: [PATCH 09/58] configuring-pi-chains.mdx to Chinese --- docs/explorer.mdx | 8 ++++---- .../configuring-pi-chains.mdx | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/explorer.mdx b/docs/explorer.mdx index a80b7e77..13582b82 100644 --- a/docs/explorer.mdx +++ b/docs/explorer.mdx @@ -1,8 +1,8 @@ -# 区块信息浏览器 +# 资源管理器 [Hyperlane Explorer](https://explorer.hyperlane.xyz/) 可以用于查找任何部署了Hyperlane的链上的信息。深入了解信息,以获取有关其属性和状态的更多详细信息。 -to/from[core chains](./reference/domains.mdx)的信息将可以通过交易哈希、信息ID或发送者/接收者地址进行搜索。对于其他链,可以通过提供链配置来配置区块信息浏览器以搜索信息。 +to/from[core chains](./reference/domains.mdx)的信息将可以通过交易哈希、信息ID或发送者/接收者地址进行搜索。对于其他链,可以通过提供链配置来配置资源管理器以搜索信息。 ### 搜索信息 @@ -22,7 +22,7 @@ to/from[core chains](./reference/domains.mdx)的信息将可以通过交易哈 :::信息 -注意,默认情况下,区块信息浏览器只能在[Hyperlane 核心链](./reference/domains.mdx)上查找信息。 +注意,默认情况下,资源管理器只能在[Hyperlane 核心链](./reference/domains.mdx)上查找信息。 要查看发送到其他链和/或来自其他链的信息,请参阅[配置 PI 链](./guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx)。 @@ -38,4 +38,4 @@ to/from[core chains](./reference/domains.mdx)的信息将可以通过交易哈 ### 应用程序接口参考 -可以通过 [REST API](./guides/developer-tips/explorer-debugging/rest-api.mdx) 或 [GraphQL API](./guides/developer-tips/explorer-debugging/graphql-api.mdx) 以编程方式访问区块信息浏览器的数据。推荐使用 REST API,因为它为信息数据提供了一个更简单的接口。 +可以通过 [REST API](./guides/developer-tips/explorer-debugging/rest-api.mdx) 或 [GraphQL API](./guides/developer-tips/explorer-debugging/graphql-api.mdx) 以编程方式访问资源管理器的数据。推荐使用 REST API,因为它为信息数据提供了一个更简单的接口。 diff --git a/docs/guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx b/docs/guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx index f07cabf4..36362c00 100644 --- a/docs/guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx +++ b/docs/guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx @@ -1,20 +1,20 @@ -# Configuring PI Chains +# 配置 PI 链 -Hyperlane can be [permissionlessly deployed](../../../deploy-hyperlane.mdx) to any chain, but messages on PI chains cannot be identified by the default Hyperlane agents. To view details about messages from PI chains, first configure the explorer with metadata about that chain. +Hyperlane 可以[无权限部署](.../.../.../deploy-hyperlane.mdx)到任何链上,但 PI 链上的报文无法通过默认的 Hyperlane 代理识别。要查看 PI 链上消息的详细信息,首先要用该链的元数据配置资源管理器。 -To begin, go to the [explorer's settings page](https://explorer.hyperlane.xyz/settings). +首先,进入 [资源管理器设置页面](https://explorer.hyperlane.xyz/settings)。 ![](../../../../static/img/explorer-debugging/explorer-settings.png) -From there, click the Add Custom Chain button. A modal will appear. Input the configuration for your PI Chain. +然后点击添加自定义链按钮。此时会出现一个模态窗口。输入 PI 链的配置。 -The chain config schema is an extension of the Hyperlane SDK's [ChainMetadata schema](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/consts/chainMetadata.ts#L21) but with a `contracts` object added. Currently only the `mailbox` contract address is required but more functionality may be enabled in the future if more addresses are provided. +链配置模式是 Hyperlane SDK [ChainMetadata 模式](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/consts/chainMetadata.ts#L21)的扩展,但增加了一个`contracts` 对象。目前只要求提供`mailbox`合约地址,但如果提供了更多地址,将来可能会启用更多功能。 -If a valid Etherscan-based block explorer config is provided, the Hyperlane Explorer will utilize it to find the desired messages. If not, it will use the RPC URL. Note, Explorers with api keys (even just free-tier keys), perform faster and more reliably. +如果提供了有效的基于 Etherscan 的区块资源管理器配置,Hyperlane Explorer 将利用它来查找所需的信息。如果没有,则会使用 RPC URL。请注意,使用 api 密钥(即使只是自由层密钥)的资源管理器运行速度更快、更可靠。 ![](../../../../static/img/explorer-debugging/explorer-add-custom-chain.png) -### Chain Config Examples +### 链配置示例 **A minimal chain config:** @@ -68,6 +68,6 @@ If a valid Etherscan-based block explorer config is provided, the Hyperlane Expl } ``` -:::info -If the origin or destination `domainId` of chains in your messages doesn't match their `chainId` then you must include the `domainId` field in your chain config. +:::信息 +如果信息中链的来源或目的地 `domainId` 与其 `chainId` 不匹配,则必须在链配置中包含 `domainId` 字段。 ::: From 003d6ecbfda6347ee39c2e8ef510f538402979d4 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Thu, 15 Feb 2024 18:19:31 +0800 Subject: [PATCH 10/58] graphql-api.mdx to Chinese --- .../explorer-debugging/graphql-api.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/guides/developer-tips/explorer-debugging/graphql-api.mdx b/docs/guides/developer-tips/explorer-debugging/graphql-api.mdx index 6a16796a..b9b48032 100644 --- a/docs/guides/developer-tips/explorer-debugging/graphql-api.mdx +++ b/docs/guides/developer-tips/explorer-debugging/graphql-api.mdx @@ -1,14 +1,14 @@ # GraphQL API -The Hyperlane agents collect useful information about activity on the system, including all messages. That data can be queried via APIs. These APIs are currently available free of charge and without any required authentication. Connect your preferred GraphQL client or library to [https://api.hyperlane.xyz/v1/graphql](https://api.hyperlane.xyz/v1/graphql) to query data! +Hyperlane代理收集系统活动的有用信息,包括所有消息。这些数据可通过应用程序接口(API)查询。这些应用程序接口目前免费提供,无需任何认证。将您喜欢的 GraphQL 客户端或库连接到 [https://api.hyperlane.xyz/v1/graphql](https://api.hyperlane.xyz/v1/graphql),即可查询数据! -:::info -Note, the REST API is recommended over the GraphQL API because it exposes a simpler schema for message data. +:::信息 +请注意,推荐使用 REST API 而不是 GraphQL API,因为它暴露了一个更简单的消息数据模式。 ::: -### Example Query +### 查询示例 -The following query will retrieve useful information about a message: +下面的查询将检索一条信息的有用信息: ```graphql query MyQuery { @@ -65,7 +65,7 @@ query MyQuery { } ``` -### GraphQL Schema Types +### GraphQL 模式类型 ```graphql type message_view { From 76a51065935ff9411f07123c230f17982426ef5b Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Thu, 15 Feb 2024 19:06:52 +0800 Subject: [PATCH 11/58] rest-api.mdx to Chinese --- .../explorer-debugging/rest-api.mdx | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/guides/developer-tips/explorer-debugging/rest-api.mdx b/docs/guides/developer-tips/explorer-debugging/rest-api.mdx index ef435f31..cbc3d70c 100644 --- a/docs/guides/developer-tips/explorer-debugging/rest-api.mdx +++ b/docs/guides/developer-tips/explorer-debugging/rest-api.mdx @@ -1,16 +1,16 @@ # REST API -The Hyperlane agents collect useful information about activity on the system, including all messages. That data can be queried via the APIs. +Hyperlane 代理收集系统活动的有用信息,包括所有消息。可以通过应用程序接口查询这些数据。 -The APIs are currently available free of charge and without any required authentication. +这些应用程序接口目前免费提供,无需任何认证。 -:::info -Connect your preferred fetch client or library to [Explorer API page](https://explorer.hyperlane.xyz/api-docs) to query data! +:::信息 +将您喜欢的获取客户端或库连接到 [Explorer API page](https://explorer.hyperlane.xyz/api-docs) 以查询数据! ::: -### Example Query +### 查询示例 -#### Request +#### 请求 ```javascript const baseUrl = "https://explorer.hyperlane.xyz/api"; @@ -24,7 +24,7 @@ const response = await fetch(url, { const data = await response.json(); ``` -#### Response +#### 响应 ```js { @@ -85,9 +85,9 @@ const data = await response.json(); } ``` -### API Reference +### 应用程序接口参考 -#### Module: Message +#### 模块: 信息 Action: `get-message`, Parameter (1 required): @@ -107,9 +107,9 @@ Action: `search-messages`, Parameter (1 required): - `query`: address or hash to search (string) -### APIs for Permissionless Interoperability chains +### 无需权限的互操作链的APIs -Hyperlane can be [permissionlessly deployed](../../../deploy-hyperlane.mdx) to any chain, but messages on PI chains cannot be identified by the default Hyperlane agents. To view details about messages from PI chains, query the `search-pi-messages` action. The search requires a chain config in the request body. Note, this same functionality is also available in the [explorer UI](../../../guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx). +Hyperlane 可以[无需权限地部署](.../.../.../deploy-hyperlane.mdx)到任何链上,但PI链上的消息无法被默认的Hyperlane代理所识别。要查看来自PI链的消息的详细信息,请查询search-pi-messages操作。搜索需要在请求正文中提供链配置。请注意,这个功能也可以在[资源管理器用户界面](.../.../.../guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx)中使用。 ```javascript const chainConfig = { @@ -150,4 +150,4 @@ const data = await response.json(); #### Chain Config Schema -The chain config schema is an extension of the Hyperlane SDK's [ChainMetadata schema](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/consts/chainMetadata.ts#L21) but with a `contracts` object added. See [Configuring PI Chains](../../../guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx) for more details about this config object. +链配置模式是Hyperlane SDK的[ChainMetadata模式](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/consts/chainMetadata.ts#L21)的扩展,但添加了一个`contracts`对象。有关此配置对象的更多详细信息,请参阅[配置PI链](../../../guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx)。 From e5b4ed17e41e57da502c6b070240941ac12caad3 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Thu, 15 Feb 2024 20:04:17 +0800 Subject: [PATCH 12/58] explorer-debugging.mdx to Chinese --- .../developer-tips/explorer-debugging.mdx | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/guides/developer-tips/explorer-debugging.mdx b/docs/guides/developer-tips/explorer-debugging.mdx index 95d469f9..2e5d9eaf 100644 --- a/docs/guides/developer-tips/explorer-debugging.mdx +++ b/docs/guides/developer-tips/explorer-debugging.mdx @@ -1,61 +1,61 @@ -# Explorer debugging +# 资源管理器调试(Explorer debugging) -Visit the Explorer at [https://explorer.hyperlane.xyz](https://explorer.hyperlane.xyz/) +请访问资源管理器 [https://explorer.hyperlane.xyz](https://explorer.hyperlane.xyz/) -Then paste a sender/recipient address or a transaction hash into the top search field. All matching messages will be shown in the result list. Click the row for more details. +然后将发送者/接收者地址或交易哈希粘贴到顶部搜索框中。所有匹配的消息将显示在结果列表中。单击行以获取更多详细信息。
![](../../../static/img/explorer-debugging/explorer-search.png)
Retrieving a transaction in the Hyperlane Explorer.
-## Debugging failed messages +## 调试失败信息(Debugging failed messages) -You'll know that a message failed to process because the message status near the top of the page will show as "Error" and the upper right section of the page will specify a reason why the message wasn't able to be processed. +您将会知道消息处理失败,因为页面顶部的消息状态将显示为”Error“,页面右上角的部分将指定消息无法处理的原因。
![](../../../static/img/explorer-debugging/tx-failing.png)
Failed transaction from Alfajores to Base Goerli.
-If your message was not delivered it can be due to several factors. +如果您的消息未被传递,可能有几个因素造成了这种情况。 -### Invalid destination +### 目标域无效(Invalid destination) -If the destination domain identifier (`uint32`) is not known to relay clients they will have no way to deliver your message. Refer to the [domains](../../reference/domains.mdx) for known domains and the canonical identifiers to use when sending messages to these destinations. +如果目标域标识符(`uint32`)对于中继客户端来说是未知的,它们将无法传递您的消息。请参考[domains](../../reference/domains.mdx)以了解已知域和发送消息到这些目的地时要使用的规范标识符。 -### Invalid recipient +### 接收地址无效(Invalid recipient) -If the recipient address (`bytes32`) is not a contract address that implements the `IMessageRecipient`, the relayer will not be able to deliver your message. +如果接收方地址(`bytes32`)不是实现了 `IMessageRecipient` 接口的合约地址,则中继器将无法传递您的消息。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/interfaces/IMessageRecipient.sol ``` -:::warning -EVM addresses (`address`) must be left-padded with zeroes to be compliant. Refer to the [TypeCasts library](../../reference/libraries/typecasts.mdx) for a `pure addressToBytes32` utility function, and the message [dispatch](../../reference/messaging/send.mdx#dispatch) section for other details. +:::警告 +EVM 地址(`address`)必须左填充零以符合规范。请参考 [TypeCasts 库](../../reference/libraries/typecasts.mdx) 中的 `pure addressToBytes32` 实用函数,以及消息 [dispatch](../../reference/messaging/send.mdx#dispatch) 部分获取其他详细信息。 ::: -### Unprocessable +### 无法处理(Unprocessable) -If gas estimation of the message recipient's `IMessageRecipient.handle()` function fails, [relayers](../../protocol/agents/relayer.mdx) will not be able to deliver the message. Relayers will continue to estimate gas for message delivery, as state changes may allow for successful delivery of a previously undeliverable message. +如果消息接收者的 IMessageRecipient.handle() 函数的燃气估算失败,中继者 将无法传递该消息。中继者将继续为消息传递估算燃气,因为状态变化可能导致先前无法传递的消息成功传递。
![](../../../static/img/explorer-debugging/call-revert-exception.png)
Example exception of a transaction signed by validators but unprocessable by the relayer.
-:::info -If you have a use case which is not accommodated by this behavior, **please reach out** [on Discord](https://discord.com/invite/KBD3aD78Bb). +:::信息 +如果您的用例错误不属于以上的类别,请**通过 Discord** [联系我们](https://discord.com/invite/KBD3aD78Bb)。 ::: -### Underfunded +### 资金不足(Underfunded) -An underfunded message implies the [interchain gas payments](../../reference/hooks/interchain-gas.mdx) made to deliver this message are insufficient. +资金不足的消息意味着用于传递此消息的[跨链燃气支付](../../reference/hooks/interchain-gas.mdx)不足。 -Relayers use the [`eth_estimateGas`](https://ethereum.github.io/execution-apis/api-documentation/)RPC on the destination chain to determine the absolute cost of relaying a message. If this amount exceeds the total amount of gas paid for on the origin chain, relayers will typically refuse to deliver a message. +中继器使用目标链上的 [`eth_estimateGas`](https://ethereum.github.io/execution-apis/api-documentation/) RPC 来确定中继消息的绝对成本。 如果这个金额超过了在源链上支付的总燃气量,中继器通常会拒绝传递消息。 -You can [manually pay for interchain gas](../../reference/hooks/interchain-gas.mdx#retrying) to resolve this. +您可以[手动支付跨链燃气费用](../../reference/hooks/interchain-gas.mdx#retrying)来解决此问题。 -## Using Etherscan +## 使用 Etherscan(Using Etherscan) -You can also look at the Etherscan page of the recipient on the destination chain however be aware that the processing transaction won't show up on list of transactions as you would typically imagine. The reason for that is that relayers actually call the Mailbox contracts which in turn call the `handle` function on the recipient. Thus, you will find evidence of processing on the under the `Internal Txns` tab instead +您还可以查看目标链上收件人的 Etherscan 页面,但请注意,处理事务不会显示在交易列表中,就像您通常想象的那样。这是因为中继器实际上调用了邮箱合约,然后调用收件人的 ‘handle’ 函数。因此,您将在“Internal Txns”选项卡下找到处理的证据。 From 62041c2d553029d75d12ea91e5c5cf811bebcb6c Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Thu, 15 Feb 2024 20:16:55 +0800 Subject: [PATCH 13/58] unit-testing.mdx to Chinese --- docs/guides/developer-tips/unit-testing.mdx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/guides/developer-tips/unit-testing.mdx b/docs/guides/developer-tips/unit-testing.mdx index acba6947..34b22fa6 100644 --- a/docs/guides/developer-tips/unit-testing.mdx +++ b/docs/guides/developer-tips/unit-testing.mdx @@ -1,10 +1,10 @@ -# Unit testing - EVM +# 单元测试 - EVM(Unit testing - EVM) -Unit testing can prove to be challenging for a multi-chain setup with Foundry. Hence, we've provided a lightweight test environment `MockHyperlaneEnvironment` for you to unit test your cross-chain app while avoiding the need to fork multiple networks. +单元测试在使用 Foundry 进行多链设置时可能会变得具有挑战性。因此,我们提供了一个轻量级的测试环境 `MockHyperlaneEnvironment`,让您能够在不需要分叉多个网络的情况下对您的跨链应用进行单元测试。 -Most multi-chain apps will be built on top of our Mailbox contract. So, we've abstracted away the details of a deployed mailbox with a `MockMailbox` and our environment contains an `originMailbox` and a `destinationMailbox` on the same chain. Internally, we store the messages arriving to the destination in the `inboundMessages` mapping on the destination mailbox. We simulate message delivery by enqueuing messages and increment the `inboundProcessedNonce` with `MockMailbox.processNextInboundMessage()`. +大多数多链应用将构建在我们的 Mailbox 合约之上。因此,我们使用 `MockMailbox` 将已部署的邮箱的细节抽象化,而我们的环境包含了同一链上的 `originMailbox` 和 `destinationMailbox`。在内部,我们通过将到达目标的消息存储在目标邮箱的 `inboundMessages` 映射中来模拟消息传递。我们通过将消息入队并使用 `MockMailbox.processNextInboundMessage()` 增加 `inboundProcessedNonce` 来模拟消息传递。 -The setup for the simple messaging forge test is as following: +简单消息 Forge 测试的设置如下: ### Sending a message @@ -45,7 +45,7 @@ contract SimpleMessagingTest is Test { ### Testing Router-based apps -Assuming you're testing `TestCrosschainApp` which inherits from `Router`: +假设您正在测试继承自 `Router` 的 `TestCrosschainApp`: ```solidity contract CrosschainAppTest is Test { @@ -67,7 +67,7 @@ contract CrosschainAppTest is Test { } ``` -Call `processNextPendingMessage()` and `processNextPendingMessageFromDestination()` to process inbound messages for destination and origin mailboxes respectively. Now, you can make your cross-chain calls from origin to destination and vice-versa: +调用 `processNextPendingMessage()` 和 `processNextPendingMessageFromDestination()` 分别处理目标邮箱和源邮箱的入站消息。现在,您可以从源链到目标链以及从目标链到源链进行跨链调用了: ```solidity function testRemoteTelephoneCallFromOrigin() public { @@ -97,7 +97,7 @@ Call `processNextPendingMessage()` and `processNextPendingMessageFromDestination } ``` -If you want to use your own ISM for your app, you can override the `defaultIsm` mailbox provides by passing it to the Router's `initialize` method like following: +如果您想为您的应用程序使用自己的 ISM,可以通过将其传递给 Router 的 `initialize` 方法来覆盖 Mailbox 提供的 `defaultIsm`,如下所示: ```solidity contract CrosschainAppTest is Test { @@ -123,8 +123,8 @@ contract CrosschainAppTest is Test { } ``` -:::tip +:::提示 -You can find examples of our unit testing setup here: [InterchainAccountRouterTest](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/dae8b26ed65383844e4fbed7585deeb52da4e454/solidity/test/InterchainAccountRouter.t.sol#L38) +您可以在此处找到我们单元测试设置的示例:[InterchainAccountRouterTest](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/dae8b26ed65383844e4fbed7585deeb52da4e454/solidity/test/InterchainAccountRouter.t.sol#L38) ::: From c8bb16a420d7fe3eb5ddef709f72748d41773234 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Thu, 15 Feb 2024 20:49:47 +0800 Subject: [PATCH 14/58] create-custom-hook-and-ism.mdx to Chinese --- docs/guides/create-custom-hook-and-ism.mdx | 46 +++++++++++----------- docs/guides/ecosystems/solana.mdx | 4 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/docs/guides/create-custom-hook-and-ism.mdx b/docs/guides/create-custom-hook-and-ism.mdx index ecc4577f..7ba1cae4 100644 --- a/docs/guides/create-custom-hook-and-ism.mdx +++ b/docs/guides/create-custom-hook-and-ism.mdx @@ -3,11 +3,11 @@ import TabItem from "@theme/TabItem"; import { MultiLanguageExample } from "@site/src/components/InteractiveExample"; -# Building your own hooks and custom ISMs +# 构建自己的钩子和自定义ISM(Building your own hooks and custom ISMs) -Hooks and ISMs have a complementary relationship: you can customize your behavior from origin and they use a pairwise ISM contract on the destination to verify your custom hook behavior. +Hooks 和 ISM 之间具有互补关系:您可以从源头自定义行为,并且它们在目标上使用成对的 ISM 合约来验证您的自定义钩子行为。 -You can implement and utilize your own hook and ISM pattern as per your requirements. You can use an external bridge provide like Wormhole or Chainlink's CCIP by implementing the `IPostDispatchHook` interface on the source chain and `IInterchainSecurityModule` on the destination chain. +您可以根据自己的需求实现和利用自己的钩子和 ISM 模式。您可以通过在源链上实现 `IPostDispatchHook` 接口,以及在目标链上实现 `IInterchainSecurityModule` 接口,来使用外部提供的桥接器,如 Wormhole 或 Chainlink 的 CCIP。
`IPostDispatchHook` Interface @@ -38,11 +38,11 @@ You can implement and utilize your own hook and ISM pattern as per your requirem
-:::info -Hooks currently expect metadata to be formatted with the [`StandardHookMetadata` library](../reference/libraries/hookmetadata.mdx). +:::信息 +Hooks 目前期望元数据采用 [`StandardHookMetadata` 库的格式](../reference/libraries/hookmetadata.mdx)。 ::: -You can also inherit from our `AbstractMessageIdAuthorizedIsm` which allows for access control for a intermediate `verifyMessageId` function call which sets in storage the messageId to true if received from the authorized `AbstractMessageIdAuthHook` hook. This pattern is used currently in the [`OpStackHook`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/ef2ece300e71a30e8f4f59e5b26e21eea012d43b/solidity/contracts/hooks/OPStackHook.sol#L33C8-L33C8) \<> [`OpStackIsm`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/ef2ece300e71a30e8f4f59e5b26e21eea012d43b/solidity/contracts/isms/hook/OPStackIsm.sol#L31) pattern. +你也可以继承我们的 `AbstractMessageIdAuthorizedIsm`,它允许对中间的 `verifyMessageId` 函数调用进行访问控制,如果它是从授权的 `AbstractMessageIdAuthHook` 钩子接收到的,则将 messageId 设置为 true 并存储起来。这种模式目前在 [`OpStackHook`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/ef2ece300e71a30e8f4f59e5b26e21eea012d43b/solidity/contracts/hooks/OPStackHook.sol#L33C8-L33C8) <> [`OpStackIsm`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/ef2ece300e71a30e8f4f59e5b26e21eea012d43b/solidity/contracts/isms/hook/OPStackIsm.sol#L31) 模式中使用。 ### Workflow @@ -81,9 +81,9 @@ flowchart TB style E_B_D fill: #FF0099 ``` -### Interface +### 接口 -After implementing the above interfaces, you can override default hook along the hook metadata by using the overloaded `dispatch` call in our mailbox: + 在实现了上述接口之后,您可以通过使用我们邮箱中重载的 `dispatch` 调用来覆盖默认的钩子以及钩子元数据: @@ -92,7 +92,7 @@ After implementing the above interfaces, you can override default hook along the ``` -### Examples +### 示例 -- On the source chain, +- 在源链上, - - `mailbox.dispatch()` calls your custom hook via `AbstractMessageIdAuthHook.postDispatch()`. - - `_postDispatch` checks whether `latestDispatchedId` is the id being dispatched from the hook to make the mailbox is the contract calling the hook (since calling `postDispatch` isn't access controlled) - - `_sendMessageId` calls your custom external bridge logic like calling the CCIP router contract. + - `mailbox.dispatch()` 通过 `AbstractMessageIdAuthHook.postDispatch()` 调用您的自定义钩子。 + - `_postDispatch` 检查 `latestDispatchedId` 是否是从钩子调用中分派的 id,以确保邮箱是调用钩子的合约(因为调用 `postDispatch` 没有访问控制)。 + - `_sendMessageId` 调用您的自定义外部桥接逻辑,例如调用 CCIP 路由合约。 -- On the destination chain, - - the external bridge will call `verifyMessageId` function (which is access-controlled) and sets the `messageId` in the `verifiedMessages` mapping to true. - - on receiving the message for the relayer, the mailbox will call your ISM contract (specified in your recipient address) which checks if the messageId in the `verifiedMessages` mapping is true and returns true to the mailbox and vice versa. +- 在目标链上, + - 外部桥将调用 `verifyMessageId` 函数(受访问控制)并将 `messageId` 设置为 `verifiedMessages` 映射中的 true。 + - 在接收到消息后,邮箱将调用您的 ISM 合约(在您的接收者地址中指定),该合约将检查 `verifiedMessages` 映射中的 messageId 是否为 true,并向邮箱返回 true,反之亦然。 -:::warning -`AbstractMessageIdAuthorizedIsm` can send `msg.value` through `postDispatch` calls and we utilize the `verifiedMessages`' little endian 255 bits for storing the `msg.value` and the top bit for the actual receipt of the messageId delivery. Therefore, you can send upto 2^255 amount of value of the native token from origin and the destination ISM can only receive 2^255 amount of value of native token on the destination chain. +:::警告 + `AbstractMessageIdAuthorizedIsm` 可以通过 `postDispatch` 调用发送 `msg.value`,我们利用 `verifiedMessages` 的小端 255 位来存储 `msg.value`,并使用顶部位来表示 messageId 传递的实际接收情况。因此,您可以从源链发送高达 2^255 数量的原生代币,并且目标 ISM 只能在目标链上接收 2^255 数量的原生代币。 ::: -### Access Control +### 访问控制 -If `postDispatch` must only be called with a `message` that was _just_ dispatched, the `latestDispatchedId` function on the Mailbox can be used to verify the message was _actually_ dispatched. + 如果 `postDispatch` 必须只能使用刚刚发送的 `message` 调用,那么可以使用 Mailbox 上的 `latestDispatchedId` 函数来验证消息是否确实已经被发送。 -:::info -This is used instead of some `require(mailbox == msg.sender)` to support **composition** where a hook may pass a `message` along to another hook. +:::信息 + 这样做是为了支持**组合**,其中一个钩子可能会将 `message` 传递给另一个钩子,而不是使用 `require(mailbox == msg.sender)`。 ::: -The following utility is provided in the [`MailboxClient` library](../reference/libraries/mailboxclient.mdx) for convenience. + 为了方便起见,以下实用程序在 [`MailboxClient` 库](../reference/libraries/mailboxclient.mdx) 中提供。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/client/MailboxClient.sol#L89-L91 diff --git a/docs/guides/ecosystems/solana.mdx b/docs/guides/ecosystems/solana.mdx index cac3149d..aa233517 100644 --- a/docs/guides/ecosystems/solana.mdx +++ b/docs/guides/ecosystems/solana.mdx @@ -1,5 +1,5 @@ # Solana -Hyperlane supports Solana Virtual Machine (SVM), and is currently live supporting Zebec's [Nautilus Bridge](https://medium.com/hyperlane/case-study-interoperability-for-the-modular-rollup-stack-featuring-nautilus-d01118fe31ec). In addition, it is live on [Eclipse testnet](https://medium.com/hyperlane/hyperlane-expands-to-solana-vm-in-collaboration-with-eclipse-8465616fd0e4). +Hyperlane支持Solana虚拟机(SVM),目前已支持Zebec的[Nautilus Bridge](https://medium.com/hyperlane/case-study-interoperability-for-the-modular-rollup-stack-featuring-nautilus-d01118fe31ec)。此外,它还在[Eclipse测试网](https://medium.com/hyperlane/hyperlane-expands-to-solana-vm-in-collaboration-with-eclipse-8465616fd0e4)上实时运行。 -Our public tooling & docs are currently EVM-only, however, though we have internal tooling that we are working to open source and develop by end of the year. If you're excited about bringing Hyperlane to Solana reach out on [our Discord](https://discord.gg/hyperlane)! +我们的公共工具和文档目前仅支持EVM,但我们有一些内部工具正在努力开源,并计划在年底之前开发完毕。如果您对将Hyperlane引入Solana感兴趣,请加入[我们的Discord](https://discord.gg/hyperlane)! From 24f8ae2ca21e7668ae3a33df6a1c0e376b781fe4 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Fri, 16 Feb 2024 09:21:51 +0800 Subject: [PATCH 15/58] Translate deploy-hyperlane-local-agents.mdx to Chinese --- docs/guides/deploy-hyperlane-local-agents.mdx | 172 +++++++++--------- 1 file changed, 85 insertions(+), 87 deletions(-) diff --git a/docs/guides/deploy-hyperlane-local-agents.mdx b/docs/guides/deploy-hyperlane-local-agents.mdx index ec73790c..b4cadbeb 100644 --- a/docs/guides/deploy-hyperlane-local-agents.mdx +++ b/docs/guides/deploy-hyperlane-local-agents.mdx @@ -7,85 +7,85 @@ import DeployWarpRoutePartial from "/docs/partials/deploy-hyperlane/_deploy-warp import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; -# Deploy Hyperlane with Local Agents +# 使用本地代理部署 Hyperlane(Deploy Hyperlane with Local Agents) -:::tip +:::提示 -This guide is for advanced users who may eventually intend to run Hyperlane agents in a production-like environment. It will cover the basics of how to manually configure and run agents but **it is not a production setup guide**. +这个指南适用于高级用户,他们可能最终打算在类似生产环境的环境中运行 Hyperlane 代理。它将介绍如何手动配置和运行代理的基础知识,但**不是生产设置指南**。 -If not done so already, beginners should get started by [**deploying Hyperlane with Kurtosis agents**](../deploy-hyperlane.mdx). +如果尚未这样做,初学者应该从[**使用 Kurtosis 代理部署 Hyperlane**](../deploy-hyperlane.mdx)开始。 ::: -## Overview +## 概览 -There are six steps in this guide: +这个指南分为六个步骤: -1. [Set up keys](#1-set-up-keys) that you will use to deploy contracts and run validators and relayers. -1. [Deploy contracts](#2-deploy-contracts) to the local chain and to every remote chain with which the local chain will be able to send and receive messages. -1. [Run a validator](#3-run-a-validator) to provide the signatures needed for the Interchain Security Modules you deployed. -1. [Run a relayer](#4-run-a-relayer) to send and receive messages between the chains you deployed contracts to. -1. [Send a test message](#5-send-test-messages) to confirm that your relayer is able to deliver messages to and from each pair of chains. -1. [Deploy a Warp Route](#6-optional-deploy-a-warp-route) to send token value, not just messages, across chains. +1. [Set up keys](#1-set-up-keys) 您将使用这些密钥部署合约并运行验证人和中继。 +1. [Deploy contracts](#2-deploy-contracts) 在本地链和与本地链能够发送和接收消息的每个远程链上部署合约。 +1. [Run a validator](#3-run-a-validator) 为您部署的互链安全模块提供所需的签名。 +1. [Run a relayer](#4-run-a-relayer) 在您部署合约的链之间发送和接收消息。 +1. [Send a test message](#5-send-test-messages) 确认您的中继能够在每对链之间传递消息。 +1. [Deploy a Warp Route](#6-optional-deploy-a-warp-route) 跨链发送令牌,而不仅仅是消息。 -## Getting Started +## 立即开始 -## 1. Set up keys +## 1. 设置密钥 -## 2. Deploy contracts +## 2. 部署合约 -## 3. Run a validator +## 3. 运行验证人 -Validators provide the security for messages sent _from_ your chain to remote chains. They're only required when using a [Multisig ISM](../protocol/ISM/multisig-ISM.mdx). +验证者为从您的链发送到远程链的消息提供安全性。仅在使用[多重签名 ISM](../protocol/ISM/multisig-ISM.mdx)时才需要它们。 -### Setup directories +### 设置目录 -First, set the `CONFIG_FILES` environment variable to the path of the agent config generated in the [deploy contracts](#2-deploy-contracts) step. For example: +首先,将 `CONFIG_FILES` 环境变量设置为在 [部署合约](#2-deploy-contracts) 步骤中生成的代理配置文件的路径。例如: ```bash export CONFIG_FILES=/full/path/to/configs/agent-config-{timestamp}.json ``` -Next, create a local directory for your validator to write its signatures to. Remember the path, as you will need this when configuring your validator. +接下来,创建一个本地目录,用于让您的验证器将其签名写入其中。记住这个路径,因为在配置验证器时您将需要它。 -:::danger -The validator signatures path will be written on-chain as part of the [validator announcement transaction](./implementation-guide.mdx#validator-announce). **Be careful not to reveal any security-sensitive or personal information!** +:::危险操作 +验证器签名路径将作为[验证器公告交易](./implementation-guide.mdx#validator-announce)的一部分写入链上。**请注意不要泄露任何安全敏感或个人信息!** ::: ```sh -# Pick an informative name specific to the chain you're validating +# 选择一个具体到您正在验证的链的信息性名称 export VALIDATOR_SIGNATURES_DIR=/tmp/hyperlane-validator-signatures- -# Create the directory +# 创建目录 mkdir -p $VALIDATOR_SIGNATURES_DIR ``` -:::warning +:::警告 -You will not be able to mount anything in `/tmp` when running the agent via Docker on Mac. To counter this, create a local `tmp` directory to mount instead. +在 Mac 上通过 Docker 运行代理时,您将无法将任何内容挂载到 `/tmp`。为了解决这个问题,请创建一个本地的 `tmp` 目录进行挂载。 ```sh -# Create a local tmp directory that can be accessed by docker +# 创建一个本地的 tmp 目录,该目录可以被 Docker 访问。 mkdir tmp -# Pick an informative name specific to the chain you're validating +# 选择一个具有特定信息的名称,该名称与您正在验证的链相关。 export VALIDATOR_SIGNATURES_DIR=tmp/hyperlane-validator-signatures- -# Create the directory +# 创建目录 mkdir -p $VALIDATOR_SIGNATURES_DIR ``` ::: -### Configure +### 配置 -There are numerous parameters that validators can be configured with. For this guide, we are concerned with just a handful: +Validators可以配置许多参数。对于本指南,我们只关心其中的一小部分: | Parameter | Description | | ------------------------- | ------------------------------------------------------------------------------------------------------------- | @@ -95,22 +95,22 @@ There are numerous parameters that validators can be configured with. For this g | `--checkpointSyncer.path` | Path to local directory where validator signatures will be written. Same path as `$VALIDATOR_SIGNATURES_DIR`. | | `--validator.key` | Your validator's hexadecimal private key. | -:::info +:::信息 -Make sure the validator key corresponds to the address provided when setting up your MultisigIsmConfig. Otherwise, the Multisig ISM you deployed in the previous step will not be able to verify messages sent from your chain. +确保验证器密钥对应于设置 MultisigIsmConfig 时提供的地址。否则,你在上一步中部署的 Multisig ISM 将无法验证从你的链发送的消息。 ::: -To learn more about all the parameters you can change, read the [agent configuration reference](../operate/config-reference.mdx). +要了解您可以更改的所有参数,请阅读 [代理配置参考](../operate/config-reference.mdx)。 -**Update agent config** +****更新代理配置**** -Unless you are running Docker on Linux, you will also need to update the agent configuration for your network. This is because Docker does not support the [`host` network mode](https://docs.docker.com/network/drivers/host/) on Mac, Windows or Windows Server. +除非您正在Linux上运行Docker,否则您还需要更新您网络的代理配置。这是因为Docker在Mac、Windows或Windows Server上不支持[`host`网络模式](https://docs.docker.com/network/drivers/host/)。 -To do this, navigate to the agent-configuration at `$CONFIG_FILES` and replace all instances of "localhost" or "127.0.0.1" in to `host.docker.internal`. For example: +要做到这一点,请转到`$CONFIG_FILES`下的代理配置,将所有实例中的 "localhost" 或 "127.0.0.1" 替换为 `host.docker.internal`。例如: ```json ... @@ -128,16 +128,16 @@ To do this, navigate to the agent-configuration at `$CONFIG_FILES` and replace a ... ``` -**Mounting directories** +**挂载目录** -Running with Docker adds an extra layer of complexity because config files need to be accessible from within the Docker container, and validator signatures need to be accessible from outside of the container for the relayer to read. This is so the relayer can construct the metadata required for the message to be successfully validated by the Multisig ISM. +使用Docker运行会增加额外的复杂性,因为配置文件需要从Docker容器内部访问,并且验证器签名需要从容器外部访问,以便中继器能够读取。这样中继器就可以构建所需的元数据,以便消息能够成功地通过Multisig ISM进行验证。 -To solve this issue, you can mount directories on your file system into the container. In the arguments below, we: +为解决这个问题,您可以将文件系统中的目录挂载到容器中。在下面的参数中,我们: -1. Set the `$CONFIG_FILES` environment variable to a fixed path within the container. -1. Mount the agent config file to this fixed path and making it readonly. -1. Mount the persistent data directory at a fixed path within the container. -1. Mount the validator signatures directory to a fixed path within the container. +1. 将 `$CONFIG_FILES` 环境变量设置为容器内的固定路径。 +1. 将代理配置文件挂载到此固定路径,并将其设置为只读。 +1. 将持久数据目录挂载到容器内的固定路径。 +1. 将验证器签名目录挂载到容器内的固定路径。 ```sh ... @@ -148,7 +148,7 @@ To solve this issue, you can mount directories on your file system into the cont ... ``` -Hardcoding these paths deduplucates the configuration between docker instances running validators for different origin chains. This makes it easier to pass the right arguments when running the container. See the example below, where the only items to be configured differently for different chains are the chain name and validator key. +硬编码这些路径可以在运行验证器的不同源链的 Docker 实例之间去重配置。这样可以更轻松地在运行容器时传递正确的参数。请参阅下面的示例,其中唯一需要针对不同链进行不同配置的是链名称和验证器密钥。 ```sh ... @@ -164,15 +164,15 @@ Hardcoding these paths deduplucates the configuration between docker instances r -**Clone and setup** +**克隆并设置** -First, clone the Hyperlane monorepo: +首先,克隆 Hyperlane monorepo: ```sh git clone git@github.com:hyperlane-xyz/hyperlane-monorepo.git ``` -Then follow the [setup instructions](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md) in the `rust` directory. This should setup `rustup` as well as Rosetta 2 if you are on Apple Silicon. +然后按照 `rust` 目录中的 [设置说明](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md) 进行操作。这将设置 `rustup` ,如果你使用的是 Apple Silicon,则会安装 Rosetta 2。 ```sh # install rustup @@ -185,23 +185,22 @@ softwareupdate --install-rosetta --agree-to-license -### Run +### 运行 -Now that you understand more about configuring validator arguments, pull the latest docker image: +现在您对配置验证器参数有了更多的了解,请拉取最新的 Docker 镜像: ```sh docker pull gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519 ``` -Before running, ensure that all directories you need to mount are present. This may involve creating `hyperlane_db_validator_` if it does not exist yet. +在运行之前,请确保所有需要挂载的目录都存在。这可能需要创建 `hyperlane_db_validator_`,如果它尚不存在的话。 ```sh mkdir -p hyperlane_db_validator_ ``` - -Finally, run the validator: + 最后,运行验证程序: ```sh docker run \ @@ -223,7 +222,7 @@ docker run \ -After following the setup instructions, you should now be able to use `cargo` to run the Validator: +完成设置后,您现在应该能够使用 `cargo` 运行验证器: ```sh cargo run --release --bin validator -- \ @@ -234,15 +233,15 @@ cargo run --release --bin validator -- \ --validator.key ``` -:::note (optional) Run the binary directly +:::备注(可选):直接运行二进制文件 -You can alternatively build out the agent: +你也可以构建代理程序: ```sh cargo build --release bin validator ``` -And run the binary directly: +然后直接运行二进制文件: ```sh ./target/release/validator \ @@ -258,13 +257,13 @@ And run the binary directly: -For further information, check out the [Validators guide](../operate/validators/run-validators.mdx). +欲了解更多信息,请查阅[验证者指南](../operate/validators/run-validators.mdx)。 -## 4. Run a relayer +## 4. 运行中继器 -Relayers deliver interchain messages sent between the local and remote chains. +Relayers负责传递在本地链和远程链之间发送的跨链消息。 -You should already have set the `CONFIG_FILES` environment variable to the path of the agent config generated in the [deploy contracts](#2-deploy-contracts) step. If not, do so now. +如果还没有,请确保已将 `CONFIG_FILES` 环境变量设置为在 [部署合约](#2-deploy-contracts) 步骤中生成的代理配置文件的路径。 ```bash export CONFIG_FILES=/full/path/to/configs/agent-config-{timestamp}.json @@ -272,7 +271,7 @@ export CONFIG_FILES=/full/path/to/configs/agent-config-{timestamp}.json ### Configure -There are numerous parameters that validators can be configured with. For this guide, we are concerned with just a handful: +这个指南涉及到配置验证器的许多参数。对于这个指南,我们只关注其中的一小部分: | Parameter | Description | | ------------------------------- | ---------------------------------------------------------------------------------------- | @@ -282,23 +281,22 @@ There are numerous parameters that validators can be configured with. For this g | `--defaultSigner.key` | A hexadecimal private key used to sign transactions for all chains. | | `--metrics-port` | Optional. The port to expose prometheus metrics on, defaults to `9090`. | -:::tip -Your set of relay chains should include both the origin chain and destination chain. +:::提示 +您的中继链集应包括原始链和目标链。 ::: -To learn more about all the parameters you can change, read the [agent configuration reference](../operate/config-reference.mdx). +要了解您可以更改的所有参数,请阅读 [代理配置参考](../operate/config-reference.mdx)。 -**Mounting directories** - -For the relayer, we provide almost the same arguments to Docker as the validator: +**挂载目录** +对于中继器(relayer),我们向Docker提供的参数几乎与验证器相同。 -1. Set the `$CONFIG_FILES` environment variable to a fixed path within the container. -1. Mount the agent config file to this fixed path and making it **readonly**. -1. Mount the persistent data directory at a fixed path within the container. -1. Mount the validator signatures directory to a fixed path within the container and making it **readonly**. +1. 将`$CONFIG_FILES`环境变量设置为容器内的固定路径。 +1. 将代理配置文件挂载到此固定路径,并将其设置为**只读**。 +1. 将持久化数据目录挂载到容器内的固定路径。 +1. 将验证器签名目录挂载到容器内的固定路径,并将其设置为**只读**。 ```sh ... @@ -309,14 +307,14 @@ For the relayer, we provide almost the same arguments to Docker as the validator ... ``` -Hardcoding these paths deduplucates the configuration between docker instances running relayers for different sets of chains. This makes it easier to pass the right arguments when running the container. See the example below, where the only items to be configured differently for different chains are the list of chains to relay between and the relayer key. +硬编码这些路径可以消除在运行中维护不同链集的中继器的Docker实例之间的配置重复。这样可以在运行容器时更容易传递正确的参数。请参阅下面的示例,其中唯一需要针对不同链进行配置的项目是中继的链列表和中继器密钥。 -**Clone and setup** +**克隆并设置** -If you haven't already done so, clone the Hyperlane monorepo and follow the [setup instructions](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md) in the `rust` directory. +如果还没有这样做,请克隆 Hyperlane monorepo 并按照 `rust` 目录中的 [设置说明](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md) 进行操作。 ```sh # clone hyperlane monorepo @@ -332,24 +330,24 @@ softwareupdate --install-rosetta --agree-to-license -### Run +### 运行 -If you haven't already pulled the Docker image, do this now by running: +如果您还没有拉取 Docker 镜像,请现在运行以下命令进行操作: ```sh docker pull gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519 ``` -Before running, ensure that all directories you need to mount are present. This may involve creating `hyperlane_db_relayer` if it does not exist yet. +在运行之前,请确保所有需要挂载的目录都存在。如果尚不存在的话,可能需要创建 `hyperlane_db_relayer` 目录。 ```sh mkdir -p hyperlane_db_validator_ ``` -Finally, run the relayer: +最后,运行中继器: ```sh docker run \ @@ -369,7 +367,7 @@ docker run \ -After following the setup instructions, you should now be able to use `cargo` to run the Relayer: +在按照设置说明进行操作后,您现在应该可以使用 `cargo` 运行中继器了: ```sh cargo run --release --bin relayer -- \ @@ -380,17 +378,17 @@ cargo run --release --bin relayer -- \ --metrics-port 9091 ``` -The metrics port is overriden to avoid clashing with the validator. +为了避免与验证器发生冲突,metrics端口被覆盖。 -:::note (optional) Run the binary directly +:::备注(可选):直接运行二进制文件 -You can alternatively build out the agent: +您也可以选择构建代理程序: ```sh cargo build --release bin relayer ``` -And run the binary directly: +然后直接运行二进制文件: ```sh ./target/release/relayer \ @@ -406,12 +404,12 @@ And run the binary directly: -For further information, check out the [Relayer guide](../operate/relayer/run-relayer.mdx). +要获取更多信息,请查阅[中继器指南](../operate/relayer/run-relayer.mdx)。 -## 5. Send test messages +## 5. 发送测试信息 -## 6. (Optional) Deploy a Warp Route +## 6. (可选) 部署一个Warp Route From d4df3d16776c044e83b86ef344108a9c2a23a2a2 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Fri, 16 Feb 2024 10:02:28 +0800 Subject: [PATCH 16/58] Translate deploy-warp-route.mdx to Chinese --- docs/guides/deploy-warp-route.mdx | 92 +++++++++++++++---------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/docs/guides/deploy-warp-route.mdx b/docs/guides/deploy-warp-route.mdx index 952bd161..6dccd4aa 100644 --- a/docs/guides/deploy-warp-route.mdx +++ b/docs/guides/deploy-warp-route.mdx @@ -1,106 +1,106 @@ -# Deploy a Warp Route +# 部署一个Warp 路由 -_Create an interchain route for your token_ +_创建一个跨链路由以管理您的代币_ -A Warp Route is a type of [router](../reference/libraries/router.mdx) application, requiring a `HypERC20` or `HypERC721` token contract to be deployed on each chain you wish to support. +Warp 路由是一种 [路由器](../reference/libraries/router.mdx) 应用程序类型,需要在您希望支持的每条链上部署一个 `HypERC20` 或 `HypERC721` 代币合约。 -:::info +:::信息 -Check out the [Warp Route](/docs/reference/applications/warp-routes) reference page for more information on the interface and security implications of a Warp Route. +查看 [Warp 路由](/docs/reference/applications/warp-routes) 参考页面,了解有关 Warp 路由接口和安全性影响的更多信息。 ::: -## Prerequisites +## 先决条件(Prerequisites) * [Hyperlane CLI](https://www.npmjs.com/package/@hyperlane-xyz/cli) -* A private key for contract transaction signing +* 用于合约交易签名的私钥 -## 1. Configuration +## 1. 配置 -### Warp Route config +### Warp 路由配置 -To deploy the route, you will need a Warp Route config file. A valid config will specify: -* Which token, on which chain, is this Warp Route being created for? -* _Optional:_ Hyperlane connection details including contract addresses for the [mailbox](../reference/messaging/messaging-interface.mdx), [interchain gas](../reference/hooks/interchain-gas.mdx), and [interchain security modules](../reference/ISM/specify-your-ISM.mdx). -* _Optional:_ The token standard - fungible tokens using ERC20 or NFTs using ERC721. Defaults to ERC20. +要部署路由,您将需要一个 Warp 路由配置文件。有效的配置将指定: +* 这个 Warp 路由是为哪个链上的哪个代币创建的? +* _可选:_ Hyperlane连接细节,包括[邮箱](../reference/messaging/messaging-interface.mdx)、[跨链燃料](../reference/hooks/interchain-gas.mdx)和[跨链安全模块](../reference/ISM/specify-your-ISM.mdx)的合约地址。 +* _可选:_ 代币标准 - 使用 ERC20 的可互换代币或使用 ERC721 的非同质化代币。默认为 ERC20。 -The easiest way to create one is with the CLI's config comamnd: +最简单的方法是使用 CLI 的 config 命令创建一个。 ```bash hyperlane config create warp ``` -:::tip +:::提示 -If your config looks correct, you can now skip to [Step 2: Deployment](#2-deployment). -Or see below for details on how to define your config manually. +如果您的配置看起来正确,现在可以直接跳转到 [第二步:部署](#2-deployment)。 +或者查看下面的详细信息,了解如何手动定义您的配置。 ::: -#### Base +#### 基础(Base) -Your config must have exactly one `base` entry. Here you will configure details about the token for which you are creating a Warp Route. +您的配置必须恰好有一个 `base` 条目。在这里,您将配置有关您正在创建 Warp 路由的代币的详细信息。 -* **chainName**: Set this equal to the chain on which your token exists -* **type**: Set this to `TokenType.collateral` to create a Warp Route for an ERC20/ERC721 token, or `TokenType.native` to create a Warp Route for a native token (e.g. ether) -* **address:** If using `TokenType.collateral`, the address of the ERC20/ERC721 contract for which to create a route -* **isNft:** If using `TokenType.collateral` for an ERC721 contract, set to `true`. +* **chainName**: 将此设置为您的代币存在的链。 +* **type**: 将其设置为 `TokenType.collateral` 以创建一个用于 ERC20/ERC721 代币的 Warp 路由,或者将其设置为 `TokenType.native` 以创建一个用于原生代币(例如以太币)的 Warp 路由。 +* **address:** 如果使用 `TokenType.collateral`,则为要创建路由的 ERC20/ERC721 合约的地址。 +* **isNft:** 如果对一个 ERC721 合约使用 `TokenType.collateral`,则设置为 `true`。 -#### Synthetics +#### 合成资产(Synthetics) -Your config must have at least one `synthetics` entry. Here you will configure details about the remote chains supported by your Warp Route. +您的配置必须至少有一个 `synthetics` 条目。在这里,您将配置有关您的 Warp 路由支持的远程链的详细信息。 -* **chainName:** Set this equal to the chain on which you want a wrapped version of your token +* **chainName:** 将此设置为您希望获得您代币的封装版本的链。 -#### Optional fields +#### 可选字段(Optional fields) -You may specify the following optional values in your `base` and `synthetics` entries. If no values are provided, values from core deployment artifacts will be used, either yours (if provided) or the [SDK's](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/consts/environments/mainnet.json). +您可以在您的 `base` 和 `synthetics` 条目中指定以下可选值。如果未提供任何值,则将使用核心部署文件中的值,这些文件可能是您自己的(如果提供了)或[SDK的](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/consts/environments/mainnet.json)。 -* **mailbox:** The address of the the [mailbox](../reference/messaging/messaging-interface.mdx) contract to use to send and receive messages -* **interchainSecurityModule:** The address of an [interchain security modules](../reference/ISM/specify-your-ISM.mdx) to verify interchain messages -* **interchainGasPaymaster:** The address of a [interchain gas payments](../reference/hooks/interchain-gas.mdx) to pay for the gas needed to deliver interchain messages +* **mailbox:** 用于发送和接收消息的[邮箱](../reference/messaging/messaging-interface.mdx)合约的地址 +* **interchainSecurityModule:** 用于验证跨链消息的[跨链安全模块](../reference/ISM/specify-your-ISM.mdx)的地址 +* **interchainGasPaymaster:** 用于支付交付跨链消息所需的燃料费用的[跨链燃料支付](../reference/hooks/interchain-gas.mdx)的地址 -#### Example +#### 示例 -For a minimal Warp config example using local anvil chains, see [`warp-tokens.yaml`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/warp-tokens.yaml). +对于使用local anvil chains的最小 Warp 配置示例,请参阅 [`warp-tokens.yaml`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/warp-tokens.yaml)。 -### Chain config +### 链配置(Chain Config) -The Warp Route deployment will require basic information about any chains it will be interacting with. If the target chains include any not already in the Hyperlane SDK, you must specify chain metadata for it. +Warp 路由部署将需要关于其将与之交互的任何链的基本信息。如果目标链包括 Hyperlane SDK 中尚未包含的任何链,您必须为其指定链元数据。 -To see what chains are in the SDK, run the following command: +要查看 SDK 中包含哪些链,请运行以下命令: ```bash hyperlane chains list ``` -To create a chain metadata config for any other chains, run the following command: +要为其他任何链创建链元数据配置,请运行以下命令: ```bash hyperlane config create chain ``` -Or you can define the config manually. See the [ChainMetadata type](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/metadata/chainMetadataTypes.ts#L62) for its schema. A minimal example can be found in [`anvil-chains.yaml`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/anvil-chains.yaml). +或者您可以手动定义配置。参见 [ChainMetadata type](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/metadata/chainMetadataTypes.ts#L62) 以查看其架构。您可以在 [`anvil-chains.yaml`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/anvil-chains.yaml) 中找到一个最小的示例。 -## 2. Deployment +## 2. 部署 -Run the following command to initiate the Warp Route deployment: +运行以下命令以启动 Warp 路由部署: ```bash hyperlane deploy warp ``` -Once finished, the CLI will create two new JSON artifact files: `warp-deployment` and `warp-ui-token-config`. The first contains just addresses for the newly deployed Warp router contracts. The second is a config file for the Warp UI, which you can use for the next optional step. +完成后,CLI 将创建两个新的 JSON 文件:`warp-deployment` 和 `warp-ui-token-config`。第一个文件仅包含新部署的 Warp 路由器合约的地址。第二个是 Warp UI 的配置文件,您可以在下一个可选步骤中使用。 -## 3. Testing +## 3. 测试 -You can initiate a test transfer of a single wei with the following command: +您可以使用以下命令发起一次单个 wei 的测试转账: ```bash hyperlane send transfer ``` -If everything goes well, you should see the output similar to the following: +如果一切顺利,您应该会看到类似以下的输出: ``` Waiting for message delivery on destination chain @@ -111,6 +111,6 @@ Confirmed balance increase Warp test transfer complete ``` -## 4. (Optional) Warp UI +## 4. (可选) Warp UI -The Warp UI is a DApp template for interacting with Warp Routes. See the [Warp UI docs](./deploy-warp-route-UI.mdx) for details on how to set it up. +Warp UI 是一个用于与 Warp 路由交互的 DApp 模板。请参阅 [Warp UI 文档](./deploy-warp-route-UI.mdx) 了解设置方法的详细信息。 From 007e8d7c079c64f003a4b7900aad25da3797e382 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Fri, 16 Feb 2024 10:19:30 +0800 Subject: [PATCH 17/58] Translate deploy-warp-route-UI.mdx to Chinese --- docs/guides/deploy-warp-route-UI.mdx | 54 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/guides/deploy-warp-route-UI.mdx b/docs/guides/deploy-warp-route-UI.mdx index d7b77fdb..02bdca93 100644 --- a/docs/guides/deploy-warp-route-UI.mdx +++ b/docs/guides/deploy-warp-route-UI.mdx @@ -1,41 +1,41 @@ import TypescriptSdkPlaceholder from "/docs/partials/ts-sdk-placeholder.mdx"; -# Deploy a UI for your Warp Route +# 部署一个用于您的 Warp 路由的用户界面 -After you've successfully [deployed a Warp Route](./deploy-warp-route.mdx), you may want to deploy a front-end UI to faciliate interchain token transfers. You can fork the [Hyperlane Warp UI template](https://github.com/hyperlane-xyz/hyperlane-warp-ui-template) and customize it to fit your needs. +在成功[部署了一个 Warp 路由](./deploy-warp-route.mdx)之后,您可能希望部署一个前端用户界面来促进跨链代币转账。您可以 fork [Hyperlane Warp UI 模板](https://github.com/hyperlane-xyz/hyperlane-warp-ui-template) 并根据您的需求进行定制。 -## Configure & Customize the UI +## 配置和定制用户界面 -Follow the [customization instructions](https://github.com/hyperlane-xyz/hyperlane-warp-ui-template/blob/main/CUSTOMIZE.md) for details on how to configure the UI's tokens and change the default branding assets/theme. +请按照 [自定义说明](https://github.com/hyperlane-xyz/hyperlane-warp-ui-template/blob/main/CUSTOMIZE.md) 中的说明,了解如何配置 UI 的代币和更改默认的品牌资产/主题。 -### Token Config Example +### 代币配置示例 -Here's an example of a token config for a Warp Route that connects WETH on Goerli (chain ID 5). You can use Typescript, JSON, or YAML configs for your token configs. +这是一个 Warp 路由的代币配置示例,连接到 Goerli 上的 WETH(链 ID 5)。您可以使用 Typescript、JSON 或 YAML 配置您的代币配置。 ```typescript { - // The chain ID of the base chain + // 链ID chainId: 5, - // The address of the underlying token + // 代币的地址 address: '0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6', - // The address of the HypERC20Token contract + // HypERC20Token 合约的地址 hypCollateralAddress: '0x145de8760021c4ac6676376691b78038d3DE9097', - // The type, either 'collateral' or 'native' + // 类型:可以是 'collateral' 或 'native' type: 'collateral' - // The base token name + // 代币名称 name: 'Weth', - // The base token symbol + // 代币符号 symbol: 'WETH', - // The base token decimals + // 代币小数 decimals: 18, - // A path to a token logo image + // 代币LOGO路径 logoURI: '/logos/weth.png' } ``` -#### Chain Config Example +#### 链配置示例 -Chain metadata can also be configured as needed. These are the same configs as the those used with the CLI for any of its deploy or send command (for example, those from the [deploy guide](../deploy-hyperlane.mdx)). +链元数据也可以根据需要进行配置。这些配置与 CLI 中用于任何部署或发送命令的配置相同(例如,来自[部署指南](../deploy-hyperlane.mdx)的配置)。 ```typescript { @@ -55,25 +55,25 @@ anvil1: { } ``` -### Deploy the UI +### 部署用户界面 -Since the UI is a Next.js app, you can use your favorite hosting service to host it. We recommend [Vercel](https://vercel.com), which works very well with Next. [AWS Amplify](https://aws.amazon.com/amplify) is another popular option. +由于用户界面是一个 Next.js 应用程序,您可以使用您喜欢的托管服务来托管它。我们推荐使用 [Vercel](https://vercel.com),它与 Next.js 非常配合。[AWS Amplify](https://aws.amazon.com/amplify) 是另一个流行的选择。 -* Sign up for [Vercel](https://vercel.com/) -* Create a new project -* Connect it to your Git repo -* Hit Deploy! +* 注册 [Vercel](https://vercel.com/) +* 创建新项目 +* 将其连接到您的 Git 仓库 +* 点击部署! -And that's it! Now you and your users can use the UI to send tokens from the collateral chain to remote chains, from one remote chain to another, and from any remote chain back to the collateral chain. +就是这样!现在您和您的用户可以使用该用户界面将代币从抵押链(collateral chain)发送到远程链,从一个远程链发送到另一个远程链,并从任何远程链发送回抵押链。 -### Return gas +### 返回燃料(Return gas) -A common problem with token bridges like Warp Routes is that a user may transfer a token like USDC to a new chain, but only afterwards realize that they do not have the native gas token to move those tokens anywhere including back. +像 Warp 路由这样的代币桥接器的一个常见问题是,用户可能会将诸如 USDC 的代币转移到新链上,但只在此之后才意识到他们没有本地的燃料代币将这些代币移动到任何地方,包括返回。 -Besides warning users in the UI about ensuring they have gas, you can also faucet them some native gas tokens to improve their initial experience. To achieve this faucet, you can modify the Warp Route contracts to hold some balance of the native token and share that with recipients. In addition, you could build an off-chain service which just observes for [`ReceivedTransferRemote events`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/token/libs/TokenRouter.sol) and transfers the native gas token to the recipient. +除了在用户界面中警告用户确保他们拥有燃料之外,您还可以为他们提供一些本地燃料代币,以改善他们的初始体验。要实现这个水龙头,您可以修改 Warp 路由合约以持有一些本地代币的余额,并与接收者分享。此外,您还可以构建一个离线服务,该服务只需观察 [`ReceivedTransferRemote events`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/token/libs/TokenRouter.sol) 并将本地燃料代币转移到接收者。 -:::tip +:::提示 From 717bca58c57cede7514bac482f12c3b32aa97e61 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Fri, 16 Feb 2024 15:15:24 +0800 Subject: [PATCH 18/58] Translate implementation-guide.mdx to Chinese --- docs/deploy-hyperlane.mdx | 2 +- docs/guides/create-custom-hook-and-ism.mdx | 2 +- .../explorer-debugging/rest-api.mdx | 2 +- docs/guides/implementation-guide.mdx | 126 +++++++++--------- docs/guides/latencies.mdx | 6 +- docs/guides/token-faucets.mdx | 2 +- docs/guides/v2-to-v3-migration.mdx | 38 +++--- docs/intro.mdx | 6 +- docs/your-first-message.mdx | 4 +- 9 files changed, 94 insertions(+), 94 deletions(-) diff --git a/docs/deploy-hyperlane.mdx b/docs/deploy-hyperlane.mdx index a523b4a7..d15e6bf0 100644 --- a/docs/deploy-hyperlane.mdx +++ b/docs/deploy-hyperlane.mdx @@ -9,7 +9,7 @@ import DeployWarpRoutePartial from "/docs/partials/deploy-hyperlane/_deploy-warp 任何人都可以在任何链上部署 Hyperlane。 本指南涵盖从新 EVM 链发送第一条链间信息。在本指南结束时,您将部署并配置好邮箱智能合约和链外代理,从而允许开发人员向您的链发送链间消息或从您的链发送链间消息。 -:::备注 +:::note 本指南专门用于演示如何将已有Hyperlane的链连接到没有Hyperlane的新链上。 diff --git a/docs/guides/create-custom-hook-and-ism.mdx b/docs/guides/create-custom-hook-and-ism.mdx index 7ba1cae4..dc9cf586 100644 --- a/docs/guides/create-custom-hook-and-ism.mdx +++ b/docs/guides/create-custom-hook-and-ism.mdx @@ -42,7 +42,7 @@ Hooks 和 ISM 之间具有互补关系:您可以从源头自定义行为,并 Hooks 目前期望元数据采用 [`StandardHookMetadata` 库的格式](../reference/libraries/hookmetadata.mdx)。 ::: -你也可以继承我们的 `AbstractMessageIdAuthorizedIsm`,它允许对中间的 `verifyMessageId` 函数调用进行访问控制,如果它是从授权的 `AbstractMessageIdAuthHook` 钩子接收到的,则将 messageId 设置为 true 并存储起来。这种模式目前在 [`OpStackHook`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/ef2ece300e71a30e8f4f59e5b26e21eea012d43b/solidity/contracts/hooks/OPStackHook.sol#L33C8-L33C8) <> [`OpStackIsm`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/ef2ece300e71a30e8f4f59e5b26e21eea012d43b/solidity/contracts/isms/hook/OPStackIsm.sol#L31) 模式中使用。 +你也可以继承我们的 `AbstractMessageIdAuthorizedIsm`,它允许对中间的 `verifyMessageId` 函数调用进行访问控制,如果它是从授权的 `AbstractMessageIdAuthHook` 钩子接收到的,则将 messageId 设置为 true 并存储起来。这种模式目前在 [`OpStackHook`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/ef2ece300e71a30e8f4f59e5b26e21eea012d43b/solidity/contracts/hooks/OPStackHook.sol#L33C8-L33C8) \<> [`OpStackIsm`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/ef2ece300e71a30e8f4f59e5b26e21eea012d43b/solidity/contracts/isms/hook/OPStackIsm.sol#L31) 模式中使用。 ### Workflow diff --git a/docs/guides/developer-tips/explorer-debugging/rest-api.mdx b/docs/guides/developer-tips/explorer-debugging/rest-api.mdx index cbc3d70c..88a69b7c 100644 --- a/docs/guides/developer-tips/explorer-debugging/rest-api.mdx +++ b/docs/guides/developer-tips/explorer-debugging/rest-api.mdx @@ -109,7 +109,7 @@ Action: `search-messages`, Parameter (1 required): ### 无需权限的互操作链的APIs -Hyperlane 可以[无需权限地部署](.../.../.../deploy-hyperlane.mdx)到任何链上,但PI链上的消息无法被默认的Hyperlane代理所识别。要查看来自PI链的消息的详细信息,请查询search-pi-messages操作。搜索需要在请求正文中提供链配置。请注意,这个功能也可以在[资源管理器用户界面](.../.../.../guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx)中使用。 +Hyperlane 可以[permissionlessly deployed](../../../deploy-hyperlane.mdx)到任何链上,但PI链上的消息无法被默认的Hyperlane代理所识别。要查看来自PI链的消息的详细信息,请查询search-pi-messages操作。搜索需要在请求正文中提供链配置。请注意,这个功能也可以在[资源管理器用户界面](.../.../.../guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx)中使用。 ```javascript const chainConfig = { diff --git a/docs/guides/implementation-guide.mdx b/docs/guides/implementation-guide.mdx index d0aca84f..9264e0fc 100644 --- a/docs/guides/implementation-guide.mdx +++ b/docs/guides/implementation-guide.mdx @@ -1,23 +1,23 @@ -# Implementation Guide +# 实施指南(Implementation Guide) -A Hyperlane implementation for a new chain architecture is comprised of the following: +一个新链架构的 Hyperlane 实施由以下内容组成: -1. [Contracts](#1-contracts): expose the interface for application developers to send and receive messages with -2. [Agents](#2-agents): operate the protocol by adding security and relaying messages -3. [Applications](#3-applications): applications that use the protocol and demonstrate its capabilities +1. [Contracts](#1-contracts): 公开应用程序开发人员用于发送和接收消息的接口 +2. [Agents](#2-agents): 通过添加安全性并中继消息来操作协议 +3. [Applications](#3-applications): 使用协议并展示其功能的应用程序 -Before getting started here, it is recommended to review the protocol documentation. +在开始之前,建议先查阅协议文档。 ## 1. Contracts -Below describes the onchain contract spec for the Hyperlane protocol. It uses solidity types for familiarity but everything should be generalizable to other languages. +下面描述了 Hyperlane 协议的链上合约规范。它使用了 Solidity 类型以便熟悉,但所有内容都可以推广到其他语言。 -* `address` should be interpreted as the local chain's address type -* `payable` describes a function that allows callers to pass native tokens +* `address` 应该解释为本地链的地址类型 +* `payable` 描述了一个允许调用者传递本地代币的函数 ### Message -The message is the core data structure used by the Hyperlane protocol. It is a packed data structure that contains all the information needed to route a message from one domain to another. +消息是 Hyperlane 协议使用的核心数据结构。它是一个紧凑的数据结构,包含了将消息从一个域路由到另一个域所需的所有信息。 * [Solidity Implementation](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/libs/Message.sol) * [Sway Implementation](https://github.com/hyperlane-xyz/fuel-contracts/blob/main/contracts/hyperlane-message/src/main.sw) @@ -43,14 +43,14 @@ struct Message { ### Mailbox -The mailbox is the entrypoint for developers to send and receive messages from. +邮箱是开发人员发送和接收消息的入口。 * [Solidity Implementation](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/Mailbox.sol) * [Sway Implementation](https://github.com/hyperlane-xyz/fuel-contracts/blob/main/contracts/hyperlane-mailbox/src/main.sw) #### dispatch -Dispatches a message to the destination domain and recipient. +将消息分派到目标域和接收者。 ```solidity function dispatch( @@ -68,7 +68,7 @@ function dispatch( #### process -Attempts to deliver `message` to its recipient. Verifies `message` via the recipient's ISM using the provided `metadata`. +尝试将 `message` 交付给其接收者。使用提供的 `metadata` 通过接收者的 ISM 验证 `message`。 ```solidity function process( @@ -81,7 +81,7 @@ function process( #### count -Returns the number of messages dispatched +返回已发送的消息数量。 ```solidity function count() public view returns (uint32); @@ -89,7 +89,7 @@ function count() public view returns (uint32); #### root -Returns root of merkle tree which contains all dispatched message IDs as leaves. +返回包含所有已发送消息 ID 的 Merkle 树的根(root of merkle tree)。 ```solidity function root() public view returns (bytes32); @@ -97,7 +97,7 @@ function root() public view returns (bytes32); ### Message Recipient -A contract that wants to receive a message must expose the following handler. +想要接收消息的合约必须公开以下处理程序。 * [Solidity Implementation](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/interfaces/IMessageRecipient.sol) * [Sway Implementation](https://github.com/hyperlane-xyz/fuel-contracts/blob/main/contracts/hyperlane-interfaces/src/lib.sw#L109) @@ -113,27 +113,27 @@ function handle( ); ``` -They may optionally specify a security module to verify messages before they are handled. +它们可以选择性地指定一个安全模块,在消息被处理之前进行验证。 ```solidity function interchainSecurityModule() returns (address); ``` -:::info +:::信息 -After implementing these three contracts, you can reach your first milestone to test, mocking a message transfer, by calling a `Mailbox`'s `dispatch` function to send a message to a recipient and assert that the recipient received the message. See a [Foundry test case here.](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/test/Messaging.t.sol#L29) +实现了这三个合约后,您就可以达到第一个里程碑,即通过调用 `Mailbox` 的 `dispatch` 函数来向接收者发送消息,并判断接收者是否收到了消息,以模拟消息传输。参见[这里的 Foundry 测试案例](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/test/Messaging.t.sol#L29)。 ::: -### Interchain Security Module +### 跨链安全模块(Interchain Security Module) -Interchain security modules are used to verify messages before they are processed. +跨链安全模块用于在消息被处理之前进行验证。 * [Solidity Implementation](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/interfaces/IInterchainSecurityModule.sol) #### moduleType -Returns an enum that represents the type of security model encoded by this ISM. +返回一个枚举,表示此 ISM 编码的安全模型的类型。 ```solidity enum ModuleType { @@ -149,11 +149,11 @@ enum ModuleType { function moduleType() returns (ModuleType); ``` -_Relayers infer how to fetch and format metadata from this type._ +_中继器推断如何从此类型获取和格式化元数据_ #### verify -Defines a security model responsible for verifying interchain messages based on the provided metadata. +定义一个安全模型,负责根据提供的元数据验证跨链消息。 ```solidity function verify( @@ -171,11 +171,11 @@ function verify( ### Validator Announce -Validators announce their signature storage location so that the relayer can fetch and verify their signatures. +验证器公布其签名存储位置,以便中继器获取并验证其签名。 ### announce -Announces a validator signature storage location +通知验证者签名存储位置 ```solidity function announce( @@ -187,7 +187,7 @@ function announce( ### getAnnouncedStorageLocations -Returns a list of all announced storage locations +返回所有已宣布的存储位置列表 ```solidity function getAnnouncedStorageLocations( @@ -199,14 +199,14 @@ function getAnnouncedStorageLocations( ### Multisig ISM -Implements a security module that checks if the metadata provided to verify satisfies a quorum of signatures from a set of configured validators. +实现一个安全模块,检查提供的元数据是否满足一组配置的验证者的签名法定数量。 * [Solidity Implementation](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/isms/multisig/AbstractMultisigIsm.sol) * [Sway Implementation](https://github.com/hyperlane-xyz/fuel-contracts/blob/main/contracts/multisig-ism/src/main.sw) #### Metadata -To be used with the MESSAGE_ID_MULTISIG module type implementation in the relayer, the metadata must be formatted as follows: +要与中继器中的 MESSAGE_ID_MULTISIG 模块类型实现一起使用,元数据必须格式化如下: * [Solidity Implementation](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/libs/isms/MessageIdMultisigIsmMetadata.sol) * [Sway Implementation](https://github.com/hyperlane-xyz/fuel-contracts/blob/main/contracts/multisig-ism-metadata/src/main.sw) @@ -224,9 +224,9 @@ struct MultisigMetadata { #### validatorsAndThreshold -Returns the set of validators responsible for verifying message and the number of signatures required +返回负责验证消息的验证者集合以及所需签名的数量 -_Can change based on the content of _message_ +_可以根据 _message 的内容进行更改_ ```solidity function validatorsAndThreshold( @@ -242,22 +242,22 @@ function validatorsAndThreshold( :::info -After implementing the MultisigISM, you reach the second milestone to test that your Mailbox only processes after a recipient's ISM returns true. You can test that with a `TestISM` that you can statically set to accept or reject any message. See a [Hardhat test case here.](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/test/mailbox.test.ts#L175) +实现了 MultisigISM 后,您就可以达到第二个里程碑,即测试您的邮箱仅在接收者的 ISM 返回 true 后才处理。您可以使用一个 `TestISM` 来测试,您可以静态设置它来接受或拒绝任何消息。参见[这里的 Hardhat 测试案例](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/test/mailbox.test.ts#L175)。 ::: ### Interchain Gas Paymaster -The gas paymaster is used to pay for the gas required in message processing on the destination chain. This is not strictly required if the relayer is willing to subsidize message processing. +燃料支付器用于支付目的链上信息处理所需的燃料。如果中继者愿意补贴信息处理费用,则不一定需要这样做。 * [Solidity Implementation](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/igps/InterchainGasPaymaster.sol) * [Sway Implementation](https://github.com/hyperlane-xyz/fuel-contracts/blob/main/contracts/igp/interchain-gas-paymaster/src/main.sw) #### payForGas -Deposits msg.value as a payment for the relaying of a message to its destination chain. +将 msg.value 存入作为向目标链中继消息的支付。 -_Overpayment will result in a refund of native tokens to the refundAddress. Callers should be aware that this may present reentrancy issues._ +_超额支付将导致向 refundAddress 退还本地令牌。调用者应注意这可能会产生重入问题。_ ```solidity function payForGas( @@ -274,7 +274,7 @@ function payForGas( #### Gas Payment -Emitted when a payment is made for a message's gas costs. +当支付消息燃料费用时发出。 ```solidity event GasPayment( @@ -286,21 +286,21 @@ event GasPayment( ## 2. Agents -Below describes the agent spec for a new chain implementation. The rust implementations hope to support all chains, but the spec is intended to be chain agnostic. +下面描述了新链实现的代理规范。Rust 实现希望支持所有链,但该规范的目的是与链无关。 #### Message Indexing -All agents must index messages from the origin mailbox. In the solidity mailbox, we [emit an event for each message](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/Mailbox.sol#L125-L129) dispatched. Other chains may have different ways of surfacing this information, but the agent must be able to get message content reliably and with consistent ordering -- see the [message indexer](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/hyperlane-core/src/traits/indexer.rs) trait. +所有代理必须索引来自原始邮箱的消息。在 Solidity 邮箱中,我们[为每条分派的消息发出一个事件](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/Mailbox.sol#L125-L129)。其他链可能有不同的方式来呈现这些信息,但代理必须能够可靠地获取消息内容,并具有一致的顺序 - 请参见[消息索引器](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/hyperlane-core/src/traits/indexer.rs)特性。 * [ethereum](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/chains/hyperlane-ethereum/src/mailbox.rs) ### Validator -In addition to indexing messages dispatched from the mailbox, validators produce attestations for the messages they observe to be used on the destination chain for security. +除了索引从邮箱分派的消息之外,验证者还会为他们观察到的消息生成认证,以便在目的地链上使用,确保安全。 #### Checkpoint -Validators produce attestations called checkpoints from the Mailbox which commit via merkle root to all dispatched message IDs. +验证者从邮箱产生称为检查点的认证,这些认证通过 Merkle 根对所有已分派的消息 ID 进行提交。 ```rust pub struct Checkpoint { @@ -315,11 +315,11 @@ pub struct Checkpoint { } ``` -Validators use the latest checkpoint method on the [mailbox trait](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/16146f0f03d0b0be67583cf16b22a3c50abdd977/rust/hyperlane-core/src/traits/mailbox.rs) to get the latest checkpoint from the mailbox and submit signatures to some highly available storage using the [checkpoint syncer trait](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/16146f0f03d0b0be67583cf16b22a3c50abdd977/rust/hyperlane-base/src/traits/checkpoint_syncer.rs). +验证者使用邮箱特性中的最新检查点方法来从邮箱获取最新的检查点,并使用检查点同步器特性将签名提交到一些高可用存储中。 #### Checkpoint with Message ID -Validators use indexed messages to join the checkpoint with the corresponding message ID emitted from the mailbox. +验证者使用索引消息将检查点与邮箱发出的相应消息 ID 进行关联。 ```rust pub struct CheckpointWithMessageId { @@ -331,61 +331,61 @@ pub struct CheckpointWithMessageId { } ``` -They also publish these augmented checkpoints on their syncer. +他们还将这些增强的检查点发布到他们的同步器上。 :::tip -You can test your validator by configuring it with a chain with the above contracts and observe that it creates valid signatures. +您可以通过将验证器配置为具有上述合约的链,并观察它是否创建有效的签名来测试验证器。 ::: ### Relayer -In addition to indexing messages dispatched from the mailbox, a relayer processes messages on the destination chain. This requires building metadata that satisfies the message recipient's ISM verification requirements, and signing transactions that process the message on the destination mailbox. +除了索引从邮箱分派的消息外,中继器还会在目标链上处理消息。这需要构建满足消息接收者 ISM 验证要求的元数据,并签署处理消息的交易,以在目标邮箱上处理消息。 #### Metadata Builders -Each module type implies a different metadata format for message verification to succeed. A Relayer will need each module trait (eg [multisig](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/hyperlane-core/src/traits/multisig_ism.rs)) to be implemented. +每个模块类型都意味着消息验证成功所需的不同元数据格式。中继器需要实现每个模块特性(例如 [multisig](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/hyperlane-core/src/traits/multisig_ism.rs))来实现。 #### Message Processor -The relayer will attempt to process messages on the destination mailbox (see [message processor](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/agents/relayer/src/msg/processor.rs#L24)). If +中继器将尝试在目标邮箱上处理消息(参见[消息处理器](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/agents/relayer/src/msg/processor.rs#L24))。 如果 -* the message recipient ISM returns an unknown module type -* module type is known but metadata fails to verify -* metadata verifies but dry running (gas estimation) message processing fails +* 消息接收方 ISM 返回一个未知的模块类型 +* 模块类型已知,但元数据验证失败 +* 元数据验证成功,但是进行燃料估算消息处理失败 -then the message will be kicked to an exponential backoff retry queue. The relayer relies on implementations of the [mailbox](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/hyperlane-core/src/traits/mailbox.rs) and [ism](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/hyperlane-core/src/traits/interchain_security_module.rs) traits for these checks. +那么消息将被推送到指数回退重试队列。中继器依赖于 [mailbox](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/hyperlane-core/src/traits/mailbox.rs) 和 [ism](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/hyperlane-core/src/traits/interchain_security_module.rs) 特性的实现来进行这些检查。 #### Gas Payment Enforcement -The Relayer may also require gas payment for a specific message ID on the origin chain before processing the message on the destination chain. To do this, they must have an IGP deployed with their address set as beneficiary and index gas payment events. See [gas payment enforcement trait](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/agents/relayer/src/msg/gas_payment/mod.rs). We recommend to start with no gas payment enforcement policy and then gradually support more restrictive ones. +中继器在处理目标链上的消息之前,可能还需要在源链上为特定的消息ID支付燃料费用。为了实现这一点,他们必须部署一个 IGP(燃料支付)合约,并将其地址设置为受益者,然后索引燃料支付事件。请参阅[gas payment enforcement trait](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/agents/relayer/src/msg/gas_payment/mod.rs)。我们建议开始时不使用气体支付强制执行策略,然后逐步支持限制性更强的策略。 :::tip -Once you implemented the MVP of the relayer, you can create an end-to-end test that +一旦您实现了中继器的MVP(最小可行产品),您可以创建一个端到端测试, -1. Spins up local origin and destination chain -2. Deploys your contracts onto both -3. Run validators for the origin chain -4. Run a relayer between both chains -5. Observe that upon dispatch of a message of the origin chain, the validator observes the message, creates a signature and the relayer appropriately processes your message via the ISM that specifies the validator on the destination chain. +1. 启动本地源链和目标链 +2. 将您的智能合约部署到两条链上 +3. 在源链上运行验证者 +4. 在两个链之间运行中继器 +5. 请注意,验证器观察到该消息在源链上布时,会创建签名,然后中继器通过在目标链上指定验证者的ISM适当地处理您的消息。 -See this [end-to-end test on the Rust codebase ](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/utils/run-locally/src/main.rs)for inspiration. +查看[Rust代码库中的端到端测试](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/utils/run-locally/src/main.rs)以获得灵感。 ::: ## 3. Applications -### Warp Routes +### Warp Router -Token router application that routes tokens between domains on demand. +令牌路由器应用程序,根据需要在不同域之间路由令牌。 #### transferRemote -Transfers `amountOrId` token to `recipient` on `destination` domain. +将 `amountOrId` 令牌转移到目标域上的 `recipient`。 ```solidity function transferRemote( @@ -403,7 +403,7 @@ function transferRemote( #### Transfer Message -To be interoperable with Warp Routes on other chains, the `body` of a transfer message must be a byte packed `TransferMessage` struct. +为了与其他链上的Warp Routes实现互操作性,转账消息的`body`必须是一个按字节打包的`TransferMessage`结构体。 ```solidity struct TransferMessage { diff --git a/docs/guides/latencies.mdx b/docs/guides/latencies.mdx index 61eed9be..6eeba2ef 100644 --- a/docs/guides/latencies.mdx +++ b/docs/guides/latencies.mdx @@ -1,8 +1,8 @@ -# Latencies +# 延迟 -Validators must wait a certain number of blocks to be mined before they are considered valid and [reorg-safe](https://www.alchemy.com/overviews/what-is-a-reorg). Without this, validators could be slashed since they may have signed a checkpoint that is no longer valid. +验证者必须等待一定数量的区块被挖掘,才能被视为有效和[reorg-safe](https://www.alchemy.com/overviews/what-is-a-reorg)。如果没有这个,验证者可能会被减持,因为它们可能已经签署了一个不再有效的检查点。 -Refer to the following sections for block finality configuration used by the Hyperlane validators. +请参考以下部分,了解Hyperlane验证者使用的区块最终性配置。 ### Mainnet diff --git a/docs/guides/token-faucets.mdx b/docs/guides/token-faucets.mdx index 53d9f4c5..3f1a1c19 100644 --- a/docs/guides/token-faucets.mdx +++ b/docs/guides/token-faucets.mdx @@ -1,4 +1,4 @@ -# Token sources & faucets +# 令牌来源和水龙头 ### Mainnet diff --git a/docs/guides/v2-to-v3-migration.mdx b/docs/guides/v2-to-v3-migration.mdx index 22d0cc51..9d272dd9 100644 --- a/docs/guides/v2-to-v3-migration.mdx +++ b/docs/guides/v2-to-v3-migration.mdx @@ -1,22 +1,22 @@ -# Hyperlane v2 to v3 Migration Guide +# Hyperlane v2 到 v3 迁移指南 -Now in v3, we’ve improved the Mailbox to unlock modularity in how you transport messages, while simplifying the interface. +现在在v3中,我们改进了邮箱以解锁消息传输的模块化方式,同时简化了界面。 :::caution -**Note:** v3 is a breaking change to v2. +**Note:** v3 对 v2 进行了重大变更。 ::: ### Mailbox Interface -A major version change of the Mailbox, v3, has arrived with these improvements: +Mailbox 的重大版本变更 v3 已经推出,并带来了以下改进: -1. modularity of domain specific transport and security layers -2. simplifying the Hyperlane API to a single call (and address) -3. configurable dispatch time requirements such as fee payments +1. 特定域传输层和安全层的模块化 +2. 将 Hyperlane API 简化为单一调用(和地址) +3. 可配置的分发时间要求,如费用支付 -v3 unifies interchain gas payments, protocol fees, and any message dispatch time behavior into a streamlined interface. +v3 将跨链燃料支付、协议费用和任何消息派发时间行为统一到一个简化的接口中。 ```solidity interface IMailbox { @@ -33,15 +33,15 @@ interface IMailbox { } ``` -This is a departure from the existing [interchain gas payment](../reference/hooks/interchain-gas.mdx) and [hook](../reference/hooks/overview.mdx) interfaces but should be almost entirely backwards compatible. Mirroring the [interchain security modules](../reference/ISM/specify-your-ISM.mdx) pre-handle lifecycle hook, the architectural change is introducing post-dispatch lifecycle hooks which receive authenticated message content from the mailbox and perform some additional task, like paying interchain gas to the relayer or using a different transport layer. +这与现有的[跨链燃料支付](../reference/hooks/interchain-gas.mdx)和[钩子](../reference/hooks/overview.mdx)接口有所不同,但几乎完全向后兼容。与[跨链安全模块](../reference/ISM/specify-your-ISM.mdx)的预处理生命周期钩子相呼应,这种架构变更引入了后处理生命周期钩子,它们从邮箱中接收经过身份验证的消息内容,并执行一些额外的任务,比如向中继器支付跨链燃料或使用不同的传输层。 ![v3 hook diagram](../../static/img/v3-hook-diagram.png) -The mailbox will have a required hook needed by the protocol and a default hook that can be overridden by the message sender, further modularizing the mailbox interface. We expect the required hook to include enforcing protocol fees. These hooks will be governable, enabling Mailbox operators to add message-specific capabilities as default or required behavior incrementally without mutating message content. This mirrors default ISM governance and post-dispatch hook behavior should reflect requirements of the message destination’s ISM, default or otherwise. +邮箱将具有协议所需的必需钩子和可以被消息发送方覆盖的默认钩子,进一步将邮箱接口模块化。我们预计必需的钩子将包括执行协议费用。这些钩子将是可管理的,使邮箱操作员能够逐步添加消息特定的功能作为默认或必需的行为,而不会改变消息内容。这与默认ISM的治理相呼应,后处理钩子的行为应反映消息目的地的ISM的要求,无论是默认的还是其他。 ### Post Dispatch Hook Interface -The post dispatch hook interface is designed for maximal generality and extensibility of implementation (quite similar to the ISM verification interface). In addition to the entire message content, metadata can be provided by the dispatcher for further expression of preferences. For hooks that charge for use, a quote interface is necessary to inform the message sender how much value must be passed to the mailbox dispatch call. +后处理钩子接口旨在实现最大的通用性和可扩展性(与ISM验证接口非常相似)。除了整个消息内容外,调度器还可以提供元数据以进一步表达偏好。对于收费使用的钩子,需要一个报价接口来告知消息发送者必须传递多少价值给邮箱派发调用。 ```solidity interface IPostDispatchHook { @@ -58,7 +58,7 @@ interface IPostDispatchHook { ### Usage Patterns -This new interface greatly simplifies the integration experience and prevents confusion for first time users. +这个新接口极大地简化了集成体验,并消除了初次使用者的困惑。 **Before** @@ -81,13 +81,13 @@ uint256 quote = mailbox.quoteDispatch(destination, recipient, body); mailbox.dispatch{value: quote}(destination, recipient, body); ``` -Alternatively, any overpayment will be refunded so quoting is not strictly necessary but dispatch may revert if payment is insufficient. +或者,任何超额支付都将退款,因此报价并不是绝对必要的,但如果支付不足,派发可能会回滚。 ```solidity mailbox.dispatch{value: msg.value}(destination, recipient, body); ``` -If you want post-dispatch behavior on a non-default chain, such as using an OpStack bridge on messages outbound from ethereum, simply pass the corresponding hook. +如果您想要在非默认链上执行后处理行为,例如在从以太坊出站的消息上使用OpStack桥接,只需传递相应的钩子。 ```solidity // overrides default hook with opStackHook @@ -100,20 +100,20 @@ mailbox.dispatch{value: msg.value}(destination, recipient, body, opStackHook); ## Implementation Guide -We have [implemented these changes for the EVM implementation](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/v3) of Hyperlane and are sending them off for audit, targeting mid-September for mainnet launch. The following summarizes the logical changes (in pseudocode) as a reference for other execution environments. +我们已经为Hyperlane的EVM实现[实施了这些更改](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/v3),并将它们发送给审计,目标是在9月中旬启动主网。以下是逻辑变更的总结(伪代码形式),供其他执行环境参考。 :::info -**`param?`** indicates an optional parameter +**`param?`** 表示可选参数 -**`optional ?? fallback`** resolves to **`optional`** if some value is specified, **`fallback`** if it is not +**`optional ?? fallback`** 如果指定了某个值,则解析为 **`optional`**,如果没有指定,则解析为 **`fallback`** ::: ### Mailbox Implementation -The incremental merkle tree has been migrated out of the mailbox and replaced by `nonce` and `latestDispatchedId` storage variables. The nonce is necessary for maintaining message uniqueness. The latest dispatched message ID is useful for hooks which need to authenticate message content independent of the caller (`msg.sender`) address. +增量 Merkle 树已从邮箱中迁移出来,并由 `nonce` 和 `latestDispatchedId` 存储变量替换。nonce 对于保持消息的唯一性是必要的。最新派发的消息 ID 对于需要独立于调用者 (`msg.sender`) 地址认证消息内容的钩子非常有用。 ```solidity contract Mailbox { @@ -166,7 +166,7 @@ contract Mailbox { ### Interchain Gas Paymaster Hook Implementation -As a motivating example, the default hook may contain an interchain gas payment hook with defaults for gas limit and refund address that may be overridden via metadata. +举个例子,默认钩子可能包含一个链间燃料支付钩子,其中默认的燃料限额和退款地址可通过元数据覆盖。 ```solidity contract IgpHook is InterchainGasPaymaster { diff --git a/docs/intro.mdx b/docs/intro.mdx index c2dedd81..2e15e3fe 100644 --- a/docs/intro.mdx +++ b/docs/intro.mdx @@ -10,6 +10,6 @@ Hyperlane的设计考虑到了模块化。特别是,其[跨链安全模块](./ 开箱即用的一些预构建示例包括: -1. Warp Routes, 允许原生、ERC20和ERC721代币在链之间无缝移动 -2. Interchain accounts, 允许一个链上的账户(例如DAO)在远程链上调用智能合约 -3. Interchain queries, 允许一个链上的账户在远程链上进行视图调用 \ No newline at end of file +1. Warp Routes:允许原生、ERC20和ERC721代币在链之间无缝移动 +2. Interchain accounts:允许一个链上的账户(例如DAO)在远程链上调用智能合约 +3. Interchain queries:允许一个链上的账户在远程链上进行视图调用 \ No newline at end of file diff --git a/docs/your-first-message.mdx b/docs/your-first-message.mdx index 027f49bc..2c539b22 100644 --- a/docs/your-first-message.mdx +++ b/docs/your-first-message.mdx @@ -10,7 +10,7 @@ import MessageQuickstart from "@site/src/components/MessageQuickstart"; # 发送您的第一条链间信息 -本教程演示如何 [发送](./reference/messaging/send.mdx)链间信息到预先部署的 "TestRecipient "合约。 +本教程演示如何[send](./reference/messaging/send.mdx)链间信息到预先部署的 "TestRecipient "合约。 @@ -40,7 +40,7 @@ import MessageQuickstart from "@site/src/components/MessageQuickstart"; -查看日志,了解信息的发送情况!git +查看日志,了解信息的发送情况!
Testnet `TestRecipient` Addresses From 0ef5a974ab05b8db58fadc5cca001678c28b4ead Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Fri, 16 Feb 2024 17:26:28 +0800 Subject: [PATCH 19/58] Translate run-relayer.mdx to Chinese --- docs/guides/implementation-guide.mdx | 2 +- docs/operate/relayer/message-filtering.mdx | 24 ++--- docs/operate/relayer/run-relayer.mdx | 114 ++++++++++----------- 3 files changed, 70 insertions(+), 70 deletions(-) diff --git a/docs/guides/implementation-guide.mdx b/docs/guides/implementation-guide.mdx index 9264e0fc..1b157b7f 100644 --- a/docs/guides/implementation-guide.mdx +++ b/docs/guides/implementation-guide.mdx @@ -1,4 +1,4 @@ -# 实施指南(Implementation Guide) +# 开发指南(Implementation Guide) 一个新链架构的 Hyperlane 实施由以下内容组成: diff --git a/docs/operate/relayer/message-filtering.mdx b/docs/operate/relayer/message-filtering.mdx index 4cfc9ad9..dd255231 100644 --- a/docs/operate/relayer/message-filtering.mdx +++ b/docs/operate/relayer/message-filtering.mdx @@ -1,20 +1,20 @@ # Message filtering -_Configure which messages to relay, and which to ignore_ +_配置要中继的消息以及要忽略的消息_ -By default, the Relayer will attempt to deliver messages sent from its origin chain to any of the configured destination chains. +默认情况下,中继器将尝试将从其源链发送到任何配置的目标链的消息传递到目标链。 -Relayers may want to further filter the messages they attempt to deliver. For example, someone building an interchain app may want to run a Relayer that only delivers messages sent to that application. Similarly, some Relayers may wish to only relay messages to a subset of available chains. +中继器可能希望进一步筛选它们尝试传递的消息。例如,构建跨链应用程序的人可能希望运行一个仅传递发送到该应用程序的消息的中继器。同样,一些中继器可能希望仅将消息中继到一部分可用的链。 -Relayers may **optionally** filter the messages they deliver by setting the `--whitelist` or `--blacklist` environment variables. See also the [configuration reference's](../config-reference.mdx) whitelist section. +中继器可以通过设置 `--whitelist` 或 `--blacklist` 环境变量来**可选地**筛选它们传递的消息。另请参阅配置参考[configuration reference's](../config-reference.mdx) 的白名单部分。 -These configs are stringified JSON objects with the following format: +这些配置是字符串化的 JSON 对象,格式如下: ```typescript -// A list of matching rules. A message matches if any of the list -// elements matches the message. +// 一个匹配规则列表。如果列表中的任何一个匹配,则消息会匹配。 +// 元素匹配消息。 type MatchingList = Array; -// Matches a message if any of the provided values matches. +// 如果提供的任何值匹配,则匹配消息。 interface ListElement { originDomain?: NumericFilter senderAddress?: HashFilter @@ -33,9 +33,9 @@ type H256 = string; type Wildcard = "*"; ``` -Both the whitelist and blacklists have "any" semantics. In other words, the Relayer will deliver messages that match _any_ of the whitelist filters, and ignore messages that match _any_ of the blacklist filters. +白名单和黑名单都有 "任意 "语义。换句话说,中继器将传送符合_any_个白名单过滤器的信息,并忽略符合_any_个黑名单过滤器的信息。 -For example, the following config used as a whitelist will ensure the Relayer will relay any messages sent to Ethereum, any messages sent from address `0xca7f632e91B592178D83A70B404f398c0a51581F` to either Celo or Avalanche, and any messages sent to address `0xca7f632e91B592178D83A70B404f398c0a51581F` on Arbitrum or Optimism. +例如,将以下配置用作白名单将确保中继器转发发送到以太坊的任何消息、从地址 `0xca7f632e91B592178D83A70B404f398c0a51581F` 发送到 Celo 或 Avalanche 的任何消息,以及发送到 Arbitrum 或 Optimism 上地址 `0xca7f632e91B592178D83A70B404f398c0a51581F` 的任何消息。 ```json [ @@ -57,10 +57,10 @@ For example, the following config used as a whitelist will ensure the Relayer wi ] ``` -A valid config may look like +一个有效的配置可能如下所示: ```bash --whitelist='[{"senderAddress":"*","destinationDomain":["1"],"recipientAddress":"*"},{"senderAddress":"0xca7f632e91B592178D83A70B404f398c0a51581F","destinationDomain":["42220","43114"],"recipientAddress":"*"},{"senderAddress":"*","destinationDomain":["42161","420"],"recipientAddress":"0xca7f632e91B592178D83A70B404f398c0a51581F"}]' ``` -The blacklist supersedes the whitelist, i.e. if a message matches both the whitelist _and_ the blacklist, it will not be delivered. +黑名单会覆盖白名单,即如果消息同时匹配白名单和黑名单,则该消息不会被传递。 diff --git a/docs/operate/relayer/run-relayer.mdx b/docs/operate/relayer/run-relayer.mdx index 7862e655..703143da 100644 --- a/docs/operate/relayer/run-relayer.mdx +++ b/docs/operate/relayer/run-relayer.mdx @@ -1,14 +1,14 @@ -# Run a Relayer +# 运行中继器 -A Hyperlane [Relayer](../../protocol/agents/relayer.mdx) delivers interchain messages to their recipients. +一个 Hyperlane [中继器](../../protocol/agents/relayer.mdx) 将跨链消息传递给它们的接收方。 :::tip -We recommend you read through the [**Deploy Hyperlane Local Agents**](../../guides/deploy-hyperlane-local-agents.mdx) guide as well as the [**Run Validators**](../validators/run-validators.mdx) documentation before trying to run a production Relayer. +在尝试在生产环境中运行继器之前,我们建议您阅读[**部署本地 Hyperlane 代理**](../../guides/deploy-hyperlane-local-agents.mdx)指南以及[**运行验证者**](../validators/run-validators.mdx)文档。 ::: -Every Hyperlane message requires two transactions to be delivered, one on the origin chain to [send](../../reference/messaging/send.mdx) the message, and one on the destination chain to [receive](../../reference/messaging/receive.mdx) the messages. A Relayer is responsible for sending the second transaction. +每个 Hyperlane 消息需要两个交易来传递,一个在原始链上用于[发送](../../reference/messaging/send.mdx)消息,另一个在目标链上用于[接收](../../reference/messaging/receive.mdx)消息。中继器负责发送第二个交易。 ```mermaid flowchart TB @@ -36,24 +36,24 @@ flowchart TB click IGP https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/igps/InterchainGasPaymaster.sol ``` -Hyperlane Relayers are configured to relay messages between one or more origin chains and destination chains. A Relayer has no special permissions in Hyperlane. If Relayer keys are compromised, only the tokens held by those keys are at risk. +Hyperlane中继器被配置为在一个或多个原始链和目标链之间中继消息。在Hyperlane中,中继器没有特殊权限。如果中继器密钥被泄露,那么只有由这些密钥持有的代币处于风险之中。 -Running a Relayer requires the following: +运行中继器需要以下步骤: -- RPC nodes - - A Relayer uses RPC nodes to read the origin chain(s), and deliver messages to the destination chain(s). The Relayer must be configured with an RPC node for all origin and destination chains. -- One or more signing keys - - In order to deliver messages, the Relayer must be configured with a signing key to submit transactions on each destination chain (thus need funds on those chains). - - The Relayer uses this key to sign `Mailbox.process()` transactions. The Hyperlane Relayer agent currently supports configuration with AWS KMS keys that are accessed via API keys/secrets or raw hexadecimal private keys. -- A machine to run on - - Relayer operators can compile the Rust binary themselves, or run a Docker image provided by Abacus Works. The binary can be run using your favorite cloud service. +- RPC 节点 + - 中继器使用RPC节点来读取原始链,并将消息传递到目标链。中继器必须配置所有原始链和目标链的RPC节点。 +- 一个或者多个签名秘钥 + - 为了传递消息,中继器必须配置一个签名密钥,在每个目标链上提交交易(因此需要在这些链上有资金)。 + - 中继器使用这个密钥来签署 `Mailbox.process()` 交易。Hyperlane中继器代理目前支持通过API密钥/secrets密钥或原始十六进制私钥访问的AWS KMS密钥进行配置。 +- 一台运行机器 + - 中继器操作者可以自己编译Rust二进制文件,也可以运行Abacus Works提供的Docker镜像。该二进制文件可以使用您喜欢的云服务运行。 -## Guide +## 指南 -We strongly encourage you to follow the [local agents guide](../../guides/deploy-hyperlane-local-agents.mdx) to understand how to configure and run the Relayer locally. +我们强烈建议您遵循[本地代理指南](../../guides/deploy-hyperlane-local-agents.mdx)以了解如何在本地配置和运行中继器。 :::info -The local agent setup shows how you can run a Relayer on your _local machine_, which is **only for testing and development purposes**. +本地代理设置展示了如何在您的**本地计算机**上运行中继器,这仅用于**测试和开发目的**。 ::: import Tabs from "@theme/Tabs"; @@ -61,75 +61,75 @@ import TabItem from "@theme/TabItem"; ### Keys -The Relayer needs to be able to submit transactions to many destination chains, and therefore requires access to a key for signing transactions. There are two supported key types: hexadecimal private keys (for in-memory signing), and AWS KMS based keys (best practice for production environments). +中继器需要能够向许多目标链提交交易,因此需要访问用于签署交易的密钥。支持两种密钥类型:十六进制私钥(用于内存中签名)和基于 AWS KMS 的密钥(用于生产环境的最佳实践)。 #### Hexadecimal keys -A hexadecimal private key used for in-memory signing can be used by your Relayer to sign transactions. This is the recommended setup for testing or development purposes. +用于内存签名的十六进制私钥可以被您的中继器用于签署交易。这是测试或开发目的的推荐设置。 #### AWS KMS keys -An AWS KMS key can be used by your Relayer to sign transactions. This is the recommended setup for a production Relayer. +AWS KMS密钥可以被您的中继器用于签署交易。这是生产中继器的推荐设置。 :::tip -See the [Agent Keys](../set-up-agent-keys.mdx) page to set up your Hexadecimal or AWS KMS keys. +请查看 [代理密钥](../set-up-agent-keys.mdx) 页面以设置您的十六进制或 AWS KMS 密钥。 ::: ### Configuration -Like the local setup, there are a few base arguments you should provide when configuring your Relayer. +像本地设置一样,配置 Relayer 时应提供一些基本参数。 | Argument | Description | | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `--relayChains` | Comma separated names of the origin and destination chains to relay messages between. For example: `ethereum,polygon,avalanche`. | -| `--db` | The path to where the Relayer should write persistent data to disk. Ensure this path to be persistent when using cloud setups. When using Docker, make sure to mount the persistent path/volume into the container. See [config-reference](../config-reference.mdx#db) for more info. | -| `--allowLocalCheckpointSyncers` | If `true`, this will allow the Relayer to look for Validator signatures on the Relayer's local filesystem. In a production environment, this should be `false`. If you're running a Validator on the same machine by following the Validator local setup instructions, set this to `true` so that your Relayer can access the local Validator signatures. | +| `--relayChains` | 这里指定了要在其间中继消息的源链和目标链的逗号分隔名称。例如:`ethereum,polygon,avalanche`。 | +| `--db` | Relayer应该将持久数据写入磁盘的路径。在使用云设置时,请确保该路径是持久的。使用Docker时,请确保将持久路径/卷挂载到容器中。有关更多信息,请参阅[配置参考](../config-reference.mdx#db)。 | +| `--allowLocalCheckpointSyncers` | 如果设置为 `true`,Relayer将允许在其本地文件系统上查找验证器签名。在生产环境中,应将此设置为 `false`。如果您按照验证器本地设置说明在同一台计算机上运行验证器,则将其设置为 `true`,以便您的Relayer可以访问本地验证器签名。 | :::info -Your Relayer takes both command line arguments and environment variables as configuration. Take a look at the [agent configuration](../agent-config.mdx) page and the [configuration reference](../config-reference.mdx) for a full list of configuration possibilities. +您的 Relayer 既可以通过命令行参数,也可以通过环境变量进行配置。请查看 [代理配置](../agent-config.mdx) 页面和 [配置参考](../config-reference.mdx) 获取完整的配置可能性列表。 ::: -Of course, you can also provide the path to additional configuration files as a comma separated list with the [`CONFIG_FILES` environment variable](../config-reference.mdx#config_files). If you choose to run in Docker, see the docker section of [agent configuration](../agent-config.mdx) for tips on mounting your config files into your Docker container. +当然,您还可以使用 [`CONFIG_FILES` 环境变量](../config-reference.mdx#config_files) 提供额外配置文件的路径,这些路径应该以逗号分隔。如果您选择在 Docker 中运行,请参阅 [代理配置](../agent-config.mdx) 的 Docker 部分,了解如何将您的配置文件挂载到 Docker 容器中的提示。 ### Setup-specific configuration -These configurations requirements differ depending on which key setup instructions you followed. +这些配置要求根据您遵循的密钥设置说明而有所不同。 -If you created a [hexadecimal key](../set-up-agent-keys.mdx), configure the default signer like so: +如果您创建了一个[十六进制密钥](../set-up-agent-keys.mdx),请像这样配置默认签名者: -| Argument | Description | +| 参数 | 描述 | | --------------------- | -------------------------------------------------------------------------------------------------- | -| `--defaultSigner.key` | A hexadecimal private key used to sign transactions for all chains. For example: `1b3dead...beef`. | +| `--defaultSigner.key` | 用于为所有链签名交易的十六进制私钥。例如:`1b3dead...beef`。 | -If you created an [AWS KMS key](../set-up-agent-keys.mdx), configure the default signer like so: + 如果您创建了一个[使用 AWS KMS 密钥](../set-up-agent-keys.mdx)的配置,请像下面这样配置默认签名者: -| Argument | Description | +| 参数 | 描述 | | ------------------------ | ----------------------------------------------------------------------------------------------------------- | -| `--defaultSigner.type` | Set to `aws`. | -| `--defaultSigner.id` | The alias of your Relayer's AWS KMS key, prefixed with `alias/`. For example: `alias/hyperlane-relayer-1`. | -| `--defaultSigner.region` | The region of your AWS KMS key. For example: `us-east-1`. | +| `--defaultSigner.type` | 设置为 `aws`。 | +| `--defaultSigner.id` | 您的 Relayer 的 AWS KMS 密钥的别名,前缀为 `alias/`。例如:`alias/hyperlane-relayer-1`。| +| `--defaultSigner.region` | 您的 AWS KMS 密钥的地区。例如:`us-east-1`。 | -For chain-specific signers (i.e. to customize the key to use for each chain) take a look at the [configuration reference](../config-reference.mdx) +对于特定链的签名者(即自定义要为每个链使用的密钥),请参阅[配置参考](../config-reference.mdx)。 ## Start Relaying ### Setup -The recommended installation method for a production environment is using a Docker image. +在生产环境中推荐的安装方法是使用 Docker 镜像。 -First download the docker image: +首先下载 docker 映像: ```bash docker pull gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519 @@ -138,25 +138,25 @@ docker pull gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519 -**Clone and setup** +**克隆和安装** -First, clone the Hyperlane monorepo: +首先克隆 Hyperlane monorepo: ```sh git clone git@github.com:hyperlane-xyz/hyperlane-monorepo.git ``` -Then follow the [setup instructions](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md) in the `rust` directory. This should setup `rustup` as well as Rosetta 2 if you are on Apple Silicon. +然后按照 `rust` 目录中的[设置说明](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md)进行操作。这将设置 `rustup`,如果您使用的是 Apple Silicon,则还会设置 Rosetta 2。 ```sh -# install rustup +# 安装 rustup curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -# (apple silicon only) install rosetta 2 +# (仅apple silicon) 安装 rosetta 2 softwareupdate --install-rosetta --agree-to-license ``` -Build the Relayer: +构建中继器 ```sh cargo build --release bin relayer @@ -167,19 +167,19 @@ cargo build --release bin relayer ### Running the agent -If the Relayer's keys have been configured with AWS KMS, you will have to provide the AWS access key and secret as environment variables. +如果中继器的密钥是通过 AWS KMS 配置的,则必须将 AWS 访问密钥和秘密作为环境变量提供。 -| Environment variable | Description | +| 环境变量 | 描述 | | ----------------------- | ----------------------------------------------------- | -| `AWS_ACCESS_KEY_ID` | The access key ID of your Relayer's AWS IAM user. | -| `AWS_SECRET_ACCESS_KEY` | The secret access key of your Relayer's AWS IAM user. | +| `AWS_ACCESS_KEY_ID` | 中继器的 AWS IAM 用户的访问密钥 ID。 | +| `AWS_SECRET_ACCESS_KEY` | 中继器 AWS IAM 用户的访问密钥。 | -For a refresher, check out the [Agent Keys](../set-up-agent-keys.mdx) guide. +如需再次进行了解,请查阅[代理密钥](../set-up-agent-keys.mdx)指南。 -Then start the container with the relevant arguments. For example, your configuration for AWS: +然后使用相关参数启动容器。例如,您的 AWS 配置如下所示: ```sh docker run \ @@ -198,9 +198,9 @@ docker run \ :::tip -If you're running Validators with a local setup on the same machine and running a local Relayer to access these Validator signatures, be sure to [mount](https://docs.docker.com/storage/bind-mounts/) your local Validator's signature directory into your Relayer at the same path that you used when [announcing your Validator](../validators/run-validators.mdx#Announcing-your-validator) +如果您正在同一台机器上使用本地设置运行验证器,并且正在运行一个本地中继以访问这些验证器签名,请确保将您本地验证器的签名目录 [挂载](https://docs.docker.com/storage/bind-mounts/) 到您的中继中,路径应与您在 [announce Validator](../validators/run-validators.mdx#Announcing-your-validator) 时使用的路径相同。 -For example, if your local Validator is writing signatures to `/tmp/hyperlane-validator-signatures-ethereum`, you should mount a directory for the Docker container: + 例如,如果您的本地验证器正在将签名写入 `/tmp/hyperlane-validator-signatures-ethereum`,您应该为 Docker 容器挂载一个目录: ```sh docker run \ @@ -222,16 +222,16 @@ docker run \ -See these instructions for building from source without Docker. +查看这些说明以了解如何在没有 Docker 的情况下从源代码构建。 -We can run the built binary from within the `hyperlane-monorepo/rust` directory: +我们可以从`hyperlane-monorepo/rust`目录中运行构建好的二进制文件。 ```sh -# set AWS environment variables +# 设置 AWS 环境变量 export AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOP export AWS_SECRET_ACCESS_KEY=xX-haha-nice-try-Xx -# run the Relayer +# 运行中继器 ./target/release/relayer \ --db /hyperlane_db \ --relayChains , \ @@ -245,4 +245,4 @@ export AWS_SECRET_ACCESS_KEY=xX-haha-nice-try-Xx ## Indexing -The Relayer needs to index all historic messages for the origin chain(s). This information is stored in a local database on disk (set with `db` in the config). This means running a Relayer for the first time may take some extra time to catch up with the current state. +Relayer需要索引所有原始链的历史消息。这些信息存储在本地磁盘上的数据库中(在配置中设置为`db`)。这意味着首次运行Relayer可能需要一些额外的时间来与当前状态同步。 From 7879395550a7eccf858c6c05f885c4bb379f1c0c Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Fri, 16 Feb 2024 18:58:49 +0800 Subject: [PATCH 20/58] Translate monitoring-alerting.mdx to Chinese --- docs/operate/validators/monitoring-alerting.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/operate/validators/monitoring-alerting.mdx b/docs/operate/validators/monitoring-alerting.mdx index dcdeba81..1478e6f9 100644 --- a/docs/operate/validators/monitoring-alerting.mdx +++ b/docs/operate/validators/monitoring-alerting.mdx @@ -1,11 +1,11 @@ -# Monitoring & Alerting +# 监控 & 警报 -Validators expose metrics on the port number specified by the argument `--metrics`. Port `9090` is the default, though any valid port can be chosen. +Validators在由参数`--metrics`指定的端口号上公开指标。默认情况下为端口`9090`,但可以选择任何有效的端口。 :::info -If running as a Docker image, make sure to port-forward the metrics endpoint port. For, instance, to forward port 9090 on the local port 80, add the following flag to your `docker run` command: `-p 9090:80` +如果作为Docker镜像运行,请确保将指标端口进行端口转发。例如,要将本地端口80上的端口9090进行转发,请在`docker run`命令中添加以下标志:`-p 9090:80` ::: -We also provide a mostly-ready-to-go Grafana dashboard to get you started, you can find the source and instructions for importing it under [tools/grafana](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/tools/grafana). If you want to use your own, the `hyperlane_latest_checkpoint` is the most critical metric in both the `phase="validator_observed"` and `phase="validator_processed"` dimension. It should gradually increase and the two should never really be out of sync. +我们还提供了一个准备就绪的Grafana仪表板,可帮助您快速入门,您可以在[tools/grafana](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/tools/grafana)下找到源代码和导入说明。如果您想使用自己的仪表板,则`hyperlane_latest_checkpoint`是两个最关键的度量值,分别为`phase="validator_observed"`和`phase="validator_processed"`。它应该会逐渐增加,而且这两个值不应该出现不同步的情况。 From 28fd06e32f418e08fa13b0c23a054b5f6ea86a90 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Fri, 16 Feb 2024 20:00:16 +0800 Subject: [PATCH 21/58] Translate validator-signatures-aws.mdx to Chinese --- .../validators/monitoring-alerting.mdx | 4 +- .../validators/validator-signatures-aws.mdx | 62 +++++++++---------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/docs/operate/validators/monitoring-alerting.mdx b/docs/operate/validators/monitoring-alerting.mdx index 1478e6f9..92498677 100644 --- a/docs/operate/validators/monitoring-alerting.mdx +++ b/docs/operate/validators/monitoring-alerting.mdx @@ -1,10 +1,10 @@ # 监控 & 警报 -Validators在由参数`--metrics`指定的端口号上公开指标。默认情况下为端口`9090`,但可以选择任何有效的端口。 +Validators在由参数`--metrics`指定的端口号上公开指标。默认情况下为端口`9090`,但可以自定义任何有效的端口。 :::info -如果作为Docker镜像运行,请确保将指标端口进行端口转发。例如,要将本地端口80上的端口9090进行转发,请在`docker run`命令中添加以下标志:`-p 9090:80` +如果你使用Docker镜像来运行,请确保将指标端口进行端口转发。例如,要将宿主机上的端口80转发到Docker容器内部的端口9090,你可以在docker run命令中添加以下标志:-p 9090:80。 ::: diff --git a/docs/operate/validators/validator-signatures-aws.mdx b/docs/operate/validators/validator-signatures-aws.mdx index e4767147..a878091c 100644 --- a/docs/operate/validators/validator-signatures-aws.mdx +++ b/docs/operate/validators/validator-signatures-aws.mdx @@ -1,48 +1,48 @@ -# AWS Signatures Bucket Setup +# AWS签名存储设置 -Configure your signing key and S3 bucket +配置签名密钥和S3存储 :::info -These instructions are for a production environment where Validator keys exist in AWS's Key Management Service and Validator signatures are posted publicly in an S3 bucket. +这些说明适用于验证器密钥存在于 AWS 的密钥管理服务中、验证器签名公开发布在S3存储中的生产环境。 -If you're only intending to run a Validator for testing or development purposes, consider following the [local setup guide](../../guides/deploy-hyperlane-local-agents.mdx) instead. +如果您只打算为测试或开发目的运行验证器,请考虑按照 [本地设置指南](../../guides/deploy-hyperlane-local-agents.mdx) 进行操作。 ::: -### 1. Create an AWS IAM user and KMS key +### 1. 创建AWS IAM用户和KMS密钥 -Follow the instructions in [Agent Keys](../set-up-agent-keys.mdx) to generate an AWS IAM user and KMS key. You will use this user and key in the following steps. +按照[Agent Keys](../set-up-agent-keys.mdx)中的说明生成AWS IAM用户和KMS密钥。您将在接下来的步骤中使用此用户和密钥。 -### 2. Create an S3 bucket +### 2. 创建 S3 存储 -Your Validator will post their signatures to this bucket. +您的验证者将把它们的签名发布到此存储中。 -1. Go to AWS's S3 in the AWS console. -2. On the right, click the orange "Create Bucket" button -3. Pick an informative bucket name, such as `hyperlane-validator-signatures-${validator_name}-${chain_name}` -4. Consider choosing the same region as the KMS key you created in the previous step. -5. Keep the recommended "ACLs disabled" setting for object ownership. -6. Configure public access settings so that the relayer can read your signatures - 1. Uncheck "Block all public access" - 2. Check the first two options that block access via access control lists - 3. Leave the last two options unchecked, we will be granting public read access via a bucket policy - 4. Acknowledge that these settings may result in public access to your bucket -7. The remaining default settings are fine, click the orange "Create bucket" button on the bottom +1. 转到 AWS 控制台中的 AWS S3。 +2. 在右侧点击橙色的 "Create Bucket "按钮 +3. 选择一个信息详实的bucket名称,例如`hyperlane验证器签名-${validator_name}-${chain_name}` +4. 考虑选择与上一步创建的 KMS 密钥相同的区域。 +5. 保持对象所有权的推荐设置为“ACLs disabled”。 +6. 配置公共访问设置,以便中继器可以读取您的签名。 +1. 取消选中“Block all public access” +2. 勾选前两个选项,阻止通过访问控制列表进行访问。 +3. 不要勾选最后两个选项,我们将通过存储策略授予公共读取权限。 +4. 请注意,这些设置可能导致公众可以访问您的存储。 +11. 剩下的默认设置都可以,点击底部的橙色“Create bucket”按钮。 -### 3. Configure S3 bucket permissions +### 3. 配置S3C存储权限 -Your Validator IAM user will need write permissions, and it should be publicly readable by the Relayer. +您的验证器 IAM 用户将需要写入权限,并且应该可以通过中继器公开读取。 -1. Navigate back to "Identity and Access Management (IAM)" in the AWS console -2. Under "IAM resources" you should see at least one "User", click into that -3. Click on the name of the user that you provisioned earlier (e.g. `hyperlane-validator-${chain_name}`) -4. Copy the "User ARN" to your clipboard, it should look something like `arn:aws:iam::791444913613:user/hyperlane-validator-${chain_name}` -5. Navigate back to "S3" in the AWS console -6. Click on the name of the bucket you just created -7. Just under the name of the bucket, click "Permissions" -8. Scroll down to "Bucket policy" and click "Edit" -9. Enter the following contents. The Bucket ARN is shown just above where you enter the policy +1. 请返回 AWS 控制台中的 "Identity and Access Management (IAM)" 页面。 +2. 在 "IAM resources" 下,您应该至少看到一个 "User",点击进入该用户。 +3. 点击您之前配置的用户的名称(例如 `hyperlane-validator-${chain_name}`)。 +4. 将“User ARN”复制到剪贴板中,它应该类似于 `arn:aws:iam::791444913613:user/hyperlane-validator-${chain_name}`。 +5. 返回 AWS 控制台中的 "S3" 页面。 +6. 点击您刚刚创建的存储的名称。 +7. 在存储名称下方,点击 "Permissions"。 +8. 向下滚动到 "Bucket policy",然后点击 "Edit"。 +9. 输入以下内容。Bucket ARN就显示在输入策略的上方 ```json { @@ -77,6 +77,6 @@ Your Validator IAM user will need write permissions, and it should be publicly r :::tip -Advanced users may consider using the [S3 terraform module](../deploy-with-terraform.mdx#iam--kms) instead to create the S3 bucket with the correct permissions. +高级用户可以考虑使用[S3 Terraform 模块](../deploy-with-terraform.mdx#iam--kms)来创建具有正确权限的 S3 存储。 ::: From de928b5842e071b21d691122ab144aeff1934cab Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Fri, 16 Feb 2024 20:21:07 +0800 Subject: [PATCH 22/58] Translate agent-config.mdx to Chinese --- docs/operate/agent-config.mdx | 54 +++++++++++++++++------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/operate/agent-config.mdx b/docs/operate/agent-config.mdx index 308268bb..5b0c13a9 100644 --- a/docs/operate/agent-config.mdx +++ b/docs/operate/agent-config.mdx @@ -1,20 +1,20 @@ -# Agent configuration +# Agent 配置 -All agents use the same method of configuration which is a multi-layered config approach which allows for easy overriding of default configs. Each layer overrides overlapping values in the previous. +所有代理都使用相同的配置方法,这是一种多层配置方法,可以轻松地覆盖默认配置。每一层都会覆盖前一层中重叠的值。 -## Config layers +## 配置layers -1. Base configuration from "default deployments" are in the [monorepo](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/config) and all of these are loaded automatically. -2. Config files passed in via the `CONFIG_FILES` env var are loaded next; this env var should be a comma separated list of paths to json files that should be loaded in order from first to last. -3. `HYP_` prefixed env vars will be read next. -4. `HYP__` prefixed env vars are then read and apply ONLY for the current agent. I.e. `RELAYER`, `VALIDATOR`, and `SCRAPER` will only read their respective prefixes. -5. Command line arguments will be read last +1. ”默认部署“的基本配置在 [monorepo](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/config) 中,所有这些配置都会自动加载。 +2. 接下来将加载通过 `CONFIG_FILES` env var 传入的配置文件;该 env var 应该是一个以逗号分隔的 json 文件路径列表,加载顺序为从第一个到最后一个。 +3. 接下来将读取以 `HYP_` 为前缀的环境变量。 +4. `HYP__` 前缀的环境变量将被读取并仅应用于当前代理。例如,`RELAYER`、`VALIDATOR` 和`SCRAPER` 只读取各自的前缀。 +5. 最后读取命令行参数 -## Command line arguments +## 命令行参数 -Command line arguments are added after the application name, such as`./relayer --originChainNames="test1,test2,test3"` +在应用程序名称后添加命令行参数,例如`./relayer --originChainNames="test1,test2,test3"` -The following formats are supported: +支持以下格式: * `--argName argValue` * `--argName "argValue"` @@ -23,40 +23,40 @@ The following formats are supported: * `--argName="argValue"` * `--argName='argValue'` -Argument names are case-insensitive, so in this guide we may show them in camel-case for easier reading, but `--argName` is equivalent to `--ARGNAME` and `--argname.` +参数名是不区分大小写的,因此在本指南中,为了方便阅读,我们可能会用驼峰小写显示参数名,但 `--argName`等同于 `--ARGNAME`和 `--argname.`。 -Examples: +示例: * `{ "db": "/path/to/dir" }` can be set with `--db "/path/to/dir"` * `{ "chains": { "ethereum": { "name": "ethereum" } } }` (abbreviated as `chains.ethereum.name` or `chains..name`) can be set with `--chains.ethereum.name ethereum` * `{ "chains": { "avalanche": { "customRpcUrls": "https://some-url.com" } } }` (abbreviated as `chains..customrpcurls`) can be set with `--chains.avalanche.customrpcurls "https://some-url.com"` -## Environment variables +## 环境参数 -The config file format is the preferred way to set things which are not secret and do not need to change for each run as it is the easiest format to inspect and edit. Every config value in the file can be set as an env var if you use the correct name, however, there are a few env vars that cannot be set in the config such as `CONFIG_FILES`. +配置文件格式是设置非机密内容的首选方式,每次运行都不需要更改,因为它是最容易检查和编辑的格式。如果使用正确的名称,文件中的每个配置值都可以设置为env-var,但是,有一些env-var不能在配置中设置,例如`CONFIG_FILES`。 -`HYP_` and `HYP__` are equivalent prefixes with the only difference being which order they are loaded in and can refer to all of the config values in the config files. +`HYP_` 和 `HYP__` 是等效的前缀,唯一的区别在于加载顺序,它们可以引用配置文件中的所有配置值。 -The env name will be one of those two prefixes, and then the underscore-separated path of the uppercased path components to the config value. +env 名称将是这两个前缀之一,然后是配置值的大写路径组件的下划线分隔路径。 -For example: +示例: -* `{ "db": "/path/to/dir" }` can be set with `HYP_DB="/path/to/dir"` or `HYP_RELAYER_DB="/path/to/dir"` -* `{ "chains": { "ethereum": { "name": "ethereum" } } }` (abbreviated as `chains.ethereum.name` or `chains..name`) can be set with `HYP_CHAINS_ETHEREUM_NAME="ethereum"` or `HYP_VALIDATOR_CHAINS_ETHEREUM_NAME="ethereum"` or `HYP_RELAYER_CHAINS_ETHEREUM_NAME="ethereum"` ... -* `{ "chains": { "avalanche": { "customRpcUrls": "https://some-url.com" } } }` (abbreviated as `chains..customrpcurls`) can be set with `HYP_CHAINS_AVALANCHE_CUSTOMRPCURLS="https://some-url.com"` or `HYP_VALIDATOR_AVALANCHE_CUSTOMRPCURLS="https://some-url.com"` and so on... +* `{ "db": "/path/to/dir" }` 可以用 `HYP_DB="/path/to/dir"` or `HYP_RELAYER_DB="/path/to/dir"` +* `{ "chains": { "ethereum": { "name": "ethereum" } } }` (abbreviated as `chains.ethereum.name` or `chains..name`) 可以用 `HYP_CHAINS_ETHEREUM_NAME="ethereum"` or `HYP_VALIDATOR_CHAINS_ETHEREUM_NAME="ethereum"` or `HYP_RELAYER_CHAINS_ETHEREUM_NAME="ethereum"` ... +* `{ "chains": { "avalanche": { "customRpcUrls": "https://some-url.com" } } }` (abbreviated as `chains..customrpcurls`) 可以用 `HYP_CHAINS_AVALANCHE_CUSTOMRPCURLS="https://some-url.com"` or `HYP_VALIDATOR_AVALANCHE_CUSTOMRPCURLS="https://some-url.com"` 等等... -## Config files with Docker +## 使用 Docker 配置文件 -Running with the agent in Docker adds an extra layer of complexity because the config files need to be accessible from within the Docker container. The base configs that can be found in [the repo](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/config) are already part of the provided Docker image and will all be loaded by default. +在 Docker 中运行代理会增加额外的复杂性,因为配置文件需要从 Docker 容器内部访问。可以在[存储库](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/config)中找到的基本配置已经是提供的 Docker 镜像的一部分,并且将默认加载所有配置文件。 -Mounting a single config file can be done with the flag `--mount type=bind,source=$LOCAL_CONFIG_PATH,target=/config/$CONFIG_NAME,readonly` and then adding the config file to `CONFIG_FILES` so it is loaded. +要挂载单个配置文件,可以使用标志 `--mount type=bind,source=$LOCAL_CONFIG_PATH,target=/config/$CONFIG_NAME,readonly`,然后将配置文件添加到 `CONFIG_FILES` 中,以便加载它。 -Mounting an entire directory can be done with the flag `--mount source=$LOCAL_CONFIG_DIR_PATH,target=/config,readonly` then adding the individual config files to `CONFIG_FILES` that you want so they are loaded. +要挂载整个目录,可以使用标志 `--mount source=$LOCAL_CONFIG_DIR_PATH,target=/config,readonly`,然后将您想要加载的个别配置文件添加到 `CONFIG_FILES` 中。 -For example, suppose you have a config file at your local machine's path `/home/workspace/ethereum.json` and want to run the validator with it. +例如,假设您在本地机器上的路径 `/home/workspace/ethereum.json` 上有一个配置文件,并希望使用它来运行验证器。 ```bash docker run -it --mount type=bind,source=/home/workspace/ethereum.json,target=/config/ethereum.json,readonly -e CONFIG_FILES=/config/ethereum.json $DOCKER_IMAGE ./validator ``` -The `source` path is the path on your local machine, the `target` path is where the source path contents will be made available within the Docker container, and the `CONFIG_FILES` should specify config(s) from the target path. +`source`是宿主机上的路径,而`target`是容器内部相应路径。`CONFIG_FILES`应指定容器内部的目标路径中的配置文件。 From a32de65b7d3393471218765973c6e2b44a8b0eed Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Fri, 16 Feb 2024 22:43:14 +0800 Subject: [PATCH 23/58] Translate config-reference.mdx to Chinese --- docs/operate/config-reference.mdx | 231 +++++++++++++++--------------- 1 file changed, 116 insertions(+), 115 deletions(-) diff --git a/docs/operate/config-reference.mdx b/docs/operate/config-reference.mdx index d73cf73f..321b749e 100644 --- a/docs/operate/config-reference.mdx +++ b/docs/operate/config-reference.mdx @@ -1,24 +1,24 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# Configuration reference +# 参考配置 ## CONFIG_FILES -**Description:** (Env only) List of additional configuration file paths to load in order (such as those in `hyperlane-monorepo/rust/config`). They will be merged first to last, so if both the first one and the last one specify a specific config path, the value set in the last file listed will be used. +**说明:**(仅限环境变量)要加载的附加配置文件路径列表(例如 `hyperlane-monorepo/rust/config` 中的路径)。它们将按照从第一个到最后一个的顺序进行合并,因此如果第一个和最后一个都指定了特定的配置路径,那么将使用最后一个文件中设置的值。 -These files must be accessible within the filesystem your agent has access to. If you're running in Docker, see [the agent configuration guide](./agent-config.mdx#config-files-with-docker) for tips on mounting your config files into your Docker container. +这些文件必须在代理程序可以访问的文件系统中可访问。如果您正在运行 Docker,请参阅[代理配置指南](./agent-config.mdx#config-files-with-docker)中有关将配置文件挂载到 Docker 容器中的提示。 **Optional:** Yes **Agents:** All -**Type:** `string` (Comma separated list of file paths) +**Type:** `string` (用逗号分隔的文件路径列表) -Not supported as an argument +在参数不支持。 @@ -28,13 +28,13 @@ export CONFIG_FILES='./config/ethereum/my-config.json,./config/ethereum/my-valid -Not supported in configuration files +在配置文件中不支持。 ## chains -**Description:** Configuration for each of the chains that must be used by an agent. +**说明:** 每个代理必须使用的链的配置。 **Optional:** No @@ -70,9 +70,9 @@ export HYP_CHAINS_ETHEREUM_*="...." ## chains.``.name -**Description:** Name of the domain. Allows specifying a different name for the domain than the chain's true name. This should _almost always_ be the same as `chain_name`. +**说明:** 域名的名称。允许指定与链的真实名称不同的名称。这几乎总是应该与 `chain_name` 相同。 -**Requires:** Alignment with domain id if it is a known domain name. +**Requires:** 如果是已知的域名,则需要与域 ID 对齐。 **Optional:** No @@ -113,9 +113,9 @@ export HYP_CHAINS_ETHEREUM_NAME="ethereum" ## chains.``.domain -**Description:** Hyperplane domain id to uniquely identify the domain. See also: [Domain Identifiers](../reference/domains.mdx). +**说明:** 用于唯一标识域的超平面域 ID。另请参阅:[域标识符](../reference/domains.mdx)。 -**Requires:** Alignment with domain name if it is a known domain. +**Requires:** 如果是已知域名,则与域名一致。 **Optional:** No @@ -156,7 +156,7 @@ export HYP_CHAINS_ETHEREUM_DOMAIN=1 ## chains.``.mailbox -**Description:** Address of the mailbox contract on the chain. See also [contract addresses](../reference/contract-addresses.mdx). +**说明:** 链上邮箱合约的地址。另请参阅 [contract addresses](.../reference/contract-addresses.mdx)。 **Optional:** No @@ -201,7 +201,7 @@ export HYP_CHAINS_ETHEREUM_MAILBOX="0x35231d4c2D8B8ADcB5617A638A0c4548684c7C70" ## chains.``.interchainGasPaymaster -**Description:** Address of the interchain gas paymaster contract on the chain. See also [contract addresses](../reference/contract-addresses.mdx). +**说明:** 链上链间燃料主合同的地址。另请参阅 [contract addresses](.../reference/contract-addresses.mdx)。 **Optional:** No @@ -246,7 +246,7 @@ export HYP_CHAINS_ETHEREUM_INTERCHAINGASPAYMASTER="0x6cA0B6D22da47f091B7613223cD ## chains.``.validatorAnnounce -**Description:** Address of the validator announce contract on the chain. See also [contract addresses](../reference/contract-addresses.mdx). +**说明:** 链上验证公告合约的地址。另请参阅 [contract addresses](.../reference/contract-addresses.mdx)。 **Optional:** No @@ -291,7 +291,7 @@ export HYP_CHAINS_ETHEREUM_VALIDATORANNOUNCE="0x9bBdef63594D5FFc2f370Fe52115DdFF ## chains.``.merkleTreeHook -**Description:** Address of the merkle tree hook contract on the chain. See also [contract addresses](../reference/contract-addresses.mdx). +**说明:** 链上merkle树钩子合约的地址。另请参阅 [contract addresses](.../reference/contract-addresses.mdx)。 **Optional:** No @@ -336,9 +336,9 @@ export HYP_CHAINS_ETHEREUM_MERKLETREEHOOK="0x48e6c30B97748d1e2e03bf3e9FbE3890ca5 ## chains.``.signer -**Description:** The signer that should be used this chain +**说明:** 本链应使用的签名者 -**Optional:** Yes (Will use `defaultsigner` if not specified) +**Optional:** Yes(如果未指定,将使用 `defaultsigner`) **Agents:** All @@ -375,9 +375,9 @@ export HYP_CHAINS_${CHAIN_NAME}_SIGNER_*="...." ## chains.``.signer.type -**Description:** The type of signer that is defined. A `HexKey` signer uses a private key, an `Aws` signer uses an AWS based KMS, and `Node` assumes the local node will sign RPC calls. +**说明:** 定义的签名者类型。`HexKey` 签名者使用私钥,`Aws` 签名者使用基于 AWS 的 KMS,而 `Node` 则假设本地节点将签署 RPC 调用。 -**Optional:** Yes; Defaults to `node` unless a `key` is specified in which case it defaults to `hexKey` +**Optional:** Yes;默认设置为 `node`,除非指定了 `key`,在这种情况下默认设置为 `hexKey`。 **Agents:** All @@ -424,11 +424,11 @@ export HYP_CHAINS_${CHAIN_NAME}_SIGNER_TYPE="hexKey" ## chains.``.signer.key -**Description:** A local hex key. The hex string of a private key. +**说明:** 本地十六进制密钥。私人密钥的十六进制字符串。 **Requires:** `chains..signer.type = "hexKey" | undefined` -**Optional:** No (iff requirements are met) +**Optional:** No(如果符合要求) **Agents:** All @@ -469,11 +469,11 @@ export HYP_CHAINS_${CHAIN_NAME}_SIGNER_KEY="8166f546bab6da521a8369cab06c5d2b9e46 ## chains.``.signer.id -**Description:** The UUID identifying the AWS KMS key +**说明:** 标识 AWS KMS 密钥的 UUID **Requires:** `chains..signer.type = "aws"` -**Optional:** No (iff requirements are met) +**Optional:** No(如果符合要求) **Agents:** All @@ -510,11 +510,11 @@ export HYP_CHAINS_${CHAIN_NAME}_SIGNER_ID="alias/validator-signer-ethereum" ## chains.``.signer.region -**Description:** The AWS region +**说明:** AWS 区域 **Requires:** `chains..signer.type = "aws"` -**Optional:** No (iff requirements are met) +**Optional:** No(如果符合要求) **Agents:** All @@ -551,9 +551,9 @@ export HYP_CHAINS_${CHAIN_NAME}_SIGNER_REGION="us-east-1" ## chains.``.protocol -**Description:** Connection protocol to use. +*说明:** 使用的连接协议。 -**Optional:** Defaults to `"ethereum"` +**Optional:** 默认设置为`"ethereum"` **Agents:** All @@ -594,17 +594,17 @@ export HYP_CHAINS_ARBITRUM_PROTOCOL="ethereum" :::info -**The consensus type currently only applies to EVM chains.** +**共识类型目前只适用于 EVM 链。** -Connections to non-EVM chains only support a single RPC url. If more than one RPC url is specified in [rpcUrls](#chainschain_namerpcurls), only the first one will be used. +与非 EVM 链的连接只支持一个 RPC url。如果在 [rpcUrls](#chainschain_namerpcurls)中指定了多个 RPC 网址,则只会使用第一个。 ::: -**Description:** How to communicate with the provider +**说明:**与提供者进行通信的方式 -* `"single"` uses a basic http connection -* `"fallback"` will try the first URL and then automatically "fall back" on a connection or other provider failure to the next provider; this should only retry calls which fail due to the provider and not the call itself such; an insufficient gas error for instance would not fall back. -* `"quorum"` requires a majority of the URLs to agree with the exception of submitting transactions; it will automatically coordinate the "latest" block if not specified to reduce sync errors. +* `"single"` 使用基本的 http 连接 +* `"fallback"` 将首先尝试第一个 URL,然后在连接或其他提供者故障时自动“退回”到下一个提供者;这应该只重新尝试由于提供者而失败的调用,而不是调用本身;例如,不足的 gas 错误不会回退。 +* `"quorum"` 要求大多数 URL 同步一致,但提交事务除外;如果没有指定,它会自动协调 "最新 "区块,以减少同步错误。 **Requires:** `chains..protocol = "ethereum" | undefined` @@ -648,13 +648,13 @@ export HYP_CHAINS_ETHEREUM_RPCCONSENSUSTYPE="single" :::info -Connections to non-EVM chains only support a single RPC url. If more than one RPC url is specified, only the first one will be used. +与非 EVM 链的连接只支持一个 RPC 网址。如果指定了多个 RPC 网址,则只会使用第一个。 ::: -**Description:** Comma-separated URLs to connect the provider to. The difference between `customRpcUrls` and [rpcUrls](#chainschain_namerpcurls) is that `customRpcUrls` allows for more user friendly inputs from the CLI or environment variables (comma-separated vs array). +*说明:**用于连接提供者的URL逗号以分隔。`customRpcUrls` 和 [rpcUrls](#chainschain_namerpcurls) 之间的区别在于,`customRpcUrls` 允许从 CLI 或环境变量中输入更加用户友好的内容(逗号分隔 vs 数组)。 -**Type:** `string` (comma separated list of urls without spaces) +**Type:** `string` (以逗号分隔的网址列表,不含空格) @@ -691,11 +691,11 @@ export HYP_CHAINS_ETHEREUM_RPCURLS_2_HTTPS="http://127.0.0.1:8545,http://127.0.0 :::info -Connections to non-EVM chains only support a single RPC url. If more than one RPC url is specified, only the first one will be used. +与非 EVM 链的连接只支持一个 RPC 网址。如果指定了多个 RPC 网址,则只会使用第一个。 ::: -**Description:** URLs to connect the provider to. The first one is initially used, and on failure the other ones are tried. See [rpcConsensusType](#chainschain_namerpcconsensustype) for more information. +**说明:** 用于连接提供者的 URL。最初使用第一个,如果失败,则尝试其他的。有关更多信息,请参阅 [rpcConsensusType](#chainschain_namerpcconsensustype)。 **Requires:** @@ -705,7 +705,7 @@ Connections to non-EVM chains only support a single RPC url. If more than one RP OR chains.``.protocol = "cosmos" | "sealevel" | "fuel" ``` -**Optional:** No (iff requirements are met) +**Optional:** No (如果满足要求) **Agents:** @@ -766,7 +766,7 @@ export HYP_CHAINS_ETHEREUM_RPCURLS_2_HTTPS="http://127.0.0.1:8547" ## chains.``.index.from -**Description:** Height at which to start indexing contracts. +**说明:** 开始索引合约的高度。 **Optional:** Defaults to `0` @@ -811,9 +811,9 @@ export HYP_CHAINS_ETHEREUM_INDEX_FROM=16271503 ## chains.``.index.chunk -**Description:** Number of blocks to query at once when indexing contracts. Note that the configured providers must support whatever value is set. The default should work with nearly all providers. +**说明:** 一次查询索引合约的区块数。请注意,配置的提供者必须支持设置的任何值。默认值几乎适用于所有提供者。 -**Optional:** Defaults to `1999` +**Optional:** 默认设置为 `1999` **Agents:** Relayer & Scraper @@ -859,11 +859,11 @@ export HYP_CHAINS_ETHEREUM_INDEX_CHUNK=1999 :::info -Because each VM supports a different signer type, the default signer can only support a single VM type. For instance, if the default signer is a ECDSA one, it will only be able to sign on EVM chains. +由于每个 VM 支持不同的签名者类型,因此默认签名者只能支持单个 VM 类型。例如,如果默认签名者是 ECDSA 类型,则只能在 EVM 链上签名。 ::: -**Description:** The default signer that should be used for all chains which did not specify their own. +**说明:** 默认的签名者应该用于所有没有指定自己的链。 **Optional:** Yes @@ -895,9 +895,9 @@ export HYP_DEFAULTSIGNER_*="...." ## defaultsigner.type -**Description:** The type of signer that is defined. A `HexKey` signer uses a private key, an `Aws` signer uses an AWS-based KMS, and `Node` assumes the local node will sign RPC calls. +**说明:** 已定义的签名者类型。HexKey "签名者使用私钥,"Aws "签名者使用基于 AWS 的 KMS,而 "Node "则假定本地节点将签署 RPC 调用。 -**Optional:** Yes; Defaults to `node` unless a `key` is specified in which case it defaults to `hexKey` +**Optional:** 是;默认设置为 `node`,除非指定了 `key`,在这种情况下默认设置为 `hexKey`。 **Agents:** All @@ -929,11 +929,11 @@ export HYP_DEFAULTSIGNER_TYPE="hexKey" ## defaultsigner.key -**Description:** A local hex key. The hex string of a private key. +**说明:** 本地十六进制密钥。私人密钥的十六进制字符串。 **Requires:** `defaultsigner.type = "hexKey" | undefined` -**Optional:** No (iff requirements are met) +**Optional:** No (如果符合要求) **Agents:** All @@ -966,11 +966,11 @@ export HYP_DEFAULTSIGNER_KEY="8166f546bab6da521a8369cab06c5d2b9e46670292d85c875e ## defaultsigner.id -**Description:** The UUID identifying the AWS KMS key +**说明:** 识别 AWS KMS 密钥的 UUID **Requires:** `defaultsigner.type = "aws"` -**Optional:** No (iff requirements are met) +**Optional:** No (如果符合要求) **Agents:** All @@ -1003,11 +1003,11 @@ export HYP_DEFAULTSIGNER_ID="alias/validator-signer-ethereum" ## defaultsigner.region -**Description:** The AWS region +*说明:** AWS 区域 **Requires:** `defaultsigner.type = "aws"` -**Optional:** No (iff requirements are met) +**Optional:** No (如果符合要求) **Agents:** All @@ -1040,7 +1040,7 @@ export HYP_DEFAULTSIGNER_REGION="us-east-1" ## metricsport -**Description:** Port to expose prometheus metrics on +**说明:** 在以下平台上公开 prometheus 指标的端口 **Optional:** Defaults to `9090` @@ -1072,9 +1072,9 @@ export HYP_METRICSPORT=9090 ## log.fmt -**Description:** Configuration for the log module. This controls logging. +**说明:** 日志模块的配置。它控制日志记录。 -**Optional:** Defaults to `pretty` +**Optional:** 默认设置为 `pretty` **Agents:** All @@ -1106,9 +1106,9 @@ export HYP_LOG_FMT="pretty" ## log.level -**Description:** Configuration for the log module. This controls logging. +**说明:** 日志模块的配置。它控制日志记录。 -**Optional:** Defaults to `info` +**Optional:** 默认设置为 `info` **Agents:** All @@ -1140,7 +1140,7 @@ export HYP_LOG_LEVEL="info" ## originchainname -**Description:** Name of the chain a validator should validate for and name of the chain a relayer should relayer messages from. **Deprecated for Relayer, use** [#relaychains](#relaychains) **instead.** +**说明:** 验证者应验证的链的名称以及中继器应从中中继消息的链的名称。 **已弃用 Relayer,请使用** [#relaychains](#relaychains) **代替。** **Optional:** No - Validators; Yes - Relayer @@ -1172,7 +1172,7 @@ export HYP_ORIGINCHAINNAME="ethereum" ## validator -**Description:** The signer that should be used by the validator. +**说明:** 验证器应使用的签名。 **Optional:** Yes @@ -1204,9 +1204,9 @@ export HYP_VALIDATOR_*="...." ## validator.type -**Description:** The type of EVM signer that is defined. Note that regardless of the VM the validator is operating on, checkpoints are always signed using the EVM ECDSA curve. A `HexKey` signer uses a private key, an `Aws` signer uses an AWS based KMS, and `Node` assumes the local node will sign RPC calls. +**说明:** 已定义的 EVM 签名器类型。请注意,无论验证器在哪个虚拟机上运行,检查点始终使用 EVM ECDSA 曲线签名。HexKey "签名器使用私钥,"Aws "签名器使用基于 AWS 的 KMS,而 "Node "则假定本地节点将签署 RPC 调用。 -**Optional:** Yes; Defaults to `node` unless a `key` is specified in which case it defaults to `hexKey` +**Optional:** Yes; 默认为 `node`,除非指定了一个 `key`,在这种情况下,默认为 `hexKey`。 **Agents:** All @@ -1238,11 +1238,11 @@ export HYP_VALIDATOR_TYPE="hexKey" ## validator.key -**Description:** A local hex key. The hex string of a private key. +**说明:** 一个本地的十六进制密钥。私钥的十六进制字符串。 **Requires:** `validator.type = "hexKey" | undefined` -**Optional:** No (iff requirements are met) +**Optional:** No (如果符合要求) **Agents:** All @@ -1275,11 +1275,11 @@ export HYP_VALIDATOR_KEY="8166f546bab6da521a8369cab06c5d2b9e46670292d85c875ee9ec ## validator.id -**Description:** The UUID identifying the AWS KMS key +**说明:** 标识 AWS KMS 密钥的 UUID **Requires:** `validator.type = "aws"` -**Optional:** No (iff requirements are met) +**Optional:** No (如果符合条件) **Agents:** All @@ -1312,11 +1312,11 @@ export HYP_VALIDATOR_ID="alias/validator-signer-ethereum" ## validator.region -**Description:** The AWS region +**说明:** AWS 地区 **Requires:** `validator.type = "aws"` -**Optional:** No (iff requirements are met) +**Optional:** No (如果符合条件) **Agents:** All @@ -1349,7 +1349,7 @@ export HYP_VALIDATOR_REGION="us-east-1" ## checkpointsyncer.type -**Description:** Defines the method of syncing checkpoints +**说明:** 定义同步检查点的方法 **Optional:** No @@ -1383,11 +1383,11 @@ export HYP_CHECKPOINTSYNCER_TYPE="localStorage" ## checkpointsyncer.path -**Description:** Path on the local disk of a local storage type checkpoint syncer configuration. +**说明:** 本地存储类型检查点同步器配置在本地磁盘上的路径。 **Requires:** `checkpointsyncer.type = "localStorage"` -**Optional:** No (iff conditions are met) +**Optional:** No (如果符合条件) **Agents:** Validator @@ -1420,11 +1420,11 @@ export HYP_CHECKPOINTSYNCER_PATH="/tmp/syncer" ## checkpointsyncer.bucket -**Description:** S3 bucket name +**说明:** S3 存储名称 **Requires:** `checkpointsyncer.type = "s3"` -**Optional:** No (iff conditions are met) +**Optional:** No (如果符合条件) **Agents:** Validator @@ -1457,11 +1457,11 @@ export HYP_CHECKPOINTSYNCER_BUCKET="signatures-ethereum" ## checkpointsyncer.region -**Description:** S3 bucket region +**说明:** S3 存储地区 **Requires:** `checkpointsyncer.type = "s3"` -**Optional:** No (iff conditions are met) +**Optional:** No (如果符合条件) **Agents:** Validator @@ -1494,7 +1494,7 @@ export HYP_CHECKPOINTSYNCER_REGION="us-east-1" ## interval -**Description:** How frequently the validator should check for new checkpoints in seconds. See also [latencies](../guides/latencies.mdx). +**说明:** 验证器检查新检查点的频率(以秒为单位)。另请参阅[latencies](../guides/latencies.mdx)。 **Optional:** No @@ -1526,11 +1526,11 @@ export HYP_INTERVAL=30 ## db -**Description:** This is a local filesystem path to where the agents store relevant data on disk. **This must be unique per agent!** Multiple agents must have different paths. The path is relative to the current working directory if it does not start with a system defined root path such as `/` on unix. When using docker images, ensure that this folder gets persisted across runs. +**说明:** 这是代理在磁盘上存储相关数据的本地文件系统路径。**每个代理的路径必须是唯一的!** 多个代理必须有不同的路径。如果路径不是以系统定义的根路径(如 unix 上的 `/`)开始,则是相对于当前工作目录的路径。使用 docker 镜像时,请确保该文件夹在运行过程中得到持久保存。 -For the scraper, this is the connection string to a postgresql database. +对于 scraper,这是 postgresql 数据库的连接字符串。 -**Optional:** For validators and relayer it is optional and defaults to a path in the current working directory which includes the `originchainname`. For the scraper it is required. +**Optional:** 对于验证器和中继器来说,它是可选项,默认为当前工作目录中包含 `originchainname` 的路径。对于scraper则为必填项。 **Agents:** All @@ -1564,6 +1564,7 @@ export HYP_DB="postgresql://postgres:password@localhost:5432/dbname" + For the validator: ```json @@ -1592,13 +1593,13 @@ For the scraper: ## relaychains -**Description:** List of chains to deliver messages between. +**说明:** 在两个链之间传递信息的链列表。 **Optional:** No **Agents:** Relayer -**Type:** `string` (comma separated list) +**Type:** `string` (逗号分隔列表) @@ -1624,9 +1625,9 @@ export HYP_RELAYCHAINS="arbitrum,ethereum,bsc" ## gaspaymentenforcement -**Description:** JSON stringified array of gas payment enforcement configurations sorted by highest priority first. The last policy should be a catch-all and handle any messages that did not match a previous policy. +**说明:** 以最高优先级为第一的 JSON 字符串化数组,其中包含燃料支付执行配置。最后一个策略应该是一个全捕获策略,处理任何未匹配到之前策略的消息。 -**Optional:** Defaults to no enforcement (`[{"type": "none"}]`) +**Optional:** 默认为不强制执行 (`[{"type": "none"}]`) **Agents:** Relayer @@ -1636,25 +1637,25 @@ export HYP_RELAYCHAINS="arbitrum,ethereum,bsc" type gaspaymentenforcement = Array; type GasPaymentEnforcementPolicy = -( // fields specific to each type... - // No requirements - all messages are processed regardless of gas payment +( // 每种类型的特定字段... + // 无要求--无论是否支付燃气费,所有信息均得到处理 { type: "none" } - // Messages that have paid a minimum amount will be processed + // 将处理已支付最低金额的信息 & { type: "minimum", payment: U256 } - // Required amount of gas on the foreign chain has been paid according - // to on-chain fee quoting. `gasfraction` defaults to "1 / 2". + // 外链上所需的燃料费已按以下规定支付 + // 到链上费用报价。`gasfraction` 默认为 "1 / 2"。 & { type: "onChainFeeQuoting", gasfraction?: GasFraction } -) | { // all types have the following fields... - // If a message matches, this policy will be used. - // If no matching list is specified, all messages will match. +) | { // 所有类型都有以下字段... + // 如果有匹配的信息,就会使用该策略。 + // 如果没有指定匹配列表,则所有信息都将匹配。 matchingList?: MatchingList }; -// A list of matching rules. A message matches if any of the list -// elements matches the message. +// 一组匹配规则。如果消息符合列表中的任何规则,则认为匹配。 +// 元素与消息匹配。 type MatchingList = Array; -// Matches a message if any of the provided values matches. +// 如果提供的任何值匹配,则匹配消息。 interface MatchingListElement { originDomain?: NumericFilter senderAddress?: HashFilter @@ -1673,7 +1674,7 @@ type U256 = string | number; type H256 = string; // Matches anything type Wildcard = "*"; -// A numeric string in the form `{numerator} / {denominator}`, e.g. "1 / 2" +// 一个形式为 `{分子} / {分母}` 的数字字符串,例如 "1 / 2"。 type GasFraction = string; ``` @@ -1701,9 +1702,9 @@ export HYP_GASPAYMENTENFORCEMENT='[{"type": "none", "matchingList": [{"senderAdd ## whitelist -**Description:** A matching list to define what messages should be allowed. Any messages which do not match this list will not be relayed. If no whitelist is supplied all messages will be allowed. +**说明:** 匹配列表,用于定义应允许哪些消息。任何不符合此列表的消息都不会被中继。如果未提供白名单,则将允许所有消息。 -See also [message filtering](./relayer/message-filtering.mdx) +另请参阅 [信息过滤](./relayer/message-filtering.mdx) **Optional:** Yes @@ -1712,11 +1713,11 @@ See also [message filtering](./relayer/message-filtering.mdx) **Type:** `JSON (string)` ```typescript -// A list of matching rules. A message matches if any of the list -// elements matches the message. +// 匹配规则列表。如果消息与列表中的任何规则匹配,则视为匹配。 +// 元素与消息匹配。 type MatchingList = Array<MatchingListElement>; -// Matches a message if any of the provided values matches. +// 如果提供的任何值匹配,则匹配消息。 interface MatchingListElement { originDomain?: NumericFilter senderAddress?: HashFilter @@ -1759,9 +1760,9 @@ export HYP_WHITELIST='[{"senderAddress": "0xa441b15fe9a3cf56661190a0b93b9dec7d04 ## blacklist -**Description:** A matching list to define what messages should be ignored. Any messages which match this list will not be relayed. If no blacklist is supplied all messages will be allowed. +**说明:** 一个匹配列表,用于定义应该被忽略的消息。与此列表匹配的任何消息都不会被中继。如果未提供黑名单,则将允许所有消息。 -See also [message filtering](./relayer/message-filtering.mdx) +另请参阅 [信息过滤](./relayer/message-filtering.mdx) **Optional:** Yes @@ -1772,11 +1773,11 @@ See also [message filtering](./relayer/message-filtering.mdx) ```typescript type blacklist = MatchingList | undefined; -// A list of matching rules. A message matches if any of the list -// elements matches the message. +// 一个匹配规则列表。如果消息与列表中的任何规则匹配,则匹配。 +// 元素与消息匹配。 type MatchingList = Array; -// Matches a message if any of the provided values matches. +// 如果提供的任何值匹配,则匹配消息。 interface MatchingListElement { originDomain?: NumericFilter senderAddress?: HashFilter @@ -1819,9 +1820,9 @@ export HYP_BLACKLIST='[{"senderAddress": "0xa441b15fe9a3cf56661190a0b93b9dec7d04 ## transactiongaslimit -**Description:** The max allowable gas to relay a transaction. +**说明:** 中继交易的最大允许燃料。 -**Optional:** Defaults to no limit +**Optional:** 默认设置无限制 **Agents:** Relayer @@ -1851,13 +1852,13 @@ export HYP_TRANSACTIONGASLIMIT="250000000" ## skiptransactiongaslimitfor -**Description:** List of domain ids to skip applying the `transactiongaslimit` for. +**说明:** 跳过应用 transactiongaslimit 的域 ID 列表。 -**Optional:** Defaults to using the `transactiongaslimit` for all domains +**Optional:** 默认情况下,所有域都使用 "transactiongaslimit"。 **Agents:** Relayer -**Type:** `string` (comma separated list of domain ids) +**Type:** `string` (以逗号分隔的域 ID 列表) @@ -1883,9 +1884,9 @@ export HYP_SKIPTRANSACTIONGASLIMITFOR="43114,10,42220" ## allowlocalcheckpointsyncers -**Description:** Whether to allow local `checkpointsyncer` types, if `false` it will ignore them. +**说明:** 是否允许本地 `checkpointsyncer` 类型,如果为 `false`,则忽略它们。 -**Optional:** Defaults to `false` +**Optional:** 默认设置为 `false` **Agents:** Relayer @@ -1915,9 +1916,9 @@ export HYP_ALLOWLOCALCHECKPOINTSYNCERS=false ## AWS_ACCESS_KEY_ID -**Description:** (Env only) The access key ID of your validator's AWS IAM user. +**说明:** (仅限 Env)验证器的 AWS IAM 用户的访问密钥 ID。 -**Optional**: Required if any signer configuration uses `aws` +**Optional**: 如果签名者配置中使用了 `aws` 则必须填写 **Agents:** Relayer & Validator @@ -1941,9 +1942,9 @@ Not supported in configuration files ## AWS_SECRET_ACCESS_KEY -**Description:** (Env only) The secret access key of your validator's AWS IAM user. +**说明:** (仅限 Env)验证器 AWS IAM 用户的秘密访问密钥。 -**Optional:** Required if any signer configuration uses `aws` +**Optional:** 如果签名者配置中使用了 `aws` 则必须填写 **Agents:** Relayer & Validator From 6469cb66aa32f7a6301889b26296bbe7fa077df7 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 11:03:48 +0800 Subject: [PATCH 24/58] Translate deploy-with-terraform.mdx to Chinese --- docs/operate/deploy-with-terraform.mdx | 92 +++++++++++++------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/docs/operate/deploy-with-terraform.mdx b/docs/operate/deploy-with-terraform.mdx index bcbc8df6..1b92461f 100644 --- a/docs/operate/deploy-with-terraform.mdx +++ b/docs/operate/deploy-with-terraform.mdx @@ -1,25 +1,25 @@ -# Deploy with Terraform +# 使用 Terraform 进行部署 -For those more familiar with deploying to AWS through infrastructure-as-code tools such as Terraform, we provide an [**example configuration in Github**](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/terraform) designed to set up the necessary infrastructure for a Hyperlane Validator on AWS. It automates the creation of resources such as ECS clusters, VPCs, subnets, and security groups required for running a Validator agent. +对于那些更熟悉通过基础设施即代码工具(如Terraform)部署到AWS的人来说,我们在Github上提供了一个示例配置,旨在为在AWS上设置Hyperlane验证器所需的基础设施。它自动创建了诸如ECS集群、VPC、子网和安全组等资源,这些资源对于运行验证器代理是必需的。 :::caution -The configuration provided is intended to only be an _example_ of running a Validator for a core supported network. You may have to modify the Validator module to support more advanced configurations. It is recommended to test thoroughly before using this setup in a production environment. +提供的配置仅用作在核心支持的网络上运行验证器的示例。您可能需要修改验证器模块以支持更高级的配置。建议在将此设置用于生产环境之前进行彻底测试。 ::: -## Overview +## 概览 -The provided terraform has a few key parts: +提供的 Terraform 有几个关键部分: -- IAM/KMS module: automatically completes [Agent Keys](set-up-agent-keys.mdx) configuration for you. -- S3 module: automatically completes [AWS Signatures Bucket](validators/validator-signatures-aws.mdx) configuration for you. -- EFS module: sets up a persistent volume that can be mounted to the Validator. -- Validator module: uses the above modules to run an instance of a Validator. -- `global.tf`: top-level networking configuration for a cluster that Validators can run in. -- `main.tf`: configures Validators for deployment. +- IAM/KMS 模块:自动为您完成 [Agent Keys](set-up-agent-keys.mdx)配置。 +- S3 模块:自动为您完成 [AWS Signatures Bucket](validators/validator-signatures-aws.mdx) 配置。 +- EFS 模块:设置可挂载到验证器的持久卷。 +- 验证器模块:使用上述模块运行验证器实例。 +- `global.tf`: Validators可以运行在其中的集群的顶层网络配置。 +- `main.tf`: 配置验证器以进行部署。 -The diagram below shows how it fits together. +下面的图表显示了它们如何相互配合。 ```mermaid graph LR @@ -59,70 +59,70 @@ graph LR ``` -## Usage +## 使用方法 -As a prerequisite, you need to have Terraform installed and the AWS CLI configured with your credentials. +作为前提条件,您需要安装 Terraform,并使用您的凭据配置 AWS CLI。 -To initialize the terraform state: +初始化 Terraform 状态: ```bash terraform init ``` -To generate the plan of infrastructure changes: +制定基础设施变更计划: ```bash terraform plan ``` -To preview and apply the infrastructure changes: +预览和应用基础架构变更: ```bash terraform apply ``` -To list the outputs such as KMS, IAM or S3 information, you will have to parse the JSON output: +要列出 KMS、IAM 或 S3 信息等输出,必须解析 JSON 输出: ```bash terraform output -json ``` -## Modules +## 模块 -Several modules exist so you can choose which parts of the Validator setup you would like managed by terraform. +Terraform 提供多个模块,您可以选择希望由 terraform 管理验证器设置的哪些部分。 ### IAM / KMS -The `iam_kms` module creates an IAM user and a KMS key for secure signing operations. It also sets up IAM policies and attachments to grant the necessary permissions for using the KMS key and other AWS services, such as S3, EFS and ECS later on. +iam_kms "模块会创建一个 IAM 用户和一个 KMS 密钥,用于安全签名操作。它还会设置 IAM 策略和附件,以授予使用 KMS 密钥和其他 AWS 服务(如 S3、EFS 和 ECS)所需的权限。 ### S3 -The `s3` module creates an S3 bucket for storing Validator-related data, such as signatures. It also sets bucket policies to manage access and permissions, including public access restrictions and versioning. +s3 "模块创建一个 S3 bucket,用于存储签名等与验证程序相关的数据。它还设置了管理访问和权限的存储策略,包括公共访问限制和版本管理。 ### EFS -The `efs` module defines an EFS file system and access point, allowing the Validator application to store and access data on EFS. It also sets up a mount target for connecting the EFS file system to the network. +efs 模块定义了 EFS 文件系统和访问点,允许 Validator 应用程序存储和访问 EFS 上的数据。它还设置了一个挂载目标,用于将 EFS 文件系统连接到网络。 :::note -This module is only required when using the `validator` module. +只有在使用 `validator` 模块时才需要该模块。 ::: ### Validator -The `validator` module uses all of the above to integrate the EFS, IAM/KMS, and S3 configurations. +`validator`模块使用上述所有功能整合 EFS、IAM/KMS 和 S3 配置。 -In addition to: -- Creating a new IAM user and relevant roles to run a Validator. -- Creating an S3 bucket that a Validator can write signatures to. -- Creating an EFS volume to persist data in the service. +此外,还有: +- 创建新的 IAM 用户和相关角色以运行验证器。 +- 创建验证器可写入签名的 S3 bucket。 +- 创建 EFS 卷,以便在服务中持久保存数据。 -This module also: -- Defines an ECS task definition for running the Validator application, including container definitions, volume configurations, and logging. -- Creates an ECS service to manage the deployment and scaling of the Validator tasks. +本模块还包括: +- 定义一个运行验证器应用程序的ECS任务定义,包括容器定义、卷配置和日志记录。 +- 创建一个ECS服务来管理验证器任务的部署和扩展。 -## Main Configuration +## 主要配置 -The root level configuration sets up a VPC, subnets, internet gateway, NAT gateway, route tables, and security groups for network infrastructure. It also provides example usage of the `validator` module. +根级配置为网络基础设施设置了 VPC、子网、互联网网关、NAT 网关、路由表和安全组。它还提供了使用 "验证器 "模块的示例。 ```terraform module "your_validator_name" { @@ -145,13 +145,13 @@ module "your_validator_name" { } ``` -### Outputs +### 输出 -The root-level `outputs.tf` passes forward all outputs from the Validators configured in `main.tf`. **You will have to update this as you add, modify or remove Validators.** +根级别的 `outputs.tf` 从 `main.tf` 中配置的验证器中传递所有输出。**随着您添加、修改或删除验证器,您将需要更新此内容。** -### Example architecture +### 结构示例 -The diagram below shows how the Validator ECS cluster fits into the top-level network infrastructure. +下图显示了 Validator ECS 集群如何融入顶级网络基础设施。 ```mermaid graph TD @@ -189,17 +189,17 @@ graph TD EIP -- Connects to --> Internet ``` -## Known issues +## 已知问题 -### PI configuration +### PI 配置 -It is non-trivial to set custom configuration values for PI chains, such as ones you've deployed Hyperlane to yourself. -Currently you may have to just pass a long list of environment variables or command line arguments. +为 PI 链(如您自己部署的 Hyperlane)设置自定义配置值并非易事。 +目前,您可能只需传递一长串环境变量或命令行参数。 -### Individual agent logs +### 单个代理日志 -Currently all agents log to the same log group - `DefaultLogGroup`. To separate them per agent, you may have to adjust the log group name and update the agent's log policy with the new group name. +目前,所有代理都登录到同一个日志组 - `DefaultLogGroup`。要按代理将它们分开,可能需要调整日志组名称,并用新的组名称更新代理的日志策略。 -### Relayer module +### 中继器模块 -The docker image supports running both types of agents. Therefore, if you choose to do so, you can use the Validator module as a starting point for a new Relayer module. +Docker镜像支持运行两种类型的代理。因此,如果您选择这样做,您可以将验证器模块作为新中继模块的起点。 From 69a4d8ac66b07a97f4fded6f654c263a2e831d35 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 11:12:53 +0800 Subject: [PATCH 25/58] Translate run-docker-compose.mdx to Chinese --- docs/operate/run-docker-compose.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/operate/run-docker-compose.mdx b/docs/operate/run-docker-compose.mdx index 94fa5278..f1ace21d 100644 --- a/docs/operate/run-docker-compose.mdx +++ b/docs/operate/run-docker-compose.mdx @@ -1,8 +1,8 @@ -# Running with Docker Compose +# 使用 Docker Compose 运行 -Sometimes it is nice to not rely on long docker commands. Running with Docker compose is very similar to using raw Docker and you can find a full specification of the format in the [Docker docs](https://docs.Docker.com/compose/compose-file/). +有时,不依赖冗长的 Docker 命令也是不错的选择。使用 Docker compose 运行与使用原始 Docker 非常相似,你可以在 [Docker docs](https://docs.Docker.com/compose/compose-file/) 中找到完整的格式说明。 -This is an example `docker-compose` file for running a validator that should get you most of the way. +这是一个运行验证器的 `docker-compose` 文件示例,应该能帮你完成大部分工作。 ```json { @@ -46,8 +46,8 @@ configs: file: ./ethereum_validator.json ``` -The above has a lot of filler values, you will of course need to update those with real ones. +上面有很多填充值,您需要用真实值更新这些填充值。 -You can also specify multiple services, so if you are running several validators, you can specify each one under `services`. +您还可以指定多个服务,因此如果要运行多个验证器,可以在 `services` 下指定每个验证器。 -To run the compose configuration use `docker compose up` and `docker compose down` to clean up after. Full documentation on the command line can be found on the [docker website](https://docs.docker.com/engine/reference/commandline/compose/). +要运行编译配置,请使用 `docker compose up` 和 `docker compose down` 进行清理。关于命令行的完整文档可以在 [docker 网站](https://docs.docker.com/engine/reference/commandline/compose/) 上找到。 From 998e1f90c08edad5ac4d0b5091699517bc40c091 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 14:19:29 +0800 Subject: [PATCH 26/58] Translate run-validators.mdx to Chinese --- docs/operate/set-up-agent-keys.mdx | 119 +++++++-------- docs/operate/validators/run-validators.mdx | 160 ++++++++++----------- 2 files changed, 140 insertions(+), 139 deletions(-) diff --git a/docs/operate/set-up-agent-keys.mdx b/docs/operate/set-up-agent-keys.mdx index 2e63a418..7134773c 100644 --- a/docs/operate/set-up-agent-keys.mdx +++ b/docs/operate/set-up-agent-keys.mdx @@ -1,35 +1,35 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# Agent keys +# 代理密钥 -Hyperlane agents - Validators and the Relayer - must be configured with private keys in order to operate. Validators use private keys to sign [message checkpoints](../reference/glossary.mdx#checkpoint), and the Relayer uses private keys to sign transactions that deliver messages. +Hyperlane 代理(验证器和中继器)必须配置私钥才能运行。验证器使用私钥签署[message checkpoints](../reference/glossary.mdx#checkpoint),中继器使用私钥签署传递信息的事务。 -Hyperlane agents currently support being configured with private keys in one of two ways. +Hyperlane 代理目前支持通过两种方式之一配置私钥。 -## 1. Hexadecimal keys +## 1. 十六进制密钥 -A raw hexadecimal private key used for in-memory signing. This is the easiest and fastest setup for testing. +用于内存签名的原始十六进制私钥。这是最简单快捷的测试设置。 :::warning -Hexadecimal keys are **not** recommended for production environments. Use AWS KMS keys instead. +不建议在生产环境中使用十六进制密钥。请使用 AWS KMS 密钥。 ::: -### Generate a hexadecimal key +### 生成十六进制密钥 -Keep track of your address and private key for use with your agent. Do not lose or leak it. +保存好您的地址和私人密钥,以便与代理一起使用。切勿丢失或泄漏。 -Using [Foundry's cast](https://book.getfoundry.sh/cast/), you can create a new key pair: +使用 [Foundry's cast](https://book.getfoundry.sh/cast/),可以创建新的密钥对: ```sh cast wallet new ``` -The output will look something like this: +输出结果将如下所示: ``` Successfully created new keypair. @@ -38,11 +38,11 @@ Private Key: 0x2958f0eb2ab71bbfb5ea1422835e20e488778b61e3c107f369572e2b53b578f9 ``` -You can visit [https://privatekeys.pw/keys/ethereum/random](https://privatekeys.pw/keys/ethereum/random), which will automatically display a list of hexadecimal private keys and their addresses. +您可以访问 [https://privatekeys.pw/keys/ethereum/random](https://privatekeys.pw/keys/ethereum/random),它会自动显示十六进制私钥及其地址的列表。 :::warning -Please note that because these are generated by a website, these private keys should be considered insecure and should not be used for anything other than testing purposes! +请注意,由于这些私人密钥是由网站生成的,因此应视为不安全密钥,除测试目的外,不得用于任何其他目的! ::: @@ -50,59 +50,60 @@ Please note that because these are generated by a website, these private keys sh ## 2. AWS KMS -A key generated by AWS and stored in a CloudHSM. This is the recommended setup for production agents, **especially** for Validators. - -### Create an IAM user - -This IAM user will be given permission to sign with the KMS key that you will later configure. Your Hyperlane agent will use this identity when signing transactions. - -1. Go to AWS's Identity and Access Management (IAM) in the [AWS console](https://us-east-1.console.aws.amazon.com/iamv2/home). -2. On the left, under "Access management", click "Users". -3. Click the blue button "Add users". -4. Pick a friendly and informative username, like `hyperlane-validator-${chain_name}` or `hyperlane-relayer-${chain_name}`. This username will be referenced in future steps, so if you choose a different username be sure to use your correct username in the future. -5. Click "Next", you do not need to assign the user any permissions. -6. Click "Create user". -7. Click into the user that you just created -8. Click the "Security Credentials" tab -9. Scroll down to "Access Keys" and click "Create Access Key" -10. Select "Application running outside AWS" and click "Next" -11. Click "Next", no need to add a description tag -12. Click "Create access key" -13. Copy the "Access key ID" and "Secret access key" to a safe place. These will be passed to your Hyperlane Relayer as environment variables. - -### Create a KMS key - -This key will be used by your agent for signing. - -1. Go to AWS's Key Management Service (KMS) in the AWS console. -2. Ensure you are in the region you want to create the key in. This can be confirmed by viewing the region at the top right of the console, or by finding the name in the URL's subdomain (e.g. `us-west-2.console.aws.amazon.com` means you're operating in the region `us-west-2`). -3. On the left, click "Customer managed keys". -4. Click "Create key". -5. Select the "Asymmetric" key type. -6. Select the "Sign and verify" key usage. -7. Select the `ECC_SECG_P256K1` key spec. -8. Click "Next". -9. Set the Alias to something friendly and informative, like `hyperlane-validator-signer-${chain_name}` or `hyperlane-relayer-signer-${chain_name}` -10. While not necessary, feel free to write a description and add any tags that you think will be useful. -11. Click "Next". -12. A key administrator is not required, but if you want, you can select one. -13. Click "Next". -14. Give usage permissions to the IAM user you created in section #1. -15. Click "Next". -16. In the Review page, scroll to the "Key policy". The generated key policy is acceptable, but you can make the access even less permissive if you wish by: - 1. Removing the `kms:DescribeKey` and `kms:Verify` actions from the statement whose "Sid" is "Allow use of the key" - 2. Removing the entire statement whose "Sid" is "Allow attachment of persistent resources". -17. Click "Finish" +由 AWS 生成并存储在 CloudHSM 中的密钥。这是生产代理,尤其是验证器的推荐设置。 + +### 创建 IAM 用户 + +该 IAM 用户将被授权使用稍后配置的 KMS 密钥签名。Hyperlane 代理在签署事务时将使用此身份。 + +1. 访问 [AWS console](https://us-east-1.console.aws.amazon.com/iamv2/home) 中的 AWS 身份和访问管理 (IAM); +2. 在左侧 "Access management "下点击 "Users"; +3. 点击蓝色的"Add users"按钮; +4. 选择一个友好而具有关联性的用户名,比如 `hyperlane-validator-${chain_name}` 或 `hyperlane-relayer-${chain_name}`。此用户名将在将来的步骤中被引用,所以如果你选择了不同的用户名,请确保将来使用你的正确用户名; +5. 点击 "Next",您无需为用户分配任何权限; +6. 点击“Create User”; +7. 点击进入刚刚创建的用户; +8. 单击“安全证书”选项卡; +9. 向下滚动到“Access Keys”,然后单击“Create Access Key”; +10. 选择“Application running outside AWS”,然后点击“Next”; +11. 点击“Next”,无需添加描述标签 ; +12. 点击“Create access key”; +13. 将“Access key ID”和“Secret access key”复制到安全的地方。它们将作为环境变量传递给 Hyperlane Relayer。 + +###创建 KMS 密钥 + +您的代理将使用此密钥进行签名。 + +1. 访问 AWS 控制台中的 AWS 密钥管理服务 (KMS); +2. 确保您处于要创建密钥的地区。这可以通过查看控制台右上角的区域,或查找 URL 子域中的名称来确认(例如,"us-west-2.console.aws.amazon.com "表示您在 "us-west-2 "区域中运行); +3. 点击左侧的“Customer managed keys”; +4. 点击“Create key”; +5. 选择“Asymmetric”密钥类型; +6. 选择“Sign and verify”密钥的使用; +7. 选择“ECC_SECG_P256K1”密钥类; +8. 点击“Next”; +9. 将别名设置为友好且具有关联性的名称,如`hyperlane-validator-signer-${chain_name}`或`hyperlane-relayer-signer-${chain_name}`; +10. 虽然没有必要,但您可以随意撰写描述,并添加任何您认为有用的标签; +11. 点击“Next”; +12. 不需要密钥管理员,但如果需要,可以选择一个; +13. 点击“Next”; +14. 将使用权限赋予在第 1 部分中创建的 IAM 用户; +15. 点击“Next”; +16. 在审查页面,滚动到“Key policy”。生成的密钥策略是可以接受的,但如果你愿意,也可以通过以下方式降低访问权限: + 1. 从“Allow use of the key”的“Sid”语句中删除“kms:DescribeKey”和“kms:Verify”操作; + 2. 删除所有“Sid”为“Allow attachment of persistent resources”的语句。 +17. 点击“Finish”。 :::tip -Advanced users may consider using the [IAM/KMS terraform module](deploy-with-terraform.mdx#iam--kms) instead to create the IAM user and KMS key. +高级用户可以考虑使用[IAM/KMS terraform模块](deploy-with-terraform.mdx#iam--kms)来创建IAM用户和KMS密钥,而不是手动创建。 ::: -### Query address +### 查询地址 + +在某些情况下,您可能需要知道与您生成的 KMS 密钥相关的地址。 -In some cases you may need to know the address associated with the KMS key you generated. @@ -114,7 +115,7 @@ AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_KMS_KEY_ID=ali -The script at the following repo will allow you to query this address: [https://github.com/tkporter/get-aws-kms-address](https://github.com/tkporter/get-aws-kms-address) +通过以下软件仓库中的脚本可以查询该地址:[https://github.com/tkporter/get-aws-kms-address](https://github.com/tkporter/get-aws-kms-address)。 diff --git a/docs/operate/validators/run-validators.mdx b/docs/operate/validators/run-validators.mdx index d40c2899..0f29e2ff 100644 --- a/docs/operate/validators/run-validators.mdx +++ b/docs/operate/validators/run-validators.mdx @@ -1,14 +1,14 @@ -# Validators +# 验证器 -Everything you need to start running a Validator. +运行验证器所需的一切。 :::tip -Experienced operators may prefer to deploy agents with terraform instead. This process will automatically create agent keys, Validator buckets, permissions and any other auxiliary setup required to run a Validator cluster on AWS. +有经验的操作员可能更喜欢使用 terraform 部署代理。此过程将自动创建代理密钥、Validator buckets、权限以及在 AWS 上运行 Validator 集群所需的任何其他辅助设置。 ::: -Hyperlane [Validators](../../protocol/agents/validators.mdx) are not networked with other Validators and do not regularly submit transactions. Hyperlane Validators are run on a per-origin-chain basis, and these instructions are written for a single chain. +Hyperlane[Validators](../../protocol/agents/validators.mdx) 与其他验证器没有网络连接,也不会定期提交事务。Hyperlane验证器是基于每个源链运行的,这些说明是针对单个链编写的。 ```mermaid flowchart TB @@ -56,135 +56,135 @@ flowchart TB style Recipient fill:#efab17 ``` -Running a Validator requires the following: +运行验证器需要满足以下条件: -- An RPC node - - Validators make simple view calls to read merkle roots from the [Mailbox](../../protocol/mailbox.mdx) contract on the chain they are validating for. +- 一个RPC节点 + - 验证器通过对其正在验证的链上的[Mailbox](../../protocol/mailbox.mdx) 合约进行简单的视图调用来读取默克尔根。 :::caution -Operating a Validator for Polygon mainnet requires access to an archive node. This is because Validators should only sign roots once they've been finalized, and Polygon requires 256 block confirmations to achieve finality. +在Polygon主网上操作验证器需要访问存档节点。这是因为验证器应仅在区块已经被最终确定后才签署根,而Polygon需要256个区块确认才能实现最终性。 ::: -- A secure signing key +- 安全签名密钥 - - Validators use this key to sign the `Mailbox`'s latest merkle root. Securing this key is important. If it is compromised, attackers can attempt to falsify messages, causing the Validator to be slashed. - - The Hyperlane Validator agent currently supports signing with AWS KMS keys that are accessed via API keys/secrets as well as hexadecimal plaintext keys for testing. See more under [agent keys](../set-up-agent-keys.mdx). + - 验证器使用此密钥对`Mailbox`的最新默克尔根进行签名。保护此密钥非常重要。如果密钥被泄露,攻击者可以尝试伪造消息,导致验证器被减持。 + - Hyperlane验证器代理当前支持使用通过API keys/secrets访问的AWS KMS密钥进行签名,以及用于测试的十六进制明文密钥。更多详情请参阅[agent keys](../set-up-agent-keys.mdx)。 -- Publicly readable storage +- 公共可读存储 - - Validators write their signatures off-chain to publicly accessible, highly available, storage, so that they can be aggregated by the [Relayer](../../protocol/agents/relayer.mdx). - - The Hyperlane Validator agent currently supports storing signatures on AWS S3 using the same AWS API key above, as well as storing signatures in the local filesystem for testing. + - 验证器将它们的签名离线写入公开访问且高可用的存储中,以便由[中继器](../../protocol/agents/relayer.mdx)进行聚合。 + - Hyperlane验证器代理当前支持使用上述相同的AWS API密钥将签名存储在AWS S3上,同时也支持将签名存储在本地文件系统中以进行测试。 -- A machine to run on - - Validators can compile the Rust binary themselves or run a Docker image provided by Abacus Works. The binary can be run using your favorite cloud service. You can even run multiple instances of them in different regions for high availability, as Hyperlane has no notion of "double signing". +- 可运行的机器 + - 验证者可以自己编译 Rust 二进制文件,也可以运行 Abacus Works 提供的 Docker 镜像。二进制文件可以使用你喜欢的云服务运行。由于 Hyperlane 没有 "双重签名 "的概念,你甚至可以在不同区域运行多个实例,以实现高可用性。 import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; -## Guide +## 指南 -We strongly encourage you to follow the [local agents guide](../../guides/deploy-hyperlane-local-agents.mdx) to understand how to configure and run a Validator locally. +我们强烈建议您按照[local agents guide](../../guides/deploy-hyperlane-local-agents.mdx)了解如何在本地配置和运行验证器。 :::info -The local agent setup shows how you can run a Validator on your _local machine_, which is **only for testing and development purposes**. This also means that signatures from local Validators are only able to be accessed by a locally run Relayer. +本地代理设置显示了如何在本地机器上运行验证器,这**仅用于测试和开发目的**。这也意味着本地验证器的签名只能由本地运行的中继器访问。 -For a production environment, you should post signatures to a publicly accessible bucket. See the [**AWS bucket setup guide**](validator-signatures-aws.mdx). +对于生产环境,您应该将签名发布到一个公开访问的存储中。请参阅[**AWS bucket setup guide**](validator-signatures-aws.mdx)。 ::: -As a recap - before running a production Validator you need to ensure you have: +一般而言,在运行生产型验证器之前,您需要确保您具备以下条件: -1. Created a key for your Validator to sign with, see the [Agent Keys](../set-up-agent-keys.mdx) documentation. -1. Set up the desination for your Validator signatures to be posted, see the [AWS Signatures Bucket Setup](validator-signatures-aws.mdx) guide. +1. 创建一个密钥供验证器签名,请参阅[Agent Keys](../set-up-agent-keys.mdx) 文档。 +1. 设置您的验证器签名发布存储的位置,请参阅 [AWS Signatures Bucket Setup](validator-signatures-aws.mdx)指南。 -## Configuration +## 配置 -Like the local setup, there are a few base arguments you should provide when configuring your Validator. +与本地设置一样,在配置 Validator 时也需要提供一些基本参数。 -| Parameter | Description | +| 参数 | 说明 | | ------------------------------------------ | ------------------------------------------------------------------------------------------------------- | -| `--db` | Path for writing persistent data to disk. | -| `--originChainName` | Name of the chain being validated. For example: `ethereum`. | -| `--chains.[originChainName].customRpcUrls` | Override the default RPC URLs used by the Validator for your origin chain. | -| `--reorgPeriod` | Number of block confirmations the Validator needs to wait for before signing the `Mailbox` merkle root. | +| `--db` | 将持久数据写入磁盘的路径。 | +| `--originChainName` | 正在验证的链的名称。例如:`ethereum`。 | +| `--chains.[originChainName].customRpcUrls` | 覆盖验证器对您的原始链使用的默认RPC URL。 | +| `--reorgPeriod` | 验证器在签署`Mailbox`默克尔根之前需要等待的区块确认数量。 | :::info -Your Validator takes both command line arguments and environment variables as configuration. Take a look at the [agent configuration](../agent-config.mdx) page and the [configuration reference](../config-reference.mdx) for a full list of configuration possibilities. +您的验证器可以使用命令行参数和环境变量进行配置。请查看[agent configuration](../agent-config.mdx) 页面和[configuration reference](../config-reference.mdx)以获取完整的配置可能性列表。 ::: -Of course, you can also provide the path to additional configuration files as a comma separated list with the [`CONFIG_FILES` environment variable](../config-reference.mdx#config_files). If you choose to run in Docker, see the docker section of [agent configuration](../agent-config.mdx) for tips on mounting your config files into your Docker container. +当然,您还可以通过使用逗号分隔的方式将附加配置文件的路径提供给 [`CONFIG_FILES` environment variable](../config-reference.mdx#config_files)。如果您选择在 Docker 中运行,请查看[agent configuration](../agent-config.mdx)中的 Docker 部分,了解如何将配置文件挂载到您的 Docker 容器中的提示。 -### Setup-specific configuration +### 设置特定的配置 -These configurations requirements differ depending on which environment you are setting up. +这些配置要求因您设置的环境而异。 -**Base Validator configuration** +**验证器基本配置** -| Argument | Description | +| 参数 | 说明 | | --------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -| `--validator.key` | Your Validator's private key, which is used to sign merkle roots. | -| `--chains.${localChainName}.signer.key` | Your Validator's private key, which will be used to submit a transaction on chain that publicly announce your Validator's checkpoint syncer. | +| `--validator.key` | 验证器的私人密钥,用于签署梅克尔根。 | +| `--chains.${localChainName}.signer.key` | 您的验证器的私钥,将用于在链上提交交易,公开宣布您的验证器的检查点同步器。 | -| Argument | Description | +| 参数 | 说明 | | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| `--validator.region` | The region of your AWS KMS key. For example: `us-east-1`. | +| `--validator.region` | AWS KMS 密钥的地区。例如:`us-east-1`。 | | `--validator.type` | Set to the `aws` literal. | -| `--validator.id` | The alias of your Validator's AWS KMS key, prefixed with `alias/`. For example: `alias/hyperlane-validator-signer-${originChainName}`. | +| `--validator.id` | 验证器 AWS KMS 密钥的别名,前缀为 "alias/"。例如:`alias/hyperlane-validator-signer-${originChainName}`。 | | `--chains.${originChainName}.signer.type` | Set to the `aws` literal. | -| `--chains.${originChainName}.signer.id` | The alias of your Validator's AWS KMS key, prefixed with `alias/`. For example: `alias/hyperlane-validator-signer-${originChainName}`. | +| `--chains.${originChainName}.signer.id` | 验证器 AWS KMS 密钥的别名,前缀为 "alias/"。例如:`alias/hyperlane-validator-signer-${originChainName}`。 | -**Checkpoint syncer configuration** +**检查点同步器配置** -| Argument | Description | +| 参数 | 说明 | | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `--checkpointSyncer.type` | Set to `localStorage`. | -| `--checkpointSyncer.path` | The path to your local directory where Validator signatures will be written. This should be the value of `$MY_VALIDATOR_SIGNATURES_DIRECTORY` from the local setup. For example: `--checkpointSyncer.path='/tmp/hyperlane-validator-signatures-ethereum'`. | +| `--checkpointSyncer.type` | 设置为 `localStorage`。 | +| `--checkpointSyncer.path` | 写入 Validator 签名的本地目录路径。这应该是本地设置中 `$MY_VALIDATOR_SIGNATURES_DIRECTORY` 的值。例如:`--checkpointSyncer.path='/tmp/hyperlane-validator-signatures-ethereum'`。 | :::warning -Note that the Relayer **must** be configured with `--allowLocalCheckpointSyncers` to be able to read signatures from this Validator. +请注意,中继器***必须配置为"--allowLocalCheckpointSyncers",才能从该验证器读取签名。 ::: -| Argument | Description | +| 参数 | 说明 | | --------------------------- | ----------------------------------------------------------- | -| `--checkpointSyncer.type` | Set to `s3`. | -| `--checkpointSyncer.bucket` | The AWS S3 bucket name. | -| `--checkpointSyncer.region` | The region of your AWS S3 bucket. For example: `us-east-1`. | +| `--checkpointSyncer.type` | 设置为 `s3`。 | +| `--checkpointSyncer.bucket` | AWS S3 存储名称。 | +| `--checkpointSyncer.region` | AWS S3 存储的区域。例如:`us-east-1`。 | -## Start Validating +## 开始验证 -### Setup +### 安装 -The recommended installation method for a production environment is using a Docker image. +生产环境的推荐安装方法是使用 Docker 映像。 -First download the docker image: +首先下载 docker 映像: ```bash docker pull gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519 @@ -193,25 +193,25 @@ docker pull gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519 -**Clone and setup** +**克隆并安装** -First, clone the Hyperlane monorepo: +首先,克隆 Hyperlane monorepo: ```sh git clone git@github.com:hyperlane-xyz/hyperlane-monorepo.git ``` -Then follow the [setup instructions](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md) in the `rust` directory. This should setup `rustup` as well as Rosetta 2 if you are on Apple Silicon. +然后按照`rust`目录中的[setup instructions](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md)进行操作。这将设置`rustup`,如果你使用的是苹果芯片,则需要安装Rosetta 2。 ```sh -# install rustup +# 安装rustup curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -# (apple silicon only) install rosetta 2 +# (仅apple silicon需要)安装rosetta 2 softwareupdate --install-rosetta --agree-to-license ``` -Build the Validator: +构建Validator: ```sh cargo build --release bin validator @@ -220,21 +220,21 @@ cargo build --release bin validator -### Running the binary +### 运行源代码 -For production Validators that write their signatures to an S3 bucket and have their keys configured with AWS KMS, you will have to provide the AWS access key and secret as environment variables. +对于将其签名写入 S3 存储并配置了 AWS KMS 密钥的生产验证器,您需要提供 AWS 访问密钥和密钥作为环境变量。 -| Environment variable | Description | +| 环境变量 | 说明 | | ----------------------- | ------------------------------------------------------- | -| `AWS_ACCESS_KEY_ID` | The access key ID of your Validator's AWS IAM user. | -| `AWS_SECRET_ACCESS_KEY` | The secret access key of your Validator's AWS IAM user. | +| `AWS_ACCESS_KEY_ID` | 您的验证器的 AWS IAM 用户的访问密钥 ID。 | +| `AWS_SECRET_ACCESS_KEY` | 验证器的 AWS IAM 用户的访问密钥。 | -For a refresher, check out the [Agent Keys](../set-up-agent-keys.mdx) guide. +如果是新手,请查看 [Agent Keys](../set-up-agent-keys.mdx) 指南。 -Then start the container with the relevant arguments. For example, your configuration for AWS: +然后使用相关参数启动容器。例如,您的 AWS 配置: ```sh docker run \ @@ -260,16 +260,16 @@ docker run \ -See these instructions for building from source without Docker. +请参阅这些说明,了解如何在不使用 Docker 的情况下从源代码构建。 -We can run the built binary from within the `hyperlane-monorepo/rust` directory: +我们可以在 `hyperlane-monorepo/rust` 目录下运行构建的二进制文件: ```sh -# set AWS environment variables +# 设置AWS环境变量 export AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOP export AWS_SECRET_ACCESS_KEY=xX-haha-nice-try-Xx -# run the Validator +# 运行验证器 ./target/release/validator \ --mount ... \ gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519 \ @@ -290,18 +290,18 @@ export AWS_SECRET_ACCESS_KEY=xX-haha-nice-try-Xx -## Announcing your Validator +## 公布您的验证器 -The [Relayer](../relayer/run-relayer.mdx) needs to know where to find your Validator's signatures. Your Validator will automatically attempt to announce itself by writing to the `ValidatorAnnounce` contract on the chain that you're validating. +[Relayer](../relayer/run-relayer.mdx) 需要知道在哪里可以找到验证器的签名。您的验证器将自动尝试通过写入您正在验证的链上的 `ValidatorAnnounce` 合约来公布自己。 -To do this, your Validator must have a small amount of tokens to pay for the gas for this transaction. +为此,您的验证器必须有少量代币来支付此次交易的燃料费。 -If your Validator has not yet announced itself, and does not have enough tokens to pay for gas, it will log a message specifying how many tokens are needed. +如果您的验证器尚未公布自己,并且没有足够的代币来支付燃气费,它将记录一条信息,说明需要多少代币。 -## Success! +## 成功 -The Validator will index the origin Mailbox contract for messages. If a message has been sent, you should see log messages that the Validator has signed them. If everything is configured correctly, you should see json files being written to your S3 bucket (if you followed the AWS setup) or to your local signatures directory if you followed the local setup. New json files get written every time a new outbound message is inserted into the mailbox. +验证器将索引原始Mailbox的消息。如果消息已发送,则应该看到验证器已对其进行签名的日志消息。如果一切都配置正确,你应该看到 JSON 文件被写入你的 S3 存储(如果你按照 AWS 设置进行了配置),或者写入你的本地签名目录(如果你按照本地设置进行了配置)。每次插入新的出站消息时都会写入新的 JSON 文件。 -## Running multiple Validators +## 运行多个验证器 -We encourage folks to validate on as many chains as they are interested in supporting. We recommend that resources are not shared between Validator instances. +我们鼓励人们在他们有兴趣支持的尽可能多的链上进行验证。我们建议不要在验证器实例之间共享资源。 From bbec61f8ed339209a371695a0ad386c0daa1ef8c Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 15:02:23 +0800 Subject: [PATCH 27/58] Translate partials to Chinese --- .../deploy-hyperlane/_deploy-contracts.mdx | 42 +++++++++---------- .../deploy-hyperlane/_deploy-warp-route.mdx | 14 +++---- .../deploy-hyperlane/_send-test-messages.mdx | 6 +-- .../partials/deploy-hyperlane/_setup-keys.mdx | 8 ++-- .../deploy-hyperlane/_terminology.mdx | 6 +-- docs/partials/ts-sdk-placeholder.mdx | 4 +- 6 files changed, 40 insertions(+), 40 deletions(-) diff --git a/docs/partials/deploy-hyperlane/_deploy-contracts.mdx b/docs/partials/deploy-hyperlane/_deploy-contracts.mdx index 95482817..40a0a6f3 100644 --- a/docs/partials/deploy-hyperlane/_deploy-contracts.mdx +++ b/docs/partials/deploy-hyperlane/_deploy-contracts.mdx @@ -1,50 +1,50 @@ -Once you have set up deployer, validator, and relayer keys it's time to use the Hyperlane CLI to deploy smart contracts to the local and remote chains. +设置好部署器、验证器和中继器密钥后,就可以使用 Hyperlane CLI 将智能合约部署到本地和远程链上了。 -On the local chain, we will deploy: +在本地链上,我们将进行部署: -- The core contracts, including a [Mailbox](/docs/reference/messaging/messaging-interface) that can be used to send and receive messages. +- 核心合约,包括可用于发送和接收信息的[Mailbox](/docs/reference/messaging/messaging-interface)。 -On all chains, we will deploy: +我们在所有链将进行部署: -- A Multisig ISM that can be used to verify inbound messages from the other local & remote chains. -- An `InterchainGasPaymaster`, which can be used to pay our relayer for delivering interchain messages. -- A `TestRecipient`, which we will send messages to, in order to test that everything is working correctly. +- 可用于验证来自其他本地和远程链的入站消息的 Multisig ISM。 +- `InterchainGasPaymaster`可用于支付中继器传递链间消息的费用。 +- `TestRecipient`我们将向其发送信息,以测试一切工作是否正常。 -### Setup +### 设置 -First, install the [Hyperlane CLI](https://www.npmjs.com/package/@hyperlane-xyz/cli) from NPM. [Node 16](https://nodejs.org/en/download) or newer is required. The following command will install it globally on your machine. See the [package page](https://www.npmjs.com/package/@hyperlane-xyz/cli) for alternatives such as temporary install or building from source. +首先,使用NPM 安装 [Hyperlane CLI](https://www.npmjs.com/package/@hyperlane-xyz/cli)。需要 [Node 16](https://nodejs.org/en/download) 或以上版本。以下命令将在你的机器上全局安装。请参阅 [package page](https://www.npmjs.com/package/@hyperlane-xyz/cli)了解临时安装或从源代码构建等其他方法。 ```bash npm install -g @hyperlane-xyz/cli ``` -Next, determine what custom chain configs you will need for your local and remote chains. Any chains that are already included in the Hyperlane SDK won't need a chain config (but can optionally have one if you want to override default settings). -Run the following to see the default SDK chains: +接下来,确定本地链和远程链需要哪些自定义链配置。任何已经包含在 Hyperlane SDK 中的链都不需要链配置(但如果想覆盖默认设置,可以选择使用)。 +运行以下命令查看默认 SDK 链: ```bash hyperlane chains list ``` -You can press space to select your chains. For any chains that need custom configs, you can define them manually using JSON or YAML (see [example config](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/chain-config.yaml)), or create them with the following command: +您可以按空格键选择链。对于需要自定义配置的链,可以使用 JSON 或 YAML 手动定义(请参阅 [配置示例](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/chain-config.yaml)),或使用以下命令创建: ```bash hyperlane config create chain ``` -Now the CLI will know how to interact with all your chains, but it will also need to know how to configure your Interchain Security Module (ISM). +现在CLI将知道如何与所有链进行交互,但它还需要知道如何配置链间安全模块(ISM)。 -To create a multisig ISM configs, you can define it manually using JSON or YAML (see [example config here](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/v3/typescript/cli/examples/multisig-ism.yaml)), or create it with the following command: +要创建多个ISM配置,您可以使用JSON或YAML手动定义它,请参阅此处[example config here](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/v3/typescript/cli/examples/multisig-ism.yaml)),或使用以下命令创建它: ```bash hyperlane config create ism ``` -When asked about the multisig type, choose `message id ism`. In the context of this guide, we will be using a 1/1 multisig, so choose a threshold of `1` and enter the address of your key. +在被询问关于多重签名类型时,选择`message id ism`。在这个指南的背景下,我们将使用 1/1 多重签名,因此选择一个阈值为 `1`,并输入您的密钥地址。 -### Deploy +### 部署 -We're now ready to use the `deploy core` command to deploy the Hyperlane contracts. To pay for transactions, the command will need the contract deployer key from step 1, which can be provided via the `HYP_KEY` env variable or as a command argument. +现在我们准备使用 `deploy core` 命令部署 Hyperlane 合约。为了支付交易费用,该命令将需要来自步骤 1 的合约部署者密钥,可以通过 `HYP_KEY` 环境变量或作为命令参数提供。 ```bash hyperlane deploy core \ @@ -56,8 +56,8 @@ hyperlane deploy core \ --key $YOUR_DEPLOYER_PRIVATE_KEY ``` -### Verify +### 验证 -Deployment contract artifacts will be written to to the `artifacts/` folder by default. The deployer will create two timestamped files, `agent-config-{timestamp}.json` and `core-deployment-{timestamp}.json` -The `core-deployment` file contains the addresses of core contracts, organized by chain. -The `agent-config` file contains the data needed to run Hyperlane agents for the next step. +部署合同操作默认将写入 `artifacts/` 文件夹。部署程序将创建两个带时间戳的文件,即 `agent-config-{timestamp}.json` 和 `core-deployment-{timestamp}.json +`core-deployment` 文件包含按链排列的核心合约地址。 +`agent-config` 文件包含下一步运行 Hyperlane 代理所需的数据。 diff --git a/docs/partials/deploy-hyperlane/_deploy-warp-route.mdx b/docs/partials/deploy-hyperlane/_deploy-warp-route.mdx index d661da8c..ff9c9250 100644 --- a/docs/partials/deploy-hyperlane/_deploy-warp-route.mdx +++ b/docs/partials/deploy-hyperlane/_deploy-warp-route.mdx @@ -1,25 +1,25 @@ -Once messages are being delivered, you can optionally deploy a [Warp Route](/docs/reference/applications/warp-routes). Warp is toolkit for permissionlessly bridging tokens between any chains. The routes can use native currencies (like `Eth`), or ERC20 tokens (like `USDC`). +一旦消息被传送,您可以选择部署一个[Warp Route](/docs/reference/applications/warp-routes)。Warp 是一个工具包,用于在任何链之间无需许可的桥接代币。路由可以使用本地货币(如 `Eth`)或 ERC20 代币(如 `USDC`)。 -To begin, create a new route config. +首先,创建一个新的路由配置: ```bash hyperlane config create warp ``` -Next, you can deploy the route. As before, the CLI will prompt for a core deployment artifacts file. +接下来,就可以部署路由了。与之前一样,CLI 会提示您提供核心部署工程文件: ```bash hyperlane deploy warp --key $PRIVATE_KEY ``` -Once finished, the CLI will create two new JSON artifact files: `warp-deployment-{timestamp}.json` and `warp-ui-token-config-{timestamp}`. The first only contains the addresses of the newly deployed Warp router contracts. The second is a config file for the Warp UI, which you can use for the next optional step. +完成后,CLI 将创建两个新的 JSON 构件文件: warp-deployment-{timestamp}.json "和 "warp-ui-token-config-{timestamp}"。第一个文件只包含新部署的 Warp 路由器合约的地址。第二个是 Warp UI 的配置文件,可用于下一个可选步骤。 :::tip -Follow the detailed [**Deploy Warp Guide**](/docs/guides/deploy-warp-route) to learn more about the underlying concepts and how to set up your Warp Route to transfer tokens. +请参阅详细的[**Deploy Warp Guide**](/docs/guides/deploy-warp-route)了解更多基本概念以及如何设置 Warp 路由以传输令牌。 ::: -### Deploy the Warp UI +### 部署 Warp UI -The Warp UI is a DApp template for interacting with Warp Routes. You can clone the [Warp UI repo](https://github.com/hyperlane-xyz/hyperlane-warp-ui-template) and follow the instructions in CUSTOMIZE.md to configure and a new instance. In short, use the `chains.yaml` and `warp-ui-token-config.json` files from the previous steps to provide the UI with the information it needs. See the [**Deploy Warp UI guide**](/docs/guides/deploy-warp-route-UI) for step-by-step instructions. +Warp UI 是用于与 Warp Routes 交互的 DApp 模板。您可以克隆 [Warp UI repo](https://github.com/hyperlane-xyz/hyperlane-warp-ui-template) 并按照 CUSTOMIZE.md 中的说明配置新实例。简而言之,使用前面步骤中的 `chains.yaml` 和 `warp-ui-token-config.json` 文件为用户界面提供所需的信息。有关分步说明,请参阅 [**Deploy Warp UI guide**](/docs/guides/deploy-warp-route-UI) 。 diff --git a/docs/partials/deploy-hyperlane/_send-test-messages.mdx b/docs/partials/deploy-hyperlane/_send-test-messages.mdx index 2fba9227..5c8e6a34 100644 --- a/docs/partials/deploy-hyperlane/_send-test-messages.mdx +++ b/docs/partials/deploy-hyperlane/_send-test-messages.mdx @@ -1,8 +1,8 @@ -You can check everything is working correctly by sending a test message between pairs of chains. -Initiate the message with the CLI. It will ask for a set of core deployment artifacts to use. Select the `core-deployments` JSON file from Step 2. +您可以在成对的链之间发送测试消息,检查一切工作是否正常。 +使用 CLI 启动信息。它会要求提供一组要使用的核心部署工件。选择步骤 2 中的 `core-deployments` JSON 文件。 ```bash hyperlane send message --key $PRIVATE_KEY ``` -The `send message` command will inform you when the message is dispatched. After a short wait, a confirmation of delivery will be displayed. If the message delivery times out, it is likely that there's an issue with the Validator or Relayer setup in the steps above. To troubleshoot start by looking at the origin chain relayer logs. If you need further help, reach out on [Discord](https://discord.gg/hyperlane). +`send message`命令会在发送信息时通知您。短暂等待后,系统将显示发送确认。如果信息发送超时,很可能是上述步骤中的验证器或中继器设置出现了问题。要排除故障,请查看起源链中继器日志。如果您需要进一步帮助,请联系 [Discord](https://discord.gg/hyperlane)。 diff --git a/docs/partials/deploy-hyperlane/_setup-keys.mdx b/docs/partials/deploy-hyperlane/_setup-keys.mdx index 1e69bbd4..7fafc500 100644 --- a/docs/partials/deploy-hyperlane/_setup-keys.mdx +++ b/docs/partials/deploy-hyperlane/_setup-keys.mdx @@ -1,8 +1,8 @@ -There are three keys you must set up and fund. +您必须设置三个密钥并为其提供资金。 :::tip -To get started, you can simplify by using the same hexadecimal key for all three roles. +首先,您可以通过对所有三个角色使用相同的十六进制密钥来简化。 ::: @@ -44,9 +44,9 @@ To get started, you can simplify by using the same hexadecimal key for all three -For instructions on how to generate keys, see the [agent keys](/docs/operate/set-up-agent-keys) section. Your deployer key **must** be a hexadecimal key, while validator and relayer keys can be hexadecimal or AWS KMS. +有关如何生成密钥的说明,请参阅[agent keys](/docs/operate/set-up-agent-keys) 部分。部署程序密钥**must**是十六进制密钥,而验证器和中继程序密钥可以是十六进制或AWS KMS。 -If deploying on a local network using [Foundry's Anvil](https://github.com/foundry-rs/foundry/tree/master/anvil), use the following command to fund your newly-generated account. It uses one of the pre-funded private keys to transfer 1 ETH to the address in the `$YOUR_TARGET_ADDRESS` environment variable. +如果使用 [Foundry's Anvil](https://github.com/foundry-rs/foundry/tree/master/anvil) 在本地网络上进行部署,请使用以下命令为新生成的帐户提供资金。 它使用预先资助的私钥之一将 1 ETH 转移到“$YOUR_TARGET_ADDRESS”环境变量中的地址。 ``` cast send $YOUR_TARGET_ADDRESS \ diff --git a/docs/partials/deploy-hyperlane/_terminology.mdx b/docs/partials/deploy-hyperlane/_terminology.mdx index a5801cf0..d6579b45 100644 --- a/docs/partials/deploy-hyperlane/_terminology.mdx +++ b/docs/partials/deploy-hyperlane/_terminology.mdx @@ -1,5 +1,5 @@ -## Terminology +## 术语表 -The "**local chain**" is your new chain that you want to deploy Hyperlane onto. +**本地链**是您要部署Hyperlane的新链。 -A "**remote chain**" is a chain with an existing Hyperlane deployment that you want your local chain to send & receive messages to & from. +**远程链**是指已部署 Hyperlane 的链,您希望本地链与之收发信息。 diff --git a/docs/partials/ts-sdk-placeholder.mdx b/docs/partials/ts-sdk-placeholder.mdx index e66575a6..09511256 100644 --- a/docs/partials/ts-sdk-placeholder.mdx +++ b/docs/partials/ts-sdk-placeholder.mdx @@ -1,3 +1,3 @@ -For developers looking to further customize the Warp UI for their own projects or build their own interchain applications, we encourage you to explore the [Typescript SDK](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/typescript/sdk). +对于希望为自己的项目进一步定制 Warp UI 或构建自己的跨链应用程序的开发人员,我们鼓励您探索 [Typescript SDK](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/typescript/sdk)。 -The SDK contains a growing set of a utilities and abstractions for interacting with Hyperlane across different protocols (EVM, Cosmos, Solana). +SDK 包含一系列实用工具和抽象概念,用于在不同协议(EVM、Cosmos、Solana)之间与 Hyperlane 进行交互。 \ No newline at end of file From 4a5e33e78b27e75d2403432ad4c19838cf3fcd4b Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 15:23:00 +0800 Subject: [PATCH 28/58] Translate warp-routes.mdx to Chinese --- .../deploy-hyperlane/_deploy-contracts.mdx | 2 +- .../deploy-hyperlane/_deploy-warp-route.mdx | 2 +- .../deploy-hyperlane/_send-test-messages.mdx | 2 +- .../partials/deploy-hyperlane/_setup-keys.mdx | 2 +- docs/protocol/warp-routes.mdx | 26 +++++++++---------- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/partials/deploy-hyperlane/_deploy-contracts.mdx b/docs/partials/deploy-hyperlane/_deploy-contracts.mdx index 40a0a6f3..032d61d3 100644 --- a/docs/partials/deploy-hyperlane/_deploy-contracts.mdx +++ b/docs/partials/deploy-hyperlane/_deploy-contracts.mdx @@ -58,6 +58,6 @@ hyperlane deploy core \ ### 验证 -部署合同操作默认将写入 `artifacts/` 文件夹。部署程序将创建两个带时间戳的文件,即 `agent-config-{timestamp}.json` 和 `core-deployment-{timestamp}.json +部署合同构件默认将写入 `artifacts/` 文件夹。部署程序将创建两个带时间戳的文件,即 `agent-config-{timestamp}.json` 和 `core-deployment-{timestamp}.json `core-deployment` 文件包含按链排列的核心合约地址。 `agent-config` 文件包含下一步运行 Hyperlane 代理所需的数据。 diff --git a/docs/partials/deploy-hyperlane/_deploy-warp-route.mdx b/docs/partials/deploy-hyperlane/_deploy-warp-route.mdx index ff9c9250..b685d4ed 100644 --- a/docs/partials/deploy-hyperlane/_deploy-warp-route.mdx +++ b/docs/partials/deploy-hyperlane/_deploy-warp-route.mdx @@ -6,7 +6,7 @@ hyperlane config create warp ``` -接下来,就可以部署路由了。与之前一样,CLI 会提示您提供核心部署工程文件: +接下来,就可以部署路由了。与之前一样,CLI 会提示您提供核心部署构件文件: ```bash hyperlane deploy warp --key $PRIVATE_KEY diff --git a/docs/partials/deploy-hyperlane/_send-test-messages.mdx b/docs/partials/deploy-hyperlane/_send-test-messages.mdx index 5c8e6a34..bf1ac94c 100644 --- a/docs/partials/deploy-hyperlane/_send-test-messages.mdx +++ b/docs/partials/deploy-hyperlane/_send-test-messages.mdx @@ -1,5 +1,5 @@ 您可以在成对的链之间发送测试消息,检查一切工作是否正常。 -使用 CLI 启动信息。它会要求提供一组要使用的核心部署工件。选择步骤 2 中的 `core-deployments` JSON 文件。 +使用 CLI 启动信息。它会要求提供一组要使用的核心部署构件。选择步骤 2 中的 `core-deployments` JSON 文件。 ```bash hyperlane send message --key $PRIVATE_KEY diff --git a/docs/partials/deploy-hyperlane/_setup-keys.mdx b/docs/partials/deploy-hyperlane/_setup-keys.mdx index 7fafc500..fe8695b1 100644 --- a/docs/partials/deploy-hyperlane/_setup-keys.mdx +++ b/docs/partials/deploy-hyperlane/_setup-keys.mdx @@ -46,7 +46,7 @@ 有关如何生成密钥的说明,请参阅[agent keys](/docs/operate/set-up-agent-keys) 部分。部署程序密钥**must**是十六进制密钥,而验证器和中继程序密钥可以是十六进制或AWS KMS。 -如果使用 [Foundry's Anvil](https://github.com/foundry-rs/foundry/tree/master/anvil) 在本地网络上进行部署,请使用以下命令为新生成的帐户提供资金。 它使用预先资助的私钥之一将 1 ETH 转移到“$YOUR_TARGET_ADDRESS”环境变量中的地址。 +如果使用 [Foundry's Anvil](https://github.com/foundry-rs/foundry/tree/master/anvil) 在本地网络上进行部署,请使用以下命令为新生成的帐户提供资金。 它使用预先注入资金的私钥之一将 1 ETH 转移到“$YOUR_TARGET_ADDRESS”环境变量中的地址。 ``` cast send $YOUR_TARGET_ADDRESS \ diff --git a/docs/protocol/warp-routes.mdx b/docs/protocol/warp-routes.mdx index 2fea8ec0..d8439836 100644 --- a/docs/protocol/warp-routes.mdx +++ b/docs/protocol/warp-routes.mdx @@ -1,31 +1,31 @@ -# Warp Routes +# Warp路由 :::caution -This protocol overview is from our v2 contract version. +此协议概述来自我们的v2合同版本。 -v3 now includes [post-dispatch hooks](../reference/hooks/overview.mdx), with [interchain gas payments (IGP)](../reference/hooks/interchain-gas.mdx) as one of the required hooks. +v3现在包含了[post-dispatch hooks](../reference/hooks/overview.mdx),其中[interchain gas payments (IGP)](../reference/hooks/interchain-gas.mdx)是必需的钩子之一。 -We are working to update it with the relevant content ASAP. In the meantime, see the fully [**updated v3 Reference**](../reference/messaging/messaging-interface.mdx) tab for the latest contract interfaces. +我们正在努力尽快更新相关内容。与此同时,请参阅完整的[**updated v3 Reference**](../reference/messaging/messaging-interface.mdx)选项卡以获取最新的合约接口。 ::: -## Overview of Warp Routes +## Warp路由概述 -Warp Routes are Hyperlane's take on the concept of token bridging, allowing you to permissionlessly transfer any ERC20 or ERC721-like asset to any chain via Hyperlane. +Warp路由是Hyperlane对令牌桥接概念的演绎,允许你通过Hyperlane将任何类似ERC20或erc721的资产无需许可转移到任何链上。 -You can combine Warp Routes with a Hyperlane deployment to create economic trade routes between any chain and others already connected through Hyperlane. +您可以将Warp Routes与Hyperlane部署相结合,在任何链上与其他已通过 Hyperlane 连接的链之间实现资金流动。 -This diagram below illustrates a fairly simplified overview of the flow in creating your Warp Route, and the resulting asset. +下面这张图简单地展示了创建Warp路由的流程,以及生成的资源。 -## Warp Route Architecture +## Warp路由架构 ![Warp Route diagram/doodle](../../static/img/warpcontractdiagram.png) -Warp Route contracts transfer value between chains by locking collateral tokens on the origin chain (aka the collateral chain) and then minting wrapped tokens on the destination chain (the synthetic chain). +Warp Route 合约通过在起源链(又称抵押链)上锁定抵押代币,然后在目的链(合成链)上铸造warp代币,从而在链之间转移价值。 -Users can redeem their locked tokens at any time by transferring their wrapped tokens back to the collateral chain. +用户可以随时通过将其warp好的代币转回抵押链来赎回被锁定的代币。 -Like all applications built on top of Hyperlane, Warp Routes have customizable security via [Interchain Security Modules](../protocol/ISM/modular-security.mdx). This allows Warp Route deployers to configure and enforce custom rules and constraints that the interchain token must follow. +与所有建立在 Hyperlane 基础上的应用程序一样,Warp Routes 可通过[Interchain Security Modules](../protocol/ISM/modular-security.mdx)自定义安全性。这样,Warp 路由部署者就可以配置和执行链间令牌必须遵守的自定义规则和约束。 -Warp Routes can be deployed between any set of chains that have Hyperlane deployments. If you would like to create a Warp Route that includes a chain that Hyperlane is not currently deployed on, feel free to [deploy hyperlane](../deploy-hyperlane.mdx) yourself! +可以在任何一组部署了 Hyperlane 的链之间部署 Warp Routes。如果您想创建的 Warp Route 包含当前未部署 Hyperlane 的链,请自行 [deploy hyperlane](../deploy-hyperlane.mdx) ! From ca96cfc89562ea76b43c008172eeef07b1c9ed6a Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 15:29:28 +0800 Subject: [PATCH 29/58] Translate protocol-overview.mdx to Chinese --- docs/protocol/protocol-overview.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/protocol/protocol-overview.mdx b/docs/protocol/protocol-overview.mdx index dc832f7e..d5f16c9b 100644 --- a/docs/protocol/protocol-overview.mdx +++ b/docs/protocol/protocol-overview.mdx @@ -1,12 +1,12 @@ -# Protocol Overview +# 协议概览 -Hyperlane is the first [permissionless interoperability](../deploy-hyperlane.mdx) layer that allows smart contract developers to send arbitrary data between blockchains. +Hyperlane是第一个[permissionless interoperability](../deploy-hyperlane.mdx) 无需许可互操作层,允许智能合约开发人员在区块链之间发送任意数据。 -Developers can use Hyperlane to move tokens, execute function calls, and many other things that allow for the creation of interchain applications, apps that can be accessed by users on any blockchain. +开发人员可以使用Hyperlane来转移令牌,执行函数调用,以及许多其他允许创建链间应用程序的事情,这些应用程序可以由任何区块链上的用户访问。 -Users interface with the Hyperlane protocol via [mailbox](./mailbox.mdx) smart contracts, which provide an on-chain [messaging interface](../reference/messaging/messaging-interface.mdx) to send and receive interchain messages. +用户通过[mailbox](./mailbox.mdx)智能合约与Hyperlane协议交互,智能合约提供链上[messaging interface](../reference/messaging/messaging-interface.mdx)来发送和接收链间消息。 -Hyperlane takes a modular approach to security, allowing applications to configure and choose from a selection of [Interchain Security Modules](../protocol/ISM/modular-security.mdx) (ISMs). Applications may specify an ISM to customize the security model that secures their integration with the Hyperlane messaging interface. +Hyperlane采用模块化的安全方法,允许应用程序从[Interchain Security Modules](../protocol/ISM/modular-security.mdx) (ISMs)(ISMs)中进行配置和选择。应用程序可以指定一个ISM来自定义安全模型,以确保它们与Hyperlane消息传递接口的集成。 ```mermaid flowchart TB From dcfedd0eb7d4fbc263e0ee4e433257e4b10b5500 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 15:39:54 +0800 Subject: [PATCH 30/58] Translate mailbox.mdx to Chinese --- docs/protocol/mailbox.mdx | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/protocol/mailbox.mdx b/docs/protocol/mailbox.mdx index f255f607..96c3ccac 100644 --- a/docs/protocol/mailbox.mdx +++ b/docs/protocol/mailbox.mdx @@ -1,23 +1,23 @@ -# Mailbox +# 邮箱 :::caution -This protocol overview is from our v2 contract version. +本协议概述来自我们的v2合约版本。 -v3 now includes [post-dispatch hooks](../reference/hooks/overview.mdx), with [interchain gas payments (IGP)](../reference/hooks/interchain-gas.mdx) as one of the required hooks. +v3现在包括了[post-dispatch hooks](../reference/hooks/overview.mdx), [interchain gas payments (IGP)](../reference/hooks/interchain-gas.mdx)作为必需的hooks之一。 -We are working to update it with the relevant content ASAP. In the meantime, see the fully [**updated v3 Reference**](../reference/messaging/messaging-interface.mdx) tab for the latest contract interfaces. +我们正在尽快更新相关内容。同时,请参阅完整的[**updated v3 Reference**](../reference/messaging/messaging-interface.mdx) 选项卡获取最新的合约接口。 ::: -The Hyperlane `Mailbox` smart contracts expose an on-chain API for sending and receiving interchain messages. There is a `Mailbox` contract deployed on every chain Hyperlane supports. +Hyperlane `Mailbox`智能合约公开了用于发送和接收链间消息的链上API。Hyperlane支持的每个链上都部署了一个“邮箱”合约。 -The network of `Mailboxes` facilitates the connective tissue between blockchains that developers leverage to create interchain applications, and add interchain functionality to their existing applications. +`Mailboxes` 网络促进了区块链之间的连接,开发人员可利用其创建链间应用程序,并将链间功能添加到其现有应用程序中。 -## Interface +## 接口 -The `IMailbox` interface exposes two state-mutating functions; `dispatch()` and `process()`, which are used to send and receive messages, respectively. +“IMailbox”接口公开了两个状态变化函数;' dispatch() '和' process() ',它们分别用于发送和接收消息。 ```solidity // SPDX-License-Identifier: MIT OR Apache-2.0 @@ -35,24 +35,24 @@ interface IMailbox { } ``` -### Dispatch +### 发送 -To send interchain messages, developers call `Mailbox.dispatch()`. +要发送链间消息,开发人员需要调用`Mailbox.dispatch()`。 -This function takes as parameters the message contents, the destination chain ID, and the recipient address. Each message get inserted as a leaf into an [incremental merkle tree](https://medium.com/@josephdelong/ethereum-2-0-deposit-merkle-tree-13ec8404ca4f) stored by the `Mailbox`. +该函数将消息内容、目标链ID和收件人地址作为参数。每条消息都作为叶子插入到由`Mailbox`存储的[增量默克尔树](https://medium.com/@josephdelong/ethereum-2-0-deposit-merkle-tree-13ec8404ca4f)中。 -Hyperlane's proof of stake protocol uses this merkle tree to verify fraud proofs. +Hyperlane的权益证明协议使用该merkle树来验证欺诈证据。 -### Process +### 进程 -To deliver interchain messages, the [relayer](./agents/relayer.mdx) call `Mailbox.process()`. +为了传递链间消息,[relayer](./agents/relayer.mdx)调用`Mailbox.process()`。 -This function takes as parameters the message to deliver as well as arbitrary metadata that can be specified by the relayer. +这个函数接受要传递的消息以及中继器指定的任意元数据作为参数。 -The `Mailbox` will pass the message and metadata to the recipient's interchain security module for verification. If the ISM successfully verifies the message, the `Mailbox` delivers the message to the recipient by calling `recipient.handle()`. +`Mailbox`将消息和元数据传递给收件人的链间安全模块进行验证。如果ISM成功验证消息,`Mailbox`通过调用`recipient.handle()`将消息传递给收件人。 :::info -See [`Message.sol`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/libs/Message.sol)for more details on Hyperlane message encoding +请参阅[' message .sol '](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/libs/Message.sol)for)了解Hyperlane消息编码的更多详细信息 ::: From f89d9db878e641257a5f2c046141772b6426bb70 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 15:59:03 +0800 Subject: [PATCH 31/58] Translate interchain-gas-payment.mdx to Chinese --- docs/protocol/interchain-gas-payment.mdx | 34 ++++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/protocol/interchain-gas-payment.mdx b/docs/protocol/interchain-gas-payment.mdx index 483539b3..8a187956 100644 --- a/docs/protocol/interchain-gas-payment.mdx +++ b/docs/protocol/interchain-gas-payment.mdx @@ -1,18 +1,18 @@ -# Interchain gas payments +# 链间燃料费支付 :::caution -This protocol overview is from our v2 contract version. +本协议概述来自我们的v2合约版本。 -v3 now includes [post-dispatch hooks](../reference/hooks/overview.mdx), with [interchain gas payments (IGP)](../reference/hooks/interchain-gas.mdx) as one of the required hooks. +v3现在包含了[post-dispatch hooks](../reference/hooks/overview.mdx),其中[interchain gas payments (IGP)](../reference/hooks/interchain-gas.mdx)是必需的钩子之一。 -We are working to update it with the relevant content ASAP. In the meantime, see the fully [**updated v3 Reference**](../reference/messaging/messaging-interface.mdx) tab for the latest contract interfaces. +我们正在努力尽快更新相关内容。与此同时,请参阅完整的[**updated v3 Reference**](../reference/messaging/messaging-interface.mdx)选项卡以获取最新的合约接口。 ::: -Successful interchain messages require two transactions; one on the origin chain to send the message, and one on the destination chain to deliver the message. +成功的链间消息需要两次交易;一个在源链上,用于发送消息,另一个在目标链上,用于传递消息。 -For convenience, Hyperlane provides an onchain interface on the origin chain that allows message senders to pay the [relayer](./agents/relayer.mdx) to deliver a message on the destination chain. This payment is called an interchain gas payment. +为了方便起见,Hyperlane在原始链上提供了一个onchain接口,允许消息发送者向[relayer](./agents/relayer.mdx)支付费用,以便在目的链上传递消息。这种付款称为链间燃料费付款。 ```mermaid flowchart LR @@ -42,28 +42,28 @@ flowchart LR ## InterchainGasPaymasters -Interchain gas payments are facilitated by `InterchainGasPaymaster` (IGP) smart contract contracts. +`InterchainGasPaymaster`(IGP)智能合约为链间天然气支付提供了便利。 -These contracts expose the [InterchainGasPaymaster interface](../reference/hooks/interchain-gas.mdx), which allows users to pay the [relayer](./agents/relayer.mdx) with native tokens on the origin chain to cover the costs of delivering a message on the destination chain. +这些合约公开了[InterchainGasPaymaster interface](../reference/hooks/interchain-gas.mdx),它允许用户用原始链上的本地令牌向 [relayer](./agents/relayer.mdx) 支付在目标链上传递消息的成本。 -Each `InterchainGasPaymaster` contract corresponds to exactly one relayer. You can find addresses of the Abacus Works' relayer under [addresses](../reference/contract-addresses.mdx) +每个` interchainingaspaymaster `合约只对应一个中继器。您可以在[addresses](../reference/contract-addresses.mdx)下找到Abacus Works中继器的地址。 ### Gas oracles -In order to support the [InterchainGasPaymaster interface](../reference/hooks/interchain-gas.mdx), IGP contracts may be configured with gas oracles, which are responsible for tracking remote token gas prices and exchange rates. +为了支持[interchingaspaymaster接口](../reference/hooks/interchain-gas.mdx), IGP合约可以配置gas oracle,该oracle负责跟踪远程令牌燃料价格和汇率。 -This allows the `quoteGasPayment` function to provide an accurate quote for the price of gas on a remote chain, denominated in the local chain's native token. +这允许`quoteGasPayment`函数为远程链上的燃料价格提供准确的报价,以本地链的本地令牌计价。 -Eventually, a relayer will be able to automatically update their gas oracles in order to ensure that their IGP always quotes a fair price for remote gas. +最终,中继将能够自动更新他们的燃料费oracle,以确保他们的IGP始终为远程天然气报价公平。 ## Trust assumptions -Interchain gas payments are based on a social contract between the message sender and relayer. +链间燃料支付基于消息发送者和中继者之间的共识。 -In other words, a relayer may receive interchain gas payments without delivering the corresponding messages. +换句话说,中继器可能在不传送相应消息的情况下收到链间燃料费付款。 -Therefore, when making interchain gas payments, it is recommended to use an IGP contract that is associated with a known and reputable relayer. +因此,在进行链间燃料费支付时,建议使用与已知和信誉良好的中继器相关的IGP合同。 -An honest relayer implementation will honor any successful gas payments made to its IGP, no matter how many tokens were actually paid. By keeping [gas oracles](../reference/hooks/interchain-gas.mdx) up to date, the relayer can ensure that gas payments succeed if and only if a "fair" price was paid. +一个诚实的中继器实现将尊重任何成功支付给IGP的燃料费款项,无论实际支付了多少代币。通过保持[gas oracles](../reference/hooks/interchain-gas.mdx)的最新状态,中继器可以确保只有在支付了“公平”的价格时,燃料费支付才会成功。 -There are no trust assumptions with respect to relayers in the Hyperlane protocol, and under no circumstances will a malicious relayer be able to censor or falsify messages. The worst thing that a relayer can do is accept payments without delivering a message. +Hyperlane协议中没有关于中继的共识,在任何情况下,恶意中继都不能审查或伪造消息。中继器能做的最糟糕的事情是接受付款而不传递消息。 From eee7b872b98c2784016e67dbebba175052ac2a0b Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 16:11:42 +0800 Subject: [PATCH 32/58] Translate relayer.mdx to Chinese --- docs/protocol/agents/relayer.mdx | 33 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/docs/protocol/agents/relayer.mdx b/docs/protocol/agents/relayer.mdx index 23a9fdf1..d31860dd 100644 --- a/docs/protocol/agents/relayer.mdx +++ b/docs/protocol/agents/relayer.mdx @@ -1,35 +1,34 @@ -# Relayer - -A relayer is responsible for ensuring messages are delivered to their recipients. Relayers are a permissionless but integral part of the Hyperlane protocol. Anyone can run a relayer! +# 中继器 +中继器负责确保消息传递到接收方。中继器是Hyperlane协议中无需许可且不可分割的一部分。任何人都可以运行中继器! :::info -Want to run a relayer? Follow the [Relayer](../../operate/relayer/run-relayer.mdx) guide. +想要运行一个中继器?查看[Relayer](../../operate/relayer/run-relayer.mdx) 指南。 ::: :::note -Running your own relayer involves deploying an [IGP contract](../interchain-gas-payment.mdx) and maintaining token exchange rates and gas prices inside of it to accurately charge message delivery fees. Therefore, we only recommend doing this while setting up a permissionlessly deployed bridge, rather than reusing an existing bridge. +运行你自己的中继器涉及部署[IGP合同](../interchain-gas payment.mdx),并在其中维护代币汇率和燃料费价格,以准确收取消息传输费用。因此,我们只建议在设置无需许可部署的网桥时这样做,而不是重用现有的网桥。 ::: -Relayers are configured to relay messages between two or more chains. A relayer observes the origin [Mailbox](../mailbox.mdx) contracts, watching for new messages. When a new message is detected, the relayer queries the destination chain to determine the message recipient's [Interchain Security Module](../../reference/ISM/specify-your-ISM.mdx). +中继器被配置为在两个或多个链之间中继消息。中继者观察原始[Mailbox](../mailbox.mdx)合约,监视新消息。当检测到新消息时,中继器查询目的链以确定消息接收者的[Interchain Security Module](../../reference/ISM/specify-your-ISM.mdx)。 -The relayer is then responsible for collecting the metadata needed by that ISM. This will vary by ISM, and may include signatures from one or more [validators](./validators.mdx), merkle proofs, zero knowledge proofs, and more! +然后,中继器负责收集该ISM所需的元数据。这可能因ISM而异,可能包括来自一个或多个[validators](./validators.mdx)、merkle证明、零知识证明等等的签名! -Finally, the relayer delivers the message to its recipient by calling `Mailbox.process()` on the destination chain with the aforementioned metadata. +最后,中继器使用上述元数据在目标链上调用`Mailbox.process()`将消息传递给收件人。 :::tip -The relayer will periodically retry metadata gathering and message submission. This is important to improve resilience against validator downtime or temporary spikes in transaction fees on the destination. +中继器将定期重试元数据收集和消息提交。这对于提高验证器宕机或目的地交易费用临时峰值的弹性非常重要。 ::: -The relayer does not receive direct token incentives from the protocol, but operators can configure their fee structure for the messages they process, enabling them to earn revenue streams for providing their critical service. For more information, check out [interchain gas payments](../interchain-gas-payment.mdx). +中继器不能从协议中直接获得令牌激励,但运营商可以配置他们处理的消息的费用结构,使他们能够通过提供关键服务获得收入流。有关更多信息,请查看[interchain gas payments](../interchain-gas payment.mdx)。 -Relayers can easily configure the messages that they wish to process. Currently, the relayer will support: +中继器可以轻松配置它们希望处理的消息。目前,中继器将支持: -1. A sender/recipient whitelist. -2. A sender/recipient blacklist. -3. The ability to accept [payments on the origin chain](../../reference/messaging/send.mdx#quote-dispatch) for processing a message on the destination chain. +1. 发送/接收方白名单。 +2. 发件人/收件人黑名单。 +3. 接收[payments on the origin chain](../../reference/messaging/send.mdx#quote-dispatch)以处理目标链上的消息的能力。 -For convenience, Hyperlane will run an open source and configurable relayer agent, implemented as a rust binary. If you'd like to run your own relayer, we've open sourced the [binary here](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/agents/relayer). +为了方便,Hyperlane将运行一个开源的可配置的中继代理,以rust二进制文件的形式实现。如果你想运行你自己的relayer,我们已经开源了[二进制文件](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/agents/relayer)。 -#### Error handling +#### 错误处理 -The relayer will periodically retry messages when processing fails, using an exponential backoff strategy. Currently, there is no fixed maximum number of retries after which the relayer will cease to attempt processing a message. However, this is not a guarantee of indefinite retries, and operators should not rely on this as a service level agreement (SLA). +当处理失败时,中继器将使用指数退避策略周期性地重试消息。目前,没有固定的最大重试次数,超过重试次数后,中继器将停止尝试处理消息。然而,这并不是无限期重试的保证,运营商不应将此作为服务水平协议(SLA)的依赖。 From bd755b38e97d53a68ee62e4eb43c215a56b6a305 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 16:18:35 +0800 Subject: [PATCH 33/58] Translate validators.mdx to Chinese --- docs/protocol/agents/validators.mdx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/protocol/agents/validators.mdx b/docs/protocol/agents/validators.mdx index 2928ac84..edc4c7ff 100644 --- a/docs/protocol/agents/validators.mdx +++ b/docs/protocol/agents/validators.mdx @@ -1,14 +1,14 @@ -# Validators +# 验证器 -Validators are responsible for observing the [Mailbox](../mailbox.mdx) contract and, if required, signing a merkle root to faciliate message transmission to remote chains. +验证器负责观察 [Mailbox](../mailbox.mdx) 合约,如果需要,还会签署merkle根证书,以便将消息传输到远程链。 -Unlike many other protocols, Hyperlane does **not** have an enshrined validator set. Anyone is free to run their own validator, as long as the receiver contract specifies a [Multisig ISM](../ISM/multisig-ISM.mdx) that includes their validator. +与许多其他协议不同,Hyperlane **没有**指定验证器集。任何人都可以自由地运行他们自己的验证器,只要接收者合约指定一个包含他们的验证器的 [Multisig ISM](../ISM/multisig-ISM.mdx) 。 :::info -Want to run a validator? Follow the [validators guide](../../operate/validators/run-validators.mdx). +想运行验证器?请查看[验证器指南](../../operate/validators/run-validators.mdx)。 ::: -For messages using a [Multisig ISM](../../reference/ISM/multisig-ISM-interface.mdx), validators read the current merkle root by calling `MerkleTreeHook.latestCheckpoint()`. Once a root has achieved sufficient [finality](https://medium.com/mechanism-labs/finality-in-blockchain-consensus-d1f83c120a9a), validators are expected to sign it and post their signature to highly available storage so that it can be collected by a [relayer](./relayer.mdx). +对于使用[Multisig ISM](../../reference/ISM/multisig-ISM-interface.mdx)的消息,验证器通过调用`MerkleTreeHook.latestCheckpoint()`来读取当前默克尔根。一旦根目录达到了足够的[finality](https://medium.com/mechanism-labs/finality-in-blockchain-consensus-d1f83c120a9a),验证者就会对其进行签名并将其签名发布到高可用的存储中,以便它可以被[relayer](./relayer.mdx)收集。 ```solidity /** @@ -22,6 +22,6 @@ function latestCheckpoint() returns (bytes32 root, uint256 index); ``` -Validators that sign anything other than a finalized checkpoint risk compromising the safety of the protocol. If they are participating in proof of stake, this may result in their stake being slashed. +如果验证器签名的不是最终的检查点,那么就有可能危及协议的安全性。如果他们参与权益证明,这可能会导致他们的权益被削减。 -Hyperlane is developing the validator as a binary implemented in Rust that can be easily run by anyone. Operationally, validators need to run this binary and have access to an RPC provider or node for the chain that they are validating for. We hope that the majority of Hyperlane validators will come from each chain's existing node operator community. +Hyperlane正在将验证器开发为用Rust实现的二进制文件,任何人都可以轻松运行。从操作上讲,验证器需要运行这个二进制文件,并能够访问正在验证的链的RPC提供者或节点。我们希望大多数Hyperlane验证器将来自每个链现有的节点操作员社区。 From a0b769b34ce7b13b3b3a34aa4a3ffb04c39cd85e Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 16:26:27 +0800 Subject: [PATCH 34/58] Translate watchtowers.mdx to Chinese --- docs/protocol/agents/watchtowers.mdx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/protocol/agents/watchtowers.mdx b/docs/protocol/agents/watchtowers.mdx index 02d47bb4..14d648bf 100644 --- a/docs/protocol/agents/watchtowers.mdx +++ b/docs/protocol/agents/watchtowers.mdx @@ -1,17 +1,17 @@ # Watchtowers :::warning -`Watchtowers` are coming soon and are not yet implemented. This page is shown for informational purposes only. Details may change as the design matures. +`Watchtowers`即将推出,但尚未实施。此页面仅供参考之用。细节可能会随着设计的成熟而改变。(翻译:守望者) ::: -[Validators](validators.mdx) are responsible for signing attestations of [Mailbox](../mailbox.mdx) state on the origin chain. These attestations can be consumed by [Interchain Security Modules](../../reference/ISM/specify-your-ISM.mdx) to prove the validity of interchain messages on the destination chain. +[Validators](validators.mdx)负责对原始链上的[Mailbox](../mailbox.mdx)状态进行签名证明。这些证明可以被[Interchain Security Modules](../../reference/ISM/specify-your-ISM.mdx)使用来证明目标链上链间消息的有效性。 -But who watches them? Who makes sure they perform their role dutifully, without fault? The Watchtowers! +但谁来监督他们?谁来确保他们尽职尽责,不出差错?Watchtowers -Watchtowers are responsible for observing a [Mailbox](../mailbox.mdx) and validator signatures to detect if validators are attempting to censor or falsify messages. They are a permissionless agent by which the network protects against fraud. +Watchtowers负责观察[Mailbox](../mailbox.mdx)和验证器签名,以检测验证器是否试图审查或伪造消息。它们是一个无授权的代理,通过它网络可以防止欺诈。 -If fraud is detected, the watchtower submits evidence to the origin chain, slashing the validator. Watchtowers earn a reward for successfully submitting evidence of fraud. +如果检测到欺诈,Watchtowers会向原始链提交证据,砍掉验证器。成功提交欺诈证据的Watchtowers可以获得奖励。 -The presence of one or more watchtowers acts to deter misbehavior by validators. +一个或多个Watchtowers的存在可以阻止验证者的不当行为。 -For convenience, Hyperlane will run an open source and configurable watchtower agent, implemented as a rust binary. Watchtowers will remain an open source and permissionless role. Applications could run watchtowers, but so could validators, relayers, and any other stakeholder in the Hyperlane ecosystem. +为了方便,Hyperlane将运行一个开源的、可配置的watchtower代理,它以rust二进制文件的形式实现。Watchtowers仍将是一个开源和无许可的角色。应用程序可以运行Watchtowers,也可以运行验证器、中继器和Hyperlane生态系统中的任何其他利益相关者。 From e037d7a93f7a5b246c9111ed23bfa1b90c14ccfd Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 16:35:22 +0800 Subject: [PATCH 35/58] Translate aggregation-ISM.mdx to Chinese --- docs/protocol/ISM/aggregation-ISM.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/protocol/ISM/aggregation-ISM.mdx b/docs/protocol/ISM/aggregation-ISM.mdx index d72ef7c7..320ce61a 100644 --- a/docs/protocol/ISM/aggregation-ISM.mdx +++ b/docs/protocol/ISM/aggregation-ISM.mdx @@ -1,17 +1,17 @@ # Aggregation ISM -Developers can use an `AggregationISM` to combine security from multiple ISMs. Simply put, an `AggregationISM` requires that `m` of `n` ISMs verify a particular interchain message. +开发人员可以使用 `AggregationISM`来组合来自多种主义的安全性。简单地说,`AggregationISM`要求`n` 中的`m`验证特定的链间信息。 -Developers can configure, for each origin chain, a set of `n` ISMs, and the number of ISMs needed to verify a message. +开发人员可以为每个起源链配置一组`n` ISMs,以及验证一条消息所需的ISMs数量。 -`AggregationISMs` can aggregate the security of any ISMs. For example, users can deploy a [Multisig ISM](multisig-ISM.mdx) with their own validator set, and deploy an `AggregationISM` that aggregates that ISM with the Hyperlane default ISM. +`AggregationISM`可以聚合任何主义的安全性。例如,用户可以部署具有自己验证器集的 [Multisig ISM](multisig-ISM.mdx),并部署一个聚合ISM,将该ISM与Hyperlane默认ISM聚合在一起。 -## Customize +## 自定义 -The hyperlane-monorepo contains an abstract `AggregationISM` implementation that application developers can fork. +hyperlane-monorepo包含一个抽象的`AggregationISM`实现,应用程序开发人员可以对其进行分支。 -Developers simply need to implement the `modulesAndThreshold()` function. +开发人员只需要实现`modulesAndThreshold()`函数。 -By creating a custom implementation, application developers can tailor the security provided by a `AggregationISM` to the needs of their application. +通过创建自定义实现,应用程序开发人员可以根据应用程序的需求定制`AggregationISM`提供的安全性。 -For example, a custom implementation could require that low value messages be verified by a [Multisig ISM](multisig-ISM.mdx), and require that high value messages _also_ be verified by a [Wormhole ISM](./wormhole-ISM.mdx). +例如,一个自定义实现可能要求低值消息由[Multisig ISM](multisig-ISM.mdx)验证,并且要求高值消息* *也* *由[Wormhole ISM](./wormhole-ISM.mdx)验证。 From f533dc5867313b6146752eafee740edfac90e82e Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 16:52:12 +0800 Subject: [PATCH 36/58] Translate ccip-read-ISM.mdx to Chinese --- docs/protocol/ISM/ccip-read-ISM.mdx | 40 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/docs/protocol/ISM/ccip-read-ISM.mdx b/docs/protocol/ISM/ccip-read-ISM.mdx index 6c27fcb8..a8907f03 100644 --- a/docs/protocol/ISM/ccip-read-ISM.mdx +++ b/docs/protocol/ISM/ccip-read-ISM.mdx @@ -1,26 +1,26 @@ # CCIP Read ISM -Using a `CcipReadIsm` provides developers with a lot of flexibility for verifying interchain messages. Ultimately, every other kind of ISM can be implemented as a CCIP Read ISM, so when building new types of ISM's moving forward it's encouraged to build CCIP Read ISM's as all the relayer integration work has already been done. +使用`CcipReadIsm`为开发人员验证链间消息提供了很大的灵活性。最终,每一种其他类型的ISM都可以实现为CCIP Read ISM,因此,当构建新的ISM时,我们鼓励构建CCIP Read ISM,因为所有中继集成工作已经完成。 -One caveat to keep in mind for CCIP Read ISM's is that they do introduce a dependency on an external (to the blockchain), but self hostable, API. If this is a hard blocker for your use case, you may want to consider other message verification techniques. +对于CCIP Read ISM要记住的一个警告是,它们确实引入了对外部(到区块链)但自托管的API的依赖。如果这对您的用例来说是一个困难的障碍,您可能需要考虑其他消息验证技术。 -Before building a CCIP Read ISM it's worth familiarizing yourself with the [CCIP Read specification](https://eips.ethereum.org/EIPS/eip-3668). The specification describes a generalized protocol that allows smart contracts on EVM compatible chains to query and consume offchain data. +在构建CCIP Read ISM之前,您有必要熟悉[CCIP Read规范](https://eips.ethereum.org/EIPS/eip-3668)。该规范描述了一种通用协议,允许EVM兼容链上的智能合约查询和消费链下数据。 -## How it works +## 它是如何工作的 -A relayer will constantly listening to `Dispatch` events emitted from Hyperlane [Mailboxes](../../protocol/mailbox.mdx). When a message is sent and picked up by a relayer, the relayer will query the destination ISM for information on how to process the message and if delivery will be successful. +中继器会持续监听从Hyperlane [Mailboxes](../../protocol/mailbox.mdx)发出的`Dispatch`事件。当消息被中继器发送和接收时,中继器将向目的ISM查询如何处理该消息以及是否交付成功的信息。 :::info -The correct `moduleType` variable will need to be set on your ISM so that the relayer knows it's a CCIP Read ISM. To make sure this is configured correctly, you can inherit from the `AbstractCcipReadIsm` in `@hyperlane-xyz/core`. +正确的`moduleType`变量需要在你的ISM上设置,以便中继知道这是一个CCIP Read ISM。为了确保正确配置,你可以从`@hyperlane-xyz/core`中的`AbstractCcipReadIsm`继承。 ::: -The relayer will then call the `getOffchainVerifyInfo(bytes)` function on the ISM with the contents of the message being delivered. This function should revert with the `OffchainLookup` error described in the [interface](#interface) section below. +然后,中继器将在ISM上调用`getOffchainVerifyInfo(bytes)`函数来传递消息的内容。当出现下面 [interface](#interface)部分描述的`OffchainLookup`错误时,该函数应该恢复。 -The relayer will query the endpoint specified in this revert message and pass the provided response and original message to the `process(bytes,bytes)` function of the destination `Mailbox`. +中继器将查询此还原消息中指定的端点,并将提供的响应和原始消息传递给目的地`Mailbox`的`process(bytes,bytes)`函数。 -## Interface +## 接口 -`CcipReadIsm`'s must implement the `ICcipReadIsm` interface and should extend the `AbstractCcipReadIsm`, a convenience contract that sets the `moduleType` correctly. +`CcipReadIsm`必须实现`ICcipReadIsm`接口,并且应该扩展`AbstractCcipReadIsm`,这是一个方便的协议,可以正确设置`moduleType`。 ```solidity // SPDX-License-Identifier: MIT OR Apache-2.0 @@ -53,13 +53,13 @@ interface ICcipReadIsm is IInterchainSecurityModule { } ``` -## Configure +## 配置 -A great example for reference while developing CCIP Read ISM's exists as the [ChainlinkISM](https://github.com/AlexBHarley/permissionless-chainlink-feeds). The `ChainlinkISM` is initialized with a set of Chainlink oracles and verifies the price feed data provided has been signed over by some subset of the signers. +在开发CCIP Read ISM时,[ChainlinkISM](https://github.com/AlexBHarley/permissionless-chainlink-feeds)是一个很好的参考例子。`ChainlinkISM`用一组Chainlink oracle初始化,并验证所提供的价格feed数据是否已经由部分签名者进行了签名。 ### API -As per CCIP Read, the offchain API will need to return JSON data with the form, +根据CCIP Read,链下API需要返回带有表单的JSON数据, ```json { @@ -67,19 +67,19 @@ As per CCIP Read, the offchain API will need to return JSON data with the form, } ``` -The relayer will pass this `data` property as the `metadata` parameter to `Mailbox.process(bytes metadata, bytes message)`. +中继器会将这个`data`属性作为`metadata`参数传递给`Mailbox.Process ` (bytes metadata, bytes message)。 -Note that in the case of the Chainlink ISM, where the receiver of the data also acts as the verifying ISM, `data` is just the raw transaction sent to submit price feed data with associated signatures. The `message` property is somewhat redundant. +请注意,在链式ISM的情况下,数据的接收方也充当验证ISM, `data`只是发送的原始交易,以提交具有相关签名的价格数据。`message`属性有些多余。 -### Contract +### 合约 -When setting up the ISM, the `getOffchainVerifyInfo` and `verify` functions are the important ones to specify. +在设置ISM时,`getOffchainVerifyInfo`和`verify`函数是需要指定的重要函数。 -- `getOffchainVerifyInfo` function should revert with an `OffchainLookup` error that instructs the relayer to query the given API endpoint. The `OffchainLookup` error allows for an array of API endpoints to be provided, so you can enforce any level of redundancy you'd like +- `getOffchainVerifyInfo`函数应该返回一个`OffchainLookup`错误,指示中继器查询给定的API端点。`OffchainLookup`错误允许提供一组API端点,因此你可以强制执行你想要的任何级别的冗余 -- `verify` must take the provided `metadata` and assert its legitimacy. Again the [ChainlinkISM implementation](https://github.com/AlexBHarley/permissionless-chainlink-feeds/blob/main/apps/contracts/contracts/ChainlinkAggregator.sol#L114) can be a useful reference point when developing this logic for your own ISM. +- `verify`必须获取提供的`metadata`并验证其合法性。同样,在为您自己的ISM开发此逻辑时,[ChainlinkISM实现](https://github.com/AlexBHarley/permissionless-chainlink-feeds/blob/main/apps/contracts/contracts/ChainlinkAggregator.sol#L114)可以是一个有用的参考点。 -Below is the scaffold of what a CCIP Read ISM could look like, where the ISM is also the receiver of the message, as per the Chainlink ISM. +下面是CCIP Read ISM的示例,其中ISM也是消息的接收者,根据链链接ISM。 ```solidity pragma solidity ^0.8.13; From e09e7f40843696840add4d1adbf6f0b188f8aecc Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 17:03:30 +0800 Subject: [PATCH 37/58] Translate economic-security.mdx to Chinese --- docs/protocol/ISM/economic-security.mdx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/protocol/ISM/economic-security.mdx b/docs/protocol/ISM/economic-security.mdx index 5e713fd8..470e6f46 100644 --- a/docs/protocol/ISM/economic-security.mdx +++ b/docs/protocol/ISM/economic-security.mdx @@ -1,27 +1,28 @@ -# Economic Security +# 生态安全 :::info -Hyperlane is committed to making fraud costly. Staking and slashing are coming soon and are not yet implemented. This page is shown for informational purposes only. Details may change as the design matures. +Hyperlane致力于让欺诈行为付出高昂代价。 Staking和slashing很快就会出现,但还没有实施。此页面仅供参考之用。细节可能会随着设计的成熟而改变。 ::: -Staking and slashing allow economic security to be added to ISMs that rely on validator signatures, including [Multisig ISM](multisig-ISM.mdx) and Optimistic ISM. +Staking和slashing允许生态安全被添加到依赖验证者签名的 ISMs中,包括[Multisig ISM](multisig-ISM.mdx) 和Optimistic ISM。 -Hyperlane validators can optionally participate in Hyperlane's staking protocol. Later, if these validators attempt to falsify or censor interchain messages, their stake, and any stake delegated to them, can be slashed. +Hyperlane验证器可以选择参与Hyperlane的质押协议。之后,如果这些验证者试图伪造或审查链间消息,他们的权益,以及任何委托给他们的权益,都可以被削减。 -[Interchain Security Modules](modular-security.mdx) that depend on signatures from these validators benefit from the additional economic security provided by staking and slashing. +依赖于这些验证者签名的[Interchain Security Modules](modular-security.mdx) 可以从质押和削减提供的额外经济安全性中获益。 -### Verifiable fraud proofs -Unlike many other interchain communication protocols, Hyperlane's slashing protocol uses **verifiable fraud proofs**. +### 可验证的欺诈证明 -This means that the Hyperlane protocol is able to verify whether or not a validator signed a fraudulent checkpoint without any participation from trusted parties. +与许多其他链间通信协议不同,Hyperlane的削减协议使用了**可验证的欺诈证据**。 -This is possible because the stake put up by validators lives on the **same chain** as the state (i.e. the Mailbox merkle root) that they're attesting to. The slashing smart contract can compare the validator signature with the latest root, and do some complicated merkle tree manipulation to confirm whether or not the checkpoint signed by the validator was fraudulent. +这意味着Hyperlane协议能够在没有可信方参与的情况下验证验证者是否签署了欺诈检查点。 -In many other interchain communication protocols, it is common for a validator's stake to live on a **different chain** than the chain from which an interchain message originated. +这是可能的,因为验证者提出的权益与他们所证明的状态(即邮箱默克尔根)在同一条链上。削减智能合约可以将验证器签名与最新根进行比较,并执行一些复杂的默克尔树操作,以确认验证器签署的检查点是否具有欺诈性。 -What this means is that in order for a fraudulent validator to have their stake slashed, the same message passing protocol must relay a message to the chain where the stake lives. You can see the problem with this right? The same validator set where fraud occurred is the mechanism by which evidence of that fraud is delivered, what could go wrong? +在许多其他链间通信协议中,验证者的权益通常存在于与链间消息来源不同的链上。 -Hyperlane doesn't want to allow for that possibility, thus in Hyperlane validators must keep their bonded stake on the origin chain for which they are validating. This means fraud proofs are trustlessly verifiable. The record of fraud that is examined for slashing exists in the same environment as the stake to be slashed, leaving no room for error with the process of fraud proofs. +这意味着,为了让欺诈性验证者的权益被削减,同一个消息传递协议必须将消息转发到权益所在的链上。你能看出问题了吧?发生欺诈的同一个验证器集是传递欺诈证据的机制,什么会出错? + +Hyperlane不允许这种可能性,因此在Hyperlane验证者必须将他们的绑定权益保持在他们正在验证的原始链上。这意味着欺诈证据是不可信的。被审查的欺诈记录与被削减的股份存在于相同的环境中,在欺诈证明过程中没有任何错误的空间。 \ No newline at end of file From c487f497a4d5b99043dfffba3c4a2f7e51cd4ee4 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 17:40:01 +0800 Subject: [PATCH 38/58] Translate modular-security.mdx to Chinese --- docs/protocol/ISM/aggregation-ISM.mdx | 4 +- docs/protocol/ISM/modular-security.mdx | 58 +++++++++++++------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/protocol/ISM/aggregation-ISM.mdx b/docs/protocol/ISM/aggregation-ISM.mdx index 320ce61a..90c75a06 100644 --- a/docs/protocol/ISM/aggregation-ISM.mdx +++ b/docs/protocol/ISM/aggregation-ISM.mdx @@ -1,10 +1,10 @@ # Aggregation ISM -开发人员可以使用 `AggregationISM`来组合来自多种主义的安全性。简单地说,`AggregationISM`要求`n` 中的`m`验证特定的链间信息。 +开发人员可以使用 `AggregationISM`来聚合来自多种ISMs的安全性。简单地说,`AggregationISM`要求`n` 中的`m`验证特定的链间信息。 开发人员可以为每个起源链配置一组`n` ISMs,以及验证一条消息所需的ISMs数量。 -`AggregationISM`可以聚合任何主义的安全性。例如,用户可以部署具有自己验证器集的 [Multisig ISM](multisig-ISM.mdx),并部署一个聚合ISM,将该ISM与Hyperlane默认ISM聚合在一起。 +`AggregationISM`可以聚合任何ISMs的安全性。例如,用户可以部署具有自己验证器集的 [Multisig ISM](multisig-ISM.mdx),并部署一个聚合ISM,将该ISM与Hyperlane默认ISM聚合在一起。 ## 自定义 diff --git a/docs/protocol/ISM/modular-security.mdx b/docs/protocol/ISM/modular-security.mdx index 6c77db3f..41edcf8c 100644 --- a/docs/protocol/ISM/modular-security.mdx +++ b/docs/protocol/ISM/modular-security.mdx @@ -1,32 +1,32 @@ -# Modular Security +# 模块化的安全 -Hyperlane is secured by **Interchain Security Modules** (ISMs). ISMs are smart contracts that are responsible for verifying that interchain messages being delivered on the destination chain were _actually sent_ on the origin chain. +Hyperlane由**Interchain Security Modules** (ISMs)保护。ISMs是一种智能合约,负责验证在目标链上传递的链间消息是否* *实际发送* *在原始链上。 -Hyperlane developers can **optionally** **override** the [Mailbox's](../mailbox.mdx)'s default ISM by specifying an application-specific ISM, which they can configure, compose, and customize according to the needs of their application. +Hyperlane开发人员可以通过指定一个应用专用的ISM,**optionally** **override** [Mailbox's](../mailbox.mdx)的默认ISM,他们可以根据自己的应用程序的需求来配置、组合和定制。 -### Configure +### 配置 -Hyperlane defines a set of pre-built ISMs. Developers can deploy any of these contracts "off-the-shelf" and configure them with their own parameters. +Hyperlane定义了一套预先构建的ISMs。开发人员可以部署任何这些“现成的”合约,并使用自己的参数配置它们。 -For example, application developers that want increased sovereignty over interchain security could deploy a [Multisig ISM](multisig-ISM.mdx) configured with validators sourced from their own community. +例如,希望增加链间安全主权的应用程序开发人员可以部署一个[Multisig ISM](multisig-ISM.mdx),其中配置了来自他们自己社区的验证器。 -### Compose +### 组合 -ISMs act as "security [legos](https://en.wikipedia.org/wiki/Lego)". Developers can mix and match different ISMs together to encode a security model that best fits their needs. +ISMs就像“security [legos](https://en.wikipedia.org/wiki/Lego)”。开发人员可以混合和匹配不同的ISMs,以编码最适合他们需求的安全模型。 -For example, application developers that want additional security could deploy an [Aggregation ISM](aggregation-ISM.mdx) that requires verification by both a [Multisig ISM](multisig-ISM.mdx) configured with validators from the Hyperlane community, **and** a [Wormhole ISM](wormhole-ISM.mdx) that verifies that a quorum of the [Wormhole](https://wormhole.com/) validator set verified the message. +例如,希望获得额外安全性的应用程序开发人员可以部署一个[Aggregation ISM](aggregation-ISM.mdx),它需要由配置了Hyperlane社区验证器的[Multisig ISM](multisig-ISM.mdx) 和一个[Wormhole ISM](wormhole-ISM.mdx)进行验证,后者验证了[Wormhole](https://wormhole.com/)验证器集的quorum验证了消息。 -### Customize +### 自定义 -ISMs are fully customizable. Developers can write their own ISMs, tailoring them to the needs of their application. +ISMs是完全可定制的。开发人员可以编写自己的ISMs,根据应用程序的需要进行调整。 -For example, application developers can build ISMs that adjust security models based on message content. High value and infrequent messages (e.g. governance) could be verified by a security model that prioritizes safety over latency and gas costs. Lower value and more frequent messages could be verified by a security model that prioritizes latency and gas costs over safety. +例如,应用程序开发人员可以构建基于消息内容调整安全模型的ISMs。高价值和不频繁的消息(例如治理)可以通过安全模型进行验证,该模型将安全性优先于延迟和gas成本。更低的值和更频繁的消息可以通过将延迟和gas成本置于安全性之上的安全模型进行验证。 -## Overriding the default ISM +## 覆盖默认ISM -Application developers can override the default ISM by implementing the `ISpecifiesInterchainSecurityModule` interface in their application. +应用程序开发者可以通过在应用程序中实现` isspecificesinterchainsecuritymodule `接口来覆盖默认的ISM。 -Specifically, this interface must be implemented in the same smart contract that implements `handle()`. +具体来说,这个接口必须在实现`handle()`的智能合约中实现。 ```solidity // SPDX-License-Identifier: MIT OR Apache-2.0 @@ -40,9 +40,9 @@ interface ISpecifiesInterchainSecurityModule { } ``` -# General Interface +# 通用接口 -ISMs must implement the `IInterchainSecurityModel()` interface. This interface consists of two functions. +ISMs必须实现`IInterchainSecurityModel()`接口。该接口由两个函数组成。 ```solidity // SPDX-License-Identifier: MIT OR Apache-2.0 @@ -70,32 +70,32 @@ interface IInterchainSecurityModule { } ``` -### Verify +### 验证 -The primary function that ISMs must implement is `verify()`. The [Mailbox](../mailbox.mdx) will call `IInterchainSecurityModule.verify()` before delivering a message to its recipient. If `verify()` reverts or returns `false`, the message will not be delivered. +ISMs必须实现的主要功能是`verify()`。[Mailbox](../ Mailbox .mdx)将在将消息传递给收件人之前调用`IInterchainSecurityModule.verify()`。如果`verify()`恢复或返回`false`,消息将不会被传递。 -The `verify()` function takes two parameters. +`verify()`函数接受两个参数。 -The first, `_metadata`, consists of arbitrary bytes provided by [Relayer](../agents/relayer.mdx). Typically, these bytes are specific to the ISM. For example, for a [Multisig ISM](multisig-ISM.mdx), `_metadata` must include validator signatures. +第一个是`_metadata`,由[Relayer](../agents/relayer.mdx)提供的任意字节组成。通常,这些字节是特定于ISM的。例如,对于[Multisig ISM](multisig-ISM.mdx), `_metadata`必须包含验证者签名。 -The second, `_message`, consists of the Hyperlane message being verified. ISMs can use this to inspect details about the message being verified. For example, a [Multisig ISM](multisig-ISM.mdx) could change validator sets based on the origin chain of the message. +第二个是`_message`,由正在验证的Hyperlane消息组成。ISMs可以使用它来检查正在验证的消息的详细信息。例如,[Multisig ISM](multisig-ISM.mdx)可以根据消息的原始链更改验证器集。 :::warning -See the [`Message.sol`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/libs/Message.sol) library for more information on the format of the Hyperlane message passed to `verify()` +有关传递给`verify()`的Hyperlane消息格式的更多信息,请参阅[` message .sol`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/libs/Message.sol)库。 ::: -### Module type +### 模块类型 -The secondary function that ISMs must implement is `moduleType()`. This is used to signal to the [Relayer](../agents/relayer.mdx) what to include in `_metadata`. ISMs **must** return one of the supported module types. +ISMs必须实现的第二个函数是`moduleType()`。这是用来通知[Relayer](../agents/relayer.mdx) 在`_metadata`中包含什么。ISMs **必须**返回支持的一种模块类型。 -## Sequence diagram +## 序列图 -The following shows a simplified sequence diagram of an interchain message being verified and delivered on the destination chain. +下面展示了在目标链上验证和交付链间消息的简化顺序图。 :::info -If the recipient does not implement `ISpecifiesInterchainSecurityModule` or `recipient.interchainSecurityModule()` returns `address(0)`, the default ISM configured on the [Mailbox](../mailbox.mdx) will be used to verify the message. +如果收件人没有实现` isspecificesinterchainsecuritymodule `或者`recipient.interchainSecurityModule()`返回`address(0)`,将使用[Mailbox](../mailbox.mdx)上配置的默认ISM来验证消息。 -This is omitted from the sequence diagram for clarity. +为了清晰起见,在序列图中省略了这一点。 ::: ```mermaid From 151a975e5796c621c028a4085c44cf400d6de788 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 17:42:54 +0800 Subject: [PATCH 39/58] Translate multisig-ISM.mdx to Chinese --- docs/protocol/ISM/multisig-ISM.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/protocol/ISM/multisig-ISM.mdx b/docs/protocol/ISM/multisig-ISM.mdx index 9e484c53..1e3af5bb 100644 --- a/docs/protocol/ISM/multisig-ISM.mdx +++ b/docs/protocol/ISM/multisig-ISM.mdx @@ -1,3 +1,3 @@ # Multisig ISM -The `MultisigISM` is one of the most commonly used ISM types. These ISMs verify that `m` of `n` [Validators](../agents/validators.mdx) have attested to the validity of a particular interchain message. +`MultisigISM` 是最常用的符号类型之一。这些ISMs验证了`n`[Validators](../agents/validators.mdx) 中的`m`验证了特定链间消息的有效性。 From f3da663bb2a7cc2e163740c613cd2e5e40f6cd6d Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 17:49:51 +0800 Subject: [PATCH 40/58] Translate optimistic-ISM.mdx to Chinese --- docs/protocol/ISM/optimistic-ISM.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/protocol/ISM/optimistic-ISM.mdx b/docs/protocol/ISM/optimistic-ISM.mdx index a35d204d..3907ddd7 100644 --- a/docs/protocol/ISM/optimistic-ISM.mdx +++ b/docs/protocol/ISM/optimistic-ISM.mdx @@ -1,13 +1,13 @@ # Optimistic ISM -Prioritizing safety over liveness +把安全放在活跃性之上 :::warning -`OptimisticISM` is coming soon and is not yet implemented. This page is shown for informational purposes only. Details may change as the design matures. +`OptimisticISM`即将到来,但尚未实施。此页面仅供参考之用。细节可能会随着设计的成熟而改变。 ::: -The `OptimisticISM` encodes the optimistic verification security model pioneered by [Optics](https://docs.celo.org/protocol/bridge/optics) and adopted by [Synapse](https://docs.synapseprotocol.com/synapse-interchain-network-sin/synapse-interchain-network/deep-dive-optimistic-pos), [Nomad](https://docs.nomad.xyz/the-nomad-protocol/verification-mechanisms/optimistic-verification), and [Connext](https://blog.connext.network/optimistic-bridges-fb800dc7b0e0). +`OptimisticISM`编码了由 [Optics](https://docs.celo.org/protocol/bridge/optics) 开创并被[Synapse](https://docs.synapseprotocol.com/synapse-interchain-network-sin/synapse-interchain-network/deep-dive-optimistic-pos)、[Nomad](https://docs.nomad.xyz/the-nomad-protocol/verification-mechanisms/optimistic-verification)和[Connext](https://blog.connext.network/optimistic-bridges-fb800dc7b0e0)采用的optimistic验证安全模型。 -`OptimisticISMs` rely on a fraud window after message verification, during which `m` of `n` **watchers** configured on the `OptimisticISM` have an opportunity to flag messages as fraudulent, preventing them from being delivered to their recipient. +`OptimisticISM`依赖于消息验证后的欺诈窗口,在此期间,配置在`OptimisticISM`上的`m`个**观察者**有机会将消息标记为欺诈,阻止它们发送给收件人。 -**This security model prioritizes safety over liveness;** the increased message latency allows for the addition of a second layer of security, the watchers, without significant increases in gas costs. +**这种安全模型将安全性置于活跃性之上**,增加的消息延迟允许添加第二层安全,即侦听器,而不会显著增加燃料成本。 From cabd3eae736eddc06145a7e3aa601e3b311aa7b9 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 17:54:39 +0800 Subject: [PATCH 41/58] Translate routing-ISM.mdx to Chinese --- docs/protocol/ISM/routing-ISM.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/protocol/ISM/routing-ISM.mdx b/docs/protocol/ISM/routing-ISM.mdx index 474a1606..8a50f1be 100644 --- a/docs/protocol/ISM/routing-ISM.mdx +++ b/docs/protocol/ISM/routing-ISM.mdx @@ -1,17 +1,17 @@ # Routing ISM -Developers can use a `RoutingISM` to delegate message verification to a different ISM. This allows developers to change security models based on message content or application context. +开发人员可以使用`RoutingISM`将消息验证委托给不同的ISM。这允许开发人员根据消息内容或应用程序上下文更改安全模型。 -This ISM simply switches security models depending on the origin chain of the message. A simple use case for this is to use different [Multisig ISM](multisig-ISM.mdx) validator sets for each chain. +该ISM根据消息的原始链简单地切换安全模型。一个简单的用例是为每个链使用不同的 [Multisig ISM](multisig-ISM.mdx)验证器集。 -Eventually, you could imagine a `DomainRoutingIsm` routing to different light-client-based ISMs, depending on the type of consensus protocol used on the origin chain. +最终,你可以实现一个`DomainRoutingIsm`路由到不同的基于轻客户端的ISMs,这取决于在origin链上使用的共识协议的类型。 -## Customize +## 自定义 -The hyperlane-monorepo contains an abstract `RoutingISM` implementation that application developers can fork. +hyperlane-monorepo包含一个抽象的`RoutingISM`实现,应用程序开发人员可以对其进行分支。 -Developers simply need to implement the `route()` function. +开发人员只需要实现`route()`函数。 -By creating a custom implementation, application developers can tailor the security provided by a `RoutingISM` to the needs of their application. +通过创建自定义实现,应用程序开发人员可以根据应用程序的需求定制`RoutingISM`提供的安全性。 -For example, a custom implementation could change security models based on the contents of the message or the state of the application receiving the message. +例如,自定义实现可以根据消息的内容或接收消息的应用程序的状态更改安全模型。 From 59c4c1544e9412de9396aa754cb878d6c5da4717 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 17:59:38 +0800 Subject: [PATCH 42/58] Translate wormhole-ISM.mdx to Chinese --- docs/protocol/ISM/wormhole-ISM.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/protocol/ISM/wormhole-ISM.mdx b/docs/protocol/ISM/wormhole-ISM.mdx index f1008e3e..233a5e99 100644 --- a/docs/protocol/ISM/wormhole-ISM.mdx +++ b/docs/protocol/ISM/wormhole-ISM.mdx @@ -1,13 +1,13 @@ # Wormhole ISM :::warning -`WormholeISM` is coming soon and is not yet implemented. This page is shown for informational purposes only. Details may change as the design matures. +`WormholeISM`即将到来,但尚未实现。此页面仅供参考之用。细节可能会随着设计的成熟而改变。 ::: -The `WormholeISM` encodes the security model used by [Wormhole's](https://wormhole.com/) interchain communication protocol. +“WormholeISM”编码了[Wormhole's](https://wormhole.com/)链间通信协议所使用的安全模型。 -This ISM requires that 13 of the 19 [Wormhole guardians](https://wormhole.com/network/#guardians) attest to the validity of a Hyperlane message. +这个ISM需要19个 [Wormhole guardians](https://wormhole.com/network/#guardians)中的13个来证明Hyperlane 信息的有效性。 -## Compose +## 组合 -Developers can compose a Wormhole ISM with a [Multisig ISM](multisig-ISM.mdx) using an [Aggregation ISM](aggregation-ISM.mdx) to require that m of n Hyperlane validators **and** 13-of-19 Wormhole guardians verify a message. +开发人员可以使用[Multisig ISM](multisig-ISM.mdx) 与[Aggregation ISM](aggregation-ISM.mdx) 组成Wormhole ISM ,以要求n个Hyperlane验证器中的m个**和19个Wormhole守护者中的13个**验证消息。 From 9bab53c64b41fd38d09a32066d9861c5e0aa2cf2 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 19:15:35 +0800 Subject: [PATCH 43/58] Translate agents.mdx to Chinese --- docs/protocol/ISM/modular-security.mdx | 2 +- docs/protocol/agents.mdx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/protocol/ISM/modular-security.mdx b/docs/protocol/ISM/modular-security.mdx index 41edcf8c..56a7649c 100644 --- a/docs/protocol/ISM/modular-security.mdx +++ b/docs/protocol/ISM/modular-security.mdx @@ -1,6 +1,6 @@ # 模块化的安全 -Hyperlane由**Interchain Security Modules** (ISMs)保护。ISMs是一种智能合约,负责验证在目标链上传递的链间消息是否* *实际发送* *在原始链上。 +Hyperlane由**Interchain Security Modules** (ISMs)保护。ISMs是一种智能合约,负责验证在目标链上传递的链间消息是否**实际发送**在原始链上。 Hyperlane开发人员可以通过指定一个应用专用的ISM,**optionally** **override** [Mailbox's](../mailbox.mdx)的默认ISM,他们可以根据自己的应用程序的需求来配置、组合和定制。 diff --git a/docs/protocol/agents.mdx b/docs/protocol/agents.mdx index 3ffafc75..f9fbc8bf 100644 --- a/docs/protocol/agents.mdx +++ b/docs/protocol/agents.mdx @@ -1,9 +1,9 @@ # Agents -The Hyperlane protocol relies on decentralized offchain agents to observe, sign, and transmit messages. +Hyperlane协议依靠去中心化的链下代理来观察、签名和传输消息。 -For convenience, Hyperlane implements these agents as a set of binaries implemented in Rust. +为了方便,Hyperlane将这些代理实现为一组用Rust实现的二进制文件。 -1. [Validators](./agents/validators.mdx) attest to the validity of [Mailbox](./mailbox.mdx) messages that use a [Multisig ISM](./ISM/multisig-ISM.mdx), and make their signatures available to a relayer. -1. [Relayers](./agents/relayer.mdx) aggregate off-chain metadata for the [`IInterchainSecurityModule` interface](../reference/ISM/specify-your-ISM) and deliver messages to their recipients. -1. [Watchtowers](./agents/watchtowers) observe the network for fraud by validators. If detected, watchtowers submit evidence to the origin chain, slashing the fraudulent validator(s). +1. [Validators](./agents/validators.mdx)验证使用 [Multisig ISM](./ISM/multisig-ISM.mdx)的[Mailbox](./mailbox.mdx) 消息的有效性,并使它们的签名对中继器可用。 +1. [Relayers](./agents/relayer.mdx)聚合[`IInterchainSecurityModule`接口](../reference/ISM/specify-your-ISM)的链下元数据,并将消息传递给他们的接收者。 +1. [Watchtowers](./agents/watchtowers)观察网络以防止验证者进行欺诈。如果被发现,watchtowers塔会向源链提交证据,削减欺诈的验证者。 From 9ace3777224fb7e2d583344bfef2f729a6d98126 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 19:35:54 +0800 Subject: [PATCH 44/58] Translate warp-routes.mdx to Chinese --- docs/reference/applications/warp-routes.mdx | 34 ++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/reference/applications/warp-routes.mdx b/docs/reference/applications/warp-routes.mdx index 5bf59bbf..2824161c 100644 --- a/docs/reference/applications/warp-routes.mdx +++ b/docs/reference/applications/warp-routes.mdx @@ -2,27 +2,27 @@ description: Create token routes between any chains --- -# Warp Route Interface +# Warp路由接口 -Developers can use Hyperlane to permissionlessly deploy Warp Routes - contracts that allow any ERC20, ERC721, or native tokens to move effortlessly between chains. +开发人员可以使用Hyperlane无需许可地部署Warp路由——允许任何ERC20、ERC721或原生令牌在链之间轻松移动的合约。 -Unlike other token wrapping protocols, Warp Routes are secured by Hyperlane's modular security protocol, allowing developers to specify the security model that governs the minting, burning, and unwrapping of their interchain token. +与其他令牌打包协议不同,Warp路由由Hyperlane的模块化安全协议保护,允许开发人员指定安全模型来管理链间令牌的制造、燃烧和解包。 -### Overview +### 概览 -A Hyperlane Warp Route allows a particular token to be moved between chains according to a security model specified by the deployer. +Hyperlane Warp路由允许特定令牌根据部署者指定的安全模型在链之间移动。 -Each Warp Route consists of one contract deployed on every chain that the token can move between. These contracts use the [Mailbox](../messaging/messaging-interface.mdx) to send interchain messages to one another. +每个Warp路由由一个合约组成,合约部署在令牌可以在其中移动的每个链上。这些合约使用 [Mailbox](../messaging/messaging-interface.mdx) 向彼此发送链间消息。 -When a user transfers from the _canonical_ origin chain to a _non-canonical_ destination chain, their tokens are locked in a `HypERC20Collateral` contract, which sends a message to the destination chain to mint wrapped tokens. +当用户从_canonical_源链转移到_noncanonical_目标链时,他们的代币被锁定在`HypERC20Collateral`合约中,该合约会向目标链发送消息以制造包装代币。 -When a user transfers between non-canonical chains, their wrapped tokens are burned on the origin chain, which sends a message to the destination chain to mint wrapped tokens. +当用户在_noncanonical_链之间传输时,他们包装的令牌会被写入原始链,并将消息发送到目标链以铸造包装的令牌。 -Finally, if a user transfers from a non-canonical origin chain back to the canonical destination chain, their wrapped tokens are burned on the origin chain, which sends a message to the destination chain to release the tokens locked in the`HypERC20Collateral` contract. +最后,如果用户从_noncanonical_的源链传输回_canonical_的目标链,他们包装的令牌将被燃烧在源链上,该链向目标链发送消息以释放锁定在`HypERC20Collateral`合约中的令牌。 -### Interface +### 接口 -Hyperlane Warp Route exposes the following token interface. Warp Route tokens implement this interface, in addition to the standard `ERC20` interface. +Hyperlane Warp Route公开了以下令牌接口。除了标准的 `ERC20`接口之外,Warp Route令牌还实现了这个接口。 ```solidity /// @notice An interchain extension of the ERC20 interface @@ -41,14 +41,14 @@ interface IHypERC20 is IERC20 { } ``` -### Security considerations +### 安全注意事项 -The deployer of a Warp Route can optionally specify the interchain security modules (ISMs) that are used to verify interchain transfer messages. +Warp Route的部署者可以选择性地指定用于验证链间传输消息的链间安全模块(ISMs)。 -This means that each Warp Route may have a unique security configuration. Users transferring interchain tokens should understand the trust assumptions of a Route before using it. +这意味着每个Warp Route可能有一个唯一的安全配置。传输链间令牌的用户在使用路由之前应该了解它的共识。 -Similarly, Warp front-ends should maintain a curated list of known good routes so as to avoid supporting insecure ones. See the [Warp UI deployment docs](../../guides/deploy-warp-route-UI.mdx) details. +同样,Warp前端应该维护一个已知良好路由的列表,以避免支持不安全的路由。参见[Warp UI deployment docs](../../guides/deploy-warp-route-UI.mdx) 详细信息。 -### Deploy your Warp Route +### 部署你的Warp Route -Ready to deploy your Warp Route? It's easy - follow the [step-by-step guide](../../guides/deploy-warp-route.mdx). +准备好部署Warp Route了吗?这很容易-按照 [step-by-step guide](../../guides/deploy-warp-route.mdx)。 From 2658fd3ad493d1a0860db6b7ed4c6048cef80fc9 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 20:15:45 +0800 Subject: [PATCH 45/58] Translate interchain-gas.mdx to Chinese --- docs/reference/hooks/interchain-gas.mdx | 70 ++++++++++++------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/docs/reference/hooks/interchain-gas.mdx b/docs/reference/hooks/interchain-gas.mdx index f616a0aa..941cc3f0 100644 --- a/docs/reference/hooks/interchain-gas.mdx +++ b/docs/reference/hooks/interchain-gas.mdx @@ -1,9 +1,9 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# Interchain Gas Payment +# 链间燃料费支付 -To [deliver a message](../messaging/receive.mdx), a transaction must be included on the destination chain that calls the Mailbox `process` function with the encoded message and ISM metadata. +为了[deliver a message](../messaging/receive.mdx),目标链上必须包含一个事务,该事务使用编码的消息和ISM元数据调用邮箱的 `process`函数。 ```mermaid flowchart LR @@ -21,7 +21,7 @@ flowchart LR IGP -. "value" .- Relayer ``` -For convenience, a [relayer](../../operate/relayer/run-relayer.mdx) watches for dispatched messages and will submit process transactions on behalf of the message sender if they receive sufficient payment on the origin chain. We refer to this as *interchain gas payment*. +为了方便起见, [relayer](../../operate/relayer/run-relayer.mdx) 监视已分发的消息,如果消息发送者在原始链上收到足够的付款,则代表消息发送者提交进程事务。我们称之为**链间燃料费支付**。 ```mermaid flowchart LR @@ -35,7 +35,7 @@ flowchart LR Relayer -- "process{gasLimit}(...)" --> M_D ``` -Because messages can trigger arbitrary code execution, the relayer must meter the [`handle` call](../messaging/receive.mdx#handle) with a `gasLimit` to charge appropriately at message dispatch time. +因为消息可以触发任意代码执行,所以中继器必须用`gasLimit`测量[`handle` call](../messaging/receive.mdx#handle) ,以便在消息分发时适当收费。 $$ txCost = gasPrice * gasLimit @@ -47,31 +47,31 @@ $$ ## Post Dispatch -During the post-dispatch hook, the `InterchainGasPaymaster` contract will revert if payment is insufficient to cover the relayer's *anticipated* costs. The relayer will honor quotes from `dispatch` time. +在发送后钩子期间,如果付款不足以支付中继器的“预期”成本,则 `InterchainGasPaymaster`合同将回滚。中继器将尊重`dispatch` 时间的报价。 ### Gas Limit -When none is specified, the `gasLimit` for metering the `handle` call uses a static default of `50_000`. +当没有指定时,用于计量`handle` 调用的 `gasLimit`使用静态默认值`50_000`。 :::tip -We recommend developers benchmark their [`handle` implementations](../messaging/receive.mdx#handle) in unit tests to determine a reasonable `gasLimit` to use. +我们建议开发人员在单元测试中对他们的[`handle` implementations](../messaging/receive.mdx#handle) 进行基准测试,以确定要使用的合理`gasLimit`。 ::: -If you expect the `handle` function to consume more than this default, you should override the [default `gasLimit` in metadata](#metadata). +如果你希望 `handle` 函数消耗超过这个默认值,你应该覆盖[default `gasLimit` in metadata](#metadata)。 -### Refunds +### 退款 -If the message sender pays more than the hook quotes, the contract will refund the difference. If none is specified, the refund address will default to the message sender. This allows senders to skip explicit `quoteDispatch` calls. +如果消息发送方支付的金额超过钩子报价,合同将退还差额。如果没有指定,退款地址将默认为消息发送方。这允许发送方跳过显式的`quoteDispatch` 调用。 :::warning -Refunds can present a risk of [reentrancy](https://www.certik.com/resources/blog/3K7ZUAKpOr1GW75J2i0VHh-what-is-a-reentracy-attack). Special care should be taken to ensure safety against reentrancy exploits. +退款可能存在[reentrancy](https://www.certik.com/resources/blog/3K7ZUAKpOr1GW75J2i0VHh-what-is-a-reentracy-attack)。应特别注意确保安全,防止再入漏洞。 ::: -Refunds are only made if payment is greater than the quote. Refunds **are not** made if delivery requires less gas than what was paid. If a refund is unsuccessful, the `payForGas` call will revert. To specify a different refund address, override the [default `refundAddress` in metadata](#metadata). +只有在付款金额大于报价的情况下才会退款。如果发送所需的燃料费比已支付的燃料费少,则**不会**退款。如果退款不成功,`payForGas`调用将回滚。要指定不同的退款地址,请覆盖[default `refundAddress` in metadata](#metadata)。 -### Metadata +### 元数据 -This hook expects metadata in a **packed encoding** of `StandardHookMetadata`. See the Mailbox [dispatch overloads](../messaging/send.mdx#overriding-default-hook-metadata) for how to pass metadata overrides. +这个钩子需要`StandardHookMetadata`的打包编码的元数据。关于如何传递元数据覆盖,请参阅邮箱Mailbox [dispatch overloads](../messaging/send.mdx#overriding-default-hook-metadata) 。 @@ -85,7 +85,7 @@ struct StandardHookMetadata { } ``` -#### Examples +#### 示例 ```solidity bytes memory metadata = abi.encodePacked( @@ -103,10 +103,10 @@ bytes memory metadata = abi.encodePacked( ## Gas Oracles -The interchain gas payment requirement is calculated using oraclized gas price and exchange rates between supported origin and destination chains. +链间燃料费支付需求是使用支持的始发链和目的地链之间的整体燃料价格和汇率来计算的。 :::info -Exchange rates and gas prices are up to the relayer to decide. A spread may be charged to account for drift and operating costs. +汇率和天然气价格由中继器决定。 可能会收取差价,以计入漂没和运营成本。 ::: @@ -115,18 +115,18 @@ Exchange rates and gas prices are up to the relayer to decide. A spread may be c ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/hooks/igp/InterchainGasPaymaster.sol#L224-L228 ``` -**Parameters** +**参数** -- `destinationDomain`: The message's destination domain +- `destinationDomain`: 消息的目的域 -**Returns** -- `tokenExchangeRate`: The exchange rate between the origin and destination chain's gas tokens -- `gasPrice`: The gas price for the destination chain +**返回** +- `tokenExchangeRate`: 起源链和目的地链的gas代币之间的汇率 +- `gasPrice`: 目的地链的燃料价格 - The `quoteGasPayment` function calculates fees for the relayer's anticipated costs. +`quoteGasPayment` 函数计算中继器预期成本的费用。 @@ -134,19 +134,19 @@ Exchange rates and gas prices are up to the relayer to decide. A spread may be c ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/hooks/igp/InterchainGasPaymaster.sol#L195-L200 ``` -**Parameters** -- `destinationDomain`: The message's destination domain -- `gasLimit`: The gas limit to meter the `handle` call with +**参数** +- `destinationDomain`: 消息的目的域 +- `gasLimit`: 测量`handle`调用的燃料制 -**Returns** -- `fee`: The payment required for the `postDispatch` to succeed +**返回** +- `fee`: `postDispatch` 成功所需的付款 -## Retrying +## 重试 -If the `handle` call consumes more gas than quoted, the relayer will not submit a process transaction. In this case, additional gas can be paid for with the `payForGas` function. +如果`handle`调用消耗的燃料费超过报价,中继器将不会提交进程事务。在这种情况下,可以使用`payForGas` 功能支付额外的gas。 @@ -154,11 +154,11 @@ If the `handle` call consumes more gas than quoted, the relayer will not submit ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/interfaces/IInterchainGasPaymaster.sol#L24-L29 ``` -**Parameters** -- `messageId`: The message identifier returned from `dispatch` call -- `destinationDomain`: The message's destination domain -- `gasAmount`: The additional gas amount to pay for -- `refundAddress`: The address to refund excess payment to +**参数** +- `messageId`: 从`dispatch`调用返回的消息标识符 +- `destinationDomain`: 消息的目的域 +- `gasAmount`: 额外的燃料费用 +- `refundAddress`: 退还超额款项的地址 From 08bdd716263eb4515585cc7685d92de831207799 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 20:25:58 +0800 Subject: [PATCH 46/58] Translate op-stack.mdx to Chinese --- docs/reference/hooks/op-stack.mdx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/reference/hooks/op-stack.mdx b/docs/reference/hooks/op-stack.mdx index 1941af29..c9996267 100644 --- a/docs/reference/hooks/op-stack.mdx +++ b/docs/reference/hooks/op-stack.mdx @@ -1,19 +1,20 @@ # OP Stack Hook -Optimism and other [OP Stack](https://stack.optimism.io/) rollups have their own interface for message passing between L1 and L2 called the `CrossDomainMessenger`. Messages passed via this interface benefit from the security of the rollup [settlement layer](https://stack.optimism.io/docs/understand/landscape/#execution). +optimistic和其他[OP Stack](https://stack.optimism.io/)聚合有自己的接口,用于L1和L2之间的消息传递,称为`CrossDomainMessenger`。通过此接口传递的消息受益于rollup[settlement layer](https://stack.optimism.io/docs/understand/landscape/#execution)的安全性。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/interfaces/optimism/ICrossDomainMessenger.sol#L15-L19 ``` -To provide this security as an option in Hyperlane, we created a Hook and ISM combo that can be transparently configured to reuse the native OP Stack interface. +为了在Hyperlane中提供这种安全性,我们创建了一个Hook和ISM组合,可以透明地配置以重用本机OP Stack接口。 -See the [addresses](../contract-addresses.mdx) page for Hook and ISM addresses. -This is currently deployed between Goerli -> Optimism Goerli and Goerli -> Base Goerli. See contract deployments [here](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/v3/typescript/sdk/src/consts/environments/testnet.json) +请参阅[addresses](../contract-addresses.mdx) 页面获取Hook和ISM地址。 +目前部署在Goerli -> Optimism Goerli和Goerli -> Base Goerli之间。参见合同部署[here](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/v3/typescript/sdk/src/consts/environments/testnet.json) -## How It Works +## 它是如何工作的 -The OPStackHook sends the messageId to the L1CrossDomainMessenger which registers it as an Optimism `TransactionDeposited` event with ETH deposit and message data which gets picked up by the rollup node. -The rollup node calls the precompiled contract `L2CrossDomainMessenger`'s relayMessage function which in turn makes calls configured OptimismISM contract, setting the messageId in the verifiedMessageId's mapping to the original L1 sender (ie. the user). The relayer carries just the message with no metadata, waiting for the Optimism node to pick and make a storage write to Optimism and the message delivery is then verified. +OPStackHook将messageId发送给L1CrossDomainMessenger,后者将其注册为带有ETH存款和消息数据的Optimism`TransactionDeposited`事件,该事件由rollup节点拾取。 + +rollup节点调用预编译的合约 `L2CrossDomainMessenger`的relayMessage函数,该函数反过来调用配置的OptimismISM合约,在verifiedMessageId的映射中设置messageId到原始L1发送者(即,用户)。中继器只携带没有元数据的消息,等待Optimism节点选择并对Optimism节点进行存储写入,然后验证消息传递。 ```mermaid flowchart TB From c38c7bf1d0fad3e8307a4f633d40e9f1d13b51ae Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 20:39:14 +0800 Subject: [PATCH 47/58] Translate overview.mdx to Chinese --- docs/reference/hooks/overview.mdx | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/docs/reference/hooks/overview.mdx b/docs/reference/hooks/overview.mdx index 2a8f8774..5d874a8e 100644 --- a/docs/reference/hooks/overview.mdx +++ b/docs/reference/hooks/overview.mdx @@ -5,7 +5,7 @@ import { MultiLanguageExample } from "@site/src/components/InteractiveExample"; # Post-Dispatch Hooks -Post-dispatch hooks allow developers to configure additional origin chain behavior with message content dispatched via the Mailbox. +Post-dispatch hooks允许开发人员配置额外的源链行为,通过邮箱分发消息内容。 ```mermaid flowchart TB @@ -19,7 +19,7 @@ flowchart TB end ``` -This allows developers to integrate third party/native bridges, make additional chain commitments, or require custom fees all while maintaining a consistent single-call Mailbox interface. +这允许开发人员在维护一致的单次调用邮箱接口的同时,集成第三方/本地桥,作出额外的链承诺,或要求自定义费用。
`IPostDispatchHook` Interface @@ -37,7 +37,7 @@ This allows developers to integrate third party/native bridges, make additional ## Post Dispatch -In addition to the `message` dispatched via the Mailbox, the `postDispatch` function receives a `metadata` parameter. The `metadata` parameter is passed from the `dispatch` call through the Mailbox unmodified. This allows developers to pass any context they wish through to the hook. +除了通过邮箱发送的`message`之外,`postDispatch`函数还接收一个`metadata` 参数。`metadata` 参数从 `dispatch`调用通过未修改的Mailbox传递。这允许开发人员将任何上下文传递给钩子。 @@ -49,12 +49,11 @@ In addition to the `message` dispatched via the Mailbox, the `postDispatch` func -If the `postDispatch` function receives insufficient payment, it may revert. +如果' postDispatch '函数收到的付款不足,它可能会回滚。 ### Quote Dispatch (Fees) -Fees are often charged in `postDispatch` to cover costs such as destination chain transaction submission and security provisioning. To receive a quote for a corresponding `postDispatch` call, you can query the `quoteDispatch` function. - +通常在 `postDispatch`”中收取费用,以支付目的地链交易提交和安全配置等成本。要接收相应 `postDispatch`调用的报价,可以查询 `quoteDispatch`函数。 @@ -65,7 +64,7 @@ Fees are often charged in `postDispatch` to cover costs such as destination chai -The Mailbox has a `quoteDispatch` function that returns the aggregate fee required for a `dispatch` call to be successful. +邮箱有一个`quoteDispatch` 函数,用于返回成功调用`dispatch`所需的总费用。 ```mermaid flowchart TB @@ -82,14 +81,14 @@ flowchart TB end ``` -Move to implementing a hook guide [here](../../guides/create-custom-hook-and-ism.mdx) +转到实现钩子指南 [这里](../../guides/create-custom-hook-and-ism.mdx) -### Overridding default Hook Metadata +### 覆盖默认钩子元数据 -To override the default metadata, there is a `dispatch` overload that takes an optional `metadata` parameter. +为了覆盖默认的元数据,有一个`dispatch`重载,它接受一个可选的`metadata`参数。 :::info -Hooks currently expect metadata to be formatted with the [`StandardHookMetadata` library](../libraries/hookmetadata.mdx). +Hooks目前期望使用[`StandardHookMetadata` library](../libraries/hookmetadata.mdx)格式化元数据。 ::: @@ -102,7 +101,7 @@ Hooks currently expect metadata to be formatted with the [`StandardHookMetadata` -The custom `metadata` will be passed to the required hook's `quoteDispatch` and `postDispatch` functions, before being passed to the default hook's `postDispatch` function. +自定义的`metadata` 将被传递给所需钩子的`quoteDispatch` 和`postDispatch` 函数,然后再传递给默认钩子的`postDispatch`函数。 ```mermaid flowchart LR @@ -119,7 +118,7 @@ flowchart LR end ``` -#### Examples +#### 示例
`StandardHookMetadata` Library @@ -155,9 +154,9 @@ mailbox.dispatch{value: msg.value}( `} /> -### Custom hook and metadata +### 自定义钩子和元数据 -After implementing the above interfaces, you can override default hook along the hook metadata by using the overloaded `dispatch` call in our mailbox: +在实现了上面的接口之后,你可以通过在我们的邮箱中重载的`dispatch`调用来覆盖钩子元数据中的默认钩子: @@ -166,7 +165,7 @@ After implementing the above interfaces, you can override default hook along the ``` -### Examples +### 示例 Date: Sat, 17 Feb 2024 20:47:38 +0800 Subject: [PATCH 48/58] Translate to Chinese --- .../ISM/aggregation-ISM-interface.mdx | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/reference/ISM/aggregation-ISM-interface.mdx b/docs/reference/ISM/aggregation-ISM-interface.mdx index 3980ed3e..f32f7ed1 100644 --- a/docs/reference/ISM/aggregation-ISM-interface.mdx +++ b/docs/reference/ISM/aggregation-ISM-interface.mdx @@ -4,29 +4,29 @@ description: Aggregate security from multiple ISMs # Aggregation Module -Developers can use an `AggregationISM` to combine security from multiple ISMs. Simply put, an `AggregationISM` requires that `m` of `n` ISMs verify a particular interchain message. +开发人员可以使用“AggregationISM”来组合来自多个ISMs的安全性。简单地说,“aggreationism”要求“n”个ISMs中的“m”验证特定的链间消息。 -## Interface +## 接口 `AggregationISMs` must implement the `IAggregationIsm` interface. ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/interfaces/isms/IAggregationIsm.sol ``` -## Configure +## 配置 -The hyperlane-monorepo contains an `AggregationISM` implementation that application developers can deploy off-the-shelf, specifying their desired configuration. +hyperlane-monorepo包含一个`AggregationISM`实现,应用程序开发人员可以部署现成的实现,指定他们想要的配置。 -Developers can configure, for each origin chain, a set of `n` ISMs, and the number of ISMs needed to verify a message. +开发人员可以为每个源链配置一组“n”个ISMs,以及验证消息所需的ISMs数量。 -`AggregationISMs` can aggregate the security of any ISMs. For example, users can deploy a [Multisig ISM](multisig-ISM-interface.mdx) with their own validator set, and deploy an `AggregationISM` that aggregates that ISM with the Hyperlane default ISM. +`AggregationISMs`可以聚合任何ISMs的安全性。例如,用户可以使用自己的验证器集部署[Multisig ISM](multisig-ISM-interface.mdx),并部署一个`AggregationISM` ,将该ISM与Hyperlane默认ISM聚合在一起。 -## Customize +## 自定义 -The hyperlane-monorepo contains an abstract `AggregationISM` implementation that application developers can fork. +hyperlane-monorepo包含一个抽象的`AggregationISM`实现,应用程序开发人员可以对其进行分叉。 -Developers simply need to implement the `modulesAndThreshold()` function. +开发人员只需要实现`modulesAndThreshold()` 函数。 -By creating a custom implementation, application developers can tailor the security provided by a `AggregationISM` to the needs of their application. +通过创建自定义实现,应用程序开发人员可以根据应用程序的需要定制`AggregationISM`提供的安全性。 -For example, a custom implementation could require that low value messages be verified by a [Multisig ISM](multisig-ISM-interface.mdx), and require that high value messages _also_ be verified by a Wormhole ISM. +例如,自定义实现可能要求低值消息由[Multisig ISM](multisig-ISM-interface.mdx)验证,并要求高值消息也由Wormhole ISM验证。 From f2bc5791a2a16ac3130faae17ecbf83f22890818 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 21:05:46 +0800 Subject: [PATCH 49/58] Translate to Chinese --- .../ISM/aggregation-ISM-interface.mdx | 6 ++--- docs/reference/ISM/multisig-ISM-interface.mdx | 26 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/reference/ISM/aggregation-ISM-interface.mdx b/docs/reference/ISM/aggregation-ISM-interface.mdx index f32f7ed1..d0d82e42 100644 --- a/docs/reference/ISM/aggregation-ISM-interface.mdx +++ b/docs/reference/ISM/aggregation-ISM-interface.mdx @@ -4,11 +4,11 @@ description: Aggregate security from multiple ISMs # Aggregation Module -开发人员可以使用“AggregationISM”来组合来自多个ISMs的安全性。简单地说,“aggreationism”要求“n”个ISMs中的“m”验证特定的链间消息。 +开发人员可以使用`AggregationISM`来组合来自多个ISMs的安全性。简单地说,`AggregationISM`要求`n`个ISMs中的`m`验证特定的链间消息。 ## 接口 -`AggregationISMs` must implement the `IAggregationIsm` interface. +`AggregationISMs`必须实现`IAggregationIsm`接口。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/interfaces/isms/IAggregationIsm.sol ``` @@ -17,7 +17,7 @@ description: Aggregate security from multiple ISMs hyperlane-monorepo包含一个`AggregationISM`实现,应用程序开发人员可以部署现成的实现,指定他们想要的配置。 -开发人员可以为每个源链配置一组“n”个ISMs,以及验证消息所需的ISMs数量。 +开发人员可以为每个源链配置一组`n`个ISMs,以及验证消息所需的ISMs数量。 `AggregationISMs`可以聚合任何ISMs的安全性。例如,用户可以使用自己的验证器集部署[Multisig ISM](multisig-ISM-interface.mdx),并部署一个`AggregationISM` ,将该ISM与Hyperlane默认ISM聚合在一起。 diff --git a/docs/reference/ISM/multisig-ISM-interface.mdx b/docs/reference/ISM/multisig-ISM-interface.mdx index b42ca0a3..733e61bb 100644 --- a/docs/reference/ISM/multisig-ISM-interface.mdx +++ b/docs/reference/ISM/multisig-ISM-interface.mdx @@ -1,30 +1,30 @@ # Multisig Module -_Verify messages using validator signatures_ +_使用验证器签名验证消息_ -The `MultisigISM` is one of the most commonly used ISM types. These ISMs verify that `m` of `n` Validators have attested to the validity of a particular interchain message. +`MultisigISM`是最常用的ISM类型之一。这些ISM验证`n`个验证器中的 `m` 个已经证明了特定链间消息的有效性。 -## Interface +## 接口 -`MultisigISMs` must implement the `IMultisigIsm` interface. +`MultisigISMs`必须实现`IMultisigIsm`接口。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/interfaces/isms/IMultisigIsm.sol ``` -## Configure +## 配置 -The hyperlane-monorepo contains [`MultisigISM` implementations](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/solidity/contracts/isms/multisig) (including a [legacy](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/isms/multisig/LegacyMultisigIsm.sol) version and more gas-efficient [versions](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/isms/multisig/StaticMultisigIsm.sol) deployable via factories) that application developers can deploy off-the-shelf, specifying their desired configuration. +hyperlane-monorepo包含[`MultisigISM` implementations](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/solidity/contracts/isms/multisig)(包括通过工厂部署的 [legacy](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/isms/multisig/LegacyMultisigIsm.sol)版本和更省燃料的[versions](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/isms/multisig/StaticMultisigIsm.sol) 应用程序开发人员可以部署现成的配置,指定他们所需的配置。 -Developers can configure, for each origin chain, a set of `n` Validators, and the number of validator signatures (`m`) needed to verify a message. +开发人员可以为每个源链配置一组`n` 个验证器,以及验证消息所需的验证器签名(`m`)的数量。 -Validator signatures are **not** specific to an ISM. In other words, developers can configure their `MultisigISM` to use **any** validator that's running on Hyperlane and it will "just work". +验证器签名**并非**特定于ISM。换句话说,开发人员可以将他们的`MultisigISM`配置为使用在Hyperlane上运行的**任何**验证器,它将“正常工作”。 -## Customize +## 自定义 -The hyperlane-monorepo contains an abstract `MultisigISM` implementation that application developers can fork. +hyperlane-monorepo 包含一个抽象的`MultisigISM`实现,应用程序开发人员可以将其分叉。 -Developers simply need to implement the `validatorsAndThreshold()` function. +开发人员只需实现`validatorsAndThreshold()` 函数即可。 -By creating a custom implementation, application developers can tailor the security provided by a `MultisigISM` to the needs of their application. +通过创建自定义实施,应用程序开发人员可以根据其应用程序的需要定制`MultisigISM`提供的安全性。 -For example, a custom implementation could vary the number of signatures required, based on the content of the message being verified. +例如,自定义实现可以根据要验证的消息的内容改变所需签名的数量。 From 8feb8ce0b6fcc964647584424c0c084863c3f33c Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 21:07:40 +0800 Subject: [PATCH 50/58] optimize translation --- docs/reference/ISM/aggregation-ISM-interface.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/ISM/aggregation-ISM-interface.mdx b/docs/reference/ISM/aggregation-ISM-interface.mdx index d0d82e42..a7fc5917 100644 --- a/docs/reference/ISM/aggregation-ISM-interface.mdx +++ b/docs/reference/ISM/aggregation-ISM-interface.mdx @@ -4,7 +4,7 @@ description: Aggregate security from multiple ISMs # Aggregation Module -开发人员可以使用`AggregationISM`来组合来自多个ISMs的安全性。简单地说,`AggregationISM`要求`n`个ISMs中的`m`验证特定的链间消息。 +开发人员可以使用“聚合ISM”来组合来自多个ISM的安全性。简单地说,“聚合ISM”要求“n个”ISM中的“m个”验证特定的链间消息。 ## 接口 From f0800dc3435234146502ae6cb52f052e644edef1 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 21:16:28 +0800 Subject: [PATCH 51/58] Translate to Chinese --- docs/reference/ISM/routing-ISM-interface.mdx | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/reference/ISM/routing-ISM-interface.mdx b/docs/reference/ISM/routing-ISM-interface.mdx index 1039e813..acf43dc5 100644 --- a/docs/reference/ISM/routing-ISM-interface.mdx +++ b/docs/reference/ISM/routing-ISM-interface.mdx @@ -2,31 +2,31 @@ description: Smarter interchain security models --- -# Routing Module +# 路由模块 -Developers can use a `RoutingISM` to delegate message verification to a different ISM. This allows developers to change security models based on message content or application context. +开发人员可以使用`RoutingISM` 将消息验证委托给不同的ISM。这允许开发人员根据消息内容或应用程序上下文更改安全模型 ; -## Interface +## 接口 -`RoutingISMs` must implement the `IRoutingIsm` interface. +`RoutingISMs` 必须实现`IRoutingIsm`接口。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/interfaces/isms/IRoutingIsm.sol ``` -## Configure +## 配置 -The hyperlane-monorepo contains a `RoutingISM` implementation, `DomainRoutingIsm`, that application developers can deploy off-the-shelf, specifying their desired configuration. +hyperlane-monorepo包含一个`RoutingISM`实现,`DomainRoutingIsm`,应用程序开发人员可以部署现成的,指定他们想要的配置。 -This ISM simply switches security models depending on the origin chain of the message. A simple use case for this is to use different [Multisig ISM](multisig-ISM-interface.mdx) validator sets for each chain. +该ISM只是根据消息的源链切换安全模型。一个简单的用例是为每个链使用不同的[Multisig ISM](multisig-ISM-interface.mdx)验证器集。 -Eventually, you could imagine a `DomainRoutingIsm` routing to different light-client-based ISMs, depending on the type of consensus protocol used on the origin chain. +最终,你可以实现一个`DomainRoutingIsm`路由到不同的基于轻客户端的ISMs,这取决于在origin链上使用的共识协议的类型。 -## Customize +## 自定义 -The hyperlane-monorepo contains an abstract `RoutingISM` implementation that application developers can fork. +hyperlane-monorepo包含一个抽象的`RoutingISM`实现,应用程序开发人员可以对其进行分叉。 -Developers simply need to implement the `route()` function. +开发人员只需要实现 `route()` 函数。 -By creating a custom implementation, application developers can tailor the security provided by a `RoutingISM` to the needs of their application. +通过创建自定义实现,应用程序开发人员可以根据应用程序的需要定制`RoutingISM`提供的安全性。 -For example, a custom implementation could change security models based on the contents of the message or the state of the application receiving the message. +例如,自定义实现可以根据消息的内容或接收消息的应用程序的状态更改安全模型。 From 4ccfe126d62c8d51cb047c41d0927504e88ef7e6 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sat, 17 Feb 2024 21:27:56 +0800 Subject: [PATCH 52/58] Translate to Chinese --- docs/reference/ISM/specify-your-ISM.mdx | 31 ++++++++++++------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/docs/reference/ISM/specify-your-ISM.mdx b/docs/reference/ISM/specify-your-ISM.mdx index 8d3ba6e0..871edfd7 100644 --- a/docs/reference/ISM/specify-your-ISM.mdx +++ b/docs/reference/ISM/specify-your-ISM.mdx @@ -3,13 +3,13 @@ import TabItem from '@theme/TabItem'; import IsmDiagram from '@site/src/diagrams/messaging-isms.md'; -# Interchain Security Module Interface +# 链间安全模块接口 -Hyperlane modularizes interchain message security through a generic smart contract interface. Implementations are responsible for verifying that messages being delivered on the destination chain were actually sent on the origin chain using some proof metadata. +Hyperlane通过通用智能合约接口模块化链间消息安全。实现负责使用一些证明元数据验证在目标链上传递的消息实际上是在源链上发送的。 -Message recipients can specify custom security constraints by specifying an `InterchainSecurityModule` address. This implementation can be configured, composed, and customized according to the needs of their application. +消息接收者可以通过指定`InterchainSecurityModule`地址来指定自定义安全约束。这个实现可以根据应用程序的需要进行配置、组合和定制。
`IInterchainSecurityModule` Interface @@ -24,30 +24,30 @@ Message recipients can specify custom security constraints by specifying an `Int
-## Verify +## 验证 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/interfaces/IInterchainSecurityModule.sol#L31-L33 ``` -The Mailbox will call `verify` before delivering a message to its recipient. If `verify` reverts or returns `false`, the message will not be delivered. +在将邮件传递给收件人之前,邮箱将调用`verify`。如果`verify`返回`false`,消息将不会被传递。 -- `_metadata` consists of arbitrary bytes provided by the Relayer. Typically, these bytes are specific to the ISM. For example, for a [Multisig ISM](./multisig-ISM-interface.mdx), `_metadata` must include validator signatures. +- `_metadata`由中继器提供的任意字节组成。通常,这些字节是针对ISM的。例如,对于[Multisig ISM](./multisig-ISM-interface.mdx),`_metadata`必须包含验证器签名。 -- `_message` consists of the Hyperlane message being verified. ISMs can use this to inspect details about the message being verified. For example, a [Multisig ISM](./multisig-ISM-interface.mdx) could change validator sets based on the origin chain of the message. +_`_message` 由正在验证的Hyperlane消息组成。ISMs可以使用它来检查正在验证的消息的详细信息。例如,[Multisig ISM](./multisig-ISM-interface.mdx) 可以根据消息的原始链更改验证器集。 -### Module Type +### 模块类型 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/interfaces/IInterchainSecurityModule.sol#L21 ``` -This is used to signal to the Relayer how to encode `_metadata`. ISMs **must** return one of the supported module types. +这是用来通知中继器如何编码 `_metadata`。ISMs **必须**返回一个支持的模块类型。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/interfaces/IInterchainSecurityModule.sol#L5-L14 ``` -## Specifying an ISM +## 指定ISM -To specify the ISM they would like to use, developers implement the `ISpecifiesInterchainSecurityModule` interface in any contract that receives interchain messages via `handle()`. +为了指定他们想要使用的ISM,开发人员在任何通过`handle()`接收链间消息的合约中实现`ISpecifiesInterchainSecurityModule`接口。 ```solidity interface ISpecifiesInterchainSecurityModule { @@ -57,16 +57,15 @@ interface ISpecifiesInterchainSecurityModule { returns (IInterchainSecurityModule); } ``` -If no ISM is specified, or if the specified ISM is the null address, whatever ISM is configured as the default on the destination chain Mailbox will be used. +如果未指定ISM或指定的ISM为空地址,则将使用目的链上已配置为默认地址的ISM。 -## Sequence Diagram +## 排序图 -Here is a detailed sequence diagram of an interchain message being verified and delivered on the destination chain. +下面是在目标链上验证和传递链间消息的详细序列图。 :::info -If the recipient does not implement `ISpecifiesInterchainSecurityModule` or `recipient.interchainSecurityModule()` returns `address(0)`, the default ISM configured on the Mailbox will be used to verify the message. - +如果收件人没有实现`ISpecifiesInterchainSecurityModule`或`recipient.interchainSecurityModule()`返回`address(0)`,则使用邮箱上配置的默认ISM来验证消息。 ::: ```mermaid From e1ebb8d8a0c24d5ca15ced4e726ec72c312e01af Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sun, 18 Feb 2024 08:41:04 +0800 Subject: [PATCH 53/58] Translate to Chinese --- docs/reference/libraries/hookmetadata.mdx | 2 +- docs/reference/libraries/mailboxclient.mdx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/reference/libraries/hookmetadata.mdx b/docs/reference/libraries/hookmetadata.mdx index d0cd54af..2055c5f3 100644 --- a/docs/reference/libraries/hookmetadata.mdx +++ b/docs/reference/libraries/hookmetadata.mdx @@ -1,4 +1,4 @@ -# `StandardHookMetadata` Library +# `StandardHookMetadata`库 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/hooks/libs/StandardHookMetadata.sol ``` diff --git a/docs/reference/libraries/mailboxclient.mdx b/docs/reference/libraries/mailboxclient.mdx index 2e332d0b..42ada4b8 100644 --- a/docs/reference/libraries/mailboxclient.mdx +++ b/docs/reference/libraries/mailboxclient.mdx @@ -1,14 +1,14 @@ -# `MailboxClient` Library +# `MailboxClient` 库 -Inheriting from [`MailboxClient`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/v3/solidity/contracts/MailboxClient.sol) is a simple way to ensure your contract knows where to send or receive interchain messages to or from. +继承自[`MailboxClient`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/v3/solidity/contracts/MailboxClient.sol)是一种简单的方法,可以确保您的合约知道在何处发送或从何处接收链间消息。 -This mix-in contract maintains a pointers to the three contracts Hyperlane developers may need to interact with: +该mix-in合约维护着指向 Hyperlane 开发人员可能需要与之交互的三个合约的指针: 1. [`Mailbox`](../messaging/messaging-interface.mdx) (required) 2. [`IPostDispatchHook`](../hooks/interchain-gas.mdx) (optional) 3. [`IInterchainSecurityModule`](../ISM/specify-your-ISM.mdx) (optional) -`MailboxClient` exposes functions that allow subclasses to easily send messages to the `Mailbox` via the `mailbox` storage variable, and permission message delivery via the `onlyMailbox` modifier. +`MailboxClient`公开了允许子类通过`mailbox` 储变量轻松发送消息到`Mailbox` 的函数,并通过`onlyMailbox` 修饰符允许消息传递。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/client/MailboxClient.sol ``` From 3e8da712806f846a0310a28428a90a2aa1004a43 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sun, 18 Feb 2024 08:46:49 +0800 Subject: [PATCH 54/58] Translate to Chinese --- docs/reference/libraries/router.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/libraries/router.mdx b/docs/reference/libraries/router.mdx index 65d00d6e..4136e503 100644 --- a/docs/reference/libraries/router.mdx +++ b/docs/reference/libraries/router.mdx @@ -2,13 +2,13 @@ import RouterDiagram from '@site/src/diagrams/router.md' # `Router` Library -Application developers looking to write their contracts once and deploy them on multiple chains should consider building with the [`Router`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/Router.sol) pattern. +希望一次性编写合约并将其部署到多个链上的应用程序开发人员应该考虑使用[`Router`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/Router.sol)模式进行构建。 -In this pattern, an instance of the application's contracts is deployed on each application-supported chain. Each instance is made aware of the addresses of instances on other chains. These instances use Hyperlane to communicate information and state to and from instances on remote chains. +在此模式中,应用程序合约的实例部署在每个应用程序支持的链上。每个实例都知道其他链上实例的地址。这些实例使用Hyperlane来与远程链上的实例通信信息和状态。 -Developers using this pattern can inherit from the `Router` mix-in contract. `Router` is a [`MailboxClient`](./mailboxclient.mdx) that tracks the addresses of other `Router` contract addresses on remote chains. This allows `Routers` to send messages directly to others without having to specify addresses. It also allows `Routers` to reject messages sent from other untrusted senders. +使用这种模式的开发人员可以继承`Router` mix-in合约。' Router '是一个[`MailboxClient`](./mailboxclient.mdx) ,它跟踪远程链上其他`Router` 合约的地址。这允许`Router` 直接向其他路由发送消息,而不必指定地址。它还允许`Router` 拒绝来自其他不受信任的发送者的消息。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/client/Router.sol ``` From 5364fe2811c2addafa67169c6e79a192b43538d0 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sun, 18 Feb 2024 10:00:08 +0800 Subject: [PATCH 55/58] Translate to Chinese --- .../messaging/messaging-interface.mdx | 40 +++++++------- docs/reference/messaging/receive.mdx | 52 +++++++++---------- docs/reference/messaging/send.mdx | 44 ++++++++-------- 3 files changed, 68 insertions(+), 68 deletions(-) diff --git a/docs/reference/messaging/messaging-interface.mdx b/docs/reference/messaging/messaging-interface.mdx index 6cc6717e..c8fb4565 100644 --- a/docs/reference/messaging/messaging-interface.mdx +++ b/docs/reference/messaging/messaging-interface.mdx @@ -5,13 +5,13 @@ import SimpleMessagingDiagram from '@site/src/diagrams/messaging-simple.md'; # Mailbox -Hyperlane's generalized message passing (GMP) interface is implemented as a smart contract called the Mailbox. This contract encodes and decodes [message headers](#message-headers), ensures global message [uniqueness](#uniqueness), and prevents [replay attacks](#replay-protection). +Hyperlane的通用消息传递(GMP)接口是以一种名为邮箱(Mailbox)的智能合约的形式实现的。该合约对[message headers](#message-headers)进行编码和解码,确保全局消息的[uniqueness](#uniqueness),并防止[replay attacks](#replay-protection)。 -To [**send**](./send.mdx) interchain messages, call the `dispatch` function. +To [**send**](./send.mdx) 跨链消息,调用`dispatch`函数。 -To [**receive**](./receive.mdx) interchain messages, implement the `handle` function. +To [**receive**](./receive.mdx) 要实现链间消息,需要执行 `handle` 函数。
`IMailbox` Interface @@ -26,22 +26,22 @@ To [**receive**](./receive.mdx) interchain messages, implement the `handle` func
-## Message Headers +## 信息头 -The Mailbox prepends message bodies with a header containing the following fields: +邮箱在邮件正文前加上一个包含以下字段的标头: -- `version`: The version of the Mailbox contract -- `nonce`: A unique identifier for each message sent from a given Mailbox -- `origin`: The domain of the origin chain -- `sender`: The address of the sender on the origin chain -- `destination`: The address of the destination chain -- `recipient`: The address of the recipient on the destination chain +- `version`: 邮箱合同的版本 +- `nonce`: 从给定邮箱发送的每个邮件的唯一标识符 +- `origin`: 原始链的域 +- `sender`: 原始链上发送方的地址 +- `destination`: 目标链的地址 +- `recipient`: 目标链上收件人的地址 -See the [`Message` library](../libraries/message.mdx) for more information on the message encoding. +有关消息编码的更多信息,请参阅 [`Message` library](../libraries/message.mdx)。 -## Uniqueness +## 独特性 -The `nonce` is a monotonically increasing integer for each message sent from a given Mailbox. It is incremented each time a message is dispatched to serve as a separator for otherwise identical messages. +对于从给定邮箱发送的每个消息,`nonce`是一个单独递增的整数。它在每次发送消息时递增,作为其他相同消息的分隔符。 @@ -52,21 +52,21 @@ The `nonce` is a monotonically increasing integer for each message sent from a g -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 -The `messageId` is a globally unique message identifier, returned from the `dispatch` call, computed as the `keccak256` hash of the message (with headers). +`messageId`是一个全局唯一的消息标识符,从`dispatch`调用返回,计算为消息的`keccak256`哈希值(带headers)。 ## Replay Protection -The Mailbox maintains a mapping of already delivered `messageId` values to prevent replay attacks. If a message is received with a `messageId` that has already been delivered, the message is rejected. +邮箱维护一个已经传递的`messageId`值的映射,以防止重播攻击。如果接收到的消息包含已经发送的`messageId`,则会拒绝该消息。 @@ -77,12 +77,12 @@ The Mailbox maintains a mapping of already delivered `messageId` values to preve -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 diff --git a/docs/reference/messaging/receive.mdx b/docs/reference/messaging/receive.mdx index 29a92b52..46175485 100644 --- a/docs/reference/messaging/receive.mdx +++ b/docs/reference/messaging/receive.mdx @@ -5,18 +5,18 @@ import MessagingIsmDiagram from '@site/src/diagrams/messaging-isms.md'; import SimpleMessagingDiagram from '@site/src/diagrams/messaging-simple.md'; -# Receive a message +# 接收消息 -Contracts can receive interchain messages by implementing the `handle` function. +合约可以通过实现`handle`函数来接收链间消息。 ## Handle -This function is called by the `Mailbox` contract when a message is received. +当收到消息时,该函数由`Mailbox`合约调用。 :::danger -To ensure only valid interchain messages are accepted, it is important to restrict [access control](#access-control) to the Mailbox address. +为了确保只接受有效的链间消息,将[access control](#access-control)限制为邮箱地址是很重要的。 ::: @@ -25,14 +25,14 @@ To ensure only valid interchain messages are accepted, it is important to restri ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/interfaces/IMessageRecipient.sol#L5-L9 ``` -**Parameters** +**参数** -- `origin`: Domain of origin chain -- `sender`: Address of sender on origin chain as bytes32 -- `messageBody`: Raw bytes content of message body +- `origin`: 原始链的域 +- `sender`: 发件人在原始链上的地址,以bytes32表示 +- `messageBody`: 消息体内容的原始字节 :::info -Sender addresses are left-padded to `bytes32` for compatibility with virtual machines that are addressed differently. The following utility is provided in the [`TypeCasts` library](../libraries/typecasts.mdx) for convenience. +发送地址左填充为 `bytes32`,以兼容不同寻址的虚拟机。为了方便使用,[`TypeCasts` library](../libraries/typecasts.mdx)中提供了以下实用程序。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/libs/TypeCasts.sol#L10-L13 ``` ::: @@ -40,21 +40,21 @@ Sender addresses are left-padded to `bytes32` for compatibility with virtual mac
-🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧
-### Access Control +### 访问控制 -The `handle` function should be restricted to the Mailbox address if the contract should only accept calls from interchain messages. +如果合约只接受链间消息的调用,`handle`函数应限制为邮箱地址。 -The following utility is provided in the [`MailboxClient` library](../libraries/mailboxclient.mdx) for convenience. +为了方便使用, [`MailboxClient` library](../libraries/mailboxclient.mdx)中提供了以下实用程序。 @@ -65,17 +65,17 @@ The following utility is provided in the [`MailboxClient` library](../libraries/ -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 -### Examples +### 示例 @@ -86,23 +86,23 @@ The following utility is provided in the [`MailboxClient` library](../libraries/ -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 -## Verify +## 验证 -When a message is received, the Mailbox will verify security with an [Interchain Security Module](../ISM/specify-your-ISM.mdx) before calling the message recipient's `handle`. +当收到消息时,在调用消息收件人的`handle`之前,邮箱将使用[Interchain Security Module](../ISM/specify-your-ISM.mdx)验证安全性。 ### Default Security -To query the default ISM address, you can call the `defaultIsm` function. +默认的ISM地址可以通过`defaultIsm`函数查询。 @@ -113,9 +113,9 @@ To query the default ISM address, you can call the `defaultIsm` function. -### Modular Security +### 模块化安全 -To leverage Hyperlane's modular security, message recipients can specify a custom Interchain Security Module to **verify anything** about incoming messages. The Mailbox will defer to this ISM when specified. +为了利用Hyperlane的模块化安全性,消息接收者可以指定一个自定义的链间安全模块来**验证任何关于传入消息的内容**。当指定时,该邮箱将遵从此ISM。 @@ -128,12 +128,12 @@ To leverage Hyperlane's modular security, message recipients can specify a custo -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 diff --git a/docs/reference/messaging/send.mdx b/docs/reference/messaging/send.mdx index 561647b2..717c92ca 100644 --- a/docs/reference/messaging/send.mdx +++ b/docs/reference/messaging/send.mdx @@ -5,9 +5,9 @@ import { MultiLanguageExample } from "@site/src/components/InteractiveExample"; import SimpleMessagingDiagram from '@site/src/diagrams/messaging-simple.md'; -# Send a message +# 发送消息 -Contracts can send interchain messages by calling the `dispatch` function on the Mailbox. +合约可以通过调用Mailbox上的`dispatch`函数来发送链间消息。 @@ -26,13 +26,13 @@ Contracts can send interchain messages by calling the `dispatch` function on the ## Dispatch -Calling this function dispatches a message to the destination domain and recipient. +调用此函数将消息分发到目标域和收件人。 :::warning -Hyperlane can only deliver messages to smart contracts that implement the `handle` function. See the [receive a message](./receive.mdx) documentation for more information. +Hyperlane只能向实现`handle`函数的智能合约传递消息。有关更多信息,请参阅 [receive a message](./receive.mdx) 文档。 ::: -Depending on the [post-`dispatch` hook configuration](##post-dispatch-hook-config), some payment may be required. See the [`quoteDispatch`](#Quote-Dispatch) section for more information. +根据 [post-`dispatch` hook configuration](##post-dispatch-hook-config),可能需要一些付款。更多信息请参阅 [`quoteDispatch`](#Quote-Dispatch)。 @@ -42,7 +42,7 @@ Depending on the [post-`dispatch` hook configuration](##post-dispatch-hook-confi ``` :::info -Recipient addresses are left-padded to `bytes32` for compatibility with virtual machines that are addressed differently. The following utility is provided in the [`TypeCasts` library](../libraries/typecasts.mdx) for convenience. +为了与地址不同的虚拟机兼容,收件人地址被保留为`bytes32` 。为了方便起见,在[`TypeCasts` library](../libraries/typecasts.mdx) 中提供了以下实用程序。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/libs/TypeCasts.sol#L5-L8 @@ -53,17 +53,17 @@ Recipient addresses are left-padded to `bytes32` for compatibility with virtual -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 -### Examples +### 示例 /node_modules/@hyperlane-xyz/core/contracts/Mailbox.sol#L149-L153 ``` -The quoted `fee` must be passed as value to the `dispatch` call to ensure it does not revert. +引用的 `fee` 必须作为值传递给`dispatch` 调用,以确保它不会回滚。 -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 -🚧 Coming soon! 🚧 +🚧 即将到来! 🚧 -### Examples +### 示例 :::tip -Underpayment to `dispatch` will revert but overpayment will be refunded to the message sender. This enables developers to skip explicit `quoteDispatch` calls in favor of `dispatch` calls with excess value. +对`dispatch` 少付的金额将回滚,但多付的金额将退还给消息发送者。 这样,开发人员就可以跳过显式的`quoteDispatch`调用,转而使用具有超额值的`quoteDispatch`调用。 ::: -## Post-Dispatch Hook Config +## Post-Dispatch Hook 配置 -There are two hooks configured on a Mailbox +在邮箱上配置了两个钩子: -- `required`: invoked for all `dispatch` calls with value that covers the required fee -- `default`: invoked (unless overriden) with remaining value after `required` hook +- `required`: 所有`dispatch`都会调用,调用值为所需费用 +- `default`: 在`required`钩子之后用剩余值调用(除非被覆盖) ```mermaid flowchart LR @@ -167,7 +167,7 @@ flowchart LR ### Required Hook -To query the required hook configuration, you can call the `requiredHook` function. +要查询所需的钩子配置,可以调用`requiredHook`函数。 @@ -181,7 +181,7 @@ To query the required hook configuration, you can call the `requiredHook` functi ### Default Hook -To query the default hook configuration, you can call the `defaultHook` function. +要查询默认的钩子配置,可以调用 `defaultHook` 函数。 @@ -193,4 +193,4 @@ To query the default hook configuration, you can call the `defaultHook` function -To override the default hook with a custom hook in the `dispatch` call, see the [Hooks Reference](../hooks/overview.mdx). +要在`dispatch` 调用中使用自定义钩子覆盖默认钩子,请参见[Hooks Reference](../hooks/overview.mdx)。 From ef135fd82fbab6fde8080e1edcd030ded48a085e Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sun, 18 Feb 2024 11:15:03 +0800 Subject: [PATCH 56/58] Translate to Chinese --- docs/reference/domains.mdx | 6 ++-- docs/reference/glossary.mdx | 72 ++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/docs/reference/domains.mdx b/docs/reference/domains.mdx index a575d7ee..fa0bae9e 100644 --- a/docs/reference/domains.mdx +++ b/docs/reference/domains.mdx @@ -5,11 +5,11 @@ import TabItem from "@theme/TabItem"; ## Core Domains -This list includes only the deployments on chains that are managed by Abacus Works (our legal entity). Anybody can deploy Hyperlane on any chain [permissionlessly](../deploy-hyperlane.mdx) - we are building a registry to reflect the community's permissionless deployments. +此列表仅包括由 Abacus Works(我们的法律实体)管理的链上的部署。任何人都可以在任何链上[permissionlessly](../deploy-hyperlane.mdx) --我们正在建立一个注册表,以反映社区的无权限部署情况。 -Hyperlane uses unique IDs for each Hyperlane-supported chain. When possible Hyperlane domain IDs match EVM chain IDs, but this is not guaranteed as we support non-EVM chains as well. +Hyperlane为每个Hyperlane支持的链使用唯一的ID。在可能的情况下,Hyperlane域ID与EVM链ID匹配,但这并不能保证,因为我们也支持非EVM链。 -When [sending a message](../your-first-message.mdx), users must provide the domain ID of the destination chain. When [receiving a message](./messaging/receive.mdx), the recipient will be passed the domain ID of the origin chain. +当[sending a message](../your-first-message.mdx)时,用户必须提供目标链的域ID。当[receiving a message](./messaging/receive.mdx)时,将向收件人传递源链的域ID。 diff --git a/docs/reference/glossary.mdx b/docs/reference/glossary.mdx index 74a49e01..7206574b 100644 --- a/docs/reference/glossary.mdx +++ b/docs/reference/glossary.mdx @@ -8,9 +8,9 @@ description: A list of common terms in the Hyperlane protocol ## Agent -Hyperlane [agents](../protocol/agents/relayer.mdx) are off-chain actors that read and write Hyperlane smart contract state. +Hyperlane[agents](../protocol/agents/relayer.mdx)是读取和写入Hyperlane智能合约状态的链外参与者。 -Example agents include [validators](../protocol/agents/validators.mdx) and the [relayer](../protocol/agents/relayer.mdx). +代理的例子包括[validators](../protocol/agents/validators.mdx) 和[relayer](../protocol/agents/relayer.mdx)。 @@ -18,7 +18,7 @@ Example agents include [validators](../protocol/agents/validators.mdx) and the [ ## Aggregation ISM -The [Aggregation ISM](../reference/ISM/aggregation-ISM-interface.mdx) is a type of interchain security module that aggregates security from many [ISMs](../reference/ISM/specify-your-ISM.mdx) by requiring that `m` of `n` ISMs verify a particular interchain message. +[Aggregation ISM](../reference/ISM/aggregation-ISM-interface.mdx)是一种链间安全模块,它通过要求' n '个ISMs中的' m '来验证特定的链间消息,从而聚合来自多个 [ISMs](../reference/ISM/specify-your-ISM.mdx)的安全性。 @@ -26,9 +26,9 @@ The [Aggregation ISM](../reference/ISM/aggregation-ISM-interface.mdx) is a type ## Checkpoint -A checkpoint is a (merkle root, index) tuple, corresponding to the state of the [mailbox](glossary.mdx#mailbox) incremental merkle tree at a particular point in time. +检查点是一个(默克尔根,索引)元组,对应于[mailbox](glossary.mdx#mailbox)增量默克尔树在特定时间点的状态。 -Checkpoints signatures by [Validators](glossary.mdx#validator) are used in [Multisig ISMs](glossary.mdx#multisig-ism). +[Validators](glossary.mdx#validator) 的检查点签名在[Multisig ISMs](glossary.mdx#multisig-ism)中使用。 @@ -36,9 +36,9 @@ Checkpoints signatures by [Validators](glossary.mdx#validator) are used in [Mult ## Collateral chain -For a [Warp Route](glossary.mdx#warp-route), the chain on which the [collateral token](glossary.mdx#collateral-token) is deposited into the Warp Route. +对于[Warp Route](glossary.mdx#warp-route), [collateral token](glossary.mdx#collateral-token)存放到Warp Route的链。 -Read more about how to [deploy a Warp Route](../guides/deploy-warp-route.mdx). +阅读更多关于如何 [deploy a Warp Route](../guides/deploy-warp-route.mdx)。 @@ -46,9 +46,9 @@ Read more about how to [deploy a Warp Route](../guides/deploy-warp-route.mdx). ## Collateral token -For a [Warp Route](glossary.mdx#warp-route), the token which is deposited on the [collateral chain](glossary.mdx#collateral-chain) to create a wrapped token on a remote [synthetic chain](glossary.mdx#synthetic-chain). +对于[Warp Route](glossary.mdx#warp-route),存放于[collateral chain](glossary.mdx#collateral-chain)上的令牌在远程 [synthetic chain](glossary.mdx#synthetic-chain)上创建包装令牌。 -Read more about how to [deploy a Warp Route](../guides/deploy-warp-route.mdx). +阅读更多关于如何[deploy a Warp Route](../guides/deploy-warp-route.mdx)。 @@ -56,7 +56,7 @@ Read more about how to [deploy a Warp Route](../guides/deploy-warp-route.mdx). ## Default ISM -The [interchain security module](glossary.mdx#interchain-security-module) that will be used to verify inbound messages if the message recipient has not specified their own ISM. +如果消息接收者没有指定自己的ISM,则将使用[interchain security module](glossary.mdx#interchain-security-module) 来验证入站消息。 @@ -64,9 +64,9 @@ The [interchain security module](glossary.mdx#interchain-security-module) that w ## Domain -A unique identifier for a particular chain, used by the Hyperlane protocol to determine message origin and destination. +Hyperlane协议用于确定消息来源和目的地的特定链的唯一标识符。 -May be the same as the EVM chain ID, but isn't always. See [domains](domains/) for a list of known Hyperlane domain IDs. +可能与EVM链ID相同,但并不总是如此。请参阅 [domains](domains/) 获取已知Hyperlane域id的列表。 @@ -74,11 +74,11 @@ May be the same as the EVM chain ID, but isn't always. See [domains](domains/) f ## Interchain accounts (ICA) -A [middleware](glossary.mdx#middleware) smart contract that allows users to make interchain smart contract calls. +一个[middleware](glossary.mdx#middleware)允许用户进行链间智能合约调用的智能合约。 -For example, DAOs can use interchain accounts to own contracts on remote chains. +例如,dao可以使用链间帐户来拥有远程链上的合约。 -See Interchain Accounts for more information. +有关更多信息,请参阅跨链帐户。 @@ -86,9 +86,9 @@ See Interchain Accounts for more information. ## Interchain gas paymaster -A smart contract deployed by a [relayer](glossary.mdx#relayer) that accepts payments on an origin chain for message delivery on destination chains. +由[relayer](glossary.mdx#relayer) 部署的智能合约,它在源链上接受支付,以便在目标链上交付消息。 -See [interchain gas payments](../protocol/interchain-gas-payment.mdx) for more information +参见 [interchain gas payments](../protocol/interchain-gas-payment.mdx)了解更多信息 @@ -96,11 +96,11 @@ See [interchain gas payments](../protocol/interchain-gas-payment.mdx) for more i ## Interchain queries (IQS) -A [middleware](glossary.mdx#middleware) smart contract that allows users to make interchain view calls. +一个[middleware](glossary.mdx#middleware)允许用户进行链间视图调用的智能合约。 -For example, smart contracts can use interchain queries to look up oracle exchange rates or token balances from a remote chain. +例如,智能合约可以使用链间查询来从远程链上查找oracle汇率或代币余额。 -See Interchain Queries (IQS) for more information. +参见Interchain Queries (IQS)了解更多信息。 @@ -108,9 +108,9 @@ See Interchain Queries (IQS) for more information. ## Interchain security module -[Interchain Security Module](./ISM/specify-your-ISM.mdx) (ISMs) are smart contracts that provide security to Hyperlane's interchain [mailbox](./messaging/messaging-interface.mdx). +[Interchain Security Module](./ISM/specify-your-ISM.mdx) (ISMs)是为Hyperlane的链间[mailbox](./messaging/messaging-interface.mdx)提供安全保障的智能合约。 -ISMs are responsible for verifying that interchain messages being delivered on the destination chain were _actually sent_ on the origin chain. +ISMs负责验证在目的链上传递的链间信息是否**实际发送**在原始链上。 @@ -118,7 +118,7 @@ ISMs are responsible for verifying that interchain messages being delivered on t ## Mailbox -Arguably the most important Hyperlane smart contract, the [mailbox](./messaging/messaging-interface.mdx) exposes an interface that developers can use to [send](./messaging/send.mdx) and [receive](./messaging/receive.mdx) interchain messages. +可以说是Hyperlane最重要的智能合约,[mailbox](./messaging/messaging-interface.mdx) 公开了一个接口,开发人员可以使用它来 [send](./messaging/send.mdx)和 [receive](./messaging/receive.mdx) 链间消息。 @@ -126,9 +126,9 @@ Arguably the most important Hyperlane smart contract, the [mailbox](./messaging/ ## Middleware -A smart contract that sends and receives messages, and exposes a developer facing API. Developers are expected use this API instead of interacting directly with the [mailbox](glossary.mdx#mailbox). +发送和接收消息的智能合约,并公开面向开发人员的API。开发人员应该使用这个API,而不是直接与[mailbox](glossary.mdx#mailbox)交互。 -Example middlewares include [interchain-accounts-ica](glossary.mdx#interchain-accounts-ica) and [interchain-queries-iqs](glossary.mdx#interchain-queries-iqs) +示例中间件包括 [interchain-accounts-ica](glossary.mdx#interchain-accounts-ica) 和[interchain-queries-iqs](glossary.mdx#interchain-queries-iqs) @@ -136,7 +136,7 @@ Example middlewares include [interchain-accounts-ica](glossary.mdx#interchain-ac ## Multisig ISM -The [multisig ISM](./ISM/multisig-ISM-interface.mdx) is a type of [interchain security module](glossary.mdx#interchain-security-module) that uses `m` of `n` [validator](glossary.mdx#validator) signatures in order to verify a particular interchain message. +[multisig ISM](./ISM/multisig-ISM-interface.mdx)多重签名 ISM 是一个链间安全模块[interchain security module](glossary.mdx#interchain-security-module) ,它使用来自 n 个验证器[validator](glossary.mdx#validator)中的 m 个验证器的签名来验证特定的链间消息。 @@ -144,9 +144,9 @@ The [multisig ISM](./ISM/multisig-ISM-interface.mdx) is a type of [interchain se ## Relayer -The [relayer](../operate/relayer/run-relayer.mdx) is a Hyperlane [agents](glossary.mdx#agent) responsible for delivering messages from their origin chain(s) to their destination chain(s). +[relayer](../operate/relayer/run-relayer.mdx)是一个Hyperlane[agents](glossary.mdx#agent),负责将消息从源链传递到目标链。 -Relayers are untrusted, and anyone can operate a relayer. +中继器是不可信的,任何人都可以操作中继器。 @@ -154,9 +154,9 @@ Relayers are untrusted, and anyone can operate a relayer. ## Routing ISM -The Routing ISM is a type of [interchain security module](glossary.mdx#interchain-security-module) that defers to a different ISM depending on the message being delivered. +路由ISM是一种[interchain security module](glossary.mdx#interchain-security-module),根据所传递的消息交由不同的ISM管理。 -For example, a Routing ISM could use a different ISM depending on the origin chain from which the message was sent. +例如,Routing ISM可以根据发送消息的源链使用不同的ISM。 @@ -164,9 +164,9 @@ For example, a Routing ISM could use a different ISM depending on the origin cha ## Synthetic chain -For a [Warp Route](glossary.mdx#warp-route), a chain on which wrapped tokens are minted. These wrapped tokens are backed by [collateral tokens](glossary.mdx#collateral-token) that have been locked on the [collateral chain](glossary.mdx#collateral-chain). +对于[Warp Route](glossary.mdx#warp-route),在其上生成包装令牌的链。这些包装的令牌由 [collateral tokens](glossary.mdx#collateral-token)支持,这些令牌已被锁定在 [collateral chain](glossary.mdx#collateral-chain)上。 -Read more about how to [deploy a Warp Route](../guides/deploy-warp-route.mdx). +阅读更多关于如何[deploy a Warp Route](../guides/deploy-warp-route.mdx)。 @@ -174,9 +174,9 @@ Read more about how to [deploy a Warp Route](../guides/deploy-warp-route.mdx). ## Validator -[Validators](../operate/validators/run-validators.mdx) are a Hyperlane [agents](glossary.mdx#agent) responsible for attesting to messages sent from an origin chain. +[Validators](../operate/validators/run-validators.mdx) 是一个Hyperlane [agents](glossary.mdx#agent) ,负责验证从源链发送的消息。 -[Multisig ISMs](glossary.mdx#multisig-ism) use validator signatures to provide security for inbound messages. +[Multisig ISMs](glossary.mdx#multisig-ism) 使用验证器签名为入站消息提供安全性。 @@ -184,6 +184,6 @@ Read more about how to [deploy a Warp Route](../guides/deploy-warp-route.mdx). ## Warp Route -[Warp Routes](applications/warp-routes.mdx#overview) are Hyperlane's take on the concept of token bridging, allowing you to permissionlessly transfer any ERC20-like asset to any chain via Hyperlane. +[Warp Routes](applications/warp-routes.mdx#overview)是Hyperlane对令牌桥接概念的采用,允许您通过Hyperlane无许可地将任何类似erc20的资产转移到任何链上。 -Read more about how to [deploy a Warp Route](../guides/deploy-warp-route.mdx). +阅读更多关于如何[deploy a Warp Route](../guides/deploy-warp-route.mdx)。 From ad5a973f6ccf18a59516e9b4d2c30fe401128daf Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Sun, 18 Feb 2024 20:16:37 +0800 Subject: [PATCH 57/58] Translation review --- docs/deploy-hyperlane-troubleshooting.mdx | 16 ++-- docs/deploy-hyperlane.mdx | 38 ++++---- docs/explorer.mdx | 18 ++-- docs/faq.mdx | 20 ++-- docs/guides/create-custom-hook-and-ism.mdx | 38 ++++---- docs/guides/deploy-hyperlane-local-agents.mdx | 96 +++++++++---------- docs/guides/deploy-warp-route-UI.mdx | 24 ++--- docs/guides/deploy-warp-route.mdx | 68 ++++++------- .../developer-tips/explorer-debugging.mdx | 20 ++-- .../configuring-pi-chains.mdx | 16 ++-- .../explorer-debugging/graphql-api.mdx | 6 +- .../explorer-debugging/rest-api.mdx | 10 +- docs/guides/developer-tips/unit-testing.mdx | 16 ++-- docs/guides/ecosystems/solana.mdx | 4 +- docs/guides/implementation-guide.mdx | 40 ++++---- docs/guides/latencies.mdx | 2 +- docs/guides/v2-to-v3-migration.mdx | 2 +- docs/intro.mdx | 8 +- docs/operate/agent-config.mdx | 14 +-- docs/operate/config-reference.mdx | 4 +- docs/operate/deploy-with-terraform.mdx | 34 +++---- docs/operate/relayer/message-filtering.mdx | 2 +- docs/operate/relayer/run-relayer.mdx | 74 +++++++------- docs/operate/run-docker-compose.mdx | 8 +- docs/operate/set-up-agent-keys.mdx | 22 ++--- docs/operate/validators/run-validators.mdx | 32 +++---- .../validators/validator-signatures-aws.mdx | 46 ++++----- .../deploy-hyperlane/_deploy-contracts.mdx | 16 ++-- .../deploy-hyperlane/_deploy-warp-route.mdx | 6 +- .../deploy-hyperlane/_send-test-messages.mdx | 2 +- .../partials/deploy-hyperlane/_setup-keys.mdx | 29 +++--- .../deploy-hyperlane/_terminology.mdx | 4 +- docs/partials/ts-sdk-placeholder.mdx | 4 +- docs/protocol/ISM/aggregation-ISM.mdx | 4 +- docs/protocol/ISM/ccip-read-ISM.mdx | 6 +- docs/protocol/ISM/economic-security.mdx | 6 +- docs/protocol/ISM/modular-security.mdx | 10 +- docs/protocol/ISM/multisig-ISM.mdx | 2 +- docs/protocol/ISM/optimistic-ISM.mdx | 4 +- docs/protocol/ISM/routing-ISM.mdx | 2 +- docs/protocol/ISM/wormhole-ISM.mdx | 4 +- docs/protocol/agents/relayer.mdx | 8 +- docs/protocol/agents/validators.mdx | 6 +- docs/protocol/interchain-gas-payment.mdx | 2 +- docs/protocol/mailbox.mdx | 10 +- docs/protocol/warp-routes.mdx | 8 +- .../ISM/aggregation-ISM-interface.mdx | 2 +- docs/reference/ISM/multisig-ISM-interface.mdx | 4 +- docs/reference/ISM/routing-ISM-interface.mdx | 6 +- docs/reference/domains.mdx | 2 +- docs/reference/hooks/interchain-gas.mdx | 6 +- docs/reference/hooks/op-stack.mdx | 2 +- docs/reference/hooks/overview.mdx | 10 +- docs/reference/libraries/mailboxclient.mdx | 2 +- docs/reference/libraries/router.mdx | 2 +- docs/reference/messaging/send.mdx | 10 +- docs/your-first-message.mdx | 8 +- 57 files changed, 432 insertions(+), 433 deletions(-) diff --git a/docs/deploy-hyperlane-troubleshooting.mdx b/docs/deploy-hyperlane-troubleshooting.mdx index ec4e143d..4d6d7999 100644 --- a/docs/deploy-hyperlane-troubleshooting.mdx +++ b/docs/deploy-hyperlane-troubleshooting.mdx @@ -1,10 +1,10 @@ -# Troubleshooting +# 故障排除 ## 链配置 -在您的工作目录中,可能会发现一个包含 `chains.yaml` 文件的 `config/` 文件夹。通过该 `chains.yaml` 配置文件,您可以描述链元数据,以便在 Hyperlane 部署或应用程序中使用。 +在您的工作目录中,可能会发现一个包含`chains.yaml` 文件的 `config/`文件夹。通过该`chains.yaml` 配置文件,您可以描述链元数据,以便在Hyperlane部署或应用程序中使用。 -您可以在此文件中为任何新链定义完整配置。可配置的元数据在此[配置示例](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/chain-config.yaml)中定义。您还可以在 [chainMetadataTypes.ts](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/metadata/chainMetadataTypes.ts) 中找到链元数据模式。 +您可以在此文件中为任何新链定义完整配置。可配置的元数据在此[配置示例](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/chain-config.yaml)中定义。您还可以在 [chainMetadataTypes.ts](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/metadata/chainMetadataTypes.ts)中找到链元数据模式。 下面是两个本地anvil chains的配置示例: @@ -41,9 +41,9 @@ sepolia: ### 重写 RPC URL -您可以通过扩展核心链配置来覆盖 RPC 网址。 +您可以通过扩展核心链配置来覆盖RPC网址。 -在下面的示例中,你可以看到如何定义 RPC 数组,以及如何调整其中任何一个 RPC 的重试参数。 +在下面的示例中,你可以看到如何定义RPC数组,以及如何调整其中任何一个RPC的重试参数。 ```yaml --- @@ -64,7 +64,7 @@ sepolia: ### 覆盖交易设置 -事务重载是在形成事务请求时包含的任何属性。例如 +事务重载是在形成事务请求时包含的任何属性。例如: - `gasPrice`: number | string - `maxFeePerGas`: number | string @@ -73,7 +73,7 @@ sepolia: - `type`: number - `ccipReadEnabled`: boolean -在下面的示例中,我们使用的燃料价格为7gwei,对 nonce 进行了硬编码,并为基本费和优先费设置了最大值。 +在下面的示例中,我们使用的燃料价格为7gwei,对nonce进行了硬编码,并为基本费和优先费设置了最大值。 ```yaml --- @@ -85,7 +85,7 @@ sepolia: nonce: 1337 ``` -:::警告 +:::warning 如果要覆盖链配置中的 nonce,请确保在交易成功时更新该值。 diff --git a/docs/deploy-hyperlane.mdx b/docs/deploy-hyperlane.mdx index d15e6bf0..fc368a91 100644 --- a/docs/deploy-hyperlane.mdx +++ b/docs/deploy-hyperlane.mdx @@ -6,8 +6,8 @@ import DeployWarpRoutePartial from "/docs/partials/deploy-hyperlane/_deploy-warp # 立即开始 -任何人都可以在任何链上部署 Hyperlane。 -本指南涵盖从新 EVM 链发送第一条链间信息。在本指南结束时,您将部署并配置好邮箱智能合约和链外代理,从而允许开发人员向您的链发送链间消息或从您的链发送链间消息。 +任何人都可以在任何链上部署Hyperlane。 +本指南涵盖从新EVM链发送第一条链间信息。在本指南结束时,您将部署并配置好邮箱智能合约和链外代理,从而允许开发人员向您的链发送链间消息或从您的链发送链间消息。 :::note @@ -23,7 +23,7 @@ import DeployWarpRoutePartial from "/docs/partials/deploy-hyperlane/_deploy-warp 1. [Set up keys](#1-set-up-keys) 您将使用它来部署合同、运行验证器和中继器。 2. [Deploy contracts](#2-deploy-contracts) 到本地链以及本地链可以收发信息的所有远程链。 -3. [Run validators and relayer ](#3-run-validators-relayer) 使用 [Kurtosis](https://cloud.kurtosis.com)。验证器为您在步骤 2 中部署的链间安全模块提供所需的签名。中继器将在已部署合约的链之间传递信息。 +3. [Run validators and relayer ](#3-run-validators-relayer)使用[Kurtosis](https://cloud.kurtosis.com)。验证器为您在步骤2中部署的链间安全模块提供所需的签名。中继器将在已部署合约的链之间传递信息。 4. [Send a test message](#4-send-test-messages) 以确认中继器能够在每对链之间传递信息 5. [Deploy a warp route](#5-optional-deploy-a-warp-route) 跨链发送标令牌 @@ -39,13 +39,13 @@ import DeployWarpRoutePartial from "/docs/partials/deploy-hyperlane/_deploy-warp ## 3. 运行验证器和中继器 -:::备注 +:::note -本节介绍如何使用第三方一键部署代理。要自行运行 Hyperlane 代理二进制文件,请遵循[本地代理指南](guides/deploy-hyperlane-local-agents.mdx)。 +本节介绍如何使用第三方一键部署代理。要自行运行Hyperlane代理二进制文件,请查看[Local Agents guide](guides/deploy-hyperlane-local-agents.mdx)。 ::: -我们与 [Kurtosis](https://www.kurtosis.com/) 合作,在云中提供一键式验证器和中继器部署。您将获得为期一个月的试用期,在此期间,您的验证器和中继器将在 Kurtosis Cloud 中免费运行。试用结束后,您需要自行运行验证器和中继器,或者购买 Kurtosis Cloud 订阅。 +我们与 [Kurtosis](https://www.kurtosis.com/) 合作,在云中提供一键式验证器和中继器部署方案。您将获得一个月的试用,在此期间,您的验证器和中继器将在Kurtosis Cloud中免费运行。试用结束后,您需要自行运行验证器和中继器,或者购买 Kurtosis Cloud 订阅。 要开始使用,请使用 `deploy kurtosis-agents` 命令生成一个链接,用于配置 Kurtosis 部署。 @@ -53,29 +53,29 @@ import DeployWarpRoutePartial from "/docs/partials/deploy-hyperlane/_deploy-warp hyperlane deploy kurtosis-agents ``` -按照提示操作,然后点击命令输出的 Kurtosis Cloud 链接。 +按照提示操作,然后点击命令输出的Kurtosis Cloud链接。 -如果这是您第一次使用 Kurtosis Cloud,您需要使用Google登录 ,Kurtosis 会在大约 2 分钟内为您的验证器和中继器提供一个远程云实例。 +如果这是您第一次使用Kurtosis Cloud,您需要使用Google登录,Kurtosis会在大约2分钟内为您的验证器和中继器提供一个远程云实例。 ![Get excited](../static/img/kurtosis-get-excited.png) -将弹出一个预填配置屏幕,其中包含步骤 1 和 2 中的所有中继器和验证器信息。 +将弹出一个预填配置表单,其中包含步骤1和2中的所有中继器和验证器信息。 -:::备注 +:::note -如果您在通过 CLI 在 Kurtosis Cloud 上部署代理时遇到问题,可以通过以下方式手动输入此信息: +如果您在通过CLI 在 Kurtosis Cloud上部署代理时遇到问题,可以通过以下方式手动输入此信息: 1. 登录 [Kurtosis Cloud](https://cloud.kurtosis.com/)。 -1. 点击[Hyperlane 软件包](https://cloud.kurtosis.com/gateway/ips/18-206-3-164/ports/9711/catalog/github.com%2Fkurtosis-tech%2Fhyperlane-package)上的 "run"。 +1. 点击[Hyperlane Package](https://cloud.kurtosis.com/gateway/ips/18-206-3-164/ports/9711/catalog/github.com%2Fkurtosis-tech%2Fhyperlane-package)上的"run"。 1. 填写配置模块。 ::: -最后一步是输入步骤 2 中的 "验证密钥"。下面的截图显示了一个预填充配置示例。 +最后一步是输入步骤2中的`Validator Key`。下面的截图显示了一个预填充配置示例。 -:::警告 +:::warning -Kurtosis 团队仍在构建 Kurtosis Cloud 的保密功能,因此目前请勿在 Kurtosis 中输入任何敏感信息(例如您的私钥)!只能使用测试值和非敏感值。 +Kurtosis 团队仍在构建Kurtosis Cloud的保密功能,因此目前请勿在Kurtosis中输入任何敏感信息(例如您的私钥)!只能使用测试值和非敏感值。 ::: @@ -85,7 +85,7 @@ Kurtosis 团队仍在构建 Kurtosis Cloud 的保密功能,因此目前请勿 单击 "run"部署中继器和验证器! -配置成功执行后,您将看到一个绿色的"running"标记。恭喜您 您现在已经使用 Kurtosis 部署了自己的中继器和验证器! +配置成功执行后,您将看到一个绿色的"running"标记。恭喜您,您现在已经使用 Kurtosis 部署了自己的中继器和验证器! ![Success](../static/img/kurtosis-success.png) @@ -95,11 +95,11 @@ Kurtosis 团队仍在构建 Kurtosis Cloud 的保密功能,因此目前请勿 ![Validator Logs](../static/img/kurtosis-validator-logs.png) -有关 Kurtosis 的问题,请提交 [Kurtosis Github repository](https://github.com/kurtosis-tech/kurtosis/issues/new/choose)。如有问题或讨论,请使用 [Kurtosis 仓库的 Github 讨论区](https://github.com/kurtosis-tech/kurtosis/discussions/new?category=q-a) 或访问 [Kurtosis Discord 服务器](https://discord.com/invite/jJFG7XBqcY)。 +有关Kurtosis的问题,请提交[Kurtosis Github repository](https://github.com/kurtosis-tech/kurtosis/issues/new/choose)。如有问题或讨论,请使用 [Github Discussions section of the Kurtosis repository](https://github.com/kurtosis-tech/kurtosis/discussions/new?category=q-a)或访问 [the Kurtosis Discord server](https://discord.com/invite/jJFG7XBqcY)。 -:::信息 +:::info -Kurtosis 提供一个月的 Kurtosis Cloud 免费试用期,用于运行您的中继器和验证器,但试用期结束后,您需要添加付款方式才能继续运行您的 Hyperlane 部署。查看订阅价格 [此处](https://kurtosis.com/pricing) 和支付方式信息 [此处](https://cloud.kurtosis.com/payment-method)。 +Kurtosis提供一个月的Kurtosis Cloud免费试用期,用于运行您的中继器和验证器,但试用期结束后,您需要添加付款方式才能继续运行您的Hyperlane。查看订阅价格[此处](https://kurtosis.com/pricing)和支付方式信息[此处](https://cloud.kurtosis.com/payment-method)。 ::: diff --git a/docs/explorer.mdx b/docs/explorer.mdx index 13582b82..6ce1a927 100644 --- a/docs/explorer.mdx +++ b/docs/explorer.mdx @@ -8,19 +8,19 @@ to/from[core chains](./reference/domains.mdx)的信息将可以通过交易哈 [Hyperlane Explorer](https://explorer.hyperlane.xyz/) 支持使用以下任何值搜索邮件: -- 发起信息的交易的哈希值(原始链的tx) -- 传递信息的交易的哈希值(目标链tx) +- 发起消息的交易的哈希值(原始链的tx) +- 传递消息的交易的哈希值(目标链tx) - 原始链交易的发送账户地址 - 目标链交易的接收账户地址 -- 信息发送者地址 -- 信息接收者地址 -- 信息ID +- 消息发送者地址 +- 消息接收者地址 +- 消息ID 要进行搜索,请在顶部的搜索栏中输入您的查询。您可以使用 "原始链"、"目标链 "和 "时间 "过滤选项来缩小搜索范围。 ![Explorer search bar](../static/img/explorersearchbar.png) -:::信息 +:::info 注意,默认情况下,资源管理器只能在[Hyperlane 核心链](./reference/domains.mdx)上查找信息。 @@ -30,12 +30,12 @@ to/from[core chains](./reference/domains.mdx)的信息将可以通过交易哈 ### 无需许可的互操作性 -可对资源管理器用户界面和 REST API 进行配置,以便在任何部署了 Hyperlane 的链上搜索信息。详情请参见[配置 PI 链](./guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx)。 +可对资源管理器用户界面和REST API进行配置,以便在任何部署了Hyperlane的链上搜索信息。详情请参见[配置 PI 链](./guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx)。 ### 调试信息 -如果您正在尝试调试信息传送问题,[explorer 调试](./guides/developer-tips/explorer-debugging.mdx) 页面提供了有用的提示。 +如果您正在尝试调试信息传送问题,[explorer 调试](./guides/developer-tips/explorer-debugging.mdx)页面提供了有用的提示。 ### 应用程序接口参考 -可以通过 [REST API](./guides/developer-tips/explorer-debugging/rest-api.mdx) 或 [GraphQL API](./guides/developer-tips/explorer-debugging/graphql-api.mdx) 以编程方式访问资源管理器的数据。推荐使用 REST API,因为它为信息数据提供了一个更简单的接口。 +可以通过[REST API](./guides/developer-tips/explorer-debugging/rest-api.mdx)或[GraphQL API](./guides/developer-tips/explorer-debugging/graphql-api.mdx)以编程方式访问资源管理器的数据。推荐使用REST API,因为它为信息数据提供了一个更简单的接口。 diff --git a/docs/faq.mdx b/docs/faq.mdx index 475ce06b..543f0b66 100644 --- a/docs/faq.mdx +++ b/docs/faq.mdx @@ -1,9 +1,9 @@ -# 常见问答 +# 常见问题解答
- **Hyperlane 是什么?** + **Hyperlane是什么?**
-
Hyperlane是为模块化区块链堆栈构建的第一个通用且无需许可的互操作层。任何人都可以无需许可地将[部署 hyperlane](./deploy-hyperlane.mdx)到任何区块链环境中,无论是1层、Rollup还是应用链,都可以让该链与部署了 Hyperlane 的任何其他链进行无缝通信。
+
Hyperlane是为模块化区块链堆栈构建的第一个通用且无需许可的互操作层。任何人都可以无需许可地[deploy hyperlane](./deploy-hyperlane.mdx)到任何区块链环境中,无论是1层、Rollup还是应用链,都可以让该链与部署了Hyperlane的任何其他链进行无缝通信。
@@ -27,7 +27,7 @@
**我可以用Hyperlane构建什么?**
-
Hyperlane的信息[传递接口](./reference/messaging/messaging-interface.mdx)允许dapp开发者在不同链上的智能合约之间发送任意字节。这可用于创建跨链应用程序,即跨越多个链的dapp。要想获得灵感,可以查看一些构建在Hyperlane之上的预构建应用程序,包括Warp Routes:允许用户将代币从一条链转移到另一条链;Interchain Accounts:允许用户进行跨链函数调用;Interchain Queries:允许用户进行跨链视图调用。
+
Hyperlane的信息[Messaging interface](./reference/messaging/messaging-interface.mdx)允许dapp开发者在不同链上的智能合约之间发送任意字节。这可用于创建跨链应用程序,即跨越多个链的dapp。要想获得灵感,可以查看一些构建在Hyperlane之上的预构建应用程序,包括Warp Routes:允许用户将代币从一条链转移到另一条链;Interchain Accounts:允许用户进行跨链函数调用;Interchain Queries:允许用户进行跨链视图调用。
@@ -39,13 +39,13 @@
**在 Hyperlane上发送信息时会发生什么?**
-
详情请参阅[send](./reference/messaging/send.mdx) 和 [receive](./reference/messaging/receive.mdx) 页面。简而言之,一个应用程序在原始链上调用 "dispatch() "函数,将信息插入邮箱的默克尔树中。Hyperlane中继观察到分发的信息,并为接收方的Interchain安全模块(ISM)组装元数据。中继器通过调用 "Mailbox.process() "将信息传递给接收方。中继器接收方使用其ISM验证信息,并调用`recipient.handle()`来传递信息。
+
详情请参阅[send](./reference/messaging/send.mdx) 和 [receive](./reference/messaging/receive.mdx) 页面。简而言之,一个应用程序在原始链上调用`dispatch()`函数,将信息插入邮箱的默克尔树中。Hyperlane中继观察到分发的信息,并为接收方的Interchain安全模块(ISM)组装元数据。中继器通过调用`Mailbox.process()`将信息传递给接收方。中继器接收方使用其ISM验证信息,并调用`recipient.handle()`来传递信息。
**如何查看已发送信息的状态?**
-
在[Hyperlane信息浏览器](./explorer.mdx)的搜索栏中粘贴地址或交易哈希值,可查看信息的状态和历史详情。如果信息因某种原因发送失败,将提示可能出现的问题。有关如何调试未传递信息的更多信息,请参阅[浏览器调试](./guides/developer-tips/explorer-debugging.mdx)。
+
在[Hyperlane Message Explorer](./explorer.mdx)的搜索栏中粘贴地址或交易哈希值,可查看信息的状态和历史详情。如果信息因某种原因发送失败,将提示可能出现的问题。有关如何调试未传递信息的更多信息,请参阅[Explorer Debugging](./guides/developer-tips/explorer-debugging.mdx)。
@@ -61,7 +61,7 @@
- **我是一名开发人员。我的团队如何使用 Hyperlane 进行构建?** + **我是一名开发人员。我的团队如何使用Hyperlane进行构建?**
如果您正在阅读本常见问题解答,那么您已经找到了文档,这是一个很好的开始。尽管如此,我们知道在实施过程中会出现一些问题,我们很乐意在您使用过程中为您提供帮助。Hyperlane社区经常在 [Discord](http://discord.gg/hyperlane) 上保持活跃。开发人员的反馈会直接影响产品路线图。
@@ -69,7 +69,7 @@
**Abacus Works是什么?**
-
Abacus Works 是从事Hyperlane开发的合法机构的名称。您可能会在较早的文章和资源库中遇到一些关于 Abacus 的引用。Hyperlane 于 2022 年秋季从 Abacus 更名为 Hyperlane。
+
Abacus Works是从事Hyperlane开发的合法机构的名称。您可能会在较早的文章和资源库中遇到一些关于Abacus的引用。Hyperlane于2022年秋季从Abacus更名为Hyperlane。
@@ -81,12 +81,12 @@
**我有兴趣在Hyperlane工作,在哪里可以看到职位空缺?**
-
查看我们的空缺职位 [此处](https://www.hyperlane.xyz/crew)。
+
查看我们的空缺职位[此处](https://www.hyperlane.xyz/crew)。
**我如何才能为改进本文档做出贡献?**
-
您可以通过 [docs repo](https://github.com/hyperlane-xyz)直接提交 PR 来编辑此文档。
+
您可以通过[docs repo](https://github.com/hyperlane-xyz)直接提交PR来编辑此文档。
\ No newline at end of file diff --git a/docs/guides/create-custom-hook-and-ism.mdx b/docs/guides/create-custom-hook-and-ism.mdx index dc9cf586..475f695e 100644 --- a/docs/guides/create-custom-hook-and-ism.mdx +++ b/docs/guides/create-custom-hook-and-ism.mdx @@ -3,11 +3,11 @@ import TabItem from "@theme/TabItem"; import { MultiLanguageExample } from "@site/src/components/InteractiveExample"; -# 构建自己的钩子和自定义ISM(Building your own hooks and custom ISMs) +# 构建自己的钩子和自定义ISM -Hooks 和 ISM 之间具有互补关系:您可以从源头自定义行为,并且它们在目标上使用成对的 ISM 合约来验证您的自定义钩子行为。 +Hooks和ISM之间具有互补关系:您可以从源头自定义行为,并且它们在目标上使用成对的ISM合约来验证您的自定义钩子行为。 -您可以根据自己的需求实现和利用自己的钩子和 ISM 模式。您可以通过在源链上实现 `IPostDispatchHook` 接口,以及在目标链上实现 `IInterchainSecurityModule` 接口,来使用外部提供的桥接器,如 Wormhole 或 Chainlink 的 CCIP。 +您可以根据自己的需求实现和利用自己的钩子和ISM模式。您可以通过在源链上实现 `IPostDispatchHook` 接口,以及在目标链上实现 `IInterchainSecurityModule` 接口,来使用外部提供的桥接器,如Wormhole或Chainlink的CCIP。
`IPostDispatchHook` Interface @@ -38,11 +38,11 @@ Hooks 和 ISM 之间具有互补关系:您可以从源头自定义行为,并
-:::信息 -Hooks 目前期望元数据采用 [`StandardHookMetadata` 库的格式](../reference/libraries/hookmetadata.mdx)。 +:::info +Hooks目前期望元数据采用[`StandardHookMetadata` library](../reference/libraries/hookmetadata.mdx)。 ::: -你也可以继承我们的 `AbstractMessageIdAuthorizedIsm`,它允许对中间的 `verifyMessageId` 函数调用进行访问控制,如果它是从授权的 `AbstractMessageIdAuthHook` 钩子接收到的,则将 messageId 设置为 true 并存储起来。这种模式目前在 [`OpStackHook`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/ef2ece300e71a30e8f4f59e5b26e21eea012d43b/solidity/contracts/hooks/OPStackHook.sol#L33C8-L33C8) \<> [`OpStackIsm`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/ef2ece300e71a30e8f4f59e5b26e21eea012d43b/solidity/contracts/isms/hook/OPStackIsm.sol#L31) 模式中使用。 +你也可以继承我们的`AbstractMessageIdAuthorizedIsm`,它允许对中间的`verifyMessageId`函数调用进行访问控制,如果它是从授权的`AbstractMessageIdAuthHook`钩子接收到的,则将messageId设置为true并存储起来。这种模式目前在[`OpStackHook`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/ef2ece300e71a30e8f4f59e5b26e21eea012d43b/solidity/contracts/hooks/OPStackHook.sol#L33C8-L33C8) \<> [`OpStackIsm`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/ef2ece300e71a30e8f4f59e5b26e21eea012d43b/solidity/contracts/isms/hook/OPStackIsm.sol#L31) 模式中使用。 ### Workflow @@ -83,7 +83,7 @@ flowchart TB ### 接口 - 在实现了上述接口之后,您可以通过使用我们邮箱中重载的 `dispatch` 调用来覆盖默认的钩子以及钩子元数据: +在实现了上述接口之后,您可以通过使用我们邮箱中重载的`dispatch`调用来覆盖默认的钩子以及钩子元数据: @@ -122,30 +122,32 @@ mailbox.dispatch( - 在源链上, - - `mailbox.dispatch()` 通过 `AbstractMessageIdAuthHook.postDispatch()` 调用您的自定义钩子。 - - `_postDispatch` 检查 `latestDispatchedId` 是否是从钩子调用中分派的 id,以确保邮箱是调用钩子的合约(因为调用 `postDispatch` 没有访问控制)。 - - `_sendMessageId` 调用您的自定义外部桥接逻辑,例如调用 CCIP 路由合约。 + - `mailbox.dispatch()`通过`AbstractMessageIdAuthHook.postDispatch()`调用您的自定义钩子。 + - `_postDispatch`检查`latestDispatchedId`是否是从钩子调用中分派的id,以确保邮箱是调用钩子的合约(因为调用`postDispatch`没有访问控制)。 + - `_sendMessageId`调用您的自定义外部桥接逻辑,例如调用CCIP路由合约。 - 在目标链上, - - 外部桥将调用 `verifyMessageId` 函数(受访问控制)并将 `messageId` 设置为 `verifiedMessages` 映射中的 true。 - - 在接收到消息后,邮箱将调用您的 ISM 合约(在您的接收者地址中指定),该合约将检查 `verifiedMessages` 映射中的 messageId 是否为 true,并向邮箱返回 true,反之亦然。 + - 外部桥将调用`verifyMessageId`函数(受访问控制)并将`messageId`设置为`verifiedMessages`映射中的 true。 + - 在接收到消息后,邮箱将调用您的ISM合约(在您的接收者地址中指定),该合约将检查`verifiedMessages`映射中的messageId是否为true,并向邮箱返回true,反之亦然。 -:::警告 - `AbstractMessageIdAuthorizedIsm` 可以通过 `postDispatch` 调用发送 `msg.value`,我们利用 `verifiedMessages` 的小端 255 位来存储 `msg.value`,并使用顶部位来表示 messageId 传递的实际接收情况。因此,您可以从源链发送高达 2^255 数量的原生代币,并且目标 ISM 只能在目标链上接收 2^255 数量的原生代币。 +:::warning + `AbstractMessageIdAuthorizedIsm`可以通过`postDispatch`调用发送`msg.value`,我们利用`verifiedMessages`的小端 255 位来存储`msg.value`,并使用顶部位来表示messageId传递的实际接收情况。因此,您可以从源链发送高达2^255数量的原生代币,并且目标ISM只能在目标链上接收2^255 数量的原生代币。 ::: ### 访问控制 - 如果 `postDispatch` 必须只能使用刚刚发送的 `message` 调用,那么可以使用 Mailbox 上的 `latestDispatchedId` 函数来验证消息是否确实已经被发送。 +如果`postDispatch`必须只能使用刚刚发送的`message`调用,那么可以使用Mailbox上的`latestDispatchedId`函数来验证消息是否确实已经被发送。 + +:::info + +这样做是为了支持**组合**,其中一个钩子可能会将`message`传递给另一个钩子,而不是使用`require(mailbox == msg.sender)`。 -:::信息 - 这样做是为了支持**组合**,其中一个钩子可能会将 `message` 传递给另一个钩子,而不是使用 `require(mailbox == msg.sender)`。 ::: - 为了方便起见,以下实用程序在 [`MailboxClient` 库](../reference/libraries/mailboxclient.mdx) 中提供。 +为了方便起见,以下实用程序在[`MailboxClient` 库](../reference/libraries/mailboxclient.mdx)中提供。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/client/MailboxClient.sol#L89-L91 diff --git a/docs/guides/deploy-hyperlane-local-agents.mdx b/docs/guides/deploy-hyperlane-local-agents.mdx index b4cadbeb..17ba8828 100644 --- a/docs/guides/deploy-hyperlane-local-agents.mdx +++ b/docs/guides/deploy-hyperlane-local-agents.mdx @@ -7,13 +7,13 @@ import DeployWarpRoutePartial from "/docs/partials/deploy-hyperlane/_deploy-warp import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; -# 使用本地代理部署 Hyperlane(Deploy Hyperlane with Local Agents) +# 使用本地代理部署Hyperlane -:::提示 +:::tip -这个指南适用于高级用户,他们可能最终打算在类似生产环境的环境中运行 Hyperlane 代理。它将介绍如何手动配置和运行代理的基础知识,但**不是生产设置指南**。 +这个指南适用于高级用户,他们可能最终打算在类似生产环境的环境中运行Hyperlane代理。它将介绍如何手动配置和运行代理的基础知识,但**不是生产设置指南**。 -如果尚未这样做,初学者应该从[**使用 Kurtosis 代理部署 Hyperlane**](../deploy-hyperlane.mdx)开始。 +如果尚未这样做,初学者应该从[**deploying Hyperlane with Kurtosis agents**](../deploy-hyperlane.mdx)开始。 ::: @@ -23,12 +23,12 @@ import TabItem from "@theme/TabItem"; 这个指南分为六个步骤: -1. [Set up keys](#1-set-up-keys) 您将使用这些密钥部署合约并运行验证人和中继。 -1. [Deploy contracts](#2-deploy-contracts) 在本地链和与本地链能够发送和接收消息的每个远程链上部署合约。 -1. [Run a validator](#3-run-a-validator) 为您部署的互链安全模块提供所需的签名。 -1. [Run a relayer](#4-run-a-relayer) 在您部署合约的链之间发送和接收消息。 -1. [Send a test message](#5-send-test-messages) 确认您的中继能够在每对链之间传递消息。 -1. [Deploy a Warp Route](#6-optional-deploy-a-warp-route) 跨链发送令牌,而不仅仅是消息。 +1. [Set up keys](#1-set-up-keys) :您将使用这些密钥部署合约并运行验证人和中继器。 +1. [Deploy contracts](#2-deploy-contracts) :在本地链和与本地链能够发送和接收消息的每个远程链上部署合约。 +1. [Run a validator](#3-run-a-validator) :为您部署的互链安全模块提供所需的签名。 +1. [Run a relayer](#4-run-a-relayer) :在您部署合约的链之间发送和接收消息。 +1. [Send a test message](#5-send-test-messages) :确认您的中继能够在每对链之间传递消息。 +1. [Deploy a Warp Route](#6-optional-deploy-a-warp-route) :跨链发送令牌,而不仅仅是消息。 ## 立即开始 @@ -42,11 +42,11 @@ import TabItem from "@theme/TabItem"; ## 3. 运行验证人 -验证者为从您的链发送到远程链的消息提供安全性。仅在使用[多重签名 ISM](../protocol/ISM/multisig-ISM.mdx)时才需要它们。 +验证者为从您的链发送到远程链的消息提供安全性。仅在使用[Multisig ISM](../protocol/ISM/multisig-ISM.mdx)时才需要它们。 ### 设置目录 -首先,将 `CONFIG_FILES` 环境变量设置为在 [部署合约](#2-deploy-contracts) 步骤中生成的代理配置文件的路径。例如: +首先,将`CONFIG_FILES`环境变量设置为在[deploy contracts](#2-deploy-contracts)步骤中生成的代理配置文件的路径。例如: ```bash export CONFIG_FILES=/full/path/to/configs/agent-config-{timestamp}.json @@ -54,8 +54,8 @@ export CONFIG_FILES=/full/path/to/configs/agent-config-{timestamp}.json 接下来,创建一个本地目录,用于让您的验证器将其签名写入其中。记住这个路径,因为在配置验证器时您将需要它。 -:::危险操作 -验证器签名路径将作为[验证器公告交易](./implementation-guide.mdx#validator-announce)的一部分写入链上。**请注意不要泄露任何安全敏感或个人信息!** +:::danger +验证器签名路径将作为[validator announcement transaction](./implementation-guide.mdx#validator-announce)的一部分写入链上。**请注意不要泄露任何安全敏感或个人信息!** ::: ```sh @@ -66,9 +66,9 @@ export VALIDATOR_SIGNATURES_DIR=/tmp/hyperlane-validator-signatures- ****更新代理配置**** -除非您正在Linux上运行Docker,否则您还需要更新您网络的代理配置。这是因为Docker在Mac、Windows或Windows Server上不支持[`host`网络模式](https://docs.docker.com/network/drivers/host/)。 +除非您正在Linux上运行Docker,否则您还需要更新您网络的代理配置。这是因为Docker在Mac、Windows或Windows Server上不支持[`host` network mode](https://docs.docker.com/network/drivers/host/)。 要做到这一点,请转到`$CONFIG_FILES`下的代理配置,将所有实例中的 "localhost" 或 "127.0.0.1" 替换为 `host.docker.internal`。例如: @@ -148,7 +148,7 @@ Validators可以配置许多参数。对于本指南,我们只关心其中的 ... ``` -硬编码这些路径可以在运行验证器的不同源链的 Docker 实例之间去重配置。这样可以更轻松地在运行容器时传递正确的参数。请参阅下面的示例,其中唯一需要针对不同链进行不同配置的是链名称和验证器密钥。 +硬编码这些路径可以在运行验证器的不同源链的Docker实例之间去重配置。这样可以更轻松地在运行容器时传递正确的参数。请参阅下面的示例,其中唯一需要针对不同链进行不同配置的是链名称和验证器密钥。 ```sh ... @@ -166,13 +166,13 @@ Validators可以配置许多参数。对于本指南,我们只关心其中的 **克隆并设置** -首先,克隆 Hyperlane monorepo: +首先,克隆Hyperlane monorepo: ```sh git clone git@github.com:hyperlane-xyz/hyperlane-monorepo.git ``` -然后按照 `rust` 目录中的 [设置说明](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md) 进行操作。这将设置 `rustup` ,如果你使用的是 Apple Silicon,则会安装 Rosetta 2。 +然后按照`rust`目录中的[setup instructions](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md)进行操作。这将设置`rustup`,如果你使用的是Apple Silicon,需要安装 Rosetta 2。 ```sh # install rustup @@ -189,7 +189,7 @@ softwareupdate --install-rosetta --agree-to-license -现在您对配置验证器参数有了更多的了解,请拉取最新的 Docker 镜像: +现在您对配置验证器参数有了更多的了解,请拉取最新的Docker镜像: ```sh docker pull gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519 @@ -200,7 +200,7 @@ docker pull gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519 ```sh mkdir -p hyperlane_db_validator_ ``` - 最后,运行验证程序: +最后,运行验证程序: ```sh docker run \ @@ -222,7 +222,7 @@ docker run \ -完成设置后,您现在应该能够使用 `cargo` 运行验证器: +完成设置后,您现在应该能够使用`cargo`运行验证器: ```sh cargo run --release --bin validator -- \ @@ -233,7 +233,7 @@ cargo run --release --bin validator -- \ --validator.key ``` -:::备注(可选):直接运行二进制文件 +:::note (可选):直接运行二进制文件 你也可以构建代理程序: @@ -257,35 +257,35 @@ cargo build --release bin validator -欲了解更多信息,请查阅[验证者指南](../operate/validators/run-validators.mdx)。 +欲了解更多信息,请查阅[Validators guide](../operate/validators/run-validators.mdx)。 ## 4. 运行中继器 Relayers负责传递在本地链和远程链之间发送的跨链消息。 -如果还没有,请确保已将 `CONFIG_FILES` 环境变量设置为在 [部署合约](#2-deploy-contracts) 步骤中生成的代理配置文件的路径。 +如果还没有,请确保已将 `CONFIG_FILES` 环境变量设置为在[deploy contracts](#2-deploy-contracts)步骤中生成的代理配置文件的路径。 ```bash export CONFIG_FILES=/full/path/to/configs/agent-config-{timestamp}.json ``` -### Configure +### 配置 这个指南涉及到配置验证器的许多参数。对于这个指南,我们只关注其中的一小部分: -| Parameter | Description | +| 参数 | 说明 | | ------------------------------- | ---------------------------------------------------------------------------------------- | -| `--db` | Path for writing persistent data to disk. | -| `--relayChains` | Comma separated names of the chains to relay between. E.g. `ethereum,polygon,avalanche`. | -| `--allowLocalCheckpointSyncers` | Allows the relayer to look for validator signatures on the local filesystem. | -| `--defaultSigner.key` | A hexadecimal private key used to sign transactions for all chains. | -| `--metrics-port` | Optional. The port to expose prometheus metrics on, defaults to `9090`. | +| `--db` | 将持久数据写入磁盘的路径。 | +| `--relayChains` | 用逗号分隔要中继的链的名称。如`ethereum,polygon,avalanche`。 | +| `--allowLocalCheckpointSyncers` | 允许中继器在本地文件系统上查找验证器签名。 | +| `--defaultSigner.key` | 用于为所有链签署事务的十六进制私钥。 | +| `--metrics-port` | 可选的。公开prometheus监控指标的端口默认为`9090`。 | -:::提示 +:::tip 您的中继链集应包括原始链和目标链。 ::: -要了解您可以更改的所有参数,请阅读 [代理配置参考](../operate/config-reference.mdx)。 +要了解您可以更改的所有参数,请阅读[agent configuration reference](../operate/config-reference.mdx)。 @@ -314,7 +314,7 @@ export CONFIG_FILES=/full/path/to/configs/agent-config-{timestamp}.json **克隆并设置** -如果还没有这样做,请克隆 Hyperlane monorepo 并按照 `rust` 目录中的 [设置说明](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md) 进行操作。 +如果还没有这样做,请克隆Hyperlane monorepo并按照 `rust` 目录中的[setup instructions](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md)进行操作。 ```sh # clone hyperlane monorepo @@ -367,7 +367,7 @@ docker run \ -在按照设置说明进行操作后,您现在应该可以使用 `cargo` 运行中继器了: +在按照设置说明进行操作后,您现在应该可以使用`cargo` 运行中继器了: ```sh cargo run --release --bin relayer -- \ @@ -380,7 +380,7 @@ cargo run --release --bin relayer -- \ 为了避免与验证器发生冲突,metrics端口被覆盖。 -:::备注(可选):直接运行二进制文件 +:::note (可选):直接运行二进制文件 您也可以选择构建代理程序: @@ -404,7 +404,7 @@ cargo build --release bin relayer -要获取更多信息,请查阅[中继器指南](../operate/relayer/run-relayer.mdx)。 +要获取更多信息,请查阅[Relayer guide](../operate/relayer/run-relayer.mdx)。 ## 5. 发送测试信息 diff --git a/docs/guides/deploy-warp-route-UI.mdx b/docs/guides/deploy-warp-route-UI.mdx index 02bdca93..158821a7 100644 --- a/docs/guides/deploy-warp-route-UI.mdx +++ b/docs/guides/deploy-warp-route-UI.mdx @@ -1,16 +1,16 @@ import TypescriptSdkPlaceholder from "/docs/partials/ts-sdk-placeholder.mdx"; -# 部署一个用于您的 Warp 路由的用户界面 +# 部署一个用于您的Warp路由的用户界面 -在成功[部署了一个 Warp 路由](./deploy-warp-route.mdx)之后,您可能希望部署一个前端用户界面来促进跨链代币转账。您可以 fork [Hyperlane Warp UI 模板](https://github.com/hyperlane-xyz/hyperlane-warp-ui-template) 并根据您的需求进行定制。 +在成功[deployed a Warp Route](./deploy-warp-route.mdx)之后,您可能希望部署一个前端用户界面来促进跨链代币转账。您可以fork[Hyperlane Warp UI 模板](https://github.com/hyperlane-xyz/hyperlane-warp-ui-template)并根据您的需求进行定制。 ## 配置和定制用户界面 -请按照 [自定义说明](https://github.com/hyperlane-xyz/hyperlane-warp-ui-template/blob/main/CUSTOMIZE.md) 中的说明,了解如何配置 UI 的代币和更改默认的品牌资产/主题。 +请按照[customization instructions](https://github.com/hyperlane-xyz/hyperlane-warp-ui-template/blob/main/CUSTOMIZE.md)中的说明,了解如何配置UI的代币和更改默认的品牌资产/主题。 ### 代币配置示例 -这是一个 Warp 路由的代币配置示例,连接到 Goerli 上的 WETH(链 ID 5)。您可以使用 Typescript、JSON 或 YAML 配置您的代币配置。 +这是一个Warp路由的代币配置示例,连接到Goerli上的WETH(链 ID 5)。您可以使用Typescript、JSON或YAML配置您的代币配置。 ```typescript { @@ -35,7 +35,7 @@ import TypescriptSdkPlaceholder from "/docs/partials/ts-sdk-placeholder.mdx"; #### 链配置示例 -链元数据也可以根据需要进行配置。这些配置与 CLI 中用于任何部署或发送命令的配置相同(例如,来自[部署指南](../deploy-hyperlane.mdx)的配置)。 +链元数据也可以根据需要进行配置。这些配置与CLI中用于任何部署或发送命令的配置相同(例如,来自[deploy guide](../deploy-hyperlane.mdx)的配置)。 ```typescript { @@ -57,23 +57,23 @@ anvil1: { ### 部署用户界面 -由于用户界面是一个 Next.js 应用程序,您可以使用您喜欢的托管服务来托管它。我们推荐使用 [Vercel](https://vercel.com),它与 Next.js 非常配合。[AWS Amplify](https://aws.amazon.com/amplify) 是另一个流行的选择。 +由于用户界面是一个Next.js应用程序,您可以使用您喜欢的托管服务来托管它。我们推荐使用 [Vercel](https://vercel.com),它与Next.js兼容。[AWS Amplify](https://aws.amazon.com/amplify)是另一个流行的选择。 -* 注册 [Vercel](https://vercel.com/) +* 注册[Vercel](https://vercel.com/) * 创建新项目 -* 将其连接到您的 Git 仓库 +* 将其连接到您的Git仓库 * 点击部署! 就是这样!现在您和您的用户可以使用该用户界面将代币从抵押链(collateral chain)发送到远程链,从一个远程链发送到另一个远程链,并从任何远程链发送回抵押链。 -### 返回燃料(Return gas) +### 返回燃料 -像 Warp 路由这样的代币桥接器的一个常见问题是,用户可能会将诸如 USDC 的代币转移到新链上,但只在此之后才意识到他们没有本地的燃料代币将这些代币移动到任何地方,包括返回。 +像Warp路由这样的代币桥接器的一个常见问题是,用户可能会将诸如USDC的代币转移到新链上,但只在此之后才意识到他们没有本地的燃料代币将这些代币移动到任何地方,包括返回。 -除了在用户界面中警告用户确保他们拥有燃料之外,您还可以为他们提供一些本地燃料代币,以改善他们的初始体验。要实现这个水龙头,您可以修改 Warp 路由合约以持有一些本地代币的余额,并与接收者分享。此外,您还可以构建一个离线服务,该服务只需观察 [`ReceivedTransferRemote events`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/token/libs/TokenRouter.sol) 并将本地燃料代币转移到接收者。 +除了在用户界面中警告用户确保他们拥有燃料之外,您还可以为他们提供一些本地燃料代币,以改善他们的初始体验。要实现这个水龙头,您可以修改Warp路由合约以持有一些本地代币的余额,并与接收者分享。此外,您还可以构建一个离线服务,该服务只需观察 [`ReceivedTransferRemote events`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/token/libs/TokenRouter.sol) 并将本地燃料代币转移到接收者。 -:::提示 +:::tip diff --git a/docs/guides/deploy-warp-route.mdx b/docs/guides/deploy-warp-route.mdx index 6dccd4aa..cacd5dce 100644 --- a/docs/guides/deploy-warp-route.mdx +++ b/docs/guides/deploy-warp-route.mdx @@ -1,74 +1,74 @@ -# 部署一个Warp 路由 +# 部署一个Warp路由 _创建一个跨链路由以管理您的代币_ -Warp 路由是一种 [路由器](../reference/libraries/router.mdx) 应用程序类型,需要在您希望支持的每条链上部署一个 `HypERC20` 或 `HypERC721` 代币合约。 +Warp 路由是一种[路由](../reference/libraries/router.mdx)应用程序类型,需要在您希望支持的每条链上部署一个`HypERC20`或`HypERC721`代币合约。 -:::信息 +:::info -查看 [Warp 路由](/docs/reference/applications/warp-routes) 参考页面,了解有关 Warp 路由接口和安全性影响的更多信息。 +查看 [Warp 路由](/docs/reference/applications/warp-routes) 参考页面,了解有关Warp路由接口和安全性影响的更多信息。 ::: -## 先决条件(Prerequisites) +## 准备 * [Hyperlane CLI](https://www.npmjs.com/package/@hyperlane-xyz/cli) * 用于合约交易签名的私钥 ## 1. 配置 -### Warp 路由配置 +### Warp路由配置 -要部署路由,您将需要一个 Warp 路由配置文件。有效的配置将指定: -* 这个 Warp 路由是为哪个链上的哪个代币创建的? -* _可选:_ Hyperlane连接细节,包括[邮箱](../reference/messaging/messaging-interface.mdx)、[跨链燃料](../reference/hooks/interchain-gas.mdx)和[跨链安全模块](../reference/ISM/specify-your-ISM.mdx)的合约地址。 -* _可选:_ 代币标准 - 使用 ERC20 的可互换代币或使用 ERC721 的非同质化代币。默认为 ERC20。 +要部署路由,您将需要一个Warp路由配置文件。有效的配置将指定: +* 这个Warp路由是为哪个链上的哪个代币创建的? +* _可选:_ Hyperlane连接细节,包括[mailbox](../reference/messaging/messaging-interface.mdx)、[interchain gas](../reference/hooks/interchain-gas.mdx)和[interchain security modules](../reference/ISM/specify-your-ISM.mdx)的合约地址。 +* _可选:_ 代币标准 - 使用ERC20的可互换代币或使用ERC721的非同质化代币。默认为ERC20。 -最简单的方法是使用 CLI 的 config 命令创建一个。 +最简单的方法是使用CLI的config命令创建一个。 ```bash hyperlane config create warp ``` -:::提示 +:::tip -如果您的配置看起来正确,现在可以直接跳转到 [第二步:部署](#2-deployment)。 +如果您的配置看起来正确,现在可以直接跳转到[Step 2: Deployment](#2-deployment)。 或者查看下面的详细信息,了解如何手动定义您的配置。 ::: -#### 基础(Base) +#### 基础 -您的配置必须恰好有一个 `base` 条目。在这里,您将配置有关您正在创建 Warp 路由的代币的详细信息。 +您的配置必须恰好有一个`base`条目。在这里,您将配置有关您正在创建Warp路由的代币的详细信息。 * **chainName**: 将此设置为您的代币存在的链。 -* **type**: 将其设置为 `TokenType.collateral` 以创建一个用于 ERC20/ERC721 代币的 Warp 路由,或者将其设置为 `TokenType.native` 以创建一个用于原生代币(例如以太币)的 Warp 路由。 -* **address:** 如果使用 `TokenType.collateral`,则为要创建路由的 ERC20/ERC721 合约的地址。 -* **isNft:** 如果对一个 ERC721 合约使用 `TokenType.collateral`,则设置为 `true`。 +* **type**: 将其设置为`TokenType.collateral`以创建一个用于ERC20/ERC721代币的Warp路由,或者将其设置为 `TokenType.native` 以创建一个用于原生代币(例如以太币)的Warp路由。 +* **address:** 如果使用`TokenType.collateral`,则为要创建路由的ERC20/ERC721合约的地址。 +* **isNft:** 如果对一个ERC721合约使用`TokenType.collateral`,则设置为`true`。 -#### 合成资产(Synthetics) +#### 合成资产 -您的配置必须至少有一个 `synthetics` 条目。在这里,您将配置有关您的 Warp 路由支持的远程链的详细信息。 +您的配置必须至少有一个`synthetics`条目。在这里,您将配置有关您的Warp路由支持的远程链的详细信息。 * **chainName:** 将此设置为您希望获得您代币的封装版本的链。 -#### 可选字段(Optional fields) +#### 可选字段 -您可以在您的 `base` 和 `synthetics` 条目中指定以下可选值。如果未提供任何值,则将使用核心部署文件中的值,这些文件可能是您自己的(如果提供了)或[SDK的](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/consts/environments/mainnet.json)。 +您可以在您的`base`和`synthetics`条目中指定以下可选值。如果未提供任何值,则将使用核心部署文件中的值,这些文件可能是您自己的(如果提供了)或[SDK's](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/consts/environments/mainnet.json)。 -* **mailbox:** 用于发送和接收消息的[邮箱](../reference/messaging/messaging-interface.mdx)合约的地址 -* **interchainSecurityModule:** 用于验证跨链消息的[跨链安全模块](../reference/ISM/specify-your-ISM.mdx)的地址 -* **interchainGasPaymaster:** 用于支付交付跨链消息所需的燃料费用的[跨链燃料支付](../reference/hooks/interchain-gas.mdx)的地址 +* **mailbox:** 用于发送和接收消息的[mailbox](../reference/messaging/messaging-interface.mdx)合约的地址 +* **interchainSecurityModule:** 用于验证跨链消息的[interchain security modules](../reference/ISM/specify-your-ISM.mdx)的地址 +* **interchainGasPaymaster:** 用于支付交付跨链消息所需的燃料费用的[interchain gas payments](../reference/hooks/interchain-gas.mdx)的地址 #### 示例 -对于使用local anvil chains的最小 Warp 配置示例,请参阅 [`warp-tokens.yaml`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/warp-tokens.yaml)。 +对于使用local anvil chains的最小Warp配置示例,请参阅[`warp-tokens.yaml`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/warp-tokens.yaml)。 -### 链配置(Chain Config) +### 链配置 -Warp 路由部署将需要关于其将与之交互的任何链的基本信息。如果目标链包括 Hyperlane SDK 中尚未包含的任何链,您必须为其指定链元数据。 +Warp路由部署需要关于其将与之交互的任何链的基本信息。如果目标链包括Hyperlane SDK中尚未包含的任何链,您必须为其指定链元数据。 -要查看 SDK 中包含哪些链,请运行以下命令: +要查看SDK中包含哪些链,请运行以下命令: ```bash hyperlane chains list @@ -80,21 +80,21 @@ hyperlane chains list hyperlane config create chain ``` -或者您可以手动定义配置。参见 [ChainMetadata type](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/metadata/chainMetadataTypes.ts#L62) 以查看其架构。您可以在 [`anvil-chains.yaml`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/anvil-chains.yaml) 中找到一个最小的示例。 +或者您可以手动定义配置。参见[ChainMetadata type](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/metadata/chainMetadataTypes.ts#L62)以查看其架构。您可以在[`anvil-chains.yaml`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/anvil-chains.yaml)中找到一个最小的示例。 ## 2. 部署 -运行以下命令以启动 Warp 路由部署: +运行以下命令以启动Warp路由部署: ```bash hyperlane deploy warp ``` -完成后,CLI 将创建两个新的 JSON 文件:`warp-deployment` 和 `warp-ui-token-config`。第一个文件仅包含新部署的 Warp 路由器合约的地址。第二个是 Warp UI 的配置文件,您可以在下一个可选步骤中使用。 +完成后,CLI将创建两个新的JSON文件:`warp-deployment` 和 `warp-ui-token-config`。第一个文件仅包含新部署的Warp路由器合约的地址。第二个是Warp UI的配置文件,您可以在下一个可选步骤中使用。 ## 3. 测试 -您可以使用以下命令发起一次单个 wei 的测试转账: +您可以使用以下命令发起一次单个wei的测试转账: ```bash hyperlane send transfer @@ -113,4 +113,4 @@ Warp test transfer complete ## 4. (可选) Warp UI -Warp UI 是一个用于与 Warp 路由交互的 DApp 模板。请参阅 [Warp UI 文档](./deploy-warp-route-UI.mdx) 了解设置方法的详细信息。 +Warp UI是一个用于与Warp路由交互的DApp模板。请参阅[Warp UI 文档](./deploy-warp-route-UI.mdx)了解设置方法的详细信息。 diff --git a/docs/guides/developer-tips/explorer-debugging.mdx b/docs/guides/developer-tips/explorer-debugging.mdx index 2e5d9eaf..acd8ea34 100644 --- a/docs/guides/developer-tips/explorer-debugging.mdx +++ b/docs/guides/developer-tips/explorer-debugging.mdx @@ -1,4 +1,4 @@ -# 资源管理器调试(Explorer debugging) +# 资源管理器调试 请访问资源管理器 [https://explorer.hyperlane.xyz](https://explorer.hyperlane.xyz/) @@ -9,7 +9,7 @@
Retrieving a transaction in the Hyperlane Explorer.
-## 调试失败信息(Debugging failed messages) +## 调试失败信息 您将会知道消息处理失败,因为页面顶部的消息状态将显示为”Error“,页面右上角的部分将指定消息无法处理的原因。 @@ -31,31 +31,31 @@ ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/interfaces/IMessageRecipient.sol ``` -:::警告 -EVM 地址(`address`)必须左填充零以符合规范。请参考 [TypeCasts 库](../../reference/libraries/typecasts.mdx) 中的 `pure addressToBytes32` 实用函数,以及消息 [dispatch](../../reference/messaging/send.mdx#dispatch) 部分获取其他详细信息。 +:::warning +EVM 地址(`address`)必须左填充零以符合规范。请参考[TypeCasts library](../../reference/libraries/typecasts.mdx)中的`pure addressToBytes32`实用函数,以及消息 [dispatch](../../reference/messaging/send.mdx#dispatch) 部分获取其他详细信息。 ::: ### 无法处理(Unprocessable) -如果消息接收者的 IMessageRecipient.handle() 函数的燃气估算失败,中继者 将无法传递该消息。中继者将继续为消息传递估算燃气,因为状态变化可能导致先前无法传递的消息成功传递。 +如果消息接收者的`IMessageRecipient.handle()`函数的燃料估算失败,中继器将无法传递该消息。中继器将继续为消息传递估算燃料,因为状态变化可能导致先前无法传递的消息成功传递。
![](../../../static/img/explorer-debugging/call-revert-exception.png)
Example exception of a transaction signed by validators but unprocessable by the relayer.
-:::信息 -如果您的用例错误不属于以上的类别,请**通过 Discord** [联系我们](https://discord.com/invite/KBD3aD78Bb)。 +:::info +如果您的用例错误不属于以上的类别,请**通过 Discord** [on Discord](https://discord.com/invite/KBD3aD78Bb)。 ::: ### 资金不足(Underfunded) -资金不足的消息意味着用于传递此消息的[跨链燃气支付](../../reference/hooks/interchain-gas.mdx)不足。 +资金不足的消息意味着用于传递此消息的[interchain gas payments](../../reference/hooks/interchain-gas.mdx)燃料不足。 中继器使用目标链上的 [`eth_estimateGas`](https://ethereum.github.io/execution-apis/api-documentation/) RPC 来确定中继消息的绝对成本。 如果这个金额超过了在源链上支付的总燃气量,中继器通常会拒绝传递消息。 -您可以[手动支付跨链燃气费用](../../reference/hooks/interchain-gas.mdx#retrying)来解决此问题。 +您可以[manually pay for interchain gas](../../reference/hooks/interchain-gas.mdx#retrying) (手动支付)来解决此问题。 ## 使用 Etherscan(Using Etherscan) -您还可以查看目标链上收件人的 Etherscan 页面,但请注意,处理事务不会显示在交易列表中,就像您通常想象的那样。这是因为中继器实际上调用了邮箱合约,然后调用收件人的 ‘handle’ 函数。因此,您将在“Internal Txns”选项卡下找到处理的证据。 +您还可以查看目标链上收件人的Etherscan页面,但请注意,处理事务不会显示在交易列表中,就像您通常想象的那样。这是因为中继器实际上调用了邮箱合约,然后调用收件人的`handle`函数。因此,您将在`Internal Txns`选项卡下找到处理的证据。 diff --git a/docs/guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx b/docs/guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx index 36362c00..b65b4666 100644 --- a/docs/guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx +++ b/docs/guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx @@ -1,16 +1,16 @@ # 配置 PI 链 -Hyperlane 可以[无权限部署](.../.../.../deploy-hyperlane.mdx)到任何链上,但 PI 链上的报文无法通过默认的 Hyperlane 代理识别。要查看 PI 链上消息的详细信息,首先要用该链的元数据配置资源管理器。 +Hyperlane 可以[permissionlessly deployed](../../../deploy-hyperlane.mdx)部署到任何链上,但PI链上的报文无法通过默认的Hyperlane代理识别。要查看PI链上消息的详细信息,首先要用该链的元数据配置资源管理器。 -首先,进入 [资源管理器设置页面](https://explorer.hyperlane.xyz/settings)。 +首先,进入[explorer's settings page](https://explorer.hyperlane.xyz/settings)。 ![](../../../../static/img/explorer-debugging/explorer-settings.png) -然后点击添加自定义链按钮。此时会出现一个模态窗口。输入 PI 链的配置。 +然后点击添加自定义链按钮。此时会出现一个模态窗口。输入PI链的配置。 -链配置模式是 Hyperlane SDK [ChainMetadata 模式](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/consts/chainMetadata.ts#L21)的扩展,但增加了一个`contracts` 对象。目前只要求提供`mailbox`合约地址,但如果提供了更多地址,将来可能会启用更多功能。 +链配置模式是Hyperlane SDK [ChainMetadata schema](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/consts/chainMetadata.ts#L21)的扩展,但增加了一个`contracts`对象。目前只要求提供`mailbox`合约地址,但如果提供了更多地址,将来可能会启用更多功能。 -如果提供了有效的基于 Etherscan 的区块资源管理器配置,Hyperlane Explorer 将利用它来查找所需的信息。如果没有,则会使用 RPC URL。请注意,使用 api 密钥(即使只是自由层密钥)的资源管理器运行速度更快、更可靠。 +如果提供了有效的基于Etherscan的区块资源管理器配置,Hyperlane Explorer将利用它来查找所需的信息。如果没有,则会使用RPC URL。请注意,使用api密钥(甚至只是免费的密钥)的资源管理器运行速度更快、更可靠。 ![](../../../../static/img/explorer-debugging/explorer-add-custom-chain.png) @@ -27,7 +27,7 @@ Hyperlane 可以[无权限部署](.../.../.../deploy-hyperlane.mdx)到任何 } ``` -**A chain config with a block explorer and block timings included:** +**带有区块资源管理器和区块计时的链配置包括:** ```js { @@ -68,6 +68,6 @@ Hyperlane 可以[无权限部署](.../.../.../deploy-hyperlane.mdx)到任何 } ``` -:::信息 -如果信息中链的来源或目的地 `domainId` 与其 `chainId` 不匹配,则必须在链配置中包含 `domainId` 字段。 +:::info +如果消息中链的来源或目的地`domainId`与其`chainId`不匹配,则必须在链配置中包含`domainId`字段。 ::: diff --git a/docs/guides/developer-tips/explorer-debugging/graphql-api.mdx b/docs/guides/developer-tips/explorer-debugging/graphql-api.mdx index b9b48032..97999375 100644 --- a/docs/guides/developer-tips/explorer-debugging/graphql-api.mdx +++ b/docs/guides/developer-tips/explorer-debugging/graphql-api.mdx @@ -1,9 +1,9 @@ # GraphQL API -Hyperlane代理收集系统活动的有用信息,包括所有消息。这些数据可通过应用程序接口(API)查询。这些应用程序接口目前免费提供,无需任何认证。将您喜欢的 GraphQL 客户端或库连接到 [https://api.hyperlane.xyz/v1/graphql](https://api.hyperlane.xyz/v1/graphql),即可查询数据! +Hyperlane代理收集系统活动的有用信息,包括所有消息。这些数据可通过应用程序接口(API)查询。这些应用程序接口目前免费提供,无需任何认证。将您喜欢的GraphQL客户端或库连接到 [https://api.hyperlane.xyz/v1/graphql](https://api.hyperlane.xyz/v1/graphql),即可查询数据! -:::信息 -请注意,推荐使用 REST API 而不是 GraphQL API,因为它暴露了一个更简单的消息数据模式。 +:::info +请注意,推荐使用REST API而不是GraphQL API,因为它暴露了一个更简单的消息数据模式。 ::: ### 查询示例 diff --git a/docs/guides/developer-tips/explorer-debugging/rest-api.mdx b/docs/guides/developer-tips/explorer-debugging/rest-api.mdx index 88a69b7c..75426b2a 100644 --- a/docs/guides/developer-tips/explorer-debugging/rest-api.mdx +++ b/docs/guides/developer-tips/explorer-debugging/rest-api.mdx @@ -1,10 +1,10 @@ # REST API -Hyperlane 代理收集系统活动的有用信息,包括所有消息。可以通过应用程序接口查询这些数据。 +Hyperlane代理收集系统活动的有用信息,包括所有消息。可以通过应用程序接口查询这些数据。 这些应用程序接口目前免费提供,无需任何认证。 -:::信息 +:::info 将您喜欢的获取客户端或库连接到 [Explorer API page](https://explorer.hyperlane.xyz/api-docs) 以查询数据! ::: @@ -109,7 +109,7 @@ Action: `search-messages`, Parameter (1 required): ### 无需权限的互操作链的APIs -Hyperlane 可以[permissionlessly deployed](../../../deploy-hyperlane.mdx)到任何链上,但PI链上的消息无法被默认的Hyperlane代理所识别。要查看来自PI链的消息的详细信息,请查询search-pi-messages操作。搜索需要在请求正文中提供链配置。请注意,这个功能也可以在[资源管理器用户界面](.../.../.../guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx)中使用。 +Hyperlane可以[permissionlessly deployed](../../../deploy-hyperlane.mdx)到任何链上,但PI链上的消息无法被默认的Hyperlane代理所识别。要查看来自PI链的消息的详细信息,请查询`search-pi-messages`操作。搜索需要在请求正文中提供链配置。请注意,这个功能也可以在[explorer UI](../../../guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx)中使用。 ```javascript const chainConfig = { @@ -148,6 +148,6 @@ const response = await fetch(url, { const data = await response.json(); ``` -#### Chain Config Schema +#### 链配置模式 -链配置模式是Hyperlane SDK的[ChainMetadata模式](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/consts/chainMetadata.ts#L21)的扩展,但添加了一个`contracts`对象。有关此配置对象的更多详细信息,请参阅[配置PI链](../../../guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx)。 +链配置模式是Hyperlane SDK的[ChainMetadata schema](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/sdk/src/consts/chainMetadata.ts#L21)的扩展,但添加了一个`contracts`对象。有关此配置对象的更多详细信息,请参阅[Configuring PI Chains](../../../guides/developer-tips/explorer-debugging/configuring-pi-chains.mdx) 。 diff --git a/docs/guides/developer-tips/unit-testing.mdx b/docs/guides/developer-tips/unit-testing.mdx index 34b22fa6..568ce1ba 100644 --- a/docs/guides/developer-tips/unit-testing.mdx +++ b/docs/guides/developer-tips/unit-testing.mdx @@ -1,10 +1,10 @@ -# 单元测试 - EVM(Unit testing - EVM) +# 单元测试 - EVM -单元测试在使用 Foundry 进行多链设置时可能会变得具有挑战性。因此,我们提供了一个轻量级的测试环境 `MockHyperlaneEnvironment`,让您能够在不需要分叉多个网络的情况下对您的跨链应用进行单元测试。 +单元测试在使用Foundry进行多链设置时可能会变得具有挑战性。因此,我们提供了一个轻量级的测试环境 `MockHyperlaneEnvironment`,让您能够在不需要分叉多个网络的情况下对您的跨链应用进行单元测试。 -大多数多链应用将构建在我们的 Mailbox 合约之上。因此,我们使用 `MockMailbox` 将已部署的邮箱的细节抽象化,而我们的环境包含了同一链上的 `originMailbox` 和 `destinationMailbox`。在内部,我们通过将到达目标的消息存储在目标邮箱的 `inboundMessages` 映射中来模拟消息传递。我们通过将消息入队并使用 `MockMailbox.processNextInboundMessage()` 增加 `inboundProcessedNonce` 来模拟消息传递。 +大多数多链应用将构建在我们的Mailbox合约之上。因此,我们使用 `MockMailbox` 将已部署的邮箱的细节抽象化,而我们的环境包含了同一链上的 `originMailbox` 和 `destinationMailbox`。在内部,我们通过将到达目标的消息存储在目标邮箱的 `inboundMessages` 映射中来模拟消息传递。我们通过将消息入队并使用 `MockMailbox.processNextInboundMessage()` 增加 `inboundProcessedNonce` 来模拟消息传递。 -简单消息 Forge 测试的设置如下: +简单消息Forge测试的设置如下: ### Sending a message @@ -45,7 +45,7 @@ contract SimpleMessagingTest is Test { ### Testing Router-based apps -假设您正在测试继承自 `Router` 的 `TestCrosschainApp`: +假设您正在测试继承自`Router`的`TestCrosschainApp`: ```solidity contract CrosschainAppTest is Test { @@ -67,7 +67,7 @@ contract CrosschainAppTest is Test { } ``` -调用 `processNextPendingMessage()` 和 `processNextPendingMessageFromDestination()` 分别处理目标邮箱和源邮箱的入站消息。现在,您可以从源链到目标链以及从目标链到源链进行跨链调用了: +调用`processNextPendingMessage()`和`processNextPendingMessageFromDestination()`分别处理目标邮箱和源邮箱的入站消息。现在,您可以从源链到目标链以及从目标链到源链进行跨链调用了: ```solidity function testRemoteTelephoneCallFromOrigin() public { @@ -97,7 +97,7 @@ contract CrosschainAppTest is Test { } ``` -如果您想为您的应用程序使用自己的 ISM,可以通过将其传递给 Router 的 `initialize` 方法来覆盖 Mailbox 提供的 `defaultIsm`,如下所示: +如果您想为您的应用程序使用自己的ISM,可以通过将其传递给Router的 `initialize` 方法来覆盖Mailbox提供的 `defaultIsm`,如下所示: ```solidity contract CrosschainAppTest is Test { @@ -123,7 +123,7 @@ contract CrosschainAppTest is Test { } ``` -:::提示 +:::tip 您可以在此处找到我们单元测试设置的示例:[InterchainAccountRouterTest](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/dae8b26ed65383844e4fbed7585deeb52da4e454/solidity/test/InterchainAccountRouter.t.sol#L38) diff --git a/docs/guides/ecosystems/solana.mdx b/docs/guides/ecosystems/solana.mdx index aa233517..39fa8240 100644 --- a/docs/guides/ecosystems/solana.mdx +++ b/docs/guides/ecosystems/solana.mdx @@ -1,5 +1,5 @@ # Solana -Hyperlane支持Solana虚拟机(SVM),目前已支持Zebec的[Nautilus Bridge](https://medium.com/hyperlane/case-study-interoperability-for-the-modular-rollup-stack-featuring-nautilus-d01118fe31ec)。此外,它还在[Eclipse测试网](https://medium.com/hyperlane/hyperlane-expands-to-solana-vm-in-collaboration-with-eclipse-8465616fd0e4)上实时运行。 +Hyperlane支持Solana虚拟机(SVM),目前已支持Zebec的[Nautilus Bridge](https://medium.com/hyperlane/case-study-interoperability-for-the-modular-rollup-stack-featuring-nautilus-d01118fe31ec)。此外,它还在[Eclipse testnet](https://medium.com/hyperlane/hyperlane-expands-to-solana-vm-in-collaboration-with-eclipse-8465616fd0e4)上实时运行。 -我们的公共工具和文档目前仅支持EVM,但我们有一些内部工具正在努力开源,并计划在年底之前开发完毕。如果您对将Hyperlane引入Solana感兴趣,请加入[我们的Discord](https://discord.gg/hyperlane)! +我们的公共工具和文档目前仅支持EVM,但我们有一些内部工具正在努力开源,并计划在年底之前开发完毕。如果您对将Hyperlane引入Solana感兴趣,请加入[our Discord](https://discord.gg/hyperlane)! diff --git a/docs/guides/implementation-guide.mdx b/docs/guides/implementation-guide.mdx index 1b157b7f..0b0f6031 100644 --- a/docs/guides/implementation-guide.mdx +++ b/docs/guides/implementation-guide.mdx @@ -1,6 +1,6 @@ -# 开发指南(Implementation Guide) +# 构建指南 -一个新链架构的 Hyperlane 实施由以下内容组成: +一个新链架构的 Hyperlane构建由以下内容组成: 1. [Contracts](#1-contracts): 公开应用程序开发人员用于发送和接收消息的接口 2. [Agents](#2-agents): 通过添加安全性并中继消息来操作协议 @@ -8,16 +8,16 @@ 在开始之前,建议先查阅协议文档。 -## 1. Contracts +## 1. contracts -下面描述了 Hyperlane 协议的链上合约规范。它使用了 Solidity 类型以便熟悉,但所有内容都可以推广到其他语言。 +下面描述了Hyperlane协议的链上合约规范。它使用了Solidity类型以便熟悉,但所有内容都可以推广到其他语言。 -* `address` 应该解释为本地链的地址类型 -* `payable` 描述了一个允许调用者传递本地代币的函数 +* `address` :应该解释为本地链的地址类型 +* `payable` :描述了一个允许调用者传递本地代币的函数 ### Message -消息是 Hyperlane 协议使用的核心数据结构。它是一个紧凑的数据结构,包含了将消息从一个域路由到另一个域所需的所有信息。 +消息是Hyperlane协议使用的核心数据结构。它是一个紧凑的数据结构,包含了将消息从一个域路由到另一个域所需的所有信息。 * [Solidity Implementation](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/libs/Message.sol) * [Sway Implementation](https://github.com/hyperlane-xyz/fuel-contracts/blob/main/contracts/hyperlane-message/src/main.sw) @@ -50,7 +50,7 @@ struct Message { #### dispatch -将消息分派到目标域和接收者。 +将消息分发到目标域和接收者。 ```solidity function dispatch( @@ -119,13 +119,13 @@ function handle( function interchainSecurityModule() returns (address); ``` -:::信息 +:::info 实现了这三个合约后,您就可以达到第一个里程碑,即通过调用 `Mailbox` 的 `dispatch` 函数来向接收者发送消息,并判断接收者是否收到了消息,以模拟消息传输。参见[这里的 Foundry 测试案例](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/test/Messaging.t.sol#L29)。 ::: -### 跨链安全模块(Interchain Security Module) +### Interchain Security Module 跨链安全模块用于在消息被处理之前进行验证。 @@ -133,7 +133,7 @@ function interchainSecurityModule() returns (address); #### moduleType -返回一个枚举,表示此 ISM 编码的安全模型的类型。 +返回一个枚举,表示此ISM编码的安全模型的类型。 ```solidity enum ModuleType { @@ -206,7 +206,7 @@ function getAnnouncedStorageLocations( #### Metadata -要与中继器中的 MESSAGE_ID_MULTISIG 模块类型实现一起使用,元数据必须格式化如下: +要与中继器中的MESSAGE_ID_MULTISIG模块类型实现一起使用,元数据必须格式化如下: * [Solidity Implementation](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/libs/isms/MessageIdMultisigIsmMetadata.sol) * [Sway Implementation](https://github.com/hyperlane-xyz/fuel-contracts/blob/main/contracts/multisig-ism-metadata/src/main.sw) @@ -226,7 +226,7 @@ struct MultisigMetadata { 返回负责验证消息的验证者集合以及所需签名的数量 -_可以根据 _message 的内容进行更改_ +可以根据 _message_ 的内容进行更改 ```solidity function validatorsAndThreshold( @@ -242,7 +242,7 @@ function validatorsAndThreshold( :::info -实现了 MultisigISM 后,您就可以达到第二个里程碑,即测试您的邮箱仅在接收者的 ISM 返回 true 后才处理。您可以使用一个 `TestISM` 来测试,您可以静态设置它来接受或拒绝任何消息。参见[这里的 Hardhat 测试案例](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/test/mailbox.test.ts#L175)。 +实现了MultisigISM后,您就可以达到第二个里程碑,即测试您的邮箱仅在接收者的ISM返回true后才处理。您可以使用一个 `TestISM` 来测试,您可以静态设置它来接受或拒绝任何消息。参见[Hardhat test case here.](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/test/mailbox.test.ts#L175)。 ::: @@ -255,9 +255,9 @@ function validatorsAndThreshold( #### payForGas -将 msg.value 存入作为向目标链中继消息的支付。 +将msg.value存入作为向目标链中继消息的支付。 -_超额支付将导致向 refundAddress 退还本地令牌。调用者应注意这可能会产生重入问题。_ +超额支付将导致向refundAddress退还本地令牌。调用者应注意这可能会产生重入问题。 ```solidity function payForGas( @@ -290,7 +290,7 @@ event GasPayment( #### Message Indexing -所有代理必须索引来自原始邮箱的消息。在 Solidity 邮箱中,我们[为每条分派的消息发出一个事件](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/Mailbox.sol#L125-L129)。其他链可能有不同的方式来呈现这些信息,但代理必须能够可靠地获取消息内容,并具有一致的顺序 - 请参见[消息索引器](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/hyperlane-core/src/traits/indexer.rs)特性。 +所有代理必须索引来自原始邮箱的消息。在Solidity邮箱中,我们[emit an event for each message](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/Mailbox.sol#L125-L129)。其他链可能有不同的方式来呈现这些信息,但代理必须能够可靠地获取消息内容,并具有一致的顺序 - 请参见[message indexer](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/hyperlane-core/src/traits/indexer.rs)特性。 * [ethereum](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/chains/hyperlane-ethereum/src/mailbox.rs) @@ -300,7 +300,7 @@ event GasPayment( #### Checkpoint -验证者从邮箱产生称为检查点的认证,这些认证通过 Merkle 根对所有已分派的消息 ID 进行提交。 +验证者从邮箱产生称为检查点的认证,这些认证通过Merkle根对所有已分派的消息ID进行提交。 ```rust pub struct Checkpoint { @@ -349,7 +349,7 @@ pub struct CheckpointWithMessageId { #### Message Processor -中继器将尝试在目标邮箱上处理消息(参见[消息处理器](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/agents/relayer/src/msg/processor.rs#L24))。 如果 +中继器将尝试在目标邮箱上处理消息(参见[message processor](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/agents/relayer/src/msg/processor.rs#L24))。 如果 * 消息接收方 ISM 返回一个未知的模块类型 * 模块类型已知,但元数据验证失败 @@ -372,7 +372,7 @@ pub struct CheckpointWithMessageId { 5. 请注意,验证器观察到该消息在源链上布时,会创建签名,然后中继器通过在目标链上指定验证者的ISM适当地处理您的消息。 -查看[Rust代码库中的端到端测试](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/utils/run-locally/src/main.rs)以获得灵感。 +查看[end-to-end test on the Rust codebase ](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/utils/run-locally/src/main.rs)以获得灵感。 ::: diff --git a/docs/guides/latencies.mdx b/docs/guides/latencies.mdx index 6eeba2ef..3b86f3fe 100644 --- a/docs/guides/latencies.mdx +++ b/docs/guides/latencies.mdx @@ -1,4 +1,4 @@ -# 延迟 +# Latencies 验证者必须等待一定数量的区块被挖掘,才能被视为有效和[reorg-safe](https://www.alchemy.com/overviews/what-is-a-reorg)。如果没有这个,验证者可能会被减持,因为它们可能已经签署了一个不再有效的检查点。 diff --git a/docs/guides/v2-to-v3-migration.mdx b/docs/guides/v2-to-v3-migration.mdx index 9d272dd9..0defde4b 100644 --- a/docs/guides/v2-to-v3-migration.mdx +++ b/docs/guides/v2-to-v3-migration.mdx @@ -8,7 +8,7 @@ ::: -### Mailbox Interface +### Mailbox 接口 Mailbox 的重大版本变更 v3 已经推出,并带来了以下改进: diff --git a/docs/intro.mdx b/docs/intro.mdx index 2e15e3fe..687462c3 100644 --- a/docs/intro.mdx +++ b/docs/intro.mdx @@ -2,13 +2,13 @@ Hyperlane是为模块化区块链堆栈构建的第一个通用且无需许可的互操作层。 -任何人都可以无需许可地将[部署 hyperlane](./deploy-hyperlane.mdx)到任何区块链环境中,无论是1层、Rollup还是应用链,都可以让该链与部署了 Hyperlane 的任何其他链进行无缝通信。 +任何人都可以无需许可地[deploy hyperlane](./deploy-hyperlane.mdx)到任何区块链环境中,无论是1层、Rollup还是应用链,都可以让该链与部署了Hyperlane的任何其他链进行无缝通信。 -Hyperlane的设计考虑到了模块化。特别是,其[跨链安全模块](./protocol/ISM/modular-security.mdx)使开发人员能够控制其安全模型,允许他们根据应用程序的需求配置、组合和定制安全性。 +Hyperlane的设计考虑到了模块化。特别是,其[interchain security modules](./protocol/ISM/modular-security.mdx)使开发人员能够控制其安全模型,允许他们根据应用程序的需求配置、组合和定制安全性。 -使用 Hyperlane,开发人员可以构建跨链应用程序--跨越多个区块链的应用程序。我们拥有适用于多种执行环境的实施方案,并与所有领先的rollup框架兼容。 +使用Hyperlane,开发人员可以构建跨链应用程序--跨越多个区块链的应用程序。我们拥有适用于多种执行环境的实施方案,并与所有领先的rollup框架兼容。 -开箱即用的一些预构建示例包括: +开箱即用的一些预构建示例: 1. Warp Routes:允许原生、ERC20和ERC721代币在链之间无缝移动 2. Interchain accounts:允许一个链上的账户(例如DAO)在远程链上调用智能合约 diff --git a/docs/operate/agent-config.mdx b/docs/operate/agent-config.mdx index 5b0c13a9..2eb65bc6 100644 --- a/docs/operate/agent-config.mdx +++ b/docs/operate/agent-config.mdx @@ -4,11 +4,11 @@ ## 配置layers -1. ”默认部署“的基本配置在 [monorepo](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/config) 中,所有这些配置都会自动加载。 -2. 接下来将加载通过 `CONFIG_FILES` env var 传入的配置文件;该 env var 应该是一个以逗号分隔的 json 文件路径列表,加载顺序为从第一个到最后一个。 -3. 接下来将读取以 `HYP_` 为前缀的环境变量。 -4. `HYP__` 前缀的环境变量将被读取并仅应用于当前代理。例如,`RELAYER`、`VALIDATOR` 和`SCRAPER` 只读取各自的前缀。 -5. 最后读取命令行参数 +1. ”默认部署“的基本配置在 [monorepo](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/config) 中,所有这些配置都会自动加载; +2. 接下来将加载通过 `CONFIG_FILES` env var 传入的配置文件;该 env var 应该是一个以逗号分隔的 json 文件路径列表,加载顺序为从第一个到最后一个; +3. 接下来将读取以 `HYP_` 为前缀的环境变量; +4. `HYP__` 前缀的环境变量将被读取并仅应用于当前代理。例如,`RELAYER`、`VALIDATOR` 和`SCRAPER` 只读取各自的前缀; +5. 最后读取命令行参数。 ## 命令行参数 @@ -37,7 +37,7 @@ `HYP_` 和 `HYP__` 是等效的前缀,唯一的区别在于加载顺序,它们可以引用配置文件中的所有配置值。 -env 名称将是这两个前缀之一,然后是配置值的大写路径组件的下划线分隔路径。 +env名称将是这两个前缀之一,然后是配置值的大写路径组件的下划线分隔路径。 示例: @@ -47,7 +47,7 @@ env 名称将是这两个前缀之一,然后是配置值的大写路径组件 ## 使用 Docker 配置文件 -在 Docker 中运行代理会增加额外的复杂性,因为配置文件需要从 Docker 容器内部访问。可以在[存储库](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/config)中找到的基本配置已经是提供的 Docker 镜像的一部分,并且将默认加载所有配置文件。 +在Docker中运行代理会增加额外的复杂性,因为配置文件需要从Docker容器内部访问。可以在[the repo](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/config)中找到的基本配置已经是提供的 Docker 镜像的一部分,并且将默认加载所有配置文件。 要挂载单个配置文件,可以使用标志 `--mount type=bind,source=$LOCAL_CONFIG_PATH,target=/config/$CONFIG_NAME,readonly`,然后将配置文件添加到 `CONFIG_FILES` 中,以便加载它。 diff --git a/docs/operate/config-reference.mdx b/docs/operate/config-reference.mdx index 321b749e..d7129a5d 100644 --- a/docs/operate/config-reference.mdx +++ b/docs/operate/config-reference.mdx @@ -8,7 +8,7 @@ import TabItem from '@theme/TabItem'; **说明:**(仅限环境变量)要加载的附加配置文件路径列表(例如 `hyperlane-monorepo/rust/config` 中的路径)。它们将按照从第一个到最后一个的顺序进行合并,因此如果第一个和最后一个都指定了特定的配置路径,那么将使用最后一个文件中设置的值。 -这些文件必须在代理程序可以访问的文件系统中可访问。如果您正在运行 Docker,请参阅[代理配置指南](./agent-config.mdx#config-files-with-docker)中有关将配置文件挂载到 Docker 容器中的提示。 +这些文件必须在代理程序可以访问的文件系统中可访问。如果您正在运行Docker,请参阅[代理配置指南](./agent-config.mdx#config-files-with-docker)中有关将配置文件挂载到 Docker 容器中的提示。 **Optional:** Yes @@ -113,7 +113,7 @@ export HYP_CHAINS_ETHEREUM_NAME="ethereum" ## chains.``.domain -**说明:** 用于唯一标识域的超平面域 ID。另请参阅:[域标识符](../reference/domains.mdx)。 +**说明:** 用于唯一标识域的hyperlane域ID。另请参阅:[Domain Identifiers](../reference/domains.mdx)。 **Requires:** 如果是已知域名,则与域名一致。 diff --git a/docs/operate/deploy-with-terraform.mdx b/docs/operate/deploy-with-terraform.mdx index 1b92461f..5dbae0a0 100644 --- a/docs/operate/deploy-with-terraform.mdx +++ b/docs/operate/deploy-with-terraform.mdx @@ -10,7 +10,7 @@ ## 概览 -提供的 Terraform 有几个关键部分: +提供的Terraform有几个关键部分: - IAM/KMS 模块:自动为您完成 [Agent Keys](set-up-agent-keys.mdx)配置。 - S3 模块:自动为您完成 [AWS Signatures Bucket](validators/validator-signatures-aws.mdx) 配置。 @@ -61,9 +61,9 @@ graph LR ## 使用方法 -作为前提条件,您需要安装 Terraform,并使用您的凭据配置 AWS CLI。 +作为前提条件,您需要安装Terraform,并使用您的凭据配置AWS CLI。 -初始化 Terraform 状态: +初始化Terraform状态: ```bash terraform init @@ -81,7 +81,7 @@ terraform plan terraform apply ``` -要列出 KMS、IAM 或 S3 信息等输出,必须解析 JSON 输出: +要列出KMS、IAM 或 S3信息等输出,必须解析JSON输出: ```bash terraform output -json @@ -89,32 +89,32 @@ terraform output -json ## 模块 -Terraform 提供多个模块,您可以选择希望由 terraform 管理验证器设置的哪些部分。 +Terraform提供多个模块,您可以选择希望由terraform管理验证器设置的哪些部分。 ### IAM / KMS -iam_kms "模块会创建一个 IAM 用户和一个 KMS 密钥,用于安全签名操作。它还会设置 IAM 策略和附件,以授予使用 KMS 密钥和其他 AWS 服务(如 S3、EFS 和 ECS)所需的权限。 +`iam_kms`模块会创建一个IAM用户和一个KMS密钥,用于安全签名操作。它还会设置IAM策略和附件,以授予使用KMS密钥和其他AWS服务(如 S3、EFS 和 ECS)所需的权限。 ### S3 -s3 "模块创建一个 S3 bucket,用于存储签名等与验证程序相关的数据。它还设置了管理访问和权限的存储策略,包括公共访问限制和版本管理。 +`s3`模块创建一个S3 bucket,用于存储签名等与验证程序相关的数据。它还设置了管理访问和权限的存储策略,包括公共访问限制和版本管理。 ### EFS -efs 模块定义了 EFS 文件系统和访问点,允许 Validator 应用程序存储和访问 EFS 上的数据。它还设置了一个挂载目标,用于将 EFS 文件系统连接到网络。 +`efs`模块定义了EFS文件系统和访问点,允许Validator应用程序存储和访问EFS上的数据。它还设置了一个挂载目标,用于将EFS文件系统连接到网络。 :::note -只有在使用 `validator` 模块时才需要该模块。 +只有在使用`validator`模块时才需要该模块。 ::: ### Validator -`validator`模块使用上述所有功能整合 EFS、IAM/KMS 和 S3 配置。 +`validator`模块使用上述所有功能整合EFS、IAM/KMS和S3配置。 此外,还有: -- 创建新的 IAM 用户和相关角色以运行验证器。 -- 创建验证器可写入签名的 S3 bucket。 -- 创建 EFS 卷,以便在服务中持久保存数据。 +- 创建新的IAM用户和相关角色以运行验证器。 +- 创建验证器可写入签名的S3 bucket。 +- 创建EFS卷,以便在服务中持久保存数据。 本模块还包括: - 定义一个运行验证器应用程序的ECS任务定义,包括容器定义、卷配置和日志记录。 @@ -122,7 +122,7 @@ efs 模块定义了 EFS 文件系统和访问点,允许 Validator 应用程序 ## 主要配置 -根级配置为网络基础设施设置了 VPC、子网、互联网网关、NAT 网关、路由表和安全组。它还提供了使用 "验证器 "模块的示例。 +根级配置为网络基础设施设置了VPC、子网、互联网网关、NAT 网关、路由表和安全组。它还提供了使用"验证器"模块的示例。 ```terraform module "your_validator_name" { @@ -147,11 +147,11 @@ module "your_validator_name" { ### 输出 -根级别的 `outputs.tf` 从 `main.tf` 中配置的验证器中传递所有输出。**随着您添加、修改或删除验证器,您将需要更新此内容。** +根级别的`outputs.tf`从`main.tf`中配置的验证器中传递所有输出。**随着您添加、修改或删除验证器,您将需要更新此内容。** ### 结构示例 -下图显示了 Validator ECS 集群如何融入顶级网络基础设施。 +下图显示了Validator ECS集群如何融入顶级网络基础设施。 ```mermaid graph TD @@ -193,7 +193,7 @@ graph TD ### PI 配置 -为 PI 链(如您自己部署的 Hyperlane)设置自定义配置值并非易事。 +为PI链(如您自己部署的Hyperlane)设置自定义配置值并非易事。 目前,您可能只需传递一长串环境变量或命令行参数。 ### 单个代理日志 diff --git a/docs/operate/relayer/message-filtering.mdx b/docs/operate/relayer/message-filtering.mdx index dd255231..2979970c 100644 --- a/docs/operate/relayer/message-filtering.mdx +++ b/docs/operate/relayer/message-filtering.mdx @@ -35,7 +35,7 @@ type Wildcard = "*"; 白名单和黑名单都有 "任意 "语义。换句话说,中继器将传送符合_any_个白名单过滤器的信息,并忽略符合_any_个黑名单过滤器的信息。 -例如,将以下配置用作白名单将确保中继器转发发送到以太坊的任何消息、从地址 `0xca7f632e91B592178D83A70B404f398c0a51581F` 发送到 Celo 或 Avalanche 的任何消息,以及发送到 Arbitrum 或 Optimism 上地址 `0xca7f632e91B592178D83A70B404f398c0a51581F` 的任何消息。 +例如,将以下配置用作白名单将确保中继器转发发送到以太坊的任何消息,从地址 `0xca7f632e91B592178D83A70B404f398c0a51581F` 发送到 Celo 或 Avalanche 的任何消息,以及发送到 Arbitrum 或 Optimism 上地址 `0xca7f632e91B592178D83A70B404f398c0a51581F` 的任何消息。 ```json [ diff --git a/docs/operate/relayer/run-relayer.mdx b/docs/operate/relayer/run-relayer.mdx index 703143da..81768c97 100644 --- a/docs/operate/relayer/run-relayer.mdx +++ b/docs/operate/relayer/run-relayer.mdx @@ -1,14 +1,14 @@ # 运行中继器 -一个 Hyperlane [中继器](../../protocol/agents/relayer.mdx) 将跨链消息传递给它们的接收方。 +一个Hyperlane[Relayer](../../protocol/agents/relayer.mdx)将跨链消息传递给它们的接收方。 :::tip -在尝试在生产环境中运行继器之前,我们建议您阅读[**部署本地 Hyperlane 代理**](../../guides/deploy-hyperlane-local-agents.mdx)指南以及[**运行验证者**](../validators/run-validators.mdx)文档。 +在尝试在生产环境中运行继器之前,我们建议您阅读[**Deploy Hyperlane Local Agents**](../../guides/deploy-hyperlane-local-agents.mdx)指南以及[**Run Validators**](../validators/run-validators.mdx)文档。 ::: -每个 Hyperlane 消息需要两个交易来传递,一个在原始链上用于[发送](../../reference/messaging/send.mdx)消息,另一个在目标链上用于[接收](../../reference/messaging/receive.mdx)消息。中继器负责发送第二个交易。 +每个Hyperlane消息需要两个交易来传递,一个在原始链上用于[send](../../reference/messaging/send.mdx)消息,另一个在目标链上用于[receive](../../reference/messaging/receive.mdx)消息。中继器负责发送第二个交易。 ```mermaid flowchart TB @@ -50,7 +50,7 @@ Hyperlane中继器被配置为在一个或多个原始链和目标链之间中 ## 指南 -我们强烈建议您遵循[本地代理指南](../../guides/deploy-hyperlane-local-agents.mdx)以了解如何在本地配置和运行中继器。 +我们强烈建议您查看[local agents guide](../../guides/deploy-hyperlane-local-agents.mdx) 以了解如何在本地配置和运行中继器。 :::info 本地代理设置展示了如何在您的**本地计算机**上运行中继器,这仅用于**测试和开发目的**。 @@ -59,77 +59,77 @@ Hyperlane中继器被配置为在一个或多个原始链和目标链之间中 import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; -### Keys +### 密钥 中继器需要能够向许多目标链提交交易,因此需要访问用于签署交易的密钥。支持两种密钥类型:十六进制私钥(用于内存中签名)和基于 AWS KMS 的密钥(用于生产环境的最佳实践)。 -#### Hexadecimal keys +#### 十六进制密钥 用于内存签名的十六进制私钥可以被您的中继器用于签署交易。这是测试或开发目的的推荐设置。 -#### AWS KMS keys +#### AWS KMS 密钥 AWS KMS密钥可以被您的中继器用于签署交易。这是生产中继器的推荐设置。 :::tip -请查看 [代理密钥](../set-up-agent-keys.mdx) 页面以设置您的十六进制或 AWS KMS 密钥。 +请查看[Agent Keys](../set-up-agent-keys.mdx) 页面以设置您的十六进制或 AWS KMS 密钥。 ::: -### Configuration +### 配置 -像本地设置一样,配置 Relayer 时应提供一些基本参数。 +像本地设置一样,配置Relayer时应提供一些基本参数。 -| Argument | Description | -| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `--relayChains` | 这里指定了要在其间中继消息的源链和目标链的逗号分隔名称。例如:`ethereum,polygon,avalanche`。 | +| 参数 | 说明 | +| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `--relayChains` | 这里指定了要在其间中继消息的源链和目标链的逗号分隔名称。例如:`ethereum,polygon,avalanche`。 | | `--db` | Relayer应该将持久数据写入磁盘的路径。在使用云设置时,请确保该路径是持久的。使用Docker时,请确保将持久路径/卷挂载到容器中。有关更多信息,请参阅[配置参考](../config-reference.mdx#db)。 | | `--allowLocalCheckpointSyncers` | 如果设置为 `true`,Relayer将允许在其本地文件系统上查找验证器签名。在生产环境中,应将此设置为 `false`。如果您按照验证器本地设置说明在同一台计算机上运行验证器,则将其设置为 `true`,以便您的Relayer可以访问本地验证器签名。 | :::info -您的 Relayer 既可以通过命令行参数,也可以通过环境变量进行配置。请查看 [代理配置](../agent-config.mdx) 页面和 [配置参考](../config-reference.mdx) 获取完整的配置可能性列表。 +您的 Relayer 既可以通过命令行参数,也可以通过环境变量进行配置。请查看[agent configuration](../agent-config.mdx)页面和[configuration reference](../config-reference.mdx)获取完整的配置可能性列表。 ::: -当然,您还可以使用 [`CONFIG_FILES` 环境变量](../config-reference.mdx#config_files) 提供额外配置文件的路径,这些路径应该以逗号分隔。如果您选择在 Docker 中运行,请参阅 [代理配置](../agent-config.mdx) 的 Docker 部分,了解如何将您的配置文件挂载到 Docker 容器中的提示。 +当然,您还可以使用 [`CONFIG_FILES` 环境变量](../config-reference.mdx#config_files) 提供额外配置文件的路径,这些路径应该以逗号分隔。如果您选择在 Docker 中运行,请参阅[agent configuration](../agent-config.mdx)的 Docker 部分,了解如何将您的配置文件挂载到 Docker 容器中的提示。 -### Setup-specific configuration +### Setup-specific配置 这些配置要求根据您遵循的密钥设置说明而有所不同。 -如果您创建了一个[十六进制密钥](../set-up-agent-keys.mdx),请像这样配置默认签名者: +如果您创建了一个[hexadecimal key](../set-up-agent-keys.mdx),请像这样配置默认签名者: -| 参数 | 描述 | +| 参数 | 描述 | | --------------------- | -------------------------------------------------------------------------------------------------- | -| `--defaultSigner.key` | 用于为所有链签名交易的十六进制私钥。例如:`1b3dead...beef`。 | +| `--defaultSigner.key` | 用于为所有链签名交易的十六进制私钥。例如:`1b3dead...beef`。 | 如果您创建了一个[使用 AWS KMS 密钥](../set-up-agent-keys.mdx)的配置,请像下面这样配置默认签名者: -| 参数 | 描述 | +| 参数 | 描述 | | ------------------------ | ----------------------------------------------------------------------------------------------------------- | -| `--defaultSigner.type` | 设置为 `aws`。 | -| `--defaultSigner.id` | 您的 Relayer 的 AWS KMS 密钥的别名,前缀为 `alias/`。例如:`alias/hyperlane-relayer-1`。| -| `--defaultSigner.region` | 您的 AWS KMS 密钥的地区。例如:`us-east-1`。 | +| `--defaultSigner.type` | 设置为 `aws`。 | +| `--defaultSigner.id` | 您的 Relayer 的 AWS KMS 密钥的别名,前缀为 `alias/`。例如:`alias/hyperlane-relayer-1`。 | +| `--defaultSigner.region` | 您的 AWS KMS 密钥的地区。例如:`us-east-1`。 | -对于特定链的签名者(即自定义要为每个链使用的密钥),请参阅[配置参考](../config-reference.mdx)。 +对于特定链的签名者(即自定义要为每个链使用的密钥),请参阅[configuration reference](../config-reference.mdx)。 -## Start Relaying +## 部署中继 -### Setup +### 安装 -在生产环境中推荐的安装方法是使用 Docker 镜像。 +在生产环境中推荐的安装方法是使用Docker镜像。 -首先下载 docker 映像: +首先下载docker映像: ```bash docker pull gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519 @@ -140,13 +140,13 @@ docker pull gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519 **克隆和安装** -首先克隆 Hyperlane monorepo: +首先克隆Hyperlane monorepo: ```sh git clone git@github.com:hyperlane-xyz/hyperlane-monorepo.git ``` -然后按照 `rust` 目录中的[设置说明](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md)进行操作。这将设置 `rustup`,如果您使用的是 Apple Silicon,则还会设置 Rosetta 2。 +然后按照`rust`目录中的[设置说明](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/rust/README.md)进行操作。这将设置`rustup`,如果您使用的是 Apple Silicon,则还需要安装 Rosetta 2。 ```sh # 安装 rustup @@ -165,7 +165,7 @@ cargo build --release bin relayer -### Running the agent +### 运行代理 如果中继器的密钥是通过 AWS KMS 配置的,则必须将 AWS 访问密钥和秘密作为环境变量提供。 @@ -174,12 +174,12 @@ cargo build --release bin relayer | `AWS_ACCESS_KEY_ID` | 中继器的 AWS IAM 用户的访问密钥 ID。 | | `AWS_SECRET_ACCESS_KEY` | 中继器 AWS IAM 用户的访问密钥。 | -如需再次进行了解,请查阅[代理密钥](../set-up-agent-keys.mdx)指南。 +如需再次进行了解,请查阅[Agent Keys](../set-up-agent-keys.mdx)指南。 -然后使用相关参数启动容器。例如,您的 AWS 配置如下所示: +然后使用相关参数启动容器。例如,您的AWS配置如下所示: ```sh docker run \ @@ -198,9 +198,9 @@ docker run \ :::tip -如果您正在同一台机器上使用本地设置运行验证器,并且正在运行一个本地中继以访问这些验证器签名,请确保将您本地验证器的签名目录 [挂载](https://docs.docker.com/storage/bind-mounts/) 到您的中继中,路径应与您在 [announce Validator](../validators/run-validators.mdx#Announcing-your-validator) 时使用的路径相同。 +如果您正在同一台机器上使用本地设置运行验证器,并且正在运行一个本地中继以访问这些验证器签名,请确保将您本地验证器的签名目录[mount](https://docs.docker.com/storage/bind-mounts/)(挂载)到您的中继中,路径应与您在 [announce Validator](../validators/run-validators.mdx#Announcing-your-validator) 时使用的路径相同。 - 例如,如果您的本地验证器正在将签名写入 `/tmp/hyperlane-validator-signatures-ethereum`,您应该为 Docker 容器挂载一个目录: +例如,如果您的本地验证器正在将签名写入`/tmp/hyperlane-validator-signatures-ethereum`,您应该为Docker容器挂载一个目录: ```sh docker run \ @@ -222,7 +222,7 @@ docker run \ -查看这些说明以了解如何在没有 Docker 的情况下从源代码构建。 +查看这些说明以了解如何在没有Docker的情况下从源代码构建。 我们可以从`hyperlane-monorepo/rust`目录中运行构建好的二进制文件。 @@ -243,6 +243,6 @@ export AWS_SECRET_ACCESS_KEY=xX-haha-nice-try-Xx -## Indexing +## 索引 Relayer需要索引所有原始链的历史消息。这些信息存储在本地磁盘上的数据库中(在配置中设置为`db`)。这意味着首次运行Relayer可能需要一些额外的时间来与当前状态同步。 diff --git a/docs/operate/run-docker-compose.mdx b/docs/operate/run-docker-compose.mdx index f1ace21d..35e01619 100644 --- a/docs/operate/run-docker-compose.mdx +++ b/docs/operate/run-docker-compose.mdx @@ -1,8 +1,8 @@ # 使用 Docker Compose 运行 -有时,不依赖冗长的 Docker 命令也是不错的选择。使用 Docker compose 运行与使用原始 Docker 非常相似,你可以在 [Docker docs](https://docs.Docker.com/compose/compose-file/) 中找到完整的格式说明。 +有时,不依赖冗长的Docker命令也是不错的选择。使用Docker compose运行与使用原始Docker非常相似,你可以在[Docker docs](https://docs.Docker.com/compose/compose-file/)中找到完整的格式说明。 -这是一个运行验证器的 `docker-compose` 文件示例,应该能帮你完成大部分工作。 +这是一个运行验证器的`docker-compose`文件示例,应该能帮你完成大部分工作。 ```json { @@ -48,6 +48,6 @@ configs: 上面有很多填充值,您需要用真实值更新这些填充值。 -您还可以指定多个服务,因此如果要运行多个验证器,可以在 `services` 下指定每个验证器。 +您还可以指定多个服务,因此如果要运行多个验证器,可以在`services`下指定每个验证器。 -要运行编译配置,请使用 `docker compose up` 和 `docker compose down` 进行清理。关于命令行的完整文档可以在 [docker 网站](https://docs.docker.com/engine/reference/commandline/compose/) 上找到。 +要运行编译配置,请使用`docker compose up`和`docker compose down`进行清理。关于命令行的完整文档可以在[docker 网站](https://docs.docker.com/engine/reference/commandline/compose/)上找到。 diff --git a/docs/operate/set-up-agent-keys.mdx b/docs/operate/set-up-agent-keys.mdx index 7134773c..f870c896 100644 --- a/docs/operate/set-up-agent-keys.mdx +++ b/docs/operate/set-up-agent-keys.mdx @@ -3,9 +3,9 @@ import TabItem from '@theme/TabItem'; # 代理密钥 -Hyperlane 代理(验证器和中继器)必须配置私钥才能运行。验证器使用私钥签署[message checkpoints](../reference/glossary.mdx#checkpoint),中继器使用私钥签署传递信息的事务。 +Hyperlane代理(验证器和中继器)必须配置私钥才能运行。验证器使用私钥签署[message checkpoints](../reference/glossary.mdx#checkpoint),中继器使用私钥签署传递信息的事务。 -Hyperlane 代理目前支持通过两种方式之一配置私钥。 +Hyperlane代理目前支持通过两种方式之一配置私钥。 ## 1. 十六进制密钥 @@ -13,7 +13,7 @@ Hyperlane 代理目前支持通过两种方式之一配置私钥。 :::warning -不建议在生产环境中使用十六进制密钥。请使用 AWS KMS 密钥。 +不建议在生产环境中使用十六进制密钥。请使用AWS KMS密钥。 ::: @@ -38,7 +38,7 @@ Private Key: 0x2958f0eb2ab71bbfb5ea1422835e20e488778b61e3c107f369572e2b53b578f9 ```
-您可以访问 [https://privatekeys.pw/keys/ethereum/random](https://privatekeys.pw/keys/ethereum/random),它会自动显示十六进制私钥及其地址的列表。 +您可以访问[https://privatekeys.pw/keys/ethereum/random](https://privatekeys.pw/keys/ethereum/random),它会自动显示十六进制私钥及其地址的列表。 :::warning @@ -50,16 +50,16 @@ Private Key: 0x2958f0eb2ab71bbfb5ea1422835e20e488778b61e3c107f369572e2b53b578f9 ## 2. AWS KMS -由 AWS 生成并存储在 CloudHSM 中的密钥。这是生产代理,尤其是验证器的推荐设置。 +由AWS生成并存储在CloudHSM中的密钥。这是生产代理,尤其是验证器的推荐设置。 ### 创建 IAM 用户 -该 IAM 用户将被授权使用稍后配置的 KMS 密钥签名。Hyperlane 代理在签署事务时将使用此身份。 +该IAM用户将被授权使用稍后配置的KMS密钥签名。Hyperlane代理在签署事务时将使用此身份。 -1. 访问 [AWS console](https://us-east-1.console.aws.amazon.com/iamv2/home) 中的 AWS 身份和访问管理 (IAM); -2. 在左侧 "Access management "下点击 "Users"; +1. 访问[AWS console](https://us-east-1.console.aws.amazon.com/iamv2/home) 中的AWS身份和访问管理(IAM); +2. 在左侧"Access management"下点击"Users"; 3. 点击蓝色的"Add users"按钮; -4. 选择一个友好而具有关联性的用户名,比如 `hyperlane-validator-${chain_name}` 或 `hyperlane-relayer-${chain_name}`。此用户名将在将来的步骤中被引用,所以如果你选择了不同的用户名,请确保将来使用你的正确用户名; +4. 选择一个友好而具有关联性的用户名,比如`hyperlane-validator-${chain_name}`或`hyperlane-relayer-${chain_name}`。此用户名将在将来的步骤中被引用,所以如果你选择了不同的用户名,请确保将来使用你的正确用户名; 5. 点击 "Next",您无需为用户分配任何权限; 6. 点击“Create User”; 7. 点击进入刚刚创建的用户; @@ -74,8 +74,8 @@ Private Key: 0x2958f0eb2ab71bbfb5ea1422835e20e488778b61e3c107f369572e2b53b578f9 您的代理将使用此密钥进行签名。 -1. 访问 AWS 控制台中的 AWS 密钥管理服务 (KMS); -2. 确保您处于要创建密钥的地区。这可以通过查看控制台右上角的区域,或查找 URL 子域中的名称来确认(例如,"us-west-2.console.aws.amazon.com "表示您在 "us-west-2 "区域中运行); +1. 访问AWS控制台中的AWS密钥管理服务(KMS); +2. 确保您处于要创建密钥的地区。这可以通过查看控制台右上角的区域,或查找URL子域中的名称来确认(例如,"us-west-2.console.aws.amazon.com "表示您在 "us-west-2 "区域中运行); 3. 点击左侧的“Customer managed keys”; 4. 点击“Create key”; 5. 选择“Asymmetric”密钥类型; diff --git a/docs/operate/validators/run-validators.mdx b/docs/operate/validators/run-validators.mdx index 0f29e2ff..22cf7ba1 100644 --- a/docs/operate/validators/run-validators.mdx +++ b/docs/operate/validators/run-validators.mdx @@ -4,11 +4,11 @@ :::tip -有经验的操作员可能更喜欢使用 terraform 部署代理。此过程将自动创建代理密钥、Validator buckets、权限以及在 AWS 上运行 Validator 集群所需的任何其他辅助设置。 +有经验的操作员可能更喜欢使用terraform部署代理。此过程将自动创建代理密钥、Validator buckets、权限以及在AWS上运行Validator集群所需的任何其他辅助设置。 ::: -Hyperlane[Validators](../../protocol/agents/validators.mdx) 与其他验证器没有网络连接,也不会定期提交事务。Hyperlane验证器是基于每个源链运行的,这些说明是针对单个链编写的。 +Hyperlane[Validators](../../protocol/agents/validators.mdx)与其他验证器没有网络连接,也不会定期提交事务。Hyperlane验证器是基于每个源链运行的,这些说明是针对单个链编写的。 ```mermaid flowchart TB @@ -74,11 +74,11 @@ flowchart TB - 公共可读存储 - - 验证器将它们的签名离线写入公开访问且高可用的存储中,以便由[中继器](../../protocol/agents/relayer.mdx)进行聚合。 + - 验证器将它们的签名离线写入公开访问且高可用的存储中,以便由[Relayer](../../protocol/agents/relayer.mdx)进行聚合。 - Hyperlane验证器代理当前支持使用上述相同的AWS API密钥将签名存储在AWS S3上,同时也支持将签名存储在本地文件系统中以进行测试。 - 可运行的机器 - - 验证者可以自己编译 Rust 二进制文件,也可以运行 Abacus Works 提供的 Docker 镜像。二进制文件可以使用你喜欢的云服务运行。由于 Hyperlane 没有 "双重签名 "的概念,你甚至可以在不同区域运行多个实例,以实现高可用性。 + - 验证者可以自己编译Rust二进制文件,也可以运行Abacus Works提供的Docker镜像。二进制文件可以使用你喜欢的云服务运行。由于Hyperlane没有"双重签名"的概念,你甚至可以在不同区域运行多个实例,以实现高可用性。 import Tabs from "@theme/Tabs"; import TabItem from "@theme/TabItem"; @@ -102,7 +102,7 @@ import TabItem from "@theme/TabItem"; ## 配置 -与本地设置一样,在配置 Validator 时也需要提供一些基本参数。 +与本地设置一样,在配置Validator时也需要提供一些基本参数。 | 参数 | 说明 | | ------------------------------------------ | ------------------------------------------------------------------------------------------------------- | @@ -117,7 +117,7 @@ import TabItem from "@theme/TabItem"; ::: -当然,您还可以通过使用逗号分隔的方式将附加配置文件的路径提供给 [`CONFIG_FILES` environment variable](../config-reference.mdx#config_files)。如果您选择在 Docker 中运行,请查看[agent configuration](../agent-config.mdx)中的 Docker 部分,了解如何将配置文件挂载到您的 Docker 容器中的提示。 +当然,您还可以通过使用逗号分隔的方式将附加配置文件的路径提供给[`CONFIG_FILES` environment variable](../config-reference.mdx#config_files)。如果您选择在Docker运行,请查看[agent configuration](../agent-config.mdx)中的Docker部分,了解如何将配置文件挂载到您的Docker容器中的提示。 ### 设置特定的配置 @@ -159,7 +159,7 @@ import TabItem from "@theme/TabItem"; :::warning -请注意,中继器***必须配置为"--allowLocalCheckpointSyncers",才能从该验证器读取签名。 +请注意,中继器**必须**配置为`--allowLocalCheckpointSyncers`,才能从该验证器读取签名。 ::: @@ -179,7 +179,7 @@ import TabItem from "@theme/TabItem"; ### 安装 -生产环境的推荐安装方法是使用 Docker 映像。 +生产环境的推荐安装方法是使用Docker映像。 @@ -195,7 +195,7 @@ docker pull gcr.io/abacus-labs-dev/hyperlane-agent:3bb4d87-20240129-164519 **克隆并安装** -首先,克隆 Hyperlane monorepo: +首先,克隆Hyperlane monorepo: ```sh git clone git@github.com:hyperlane-xyz/hyperlane-monorepo.git @@ -222,19 +222,19 @@ cargo build --release bin validator ### 运行源代码 -对于将其签名写入 S3 存储并配置了 AWS KMS 密钥的生产验证器,您需要提供 AWS 访问密钥和密钥作为环境变量。 +对于将其签名写入S3存储并配置了AWS KMS密钥的生产验证器,您需要提供AWS访问密钥和密钥作为环境变量。 | 环境变量 | 说明 | | ----------------------- | ------------------------------------------------------- | | `AWS_ACCESS_KEY_ID` | 您的验证器的 AWS IAM 用户的访问密钥 ID。 | | `AWS_SECRET_ACCESS_KEY` | 验证器的 AWS IAM 用户的访问密钥。 | -如果是新手,请查看 [Agent Keys](../set-up-agent-keys.mdx) 指南。 +如果是新手,请查看[Agent Keys](../set-up-agent-keys.mdx)指南。 -然后使用相关参数启动容器。例如,您的 AWS 配置: +然后使用相关参数启动容器。例如,您的AWS配置: ```sh docker run \ @@ -260,9 +260,9 @@ docker run \ -请参阅这些说明,了解如何在不使用 Docker 的情况下从源代码构建。 +请参阅这些说明,了解如何在不使用Docker的情况下从源代码构建。 -我们可以在 `hyperlane-monorepo/rust` 目录下运行构建的二进制文件: +我们可以在`hyperlane-monorepo/rust`目录下运行构建的二进制文件: ```sh # 设置AWS环境变量 @@ -292,7 +292,7 @@ export AWS_SECRET_ACCESS_KEY=xX-haha-nice-try-Xx ## 公布您的验证器 -[Relayer](../relayer/run-relayer.mdx) 需要知道在哪里可以找到验证器的签名。您的验证器将自动尝试通过写入您正在验证的链上的 `ValidatorAnnounce` 合约来公布自己。 +[Relayer](../relayer/run-relayer.mdx)需要知道在哪里可以找到验证器的签名。您的验证器将自动尝试通过写入您正在验证的链上的`ValidatorAnnounce`合约来公布自己。 为此,您的验证器必须有少量代币来支付此次交易的燃料费。 @@ -300,7 +300,7 @@ export AWS_SECRET_ACCESS_KEY=xX-haha-nice-try-Xx ## 成功 -验证器将索引原始Mailbox的消息。如果消息已发送,则应该看到验证器已对其进行签名的日志消息。如果一切都配置正确,你应该看到 JSON 文件被写入你的 S3 存储(如果你按照 AWS 设置进行了配置),或者写入你的本地签名目录(如果你按照本地设置进行了配置)。每次插入新的出站消息时都会写入新的 JSON 文件。 +验证器将索引原始Mailbox的消息。如果消息已发送,则应该看到验证器已对其进行签名的日志消息。如果一切都配置正确,你应该看到JSON文件被写入你的S3存储(如果你按照AWS设置进行了配置),或者写入你的本地签名目录(如果你按照本地设置进行了配置)。每次插入新的出站消息时都会写入新的JSON文件。 ## 运行多个验证器 diff --git a/docs/operate/validators/validator-signatures-aws.mdx b/docs/operate/validators/validator-signatures-aws.mdx index a878091c..6023f745 100644 --- a/docs/operate/validators/validator-signatures-aws.mdx +++ b/docs/operate/validators/validator-signatures-aws.mdx @@ -4,9 +4,9 @@ :::info -这些说明适用于验证器密钥存在于 AWS 的密钥管理服务中、验证器签名公开发布在S3存储中的生产环境。 +这些说明适用于验证器密钥存在于AWS的密钥管理服务中、验证器签名公开发布在S3存储中的生产环境。 -如果您只打算为测试或开发目的运行验证器,请考虑按照 [本地设置指南](../../guides/deploy-hyperlane-local-agents.mdx) 进行操作。 +如果您只打算为测试或开发目的运行验证器,请考虑按照[local setup guide](../../guides/deploy-hyperlane-local-agents.mdx)进行操作。 ::: @@ -18,31 +18,31 @@ 您的验证者将把它们的签名发布到此存储中。 -1. 转到 AWS 控制台中的 AWS S3。 -2. 在右侧点击橙色的 "Create Bucket "按钮 -3. 选择一个信息详实的bucket名称,例如`hyperlane验证器签名-${validator_name}-${chain_name}` -4. 考虑选择与上一步创建的 KMS 密钥相同的区域。 -5. 保持对象所有权的推荐设置为“ACLs disabled”。 -6. 配置公共访问设置,以便中继器可以读取您的签名。 -1. 取消选中“Block all public access” -2. 勾选前两个选项,阻止通过访问控制列表进行访问。 -3. 不要勾选最后两个选项,我们将通过存储策略授予公共读取权限。 -4. 请注意,这些设置可能导致公众可以访问您的存储。 +1. 转到AWS控制台中的AWS S3; +2. 在右侧点击橙色的"Create Bucket"按钮; +3. 选择一个信息详实的bucket名称,例如`hyperlane验证器签名-${validator_name}-${chain_name}`; +4. 考虑选择与上一步创建的KMS密钥相同的区域; +5. 保持对象所有权的推荐设置为“ACLs disabled”; +6. 配置公共访问设置,以便中继器可以读取您的签名; +1. 取消选中“Block all public access”; +2. 勾选前两个选项,阻止通过访问控制列表进行访问; +3. 不要勾选最后两个选项,我们将通过存储策略授予公共读取权限; +4. 请注意,这些设置可能导致公众可以访问您的存储; 11. 剩下的默认设置都可以,点击底部的橙色“Create bucket”按钮。 ### 3. 配置S3C存储权限 -您的验证器 IAM 用户将需要写入权限,并且应该可以通过中继器公开读取。 +您的验证器IAM用户将需要写入权限,并且应该可以通过中继器公开读取。 -1. 请返回 AWS 控制台中的 "Identity and Access Management (IAM)" 页面。 -2. 在 "IAM resources" 下,您应该至少看到一个 "User",点击进入该用户。 -3. 点击您之前配置的用户的名称(例如 `hyperlane-validator-${chain_name}`)。 -4. 将“User ARN”复制到剪贴板中,它应该类似于 `arn:aws:iam::791444913613:user/hyperlane-validator-${chain_name}`。 -5. 返回 AWS 控制台中的 "S3" 页面。 -6. 点击您刚刚创建的存储的名称。 -7. 在存储名称下方,点击 "Permissions"。 -8. 向下滚动到 "Bucket policy",然后点击 "Edit"。 -9. 输入以下内容。Bucket ARN就显示在输入策略的上方 +1. 请返回AWS控制台中的"Identity and Access Management (IAM)"页面; +2. 在 "IAM resources" 下,您应该至少看到一个 "User",点击进入该用户; +3. 点击您之前配置的用户的名称(例如 `hyperlane-validator-${chain_name}`); +4. 将“User ARN”复制到剪贴板中,它应该类似于 `arn:aws:iam::791444913613:user/hyperlane-validator-${chain_name}`; +5. 返回 AWS 控制台中的 "S3" 页面; +6. 点击您刚刚创建的存储的名称; +7. 在存储名称下方,点击 "Permissions"; +8. 向下滚动到 "Bucket policy",然后点击 "Edit"; +9. 输入以下内容。Bucket ARN就显示在输入策略的上方。 ```json { @@ -77,6 +77,6 @@ :::tip -高级用户可以考虑使用[S3 Terraform 模块](../deploy-with-terraform.mdx#iam--kms)来创建具有正确权限的 S3 存储。 +高级用户可以考虑使用[S3 terraform module](../deploy-with-terraform.mdx#iam--kms)来创建具有正确权限的S3存储。 ::: diff --git a/docs/partials/deploy-hyperlane/_deploy-contracts.mdx b/docs/partials/deploy-hyperlane/_deploy-contracts.mdx index 032d61d3..b958c52d 100644 --- a/docs/partials/deploy-hyperlane/_deploy-contracts.mdx +++ b/docs/partials/deploy-hyperlane/_deploy-contracts.mdx @@ -1,4 +1,4 @@ -设置好部署器、验证器和中继器密钥后,就可以使用 Hyperlane CLI 将智能合约部署到本地和远程链上了。 +设置好部署器、验证器和中继器密钥后,就可以使用Hyperlane CLI将智能合约部署到本地和远程链上了。 在本地链上,我们将进行部署: @@ -12,20 +12,20 @@ ### 设置 -首先,使用NPM 安装 [Hyperlane CLI](https://www.npmjs.com/package/@hyperlane-xyz/cli)。需要 [Node 16](https://nodejs.org/en/download) 或以上版本。以下命令将在你的机器上全局安装。请参阅 [package page](https://www.npmjs.com/package/@hyperlane-xyz/cli)了解临时安装或从源代码构建等其他方法。 +首先,使用NPM安装[Hyperlane CLI](https://www.npmjs.com/package/@hyperlane-xyz/cli)。需要[Node 16](https://nodejs.org/en/download) 或以上版本。以下命令将在你的机器上全局安装。请参阅[package page](https://www.npmjs.com/package/@hyperlane-xyz/cli)了解临时安装或从源代码构建等其他方法。 ```bash npm install -g @hyperlane-xyz/cli ``` -接下来,确定本地链和远程链需要哪些自定义链配置。任何已经包含在 Hyperlane SDK 中的链都不需要链配置(但如果想覆盖默认设置,可以选择使用)。 -运行以下命令查看默认 SDK 链: +接下来,确定本地链和远程链需要哪些自定义链配置。任何已经包含在Hyperlane SDK中的链都不需要链配置(但如果想覆盖默认设置,可以选择使用)。 +运行以下命令查看默认SDK链: ```bash hyperlane chains list ``` -您可以按空格键选择链。对于需要自定义配置的链,可以使用 JSON 或 YAML 手动定义(请参阅 [配置示例](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/chain-config.yaml)),或使用以下命令创建: +您可以按空格键选择链。对于需要自定义配置的链,可以使用JSON或YAML手动定义(请参阅 [配置示例](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/chain-config.yaml)),或使用以下命令创建: ```bash hyperlane config create chain @@ -44,7 +44,7 @@ hyperlane config create ism ### 部署 -现在我们准备使用 `deploy core` 命令部署 Hyperlane 合约。为了支付交易费用,该命令将需要来自步骤 1 的合约部署者密钥,可以通过 `HYP_KEY` 环境变量或作为命令参数提供。 +现在我们准备使用`deploy core`命令部署Hyperlane合约。为了支付交易费用,该命令将需要来自步骤1的合约部署者密钥,可以通过`HYP_KEY`环境变量或作为命令参数提供。 ```bash hyperlane deploy core \ @@ -58,6 +58,6 @@ hyperlane deploy core \ ### 验证 -部署合同构件默认将写入 `artifacts/` 文件夹。部署程序将创建两个带时间戳的文件,即 `agent-config-{timestamp}.json` 和 `core-deployment-{timestamp}.json +部署合同构件默认将写入`artifacts/`文件夹。部署程序将创建两个带时间戳的文件,即`agent-config-{timestamp}.json`和`core-deployment-{timestamp}.json` `core-deployment` 文件包含按链排列的核心合约地址。 -`agent-config` 文件包含下一步运行 Hyperlane 代理所需的数据。 +`agent-config` 文件包含下一步运行Hyperlane代理所需的数据。 diff --git a/docs/partials/deploy-hyperlane/_deploy-warp-route.mdx b/docs/partials/deploy-hyperlane/_deploy-warp-route.mdx index b685d4ed..40d8084f 100644 --- a/docs/partials/deploy-hyperlane/_deploy-warp-route.mdx +++ b/docs/partials/deploy-hyperlane/_deploy-warp-route.mdx @@ -12,14 +12,14 @@ hyperlane config create warp hyperlane deploy warp --key $PRIVATE_KEY ``` -完成后,CLI 将创建两个新的 JSON 构件文件: warp-deployment-{timestamp}.json "和 "warp-ui-token-config-{timestamp}"。第一个文件只包含新部署的 Warp 路由器合约的地址。第二个是 Warp UI 的配置文件,可用于下一个可选步骤。 +完成后,CLI将创建两个新的JSON构件文件:`warp-deployment-{timestamp}.json`和`warp-ui-token-config-{timestamp}`。第一个文件只包含新部署的Warp路由器合约的地址。第二个是Warp UI的配置文件,可用于下一个可选步骤。 :::tip -请参阅详细的[**Deploy Warp Guide**](/docs/guides/deploy-warp-route)了解更多基本概念以及如何设置 Warp 路由以传输令牌。 +请参阅详细的[**Deploy Warp Guide**](/docs/guides/deploy-warp-route)了解更多基本概念以及如何设置Warp路由以传输令牌。 ::: ### 部署 Warp UI -Warp UI 是用于与 Warp Routes 交互的 DApp 模板。您可以克隆 [Warp UI repo](https://github.com/hyperlane-xyz/hyperlane-warp-ui-template) 并按照 CUSTOMIZE.md 中的说明配置新实例。简而言之,使用前面步骤中的 `chains.yaml` 和 `warp-ui-token-config.json` 文件为用户界面提供所需的信息。有关分步说明,请参阅 [**Deploy Warp UI guide**](/docs/guides/deploy-warp-route-UI) 。 +Warp UI是用于与Warp Routes交互的DApp 模板。您可以克隆[Warp UI repo](https://github.com/hyperlane-xyz/hyperlane-warp-ui-template) 并按照 CUSTOMIZE.md 中的说明配置新实例。简而言之,使用前面步骤中的 `chains.yaml` 和 `warp-ui-token-config.json` 文件为用户界面提供所需的信息。有关分步说明,请参阅 [**Deploy Warp UI guide**](/docs/guides/deploy-warp-route-UI) 。 diff --git a/docs/partials/deploy-hyperlane/_send-test-messages.mdx b/docs/partials/deploy-hyperlane/_send-test-messages.mdx index bf1ac94c..bd6fa162 100644 --- a/docs/partials/deploy-hyperlane/_send-test-messages.mdx +++ b/docs/partials/deploy-hyperlane/_send-test-messages.mdx @@ -1,5 +1,5 @@ 您可以在成对的链之间发送测试消息,检查一切工作是否正常。 -使用 CLI 启动信息。它会要求提供一组要使用的核心部署构件。选择步骤 2 中的 `core-deployments` JSON 文件。 +使用CLI启动信息。它会要求提供一组要使用的核心部署构件。选择步骤2中的`core-deployments`JSON 文件。 ```bash hyperlane send message --key $PRIVATE_KEY diff --git a/docs/partials/deploy-hyperlane/_setup-keys.mdx b/docs/partials/deploy-hyperlane/_setup-keys.mdx index fe8695b1..efeae11f 100644 --- a/docs/partials/deploy-hyperlane/_setup-keys.mdx +++ b/docs/partials/deploy-hyperlane/_setup-keys.mdx @@ -9,42 +9,39 @@ - - - + + + - - - + + + - + - +
Key RoleDescriptionFunding Needs密钥角色说明资金需求
Contract Deployer32 byte hexadecimal private keyFunded on all the chains on which we need to deploy contracts.合约部署者32字节十六进制私钥在我们需要部署合约的所有链上提供资金。
Validator Accounts验证者账户 - A list of validator addresses that will sign outbound messages from your - local chain. Just one validator works to get started quickly. + 将对本地链中的出站消息进行签名的验证器地址列表。只需一个验证器就可以快速启动。 - A small amount so validators can announce the location of their - signatures onchain with a one-time transaction + 只需少量,这样验证者就可以通过一次性交易在链上公布他们的签名位置
Relayer Accounts中继器账户 - The single relayer you will operate requires an account on each chain it - will deliver messages to & from + 您将操作的单个中继器需要在它将发送消息的每个链上都有一个帐户 - The relayer must have a balance on all chains it's relaying between. + 中继器必须在它所传递的所有链上持有余额。
-有关如何生成密钥的说明,请参阅[agent keys](/docs/operate/set-up-agent-keys) 部分。部署程序密钥**must**是十六进制密钥,而验证器和中继程序密钥可以是十六进制或AWS KMS。 +有关如何生成密钥的说明,请参阅[agent keys](/docs/operate/set-up-agent-keys) 部分。部署程序密钥**必须**是十六进制密钥,而验证器和中继程序密钥可以是十六进制或AWS KMS。 如果使用 [Foundry's Anvil](https://github.com/foundry-rs/foundry/tree/master/anvil) 在本地网络上进行部署,请使用以下命令为新生成的帐户提供资金。 它使用预先注入资金的私钥之一将 1 ETH 转移到“$YOUR_TARGET_ADDRESS”环境变量中的地址。 diff --git a/docs/partials/deploy-hyperlane/_terminology.mdx b/docs/partials/deploy-hyperlane/_terminology.mdx index d6579b45..a16e93d3 100644 --- a/docs/partials/deploy-hyperlane/_terminology.mdx +++ b/docs/partials/deploy-hyperlane/_terminology.mdx @@ -1,5 +1,5 @@ ## 术语表 -**本地链**是您要部署Hyperlane的新链。 +**local chain**:是您要部署Hyperlane的新链。 -**远程链**是指已部署 Hyperlane 的链,您希望本地链与之收发信息。 +**remote chain**:是指已部署 Hyperlane 的链,您希望本地链与之收发信息。 diff --git a/docs/partials/ts-sdk-placeholder.mdx b/docs/partials/ts-sdk-placeholder.mdx index 09511256..1fa3e605 100644 --- a/docs/partials/ts-sdk-placeholder.mdx +++ b/docs/partials/ts-sdk-placeholder.mdx @@ -1,3 +1,3 @@ -对于希望为自己的项目进一步定制 Warp UI 或构建自己的跨链应用程序的开发人员,我们鼓励您探索 [Typescript SDK](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/typescript/sdk)。 +对于希望为自己的项目进一步定制Warp UI或构建自己的跨链应用程序的开发人员,我们鼓励您探索 [Typescript SDK](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/typescript/sdk)。 -SDK 包含一系列实用工具和抽象概念,用于在不同协议(EVM、Cosmos、Solana)之间与 Hyperlane 进行交互。 \ No newline at end of file +SDK包含一系列实用工具和抽象概念,用于在不同协议(EVM、Cosmos、Solana)之间与Hyperlane进行交互。 \ No newline at end of file diff --git a/docs/protocol/ISM/aggregation-ISM.mdx b/docs/protocol/ISM/aggregation-ISM.mdx index 90c75a06..0bf672d9 100644 --- a/docs/protocol/ISM/aggregation-ISM.mdx +++ b/docs/protocol/ISM/aggregation-ISM.mdx @@ -1,8 +1,8 @@ # Aggregation ISM -开发人员可以使用 `AggregationISM`来聚合来自多种ISMs的安全性。简单地说,`AggregationISM`要求`n` 中的`m`验证特定的链间信息。 +开发人员可以使用`AggregationISM`来聚合来自多种ISMs的安全性。简单地说,`AggregationISM`要求`n`中的`m`个来验证特定的链间信息。 -开发人员可以为每个起源链配置一组`n` ISMs,以及验证一条消息所需的ISMs数量。 +开发人员可以为每个起源链配置一组`n`个ISMs,以及验证一条消息所需的ISMs数量。 `AggregationISM`可以聚合任何ISMs的安全性。例如,用户可以部署具有自己验证器集的 [Multisig ISM](multisig-ISM.mdx),并部署一个聚合ISM,将该ISM与Hyperlane默认ISM聚合在一起。 diff --git a/docs/protocol/ISM/ccip-read-ISM.mdx b/docs/protocol/ISM/ccip-read-ISM.mdx index a8907f03..dfbabe01 100644 --- a/docs/protocol/ISM/ccip-read-ISM.mdx +++ b/docs/protocol/ISM/ccip-read-ISM.mdx @@ -4,7 +4,7 @@ 对于CCIP Read ISM要记住的一个警告是,它们确实引入了对外部(到区块链)但自托管的API的依赖。如果这对您的用例来说是一个困难的障碍,您可能需要考虑其他消息验证技术。 -在构建CCIP Read ISM之前,您有必要熟悉[CCIP Read规范](https://eips.ethereum.org/EIPS/eip-3668)。该规范描述了一种通用协议,允许EVM兼容链上的智能合约查询和消费链下数据。 +在构建CCIP Read ISM之前,您有必要熟悉[CCIP Read specification](https://eips.ethereum.org/EIPS/eip-3668)。该规范描述了一种通用协议,允许EVM兼容链上的智能合约查询和消费链下数据。 ## 它是如何工作的 @@ -69,7 +69,7 @@ interface ICcipReadIsm is IInterchainSecurityModule { 中继器会将这个`data`属性作为`metadata`参数传递给`Mailbox.Process ` (bytes metadata, bytes message)。 -请注意,在链式ISM的情况下,数据的接收方也充当验证ISM, `data`只是发送的原始交易,以提交具有相关签名的价格数据。`message`属性有些多余。 +请注意,在链式ISM的情况下,数据的接收方也充当验证ISM,`data`只是发送的原始交易,以提交具有相关签名的价格数据。`message`属性有些多余。 ### 合约 @@ -77,7 +77,7 @@ interface ICcipReadIsm is IInterchainSecurityModule { - `getOffchainVerifyInfo`函数应该返回一个`OffchainLookup`错误,指示中继器查询给定的API端点。`OffchainLookup`错误允许提供一组API端点,因此你可以强制执行你想要的任何级别的冗余 -- `verify`必须获取提供的`metadata`并验证其合法性。同样,在为您自己的ISM开发此逻辑时,[ChainlinkISM实现](https://github.com/AlexBHarley/permissionless-chainlink-feeds/blob/main/apps/contracts/contracts/ChainlinkAggregator.sol#L114)可以是一个有用的参考点。 +- `verify`必须获取提供的`metadata`并验证其合法性。同样,在为您自己的ISM开发此逻辑时,[ChainlinkISM实现](https://github.com/AlexBHarley/permissionless-chainlink-feeds/blob/main/apps/contracts/contracts/ChainlinkAggregator.sol#L114)是一个非常棒的参考。 下面是CCIP Read ISM的示例,其中ISM也是消息的接收者,根据链链接ISM。 diff --git a/docs/protocol/ISM/economic-security.mdx b/docs/protocol/ISM/economic-security.mdx index 470e6f46..1820ed2a 100644 --- a/docs/protocol/ISM/economic-security.mdx +++ b/docs/protocol/ISM/economic-security.mdx @@ -2,15 +2,15 @@ :::info -Hyperlane致力于让欺诈行为付出高昂代价。 Staking和slashing很快就会出现,但还没有实施。此页面仅供参考之用。细节可能会随着设计的成熟而改变。 +Hyperlane致力于让欺诈行为付出高昂代价。 Staking和slashing很快就会公布。此页面仅供参考之用。细节可能会随着设计的成熟而改变。 ::: -Staking和slashing允许生态安全被添加到依赖验证者签名的 ISMs中,包括[Multisig ISM](multisig-ISM.mdx) 和Optimistic ISM。 +Staking和slashing允许生态安全被添加到依赖验证者签名的ISMs中,包括[Multisig ISM](multisig-ISM.mdx)和Optimistic ISM。 Hyperlane验证器可以选择参与Hyperlane的质押协议。之后,如果这些验证者试图伪造或审查链间消息,他们的权益,以及任何委托给他们的权益,都可以被削减。 -依赖于这些验证者签名的[Interchain Security Modules](modular-security.mdx) 可以从质押和削减提供的额外经济安全性中获益。 +依赖于这些验证者签名的[Interchain Security Modules](modular-security.mdx)可以从质押和削减提供的额外经济安全性中获益。 ### 可验证的欺诈证明 diff --git a/docs/protocol/ISM/modular-security.mdx b/docs/protocol/ISM/modular-security.mdx index 56a7649c..28da28a1 100644 --- a/docs/protocol/ISM/modular-security.mdx +++ b/docs/protocol/ISM/modular-security.mdx @@ -2,7 +2,7 @@ Hyperlane由**Interchain Security Modules** (ISMs)保护。ISMs是一种智能合约,负责验证在目标链上传递的链间消息是否**实际发送**在原始链上。 -Hyperlane开发人员可以通过指定一个应用专用的ISM,**optionally** **override** [Mailbox's](../mailbox.mdx)的默认ISM,他们可以根据自己的应用程序的需求来配置、组合和定制。 +Hyperlane开发人员可以通过指定一个应用专用的ISM,**optionally** **override**[Mailbox's](../mailbox.mdx)的默认ISM,他们可以根据自己的应用程序的需求来配置、组合和定制。 ### 配置 @@ -12,7 +12,7 @@ Hyperlane定义了一套预先构建的ISMs。开发人员可以部署任何这 ### 组合 -ISMs就像“security [legos](https://en.wikipedia.org/wiki/Lego)”。开发人员可以混合和匹配不同的ISMs,以编码最适合他们需求的安全模型。 +ISMs就像“security[legos](https://en.wikipedia.org/wiki/Lego)”。开发人员可以混合和匹配不同的ISMs,以编码最适合他们需求的安全模型。 例如,希望获得额外安全性的应用程序开发人员可以部署一个[Aggregation ISM](aggregation-ISM.mdx),它需要由配置了Hyperlane社区验证器的[Multisig ISM](multisig-ISM.mdx) 和一个[Wormhole ISM](wormhole-ISM.mdx)进行验证,后者验证了[Wormhole](https://wormhole.com/)验证器集的quorum验证了消息。 @@ -24,7 +24,7 @@ ISMs是完全可定制的。开发人员可以编写自己的ISMs,根据应用 ## 覆盖默认ISM -应用程序开发者可以通过在应用程序中实现` isspecificesinterchainsecuritymodule `接口来覆盖默认的ISM。 +应用程序开发者可以通过在应用程序中实现`isspecificesinterchainsecuritymodule`接口来覆盖默认的ISM。 具体来说,这个接口必须在实现`handle()`的智能合约中实现。 @@ -72,7 +72,7 @@ interface IInterchainSecurityModule { ### 验证 -ISMs必须实现的主要功能是`verify()`。[Mailbox](../ Mailbox .mdx)将在将消息传递给收件人之前调用`IInterchainSecurityModule.verify()`。如果`verify()`恢复或返回`false`,消息将不会被传递。 +ISMs必须实现的主要功能是`verify()`。[Mailbox](../mailbox.mdx)将在将消息传递给收件人之前调用`IInterchainSecurityModule.verify()`。如果`verify()`恢复或返回`false`,消息将不会被传递。 `verify()`函数接受两个参数。 @@ -93,7 +93,7 @@ ISMs必须实现的第二个函数是`moduleType()`。这是用来通知[Relayer 下面展示了在目标链上验证和交付链间消息的简化顺序图。 :::info -如果收件人没有实现` isspecificesinterchainsecuritymodule `或者`recipient.interchainSecurityModule()`返回`address(0)`,将使用[Mailbox](../mailbox.mdx)上配置的默认ISM来验证消息。 +如果收件人没有实现`isspecificesinterchainsecuritymodule`或者`recipient.interchainSecurityModule()`返回`address(0)`,将使用[Mailbox](../mailbox.mdx)上配置的默认ISM来验证消息。 为了清晰起见,在序列图中省略了这一点。 ::: diff --git a/docs/protocol/ISM/multisig-ISM.mdx b/docs/protocol/ISM/multisig-ISM.mdx index 1e3af5bb..5847937d 100644 --- a/docs/protocol/ISM/multisig-ISM.mdx +++ b/docs/protocol/ISM/multisig-ISM.mdx @@ -1,3 +1,3 @@ # Multisig ISM -`MultisigISM` 是最常用的符号类型之一。这些ISMs验证了`n`[Validators](../agents/validators.mdx) 中的`m`验证了特定链间消息的有效性。 +`MultisigISM` 是最常用的符号类型之一。这些ISMs验证了`n`个[Validators](../agents/validators.mdx) 中的`m`个验证了特定链间消息的有效性。 diff --git a/docs/protocol/ISM/optimistic-ISM.mdx b/docs/protocol/ISM/optimistic-ISM.mdx index 3907ddd7..20510a93 100644 --- a/docs/protocol/ISM/optimistic-ISM.mdx +++ b/docs/protocol/ISM/optimistic-ISM.mdx @@ -3,10 +3,10 @@ 把安全放在活跃性之上 :::warning -`OptimisticISM`即将到来,但尚未实施。此页面仅供参考之用。细节可能会随着设计的成熟而改变。 +`OptimisticISM`即将到来。此页面仅供参考之用。细节可能会随着设计的成熟而改变。 ::: -`OptimisticISM`编码了由 [Optics](https://docs.celo.org/protocol/bridge/optics) 开创并被[Synapse](https://docs.synapseprotocol.com/synapse-interchain-network-sin/synapse-interchain-network/deep-dive-optimistic-pos)、[Nomad](https://docs.nomad.xyz/the-nomad-protocol/verification-mechanisms/optimistic-verification)和[Connext](https://blog.connext.network/optimistic-bridges-fb800dc7b0e0)采用的optimistic验证安全模型。 +`OptimisticISM`编码了由[Optics](https://docs.celo.org/protocol/bridge/optics)开创并被[Synapse](https://docs.synapseprotocol.com/synapse-interchain-network-sin/synapse-interchain-network/deep-dive-optimistic-pos)、[Nomad](https://docs.nomad.xyz/the-nomad-protocol/verification-mechanisms/optimistic-verification)和[Connext](https://blog.connext.network/optimistic-bridges-fb800dc7b0e0)采用的optimistic验证安全模型。 `OptimisticISM`依赖于消息验证后的欺诈窗口,在此期间,配置在`OptimisticISM`上的`m`个**观察者**有机会将消息标记为欺诈,阻止它们发送给收件人。 diff --git a/docs/protocol/ISM/routing-ISM.mdx b/docs/protocol/ISM/routing-ISM.mdx index 8a50f1be..7c2dffcd 100644 --- a/docs/protocol/ISM/routing-ISM.mdx +++ b/docs/protocol/ISM/routing-ISM.mdx @@ -2,7 +2,7 @@ 开发人员可以使用`RoutingISM`将消息验证委托给不同的ISM。这允许开发人员根据消息内容或应用程序上下文更改安全模型。 -该ISM根据消息的原始链简单地切换安全模型。一个简单的用例是为每个链使用不同的 [Multisig ISM](multisig-ISM.mdx)验证器集。 +该ISM根据消息的原始链简单地切换安全模型。一个简单的用例是为每个链使用不同的[Multisig ISM](multisig-ISM.mdx)验证器集。 最终,你可以实现一个`DomainRoutingIsm`路由到不同的基于轻客户端的ISMs,这取决于在origin链上使用的共识协议的类型。 diff --git a/docs/protocol/ISM/wormhole-ISM.mdx b/docs/protocol/ISM/wormhole-ISM.mdx index 233a5e99..f185ee40 100644 --- a/docs/protocol/ISM/wormhole-ISM.mdx +++ b/docs/protocol/ISM/wormhole-ISM.mdx @@ -6,8 +6,8 @@ “WormholeISM”编码了[Wormhole's](https://wormhole.com/)链间通信协议所使用的安全模型。 -这个ISM需要19个 [Wormhole guardians](https://wormhole.com/network/#guardians)中的13个来证明Hyperlane 信息的有效性。 +这个ISM需要19个[Wormhole guardians](https://wormhole.com/network/#guardians)中的13个来证明Hyperlane 信息的有效性。 ## 组合 -开发人员可以使用[Multisig ISM](multisig-ISM.mdx) 与[Aggregation ISM](aggregation-ISM.mdx) 组成Wormhole ISM ,以要求n个Hyperlane验证器中的m个**和19个Wormhole守护者中的13个**验证消息。 +开发人员可以使用[Multisig ISM](multisig-ISM.mdx) 与[Aggregation ISM](aggregation-ISM.mdx) 组成Wormhole ISM,以要求n个Hyperlane验证器中的m个**和19个Wormhole守护者中的13个**来验证消息。 diff --git a/docs/protocol/agents/relayer.mdx b/docs/protocol/agents/relayer.mdx index d31860dd..ebc30a4b 100644 --- a/docs/protocol/agents/relayer.mdx +++ b/docs/protocol/agents/relayer.mdx @@ -6,10 +6,10 @@ ::: :::note -运行你自己的中继器涉及部署[IGP合同](../interchain-gas payment.mdx),并在其中维护代币汇率和燃料费价格,以准确收取消息传输费用。因此,我们只建议在设置无需许可部署的网桥时这样做,而不是重用现有的网桥。 +运行你自己的中继器涉及部署[IGP contract](../interchain-gas-payment.mdx),并在其中维护代币汇率和燃料费价格,以准确收取消息传输费用。因此,我们只建议在设置无需许可部署的网桥时这样做,而不是重用现有的网桥。 ::: -中继器被配置为在两个或多个链之间中继消息。中继者观察原始[Mailbox](../mailbox.mdx)合约,监视新消息。当检测到新消息时,中继器查询目的链以确定消息接收者的[Interchain Security Module](../../reference/ISM/specify-your-ISM.mdx)。 +中继器被配置为在两个或多个链之间中继消息。中继器观察原始[Mailbox](../mailbox.mdx)合约,监视新消息。当检测到新消息时,中继器查询目的链以确定消息接收者的[Interchain Security Module](../../reference/ISM/specify-your-ISM.mdx)。 然后,中继器负责收集该ISM所需的元数据。这可能因ISM而异,可能包括来自一个或多个[validators](./validators.mdx)、merkle证明、零知识证明等等的签名! @@ -27,8 +27,8 @@ 2. 发件人/收件人黑名单。 3. 接收[payments on the origin chain](../../reference/messaging/send.mdx#quote-dispatch)以处理目标链上的消息的能力。 -为了方便,Hyperlane将运行一个开源的可配置的中继代理,以rust二进制文件的形式实现。如果你想运行你自己的relayer,我们已经开源了[二进制文件](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/agents/relayer)。 +为了方便,Hyperlane将运行一个开源的可配置的中继代理,以rust二进制文件的形式实现。如果你想运行你自己的relayer,我们已经开源了源代码 [binary here](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/agents/relayer)。 #### 错误处理 -当处理失败时,中继器将使用指数退避策略周期性地重试消息。目前,没有固定的最大重试次数,超过重试次数后,中继器将停止尝试处理消息。然而,这并不是无限期重试的保证,运营商不应将此作为服务水平协议(SLA)的依赖。 +当处理失败时,中继器将使用指数回滚策略周期性地重试消息。目前,没有固定的最大重试次数,超过重试次数后,中继器将停止尝试处理消息。然而,这并不是无限期重试的保证,运营商不应将此作为服务水平协议(SLA)的依赖。 diff --git a/docs/protocol/agents/validators.mdx b/docs/protocol/agents/validators.mdx index edc4c7ff..a7092eea 100644 --- a/docs/protocol/agents/validators.mdx +++ b/docs/protocol/agents/validators.mdx @@ -2,10 +2,10 @@ 验证器负责观察 [Mailbox](../mailbox.mdx) 合约,如果需要,还会签署merkle根证书,以便将消息传输到远程链。 -与许多其他协议不同,Hyperlane **没有**指定验证器集。任何人都可以自由地运行他们自己的验证器,只要接收者合约指定一个包含他们的验证器的 [Multisig ISM](../ISM/multisig-ISM.mdx) 。 +与许多其他协议不同,Hyperlane**没有**指定验证器集。任何人都可以自由地运行他们自己的验证器,只要接收者合约指定一个包含他们的验证器的 [Multisig ISM](../ISM/multisig-ISM.mdx) 。 :::info -想运行验证器?请查看[验证器指南](../../operate/validators/run-validators.mdx)。 +想运行验证器?请查看[validators guide](../../operate/validators/run-validators.mdx)。 ::: 对于使用[Multisig ISM](../../reference/ISM/multisig-ISM-interface.mdx)的消息,验证器通过调用`MerkleTreeHook.latestCheckpoint()`来读取当前默克尔根。一旦根目录达到了足够的[finality](https://medium.com/mechanism-labs/finality-in-blockchain-consensus-d1f83c120a9a),验证者就会对其进行签名并将其签名发布到高可用的存储中,以便它可以被[relayer](./relayer.mdx)收集。 @@ -22,6 +22,6 @@ function latestCheckpoint() returns (bytes32 root, uint256 index); ``` -如果验证器签名的不是最终的检查点,那么就有可能危及协议的安全性。如果他们参与权益证明,这可能会导致他们的权益被削减。 +如果验证器签名的不是最新的检查点,那么就有可能危及协议的安全性。如果他们参与权益证明,这可能会导致他们的权益被削减。 Hyperlane正在将验证器开发为用Rust实现的二进制文件,任何人都可以轻松运行。从操作上讲,验证器需要运行这个二进制文件,并能够访问正在验证的链的RPC提供者或节点。我们希望大多数Hyperlane验证器将来自每个链现有的节点操作员社区。 diff --git a/docs/protocol/interchain-gas-payment.mdx b/docs/protocol/interchain-gas-payment.mdx index 8a187956..20250e3e 100644 --- a/docs/protocol/interchain-gas-payment.mdx +++ b/docs/protocol/interchain-gas-payment.mdx @@ -46,7 +46,7 @@ flowchart LR 这些合约公开了[InterchainGasPaymaster interface](../reference/hooks/interchain-gas.mdx),它允许用户用原始链上的本地令牌向 [relayer](./agents/relayer.mdx) 支付在目标链上传递消息的成本。 -每个` interchainingaspaymaster `合约只对应一个中继器。您可以在[addresses](../reference/contract-addresses.mdx)下找到Abacus Works中继器的地址。 +每个`interchainingaspaymaster`合约只对应一个中继器。您可以在[addresses](../reference/contract-addresses.mdx)下找到Abacus Works中继器的地址。 ### Gas oracles diff --git a/docs/protocol/mailbox.mdx b/docs/protocol/mailbox.mdx index 96c3ccac..a314ff74 100644 --- a/docs/protocol/mailbox.mdx +++ b/docs/protocol/mailbox.mdx @@ -11,13 +11,13 @@ v3现在包括了[post-dispatch hooks](../reference/hooks/overview.mdx), [inte ::: -Hyperlane `Mailbox`智能合约公开了用于发送和接收链间消息的链上API。Hyperlane支持的每个链上都部署了一个“邮箱”合约。 +Hyperlane`Mailbox`智能合约公开了用于发送和接收链间消息的链上API。Hyperlane支持的每个链上都部署了一个“邮箱”合约。 -`Mailboxes` 网络促进了区块链之间的连接,开发人员可利用其创建链间应用程序,并将链间功能添加到其现有应用程序中。 +`Mailboxes`网络促进了区块链之间的连接,开发人员可利用其创建链间应用程序,并将链间功能添加到其现有应用程序中。 ## 接口 -“IMailbox”接口公开了两个状态变化函数;' dispatch() '和' process() ',它们分别用于发送和接收消息。 +`IMailbox`接口公开了两个状态变化函数; `dispatch()`和`process()`,它们分别用于发送和接收消息。 ```solidity // SPDX-License-Identifier: MIT OR Apache-2.0 @@ -39,7 +39,7 @@ interface IMailbox { 要发送链间消息,开发人员需要调用`Mailbox.dispatch()`。 -该函数将消息内容、目标链ID和收件人地址作为参数。每条消息都作为叶子插入到由`Mailbox`存储的[增量默克尔树](https://medium.com/@josephdelong/ethereum-2-0-deposit-merkle-tree-13ec8404ca4f)中。 +该函数将消息内容、目标链ID和收件人地址作为参数。每条消息都作为叶子插入到由`Mailbox`存储的[incremental merkle tree](https://medium.com/@josephdelong/ethereum-2-0-deposit-merkle-tree-13ec8404ca4f)中。 Hyperlane的权益证明协议使用该merkle树来验证欺诈证据。 @@ -53,6 +53,6 @@ Hyperlane的权益证明协议使用该merkle树来验证欺诈证据。 :::info -请参阅[' message .sol '](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/libs/Message.sol)for)了解Hyperlane消息编码的更多详细信息 +请参阅[`Message.sol`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/libs/Message.sol)了解Hyperlane消息编码的更多详细信息 ::: diff --git a/docs/protocol/warp-routes.mdx b/docs/protocol/warp-routes.mdx index d8439836..a4e7d31e 100644 --- a/docs/protocol/warp-routes.mdx +++ b/docs/protocol/warp-routes.mdx @@ -14,7 +14,7 @@ v3现在包含了[post-dispatch hooks](../reference/hooks/overview.mdx),其中 Warp路由是Hyperlane对令牌桥接概念的演绎,允许你通过Hyperlane将任何类似ERC20或erc721的资产无需许可转移到任何链上。 -您可以将Warp Routes与Hyperlane部署相结合,在任何链上与其他已通过 Hyperlane 连接的链之间实现资金流动。 +您可以将Warp Routes与Hyperlane部署相结合,在任何链上与其他已通过Hyperlane连接的链之间实现资金流动。 下面这张图简单地展示了创建Warp路由的流程,以及生成的资源。 @@ -22,10 +22,10 @@ Warp路由是Hyperlane对令牌桥接概念的演绎,允许你通过Hyperlane ![Warp Route diagram/doodle](../../static/img/warpcontractdiagram.png) -Warp Route 合约通过在起源链(又称抵押链)上锁定抵押代币,然后在目的链(合成链)上铸造warp代币,从而在链之间转移价值。 +Warp Route合约通过在起源链(又称抵押链)上锁定抵押代币,然后在目的链(合成链)上铸造warp代币,从而在链之间转移价值。 用户可以随时通过将其warp好的代币转回抵押链来赎回被锁定的代币。 -与所有建立在 Hyperlane 基础上的应用程序一样,Warp Routes 可通过[Interchain Security Modules](../protocol/ISM/modular-security.mdx)自定义安全性。这样,Warp 路由部署者就可以配置和执行链间令牌必须遵守的自定义规则和约束。 +与所有建立在Hyperlane基础上的应用程序一样,Warp Routes可通过[Interchain Security Modules](../protocol/ISM/modular-security.mdx)自定义安全性。这样,Warp 路由部署者就可以配置和执行链间令牌必须遵守的自定义规则和约束。 -可以在任何一组部署了 Hyperlane 的链之间部署 Warp Routes。如果您想创建的 Warp Route 包含当前未部署 Hyperlane 的链,请自行 [deploy hyperlane](../deploy-hyperlane.mdx) ! +可以在任何一组部署了Hyperlane的链之间部署Warp Routes。如果您想创建的Warp Route包含当前未部署Hyperlane的链,请自行 [deploy hyperlane](../deploy-hyperlane.mdx) ! diff --git a/docs/reference/ISM/aggregation-ISM-interface.mdx b/docs/reference/ISM/aggregation-ISM-interface.mdx index a7fc5917..8a89b53e 100644 --- a/docs/reference/ISM/aggregation-ISM-interface.mdx +++ b/docs/reference/ISM/aggregation-ISM-interface.mdx @@ -4,7 +4,7 @@ description: Aggregate security from multiple ISMs # Aggregation Module -开发人员可以使用“聚合ISM”来组合来自多个ISM的安全性。简单地说,“聚合ISM”要求“n个”ISM中的“m个”验证特定的链间消息。 +开发人员可以使用“Aggregation ISM”来组合来自多个ISM的安全性。简单地说,“Aggregation ISM”要求“n个”ISM中的“m个”验证特定的链间消息。 ## 接口 diff --git a/docs/reference/ISM/multisig-ISM-interface.mdx b/docs/reference/ISM/multisig-ISM-interface.mdx index 733e61bb..8624af53 100644 --- a/docs/reference/ISM/multisig-ISM-interface.mdx +++ b/docs/reference/ISM/multisig-ISM-interface.mdx @@ -14,7 +14,7 @@ _使用验证器签名验证消息_ hyperlane-monorepo包含[`MultisigISM` implementations](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/solidity/contracts/isms/multisig)(包括通过工厂部署的 [legacy](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/isms/multisig/LegacyMultisigIsm.sol)版本和更省燃料的[versions](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/isms/multisig/StaticMultisigIsm.sol) 应用程序开发人员可以部署现成的配置,指定他们所需的配置。 -开发人员可以为每个源链配置一组`n` 个验证器,以及验证消息所需的验证器签名(`m`)的数量。 +开发人员可以为每个源链配置一组`n`个验证器,以及验证消息所需的验证器签名(`m`)的数量。 验证器签名**并非**特定于ISM。换句话说,开发人员可以将他们的`MultisigISM`配置为使用在Hyperlane上运行的**任何**验证器,它将“正常工作”。 @@ -23,7 +23,7 @@ hyperlane-monorepo包含[`MultisigISM` implementations](https://github.com/hyper hyperlane-monorepo 包含一个抽象的`MultisigISM`实现,应用程序开发人员可以将其分叉。 -开发人员只需实现`validatorsAndThreshold()` 函数即可。 +开发人员只需实现`validatorsAndThreshold()`函数即可。 通过创建自定义实施,应用程序开发人员可以根据其应用程序的需要定制`MultisigISM`提供的安全性。 diff --git a/docs/reference/ISM/routing-ISM-interface.mdx b/docs/reference/ISM/routing-ISM-interface.mdx index acf43dc5..f708ae01 100644 --- a/docs/reference/ISM/routing-ISM-interface.mdx +++ b/docs/reference/ISM/routing-ISM-interface.mdx @@ -4,11 +4,11 @@ description: Smarter interchain security models # 路由模块 -开发人员可以使用`RoutingISM` 将消息验证委托给不同的ISM。这允许开发人员根据消息内容或应用程序上下文更改安全模型 ; +开发人员可以使用`RoutingISM`将消息验证委托给不同的ISM。这允许开发人员根据消息内容或应用程序上下文更改安全模型; ## 接口 -`RoutingISMs` 必须实现`IRoutingIsm`接口。 +`RoutingISMs`必须实现`IRoutingIsm`接口。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/interfaces/isms/IRoutingIsm.sol ``` @@ -25,7 +25,7 @@ hyperlane-monorepo包含一个`RoutingISM`实现,`DomainRoutingIsm`,应用 hyperlane-monorepo包含一个抽象的`RoutingISM`实现,应用程序开发人员可以对其进行分叉。 -开发人员只需要实现 `route()` 函数。 +开发人员只需要实现`route()`函数。 通过创建自定义实现,应用程序开发人员可以根据应用程序的需要定制`RoutingISM`提供的安全性。 diff --git a/docs/reference/domains.mdx b/docs/reference/domains.mdx index fa0bae9e..e5f2d314 100644 --- a/docs/reference/domains.mdx +++ b/docs/reference/domains.mdx @@ -5,7 +5,7 @@ import TabItem from "@theme/TabItem"; ## Core Domains -此列表仅包括由 Abacus Works(我们的法律实体)管理的链上的部署。任何人都可以在任何链上[permissionlessly](../deploy-hyperlane.mdx) --我们正在建立一个注册表,以反映社区的无权限部署情况。 +此列表仅包括由Abacus Works(我们的法律实体)管理的链上的部署。任何人都可以在任何链上[permissionlessly](../deploy-hyperlane.mdx) --我们正在建立一个注册表,以反映社区的无权限部署情况。 Hyperlane为每个Hyperlane支持的链使用唯一的ID。在可能的情况下,Hyperlane域ID与EVM链ID匹配,但这并不能保证,因为我们也支持非EVM链。 diff --git a/docs/reference/hooks/interchain-gas.mdx b/docs/reference/hooks/interchain-gas.mdx index 941cc3f0..afd0d084 100644 --- a/docs/reference/hooks/interchain-gas.mdx +++ b/docs/reference/hooks/interchain-gas.mdx @@ -21,7 +21,7 @@ flowchart LR IGP -. "value" .- Relayer ``` -为了方便起见, [relayer](../../operate/relayer/run-relayer.mdx) 监视已分发的消息,如果消息发送者在原始链上收到足够的付款,则代表消息发送者提交进程事务。我们称之为**链间燃料费支付**。 +为了方便起见,[relayer](../../operate/relayer/run-relayer.mdx)监视已分发的消息,如果消息发送者在原始链上收到足够的付款,则代表消息发送者提交进程事务。我们称之为**链间燃料费支付**。 ```mermaid flowchart LR @@ -71,7 +71,7 @@ $$ ### 元数据 -这个钩子需要`StandardHookMetadata`的打包编码的元数据。关于如何传递元数据覆盖,请参阅邮箱Mailbox [dispatch overloads](../messaging/send.mdx#overriding-default-hook-metadata) 。 +这个钩子需要`StandardHookMetadata`的打包编码的元数据。关于如何传递元数据覆盖,请参阅邮箱Mailbox[dispatch overloads](../messaging/send.mdx#overriding-default-hook-metadata) 。 @@ -146,7 +146,7 @@ bytes memory metadata = abi.encodePacked( ## 重试 -如果`handle`调用消耗的燃料费超过报价,中继器将不会提交进程事务。在这种情况下,可以使用`payForGas` 功能支付额外的gas。 +如果`handle`调用消耗的燃料费超过报价,中继器将不会提交进程事务。在这种情况下,可以使用`payForGas`功能支付额外的gas。 diff --git a/docs/reference/hooks/op-stack.mdx b/docs/reference/hooks/op-stack.mdx index c9996267..7b1c48d5 100644 --- a/docs/reference/hooks/op-stack.mdx +++ b/docs/reference/hooks/op-stack.mdx @@ -14,7 +14,7 @@ optimistic和其他[OP Stack](https://stack.optimism.io/)聚合有自己的接 OPStackHook将messageId发送给L1CrossDomainMessenger,后者将其注册为带有ETH存款和消息数据的Optimism`TransactionDeposited`事件,该事件由rollup节点拾取。 -rollup节点调用预编译的合约 `L2CrossDomainMessenger`的relayMessage函数,该函数反过来调用配置的OptimismISM合约,在verifiedMessageId的映射中设置messageId到原始L1发送者(即,用户)。中继器只携带没有元数据的消息,等待Optimism节点选择并对Optimism节点进行存储写入,然后验证消息传递。 +rollup节点调用预编译的合约`L2CrossDomainMessenger`的relayMessage函数,该函数反过来调用配置的OptimismISM合约,在verifiedMessageId的映射中设置messageId到原始L1发送者(即,用户)。中继器只携带没有元数据的消息,等待Optimism节点选择并对Optimism节点进行存储写入,然后验证消息传递。 ```mermaid flowchart TB diff --git a/docs/reference/hooks/overview.mdx b/docs/reference/hooks/overview.mdx index 5d874a8e..5256023a 100644 --- a/docs/reference/hooks/overview.mdx +++ b/docs/reference/hooks/overview.mdx @@ -37,7 +37,7 @@ flowchart TB ## Post Dispatch -除了通过邮箱发送的`message`之外,`postDispatch`函数还接收一个`metadata` 参数。`metadata` 参数从 `dispatch`调用通过未修改的Mailbox传递。这允许开发人员将任何上下文传递给钩子。 +除了通过邮箱发送的`message`之外,`postDispatch`函数还接收一个`metadata`参数。`metadata`参数从`dispatch`调用通过未修改的Mailbox传递。这允许开发人员将任何上下文传递给钩子。 @@ -49,11 +49,11 @@ flowchart TB -如果' postDispatch '函数收到的付款不足,它可能会回滚。 +如果'postDispatch'函数收到的付款不足,它可能会回滚。 ### Quote Dispatch (Fees) -通常在 `postDispatch`”中收取费用,以支付目的地链交易提交和安全配置等成本。要接收相应 `postDispatch`调用的报价,可以查询 `quoteDispatch`函数。 +通常在`postDispatch`中收取费用,以支付目的地链交易提交和安全配置等成本。要接收相应`postDispatch`调用的报价,可以查询`quoteDispatch`函数。 @@ -81,7 +81,7 @@ flowchart TB end ``` -转到实现钩子指南 [这里](../../guides/create-custom-hook-and-ism.mdx) +转到实现钩子指南[这里](../../guides/create-custom-hook-and-ism.mdx) ### 覆盖默认钩子元数据 @@ -101,7 +101,7 @@ Hooks目前期望使用[`StandardHookMetadata` library](../libraries/hookmetadat -自定义的`metadata` 将被传递给所需钩子的`quoteDispatch` 和`postDispatch` 函数,然后再传递给默认钩子的`postDispatch`函数。 +自定义的`metadata`将被传递给所需钩子的`quoteDispatch`和`postDispatch`函数,然后再传递给默认钩子的`postDispatch`函数。 ```mermaid flowchart LR diff --git a/docs/reference/libraries/mailboxclient.mdx b/docs/reference/libraries/mailboxclient.mdx index 42ada4b8..bdcaa399 100644 --- a/docs/reference/libraries/mailboxclient.mdx +++ b/docs/reference/libraries/mailboxclient.mdx @@ -8,7 +8,7 @@ 2. [`IPostDispatchHook`](../hooks/interchain-gas.mdx) (optional) 3. [`IInterchainSecurityModule`](../ISM/specify-your-ISM.mdx) (optional) -`MailboxClient`公开了允许子类通过`mailbox` 储变量轻松发送消息到`Mailbox` 的函数,并通过`onlyMailbox` 修饰符允许消息传递。 +`MailboxClient`公开了允许子类通过`mailbox`储变量轻松发送消息到`Mailbox`的函数,并通过`onlyMailbox`修饰符允许消息传递。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/client/MailboxClient.sol ``` diff --git a/docs/reference/libraries/router.mdx b/docs/reference/libraries/router.mdx index 4136e503..921bc431 100644 --- a/docs/reference/libraries/router.mdx +++ b/docs/reference/libraries/router.mdx @@ -8,7 +8,7 @@ import RouterDiagram from '@site/src/diagrams/router.md' -使用这种模式的开发人员可以继承`Router` mix-in合约。' Router '是一个[`MailboxClient`](./mailboxclient.mdx) ,它跟踪远程链上其他`Router` 合约的地址。这允许`Router` 直接向其他路由发送消息,而不必指定地址。它还允许`Router` 拒绝来自其他不受信任的发送者的消息。 +使用这种模式的开发人员可以继承`Router`mix-in合约。'Router'是一个[`MailboxClient`](./mailboxclient.mdx) ,它跟踪远程链上其他`Router`合约的地址。这允许`Router`直接向其他路由发送消息,而不必指定地址。它还允许`Router`拒绝来自其他不受信任的发送者的消息。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/client/Router.sol ``` diff --git a/docs/reference/messaging/send.mdx b/docs/reference/messaging/send.mdx index 717c92ca..61f566e0 100644 --- a/docs/reference/messaging/send.mdx +++ b/docs/reference/messaging/send.mdx @@ -32,7 +32,7 @@ import SimpleMessagingDiagram from '@site/src/diagrams/messaging-simple.md'; Hyperlane只能向实现`handle`函数的智能合约传递消息。有关更多信息,请参阅 [receive a message](./receive.mdx) 文档。 ::: -根据 [post-`dispatch` hook configuration](##post-dispatch-hook-config),可能需要一些付款。更多信息请参阅 [`quoteDispatch`](#Quote-Dispatch)。 +根据[post-`dispatch` hook configuration](##post-dispatch-hook-config),可能需要一些付款。更多信息请参阅 [`quoteDispatch`](#Quote-Dispatch)。 @@ -42,7 +42,7 @@ Hyperlane只能向实现`handle`函数的智能合约传递消息。有关更多 ``` :::info -为了与地址不同的虚拟机兼容,收件人地址被保留为`bytes32` 。为了方便起见,在[`TypeCasts` library](../libraries/typecasts.mdx) 中提供了以下实用程序。 +为了与地址不同的虚拟机兼容,收件人地址被保留为`bytes32`。为了方便起见,在[`TypeCasts` library](../libraries/typecasts.mdx) 中提供了以下实用程序。 ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/libs/TypeCasts.sol#L5-L8 @@ -85,7 +85,7 @@ bytes32 messageId = mailbox.dispatch{value: msg.value}( ## Quote Dispatch -费用通常配置为支付IGP付款和协议费用。这包括目标链上的事务提交、安全配置和维护。要接收对应的`dispatch` 调用的报价,你可以查询`quoteDispatch`函数。 +费用通常配置为支付IGP付款和协议费用。这包括目标链上的事务提交、安全配置和维护。要接收对应的`dispatch`调用的报价,你可以查询`quoteDispatch`函数。 ```mermaid flowchart TB @@ -103,7 +103,7 @@ flowchart TB ```solidity file=/node_modules/@hyperlane-xyz/core/contracts/Mailbox.sol#L149-L153 ``` -引用的 `fee` 必须作为值传递给`dispatch` 调用,以确保它不会回滚。 +引用的`fee`必须作为值传递给`dispatch`调用,以确保它不会回滚。 @@ -140,7 +140,7 @@ mailbox.dispatch{value: fee}(destination, recipient, body); /> :::tip -对`dispatch` 少付的金额将回滚,但多付的金额将退还给消息发送者。 这样,开发人员就可以跳过显式的`quoteDispatch`调用,转而使用具有超额值的`quoteDispatch`调用。 +对`dispatch`少付的金额将回滚,但多付的金额将退还给消息发送者。这样,开发人员就可以跳过显式的`quoteDispatch`调用,转而使用具有超额值的`quoteDispatch`调用。 ::: ## Post-Dispatch Hook 配置 diff --git a/docs/your-first-message.mdx b/docs/your-first-message.mdx index 2c539b22..f9549828 100644 --- a/docs/your-first-message.mdx +++ b/docs/your-first-message.mdx @@ -8,17 +8,17 @@ import { } from "@site/src/components/AddressTable"; import MessageQuickstart from "@site/src/components/MessageQuickstart"; -# 发送您的第一条链间信息 +# 发送您的第一条消息 -本教程演示如何[send](./reference/messaging/send.mdx)链间信息到预先部署的 "TestRecipient "合约。 +本教程演示如何[send](./reference/messaging/send.mdx)链间消息到预先部署的 "TestRecipient "合约。 -发送信息只需调用 `Mailbox.dispatch`方法。请确保您的账户在原始链上有资金。 +发送信息只需调用`Mailbox.dispatch`方法。请确保您的账户在原始链上有资金。 -:::提示 +:::tip 你可以在[explorer.hyperlane.xyz](https://explorer.hyperlane.xyz/)上通过搜索你的`Mailbox.dispatch`调用的**transaction hash**来查看信息的进度。 ::: From e343d2f4e17d2f18a54dc264d378bf35019e1243 Mon Sep 17 00:00:00 2001 From: polibee <1244762327@qq.com> Date: Fri, 22 Mar 2024 21:54:29 +0800 Subject: [PATCH 58/58] update --- docs/guides/deploy-warp-route.mdx | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/docs/guides/deploy-warp-route.mdx b/docs/guides/deploy-warp-route.mdx index 64c68dcd..84351f2b 100644 --- a/docs/guides/deploy-warp-route.mdx +++ b/docs/guides/deploy-warp-route.mdx @@ -41,7 +41,6 @@ hyperlane config create warp 您的配置必须恰好有一个`base`条目。在这里,您将配置有关您正在创建Warp路由的代币的详细信息。 -<<<<<<< HEAD * **chainName**:将其设置为令牌所在的链 * **type**: - 将此设置为`TokenType. collateral` 为ERC20/ERC721令牌创建基本的Warp路由。 @@ -51,15 +50,6 @@ hyperlane config create warp - 如果使用`TokenType.collateral`为其创建路由的ERC20/ERC721合约的地址 - 如果使用`TokenType.collateralVault`,用于存放抵押品的ERC4626保险库的地址 * **isNft:** 如果使用`TokenType.collateral` 为ERC721合约,设置为`true`。 -======= - -* **chainName**: 将此设置为您的代币存在的链。 -* **type**: 将其设置为`TokenType.collateral`以创建一个用于ERC20/ERC721代币的Warp路由,或者将其设置为 `TokenType.native` 以创建一个用于原生代币(例如以太币)的Warp路由。 -* **address:** 如果使用`TokenType.collateral`,则为要创建路由的ERC20/ERC721合约的地址。 -* **isNft:** 如果对一个ERC721合约使用`TokenType.collateral`,则设置为`true`。 - - ->>>>>>> efd555e68769802fbff928e5bd3df790a7a5479a #### 合成资产 @@ -79,13 +69,7 @@ hyperlane config create warp #### 示例 -<<<<<<< HEAD 有关使用本地anvil 链的最小 Warp 部署配置示例,请参阅 [`warp-route-deployment.yaml`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/warp-route-deployment.yaml) 。 -======= - -有关使用本地anvil链的最小Warp部署配置示例,请参阅[`warp-deployment.yaml`](https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/warp-deployment.yaml)。 - ->>>>>>> efd555e68769802fbff928e5bd3df790a7a5479a ### 链配置