如何添加自定义网络 RPC
需要翻译这篇文章吗?
在 GitHub 上提交翻译、更正和建议,或通过我们的社区论坛联系我们。
MetaMask can access many more networks than just Ethereum mainnet: you can add any EVM-compatible network directly within your wallet and browse Snaps for additional non-EVM interoperability.
首字母缩略词 RPC 代表远程过程调用,这是一组协议,可让客户端(例如 MetaMask)与区块链交互。 You can add multiple RPC URLs for a single network and edit the default RPC URL from your list of networks in both Extension and Mobile settings.
Adding a custom RPC URL will disable Smart Transaction capabilities. To re-enable this, you'll need to switch back to the default RPC URL from the network dropdown selector.
On both Mobile and Extension, you can easily add several prominent networks with just a click. 包括:
- Arbitrum
- Avalanche
- BNB Chain/BSC
- Base
- Optimism
- Polygon
- zkSync Era
You can find this using the following steps:
- 扩展程序
- 移动版
在钱包的主页上,点击左上方的网络选择器。 向下滚动,直到看到“其他网络”部分。 或者,您也可以在搜索栏中搜索要添加的网络。
Tap the "Add" button next to the network to add it to your MetaMask instance.
-
点击屏幕顶部的网络选择器。 (或者,您可以点击齿轮图标访问设置,然后转到“网络”。)
-
您将在此处看到已经添加的网络列表。 Tap the "Add Network" button at the bottom of the screen.
-
You should now see a list of networks you can add under the "Popular" tab, as shown below.
-
When you choose to add one of them, you'll be prompted to confirm your selection and then get the option to switch immediately to that network. 全部完成!
MetaMask 正在改进网络切换体验。 从 v12.0 开始,在同时连接到多个 dapp 时,您将不必再在网络之间手动切换。 此功能目前仅在扩展程序中可用。
手动添加网络
If you don’t see a desired network in the list, you can follow these instructions to establish the network connection manually:
- 扩展程序
- 移动版
-
点击网络选择器按钮。 这将显示您已添加的网络列表。
-
Click "Add custom network":
-
将出现一个屏幕,您可以在其中输入要添加的网络的详细信息。 Click "Save" to add the network.
-
点击屏幕顶部的网络选择器。
-
Tap on "Add Network".
-
Switch to the "Custom networks" tab.
-
填写网络详细信息:
执行上述步骤后,您将能够在网络选择器中看到自定义网络。
上述字段的详细信息可以在我们的网络概况中找到,或者在每个网络的文档(即开发者文档)或操作指南中找到。 例如:
执行上述步骤后,下次访问网络选择器时,便能看到自定义网络。
Adding or editing RPC URLs
You can add multiple RPC URLs for a single network and edit the default RPC URL from your list of networks in both Extension and Mobile settings.
- 扩展程序
- 移动版
- Click the network icon in the top left of your wallet to show the list of enabled networks.
- Locate the desired network you want to edit and click the 3 dots to edit.
- Select the Default RPC URL dropdown field and click “Add RPC URL”.
- Enter the URL, nickname, and save your configurations.
- Tap the network selector at the top in the middle of your wallet to show the list of enabled networks
- Click the 3 dots by the network you want to edit
- Select the Default RPC URL downtown field and click “Add RPC URL”
- Enter the URL, nickname, and click “Add URL” to save your configurations
You can now toggle between various RPC URLs directly from the network drop-down selector when you want to switch providers. To delete any RPC URL, follow the same steps above and click on the trash bin icon to delete.
通过链列表添加
如需一种向 MetaMask 添加网络的简易方法,请转到 chainid.network,只需点击几下,即可连接 MetaMask 并添加网络。 请参阅我们的指南,了解详情。
此外,请注意,在一台设备上添加某个网络,那么在另一台设备上访问同一账户时,并不会出现该网络。 If you add it on Extension, it will not automatically be added to your MetaMask Mobile app yet, and vice versa.
如果您卸载了浏览器扩展程序或移动版应用程序,之后您需要使用私钥助记词来恢复您的钱包,自定义网络也需要重新添加。