前端技术

【初识区块链技术】以太坊环境搭建

2019-05-23  本文已影响13人  一俢

这篇文章你会学到:

以太坊客户端的下载和安装

geth 命令的使用

web3

创建私有区块链

{
    "config": {
        "chainId": 10,
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
    "alloc": {},
    "coinbase": "0x0000000000000000000000000000000000000000",
    "difficulty": "0x1",
    "extraData": "",
    "gasLimit": "0x2fefd8",
    "nonce": "0x0000000000000042",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "timestamp": "0x00"
}
geth \
--identity "linoy" \
--rpc \
--rpcaddr "localhost" \
--rpccorsdomain "*" \
--datadir "./daibi" \
--port "30303" \
--nodiscover \
--rpcapi "personal,db,eth,net,web3,miner" \
--networkid 1999 console 2>>geth.log

注:在日志 geth.log 中查看到 Generating DAG in progress epoch=0 percentage=99 elapsed=3m4.183s 的进度到达 100% 时,挖矿会开始正式开启,此时你的第 0 个账户才会开始有余额

genesis.json 配置字段解释:

〖坚持的一俢〗

上一篇下一篇

猜你喜欢

热点阅读