current position:Home>Which Optimism node is better?Public Nodes vs Private Nodes vs Self-Hosted Nodes

Which Optimism node is better?Public Nodes vs Private Nodes vs Self-Hosted Nodes

2022-09-22 13:08:24golden finance

作者:Alchemy

来源:alchemy.com

为了从 Optimism 检索数据,dApp 需要通过 RPC (Remote Procedure Call,远程过程调用)Node sends retrieval request.

在这篇文章,我们将探索 Optimism 上用于 web3 Development support different types of nodes.

什么是 Optimism?

Optimism Is the etheric fang 2(L2)的扩容解决方案,它利用 optimistic rollup The technical solution enables every second 2000 Transaction processing is possible.

Optimism Based on a clear set of core design concept to design and maintain their block chain network.

  • 简约性

  • 实用主义

  • 可持续性

  • 乐观主义

什么是 optimistic rollup?

optimistic rollup Through the computation and data storage migration to the chain of,Using the etheric fang base layer of security to ascend the etheric fang throughput and improve the network delay.

Optimism 创造了一种在 L2 Many deals on the chain rollup 技术,Will deal together.

接着,rollup Agreement optimistically assuming the validity of all these deals,并将打包的 rollup A layer of transaction bound to submit to the lane(L1)链.

什么是 Optimism 节点?

Optimism Node is a program,Run on a single computer,Let the builder and traders and Optimism Others in the block chain network connection.

Optimism Node includes two important component:数据传输层(the Data Transport Layer)和客户端软件.

数据传输层(DTL)

Data transmission layer is Optimism And the connection between the etheric fang.And managed in the etheric fang intelligent contract ——(CanonicalTransactionChain,CTC)合约 —— Contains all released to Optimism Chain of the block.

DTL Through retrieving before release to CTC 的区块,On a regular basis on one node structure Optimism 区块链.如果没有 DTL,Optimism The node will not be able to timely obtain L2 optimistic rollup Tectonic block data.

客户端软件

与 DTL Are running together Optimism 的客户端软件.

Optimism 的客户端与 Geth(又称 Go Ethereum)Almost the same as the native version —— Geth The etheric fang is the most widely used the client.

就其本身而言,Optimism Is very similar and etheric fang,Can be used to share EVM,Similar pricing structure and gas 计量等.

在 Optimism On the development of big advantage is that,Most etheric lane on the operation of the tools can also be in Optimism 上使用,几乎不用修改代码.

为什么需要一个 Optimism 节点?

构建一个 Optimism Applications need to optimistic rollup Release deal to CTC.

此外,Optimism 节点允许 dApp The retrieval of Optimism 区块的数据.为了支持 Optimism 上高性能的 dApp,There must be a fully functional node.

Optimism 的节点类型

有几种将 dApp 连接到 Optimism 节点的选择,包括私人 Optimism 节点、使用 Optimism 公共 RPC Endpoint node,And to run、Since the hosting node.

大部分 Optimism Developers can use such as Alchemy 等 Optimism Node providers of private RPC 端点,Because the public endpoints and the hosting node has many disadvantages,Including low throughput、High set cost,And need more engineering maintenance support.

1. 公共 Optimism 节点

Alchemy 管理着 Optimism The main public endpoints,It can pass this endpoint URL: https://mainnet.optimism.io 访问.

Despite the public endpoints also have technical support,但 Optimism Emphasis on public RPC Endpoint is completely not suitable for product level of project.

Optimism The public endpoints will limit the application,And often only support a limited JSON-RPC 方法.

2. 私人 Optimism 节点提供商

如果 Optimism The lack of public node throughput limits the application of user or trading,那么 Optimism Node specialized provider of private Optimism RPC The endpoint can help engineers to visit the reliable、可扩展的 Optimism 节点.

Alchemy 是 Optimism Recommended supplier of node,Alchemy 除了拥有 web3 One of the most reliable Optimism Node performance outside,它提供 Optimism Developers with a series of host development tools,包括 Alchemy Build、Minitor 和 Optimism webhooks,These are to give developers the best Optimism Development and design of.

如何使用 Alchemy 的私人 Optimism RPC 端点?

Alchemy Provide a powerful free layer,Lets users with a reliable private Optimism RPC 端点开始.

在 Alchemy 中创建一个新的 Optimism 应用

After registration to create a free account or log in to your existing account

点击 dashboard 右上方“Create APP”的按钮

Alchemy 开发者平台 dashboard

Now, please fill in the following part,包括:

  1. Name your application

  2. 填写描述

  3. 选择“Optimism”作为你的“链”

  4. 选择“Optimism 主网”作为你的网络

如果你想要在 Optimism 的 Goerli Test create or move application online,你可以选择“网络”The drop-down list Goerli 测试网.

使用 Alchemy Create a private Optimism RPC 端点

接下来,点击 dashboard “View Key(查看密钥)”Button to see your HTTPS Keys and began to send a request to your new node!

从 Alchemy 应用的 dashboard 上复制你的 Optimism RPC 端点的 URL

现在,Please replace your application Optimism RPC URL,通过 Alchemy 专门提供的 Optimism Endpoint start sending traffic.

3. 自托管的 Optimism 节点

In order to complete your node configuration and implementation of control,Developers may choose to run their own Optimism 节点(比如,Since the hosting node).

设置 Optimism The first step is to identify their own nodes hardware.在这方面,Optimism Suggestion systems need to meet:

  • 至少有 16 GB 的内存

  • 一个至少有 100 GB 可用空间 SSD(固态硬盘)

After determine the hardware,Optimism Provider specifies two set user since the managed nodes ways:一种是使用 Docker 的配置,而另一种是不使用 Docker 的配置.

Here are the two Settings Optimism Node based on summary of.If you decide to set a node,可以跟着 Optimism The node configuration instructions.

(1) Docker 的配置

Optimism Recommended set the managed node method is to use their offer Docker 镜像.

通过设置节点的 Dokcer 镜像,You can skip a lot of configuration steps,Because the image has been set the most configuration.

这里是使用 Docker 配置步骤的简要概述:

  1. Clone node on your computer Github 仓库

  2. 配置节点设置

  3. Run the managed Optimism 节点

在第二步,You will have to provide more other node,另一个 L2 Optimism 节点和 L1 的 RPC 节点.

另一个的 L2 Optimism The node will be your Optimism Node is used to verify its correctness,而以太坊(L1)的 RPC Node is used to check your root node status,并通过 CTC 从 L1 下载 L2 的区块.

Optimism 建议使用 RPC Provider support node.

使用这个 Docker 配置,Your node will benefit from some additional features,To help you maintain node.

How to network health inspection service?

Network health testing services regularly your node status were compared with the state of the reference node,Make sure your nodes synchronize right.

Error detector scans from Optimism The orderer trading and contrast on your node to compute the result.

最后,Local hosting dashboard Will allow you to easily access the basic nodes measure,Including the fault data、DTL 同步等.

2. 非 Docker 配置

If the configuration in advance Docker The mirror can provide you with enough custom,Optimism Also describes the framework of independent setting node.然而,They do not recommend this set node way.

Although these instructions tested,But they are not as good as Docker Configuration way that secure.This method may be accompanied by setting the risk of node function not beautiful.This method of instruction as follows:

1.Installation need to run Optimism Node software packages and tools

You want to install packages and tools as follows:

  • Libusb - Geth Used to check the hardware wallet library

  • Node.js - 一段 Javascript 运行时间

  • Yarn - 一个常见的 Node.js 软件包管理工具

  • Go - Nodes run programming language

2.Set the data transport layer

DTL Is the first part of the node software.You can download the source code here,To edit its configuration and run the floor.

就像 Docker Configuration as is the case,You will need to be here for you since the escrow Optimism Node provides another node,Let it can synchronize the block.

Once the operation,你需要管理 DTL To make sure it with Optimism Properly synchronous.

3.设置 Optimism 的客户端

设置 Optimism The client is your self managed nodes to do the second part of the.You must compile the source code,Download and verify from Optimism The state of the node creation,Create and configure its environment,Run the configuration and in the last open the client.

To want more control over their own professional node configuration web3 开发者来说,Run the managed nodes just another choice.但是,比起使用 Optimism Node providers and Alchemy Such as developer platform,To start and manage the managed nodes is more expensive and time-consuming selection.

哪种 Optimism Node is best for me?

在大多数情况下,通过 Alchemy 使用私人 Optimism The endpoint is the best choice.

公共 Optimism Endpoint should not be in the service of the flow of product level project,Unless you are a professional infrastructure engineer,Or you should not manage their own Optimism 节点.

即使你是 Optimism The temporary traders or dApp 用户,用一个专门的 Optimism The endpoint to update their own Metamask Purse can also serve themselves to provide faster and more reliable.

从今天开始,Using the powerful in the market、免费的 Optimism Node provider layer,用 Alchemy To release your dApp All the power of.

copyright notice
author[golden finance],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/265/202209221246516271.html

Random recommended