以太坊私有链-挖矿blockNumber总是为0是什么原因

现象

部署好私有链后,创建账户,执行挖矿命令 miner.start(),执行了很久发现账号余额还是0

blockNumber也是0;使用geth的默认配置blockNumber会增加很快,使用了自定义的配置

{
  "config": {
        "chainId": 15,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
    "coinbase" : "0x0000000000000000000000000000000000000000",
    "difficulty" : "0x40000",
    "extraData" : "",
    "gasLimit" : "0xffffffff",
    "nonce" : "0x0000000000000042",
    "mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
    "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
    "timestamp" : "0x00",
    "alloc": { }
}

参数的含义参考:

以太坊私有链入门最新教程(6.6更新) https://blog.csdn.net/wxb880114/article/details/79202378

其中 difficulty参数觉得出块的时间,那么设置小一点不就可以了嘛

于是修改genesis.json如下

{
  "config": {
        "chainId": 15,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
    "coinbase" : "0x0000000000000000000000000000000000000000",
    "difficulty" : "400",
    "extraData" : "",
    "gasLimit" : "2100000",
    "nonce" : "0x0000000000000042",
    "mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
    "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
    "timestamp" : "0x00",
    "alloc": { }
}

很快就有了



扫描二维码关注公众号,回复: 1766722 查看本文章


生产环境改怎么设置呢?waiting for me 想想!



欢迎大家一起加入讨论!!!




欢迎大家一起加入讨论!!!

猜你喜欢

转载自blog.csdn.net/wxb880114/article/details/80741669