Blockchain | geth1.12的一些问题

发布时间 2023-08-31 15:16:05作者: Mz1

Blockchain | geth1.12的一些问题

最近重装了geth,是最新的geth version 1.12.2-stable-bed84606
但是这个版本似乎挖不了矿了,不再PoW了。

image

还是跟之前一样的创世区块:

{
    "config":{
        "chainId": 15,
        "homesteadBlock": 0,
        "byzantiumBlock": 0,
        "constantinopleBlock": 0,
        "eip150Block": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
    "nonce": "0x0000000000000033",
    "timestamp": "0x0",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "gaslimit": "0x8000000",
    "difficulty": "0x100",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "coinbase": "0x3333333333333333333333333333333333333333",
    "alloc": {}
}

然后用geth初始化链子:

geth --datadir . init C:\Users\mz1\Desktop\testchain\genesis.json

然后导入一个账户:

geth --datadir . account import C:\Users\mz1\Desktop\testchain\privatekey1.txt

然后启动:

geth --datadir . --nodiscover --networkid 15 --http

然后无法挖矿。
具体的问题可以参考:https://ethereum.stackexchange.com/questions/150714/fatal-failed-to-register-the-ethereum-service-ethash-is-only-supported-as-a-hi

反正就是关闭了工作量证明:
image

有一种方式就是在创世区块中分配初始资产:
image