|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Running an archive node for a blockchain like Ethereum or Polygon is an undertaking that’s both labor-intensive and costly. It’s more or less the pinnacle of node setups. The node will require good hardware, maintenance (i.e., good monitoring), and also time—at least whenever monitoring kicks in or a new release is due. Typically, one will only take this on for a specific reason.
为以太坊或 Polygon 等区块链运行存档节点是一项劳动密集型且成本高昂的工作。它或多或少是节点设置的顶峰。该节点将需要良好的硬件、维护(即良好的监控)以及时间——至少在监控启动或新版本到期时如此。通常,人们只会出于特定原因才会采取这一行动。
An archive node is more than a full node. A full node “only” stores the entire blockchain, whereas an archive node additionally stores every state that each smart contract and transaction ever had (i.e., at every block height). However, the additional data of an archive node can be reconstructed from the data of a full node.
存档节点不仅仅是一个完整节点。完整节点“仅”存储整个区块链,而存档节点还存储每个智能合约和交易曾经拥有的每个状态(即在每个块高度)。然而,归档节点的附加数据可以从全节点的数据重建。
Since this often leads to discussions on Twitter or online forums, I like to bring an analogy to Bitcoin: An archive node for Ethereum is akin to a Bitcoin node that stores the UTXO (Unspent Transaction Output) set valid at every block height. This isn’t particularly interesting for Bitcoin because (a) these data can be reconstructed much faster and (b) they don’t hold any special informational value. It’s different with Ethereum because there are smart contracts whose intermediate states are stored, making it possible to directly query, for example, how much USDT an account had at any given time (block height).
由于这经常会引起 Twitter 或在线论坛上的讨论,因此我喜欢用比特币进行类比:以太坊的存档节点类似于比特币节点,用于存储在每个区块高度有效的 UTXO(未花费交易输出)集。这对于比特币来说并不是特别有趣,因为(a)这些数据可以更快地重建,并且(b)它们不具有任何特殊的信息价值。它与以太坊不同,因为智能合约存储了中间状态,可以直接查询,例如,一个账户在任何给定时间(区块高度)有多少 USDT。
I synchronized my first archive node for the Ethereum ecosystem in 2019. It was out of pure curiosity: I had purchased a lot of server hardware for a project (96 cores, 768 GiB RAM, over 40 TiB SSD storage) and wanted to push it to the limit. So, I synchronized an archive node for Ethereum using geth, which took exactly 7 days and 22 hours. I still remember it so precisely because I discussed the topic on coinforum.de and documented my progress.
我在 2019 年同步了以太坊生态系统的第一个存档节点。纯粹出于好奇:我为一个项目购买了很多服务器硬件(96 个内核、768 GiB RAM、超过 40 TiB SSD 存储)并想要推送它到极限。因此,我使用 geth 同步了以太坊的一个存档节点,整整花了 7 天零 22 小时。我仍然记得如此清晰,因为我在 coinforum.de 上讨论了这个话题并记录了我的进展。
Long-term, better reasons are needed. That’s a significant difference between Ethereum and Bitcoin. Bitcoiners synchronize the entire blockchain out of idealism. In Ethereum, most users utilize node providers like Infura or Alchemy. These providers allow roughly 100,000 free API calls, sufficient for smaller projects and wallets.
从长远来看,需要更好的理由。这是以太坊和比特币之间的显着差异。比特币爱好者出于理想主义同步整个区块链。在以太坊中,大多数用户使用 Infura 或 Alchemy 等节点提供商。这些提供商允许大约 100,000 次免费 API 调用,足以满足小型项目和钱包的需求。
When and for whom is an archive node useful?
归档节点何时有用、对谁有用?
It becomes critical when one wants or needs to conduct blockchain analyses. If, for instance, you want to know which accounts held what amounts of a token on Ethereum at any time, you need to scan the blockchain block by block to find all addresses and then query the historical balances for each ERC20 transaction. This quickly exceeds the free API calls provided by Alchemy and Infura and can become expensive fast. In such cases, an archive node is worthwhile because scanning all blocks leads to as many API calls as there are blocks in the blockchain. Ethereum currently has over 20 million blocks.
当人们想要或需要进行区块链分析时,它就变得至关重要。例如,如果您想随时知道哪些账户在以太坊上持有多少代币,您需要逐块扫描区块链以找到所有地址,然后查询每笔 ERC20 交易的历史余额。这很快就超过了 Alchemy 和 Infura 提供的免费 API 调用,并且很快就会变得昂贵。在这种情况下,归档节点是值得的,因为扫描所有块会导致与区块链中的块一样多的 API 调用。以太坊目前拥有超过 2000 万个区块。
I now operate such nodes for clients. The reasons can sometimes be absurd. For instance, a company offers assistance in complying with EU regulations, which require demonstrating the CO2 consumption for each crypto asset. If you have a token on Ethereum, you must trace back all past transactions and swaps to calculate the gas used by the token. The gas corresponds to the required computational power and thus serves as an indicator of CO2 consumption.
我现在为客户运营这样的节点。原因有时可能是荒谬的。例如,一家公司提供遵守欧盟法规的协助,该法规要求证明每种加密资产的二氧化碳消耗量。如果你在以太坊上有一个代币,你必须追溯所有过去的交易和掉期来计算该代币使用的gas。该气体对应于所需的计算能力,因此可以作为二氧化碳消耗的指标。
This is, of course, ludicrous. As a Proof-of-Stake blockchain, Ethereum consumes very little energy, and synchronizing an archive node likely generates far more CO2 than you could ever save through the regulation (if at all). But it’s not my job to ask such questions, but rather to set up nodes.
这当然是可笑的。作为权益证明区块链,以太坊消耗的能源非常少,并且同步存档节点可能产生的二氧化碳远多于您通过法规节省的二氧化碳(如果有的话)。但提出这样的问题不是我的工作,而是设置节点。
What resources are needed to operate an Ethereum archive node?
运行以太坊存档节点需要哪些资源?
The differences between nodes and clients can be substantial. I have experience with Ethereum, Polygon, and Solana.
节点和客户端之间的差异可能很大。我有以太坊、Polygon 和 Solana 的经验。
Using the Nethermind client, Ethereum requires about 15 terabytes of storage for the execution layer data, 8 CPU cores (preferably 16 for synchronization), and 128 gigabytes of RAM. An alternative client is Erigon, which requires only three terabytes of data. Erigon stores data differently than Nethermind, using a flat architecture that only saves deltas between some blocks. This may result in slightly longer query times for historical data but saves a lot of space.
使用 Nethermind 客户端,以太坊需要大约 15 TB 的存储空间用于执行层数据、8 个 CPU 核心(最好是 16 个用于同步)和 128 GB 的 RAM。另一种客户端是 Erigon,它只需要 3 TB 的数据。 Erigon 存储数据的方式与 Nethermind 不同,它使用扁平架构,仅保存某些块之间的增量。这可能会导致历史数据的查询时间稍长,但会节省大量空间。
For a server, the demand is moderate. Once synchronized, less is needed. The biggest challenge is the hard drives, or rather the SSDs. To understand why, you must know how smart contracts work with the Ethereum Virtual Machine (EVM). I’ll keep it brief: Each smart contract has its own virtual memory space, which may load different parts depending on the account. This leads to numerous read and write operations (I/O) with each new block and during synchronization.
对于服务器来说,需求适中。一旦同步,就需要更少的东西。最大的挑战是硬盘,或者更确切地说是SSD。要理解其中的原因,您必须了解智能合约如何与以太坊虚拟机(EVM)配合使用。我简单说一下:每个智能合约都有自己的虚拟内存空间,根据账户的不同,虚拟内存空间可能会加载不同的部分。这会导致每个新块以及同步期间进行大量读写操作 (I/O)。
Therefore, traditional hard drives (HDDs) are outdated; SSDs are needed. Users of Nethermind must chain several SSDs together to store at least 15 terabytes. This can quickly cost a four-figure amount if
因此,传统硬盘(HDD)已经过时;需要SSD。 Nethermind 的用户必须将多个 SSD 连接在一起才能存储至少 15 TB。如果这样做的话,这很快就会花费四位数的费用
免责声明:info@kdj.com
所提供的信息并非交易建议。根据本文提供的信息进行的任何投资,kdj.com不承担任何责任。加密货币具有高波动性,强烈建议您深入研究后,谨慎投资!
如您认为本网站上使用的内容侵犯了您的版权,请立即联系我们(info@kdj.com),我们将及时删除。
-
- Invesco QQQ Trust:百万富翁制造者 ETF?
- 2024-11-23 20:30:02
- 该指数中的许多股票都是您可能会发现的大型科技股:英伟达、微软、苹果和亚马逊。