基于区块链的毕业设计eth2-testnet-genesis – eth2测试网

本文提供基于区块链的毕业设计国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,基于区块链的毕业设计eth2-testnet-genesis – eth2测试网 是一篇很好的国外资料

eth2-testnet-genesis

This is a tool to create an Eth2 testnet genesis state, without having to make deposits for all validators.

The steps are:

  • Deploy a deposit contract
  • Take an Eth1 block hash and corresponding timestamp as starting point. The deposit contract contents must be empty at this block.
  • Configure the minimum genesis time. This normally specifies what the above would be, the first eligible eth1 block starting point. Make sure to pick an eth1 block that is compatible (has equal or later timestamp) than the minimum genesis time. If you pick a time in the future, the generated state is invalid.
  • Configure the genesis delay to adjust the actual genesis time (actual genesis time = chosen eth1 time + delay)

The result:

  • The deposit data tree at genesis will be empty, instead of filled with the genesis validators.
    • The expected empty deposit tree root is 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e (32th order zero hash, with zero length-mixin)
  • The validators will be pre-filled in the genesis state.
  • The state has an existing eth1 block, empty deposit tree, and zero deposit count, from where deposits can continue.
  • The state has a zero deposit index: block proposers won’t have to search for non-existing deposits of the pre-filled validators.
  • The deposit contract is considered to be empty by Eth2 nodes at genesis. Any deposits will be appended to the validator set, as expected.

Usage

Create genesis state. See sub-commands for different fork versions.  Sub commands:   phase0           Create genesis state for phase0 beacon chain   altair           Altair not supported yet   merge            Create genesis state for post-merge beacon chain, from eth1 and eth2 configs 

Phase0

Create genesis state for phase0 beacon chain  Flags/args:       --config string         Path to config YAML for eth2 (default "mainnet.yaml")       --eth1-block bytes32    Eth1 block hash to put into state (default 0000000000000000000000000000000000000000000000000000000000000000)       --mnemonics string      File with YAML of key sources (default "mnemonics.yaml")       --state-output string   Output path for state file (default "genesis.ssz")       --timestamp uint        Eth1 block timestamp (default 1618411084)       --tranches-dir string   Directory to dump lists of pubkeys of each tranche in (default "tranches")  

Merge

Create genesis state for post-merge beacon chain, from eth1 and eth2 configs  Flags/args:       --eth1-config string    Path to config JSON for eth1 (default "eth1_testnet.json")       --eth2-config string    Path to config YAML for eth2 (default "eth2_testnet.yaml")       --mnemonics string      File with YAML of key sources (default "mnemonics.yaml")       --state-output string   Output path for state file (default "genesis.ssz")       --tranches-dir string   Directory to dump lists of pubkeys of each tranche in (default "tranches") 

Common inputs

Eth1 config

A genesis.json, as specified in Geth. See The Merge devnet setup guide for more info and config example.

Eth2 config

A standard YAML file, as specified in Eth2.0 specs. Concatenation of configs of all relevant phases.

Mnemonics

The mnemonics.yaml is formatted as:

- mnemonic: "reward base tuna ..."  # a 24 word BIP 39 mnemonic   count: 100  # amount of validators - mnemonic: "hint dizzy fog ..."   count: 9000 # ... more

Outputs

The output will be:

  • genesis.ssz: a state to start the network with
  • tranches: a dir with text files for each mnemonic, listing all pubkeys (1 per line). Useful for to check if keystores are generated correctly before genesis, and to track the validators.

Computing extra details

To get info such as fork digest, genesis validators root, etc. run the compute_genesis_details.py script. Install dependencies with (use of a venv recommended):

pip install milagro-bls-binding==1.6.3 eth2spec==1.0.0 

License

MIT. See LICENSE file.


eth2 testnet genesis

这是一个创建eth2testnet genesis状态的工具,无需为所有验证器存款。

步骤是:

  • 部署存款合同
  • 采取Eth1块散列并相应的时间戳作为起点。此区块的存款合同内容必须为空。
  • 配置最短生成时间。这通常指定上面的内容,即第一个合格的eth1块起始点。确保选择一个兼容的eth1块(时间戳等于或晚于最小生成时间)。如果选择将来的某个时间,则生成的状态无效。
  • 配置genesis延迟以调整实际genesis时间(实际genesis时间=所选eth1时间+延迟)

结果:

  • genesis的存款数据树将为空,而不是用genesis验证器填充。预期的空存款树根是0xd70a234731285c6804c2a4f5671ddb8c82c99740f207854891028af34e27e5e(32阶零散列,具有零长度混合)
  • 验证程序将在genesis状态下预填充。
  • 该州有一个现有的eth1块、空存款树和零存款计数,存款可以从中继续。
  • 该州的存款指数为零:区块提案人无需搜索预先填写的验证器中不存在的存款。
  • 存款合同被genesis的Eth2节点视为空。任何存款都将按预期附加到验证程序集。

用法

Create genesis state. See sub-commands for different fork versions.  Sub commands:   phase0           Create genesis state for phase0 beacon chain   altair           Altair not supported yet   merge            Create genesis state for post-merge beacon chain, from eth1 and eth2 configs 

阶段0

Create genesis state for phase0 beacon chain  Flags/args:       --config string         Path to config YAML for eth2 (default "mainnet.yaml")       --eth1-block bytes32    Eth1 block hash to put into state (default 0000000000000000000000000000000000000000000000000000000000000000)       --mnemonics string      File with YAML of key sources (default "mnemonics.yaml")       --state-output string   Output path for state file (default "genesis.ssz")       --timestamp uint        Eth1 block timestamp (default 1618411084)       --tranches-dir string   Directory to dump lists of pubkeys of each tranche in (default "tranches")  

合并

Create genesis state for post-merge beacon chain, from eth1 and eth2 configs  Flags/args:       --eth1-config string    Path to config JSON for eth1 (default "eth1_testnet.json")       --eth2-config string    Path to config YAML for eth2 (default "eth2_testnet.yaml")       --mnemonics string      File with YAML of key sources (default "mnemonics.yaml")       --state-output string   Output path for state file (default "genesis.ssz")       --tranches-dir string   Directory to dump lists of pubkeys of each tranche in (default "tranches") 

公共输入

Eth1配置

A创世纪.json,如Geth中所述。有关更多信息和配置示例,请参阅合并devnet安装指南。

助记符

Eth2.0规范中指定的标准YAML文件。所有相关阶段配置的串联。

输出

助记符.yaml格式为:

- mnemonic: "reward base tuna ..."  # a 24 word BIP 39 mnemonic   count: 100  # amount of validators - mnemonic: "hint dizzy fog ..."   count: 9000 # ... more

计算额外细节

输出为:

  • 创世纪.ssz:用
  • 段启动网络的状态:一个目录,每个助记符都有文本文件,列出所有pubkey(每行1个)。用于在genesis之前检查密钥库是否正确生成,以及跟踪验证器。你知道吗

许可证

以获取诸如fork digest、genesis validators root等信息。运行computeu genesis_详细信息.py脚本。安装依赖项(建议使用venv):

pip install milagro-bls-binding==1.6.3 eth2spec==1.0.0 

License

MIT。请参阅许可证文件。

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/21652.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » 基于区块链的毕业设计eth2-testnet-genesis – eth2测试网

提供最优质的资源集合

立即查看 了解详情