一、下载以太坊源码node
wget http://www.huiyanghua.com/js/go-ethereum-1.4.12.zip
json
二、解压vim
tar -zxvf go-ethereum-1.4.12.zip /usr/local/bin网络
三、建立私有文件夹 mkdir private-gethoracle
四、进入私有文件夹app
cd private-gethui
五、创世纪区块文件url
|
{命令行 "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": { } } |
六、初始化创世纪节点,并设置data目录:
/usr/local/bin/geth/geth --datadir ./data/00 init genesis.json(红色部分表示geth的安装目录)
能够看到在当前目录下新增了一个文件夹data,目录结构以下
启动节点, 加上console 表示启动后,启用命令行:
/usr/local/bin/geth/geth --datadir ./data/00 --networkid 1234567890 console
如今私有网络就搭建成功
挖矿
挖矿首先必须有一个帐户,输入下面的命令,查看当前node中的全部帐户:
> eth.accounts [] |
> personal.newAccount('oracle') "0xb241b0b47a4d773d5c8b462607f590f3ed1762c8" > INFO [09-16|02:54:18] New wallet appeared url=keystore:///data/00/keystore/UT… status=Locked > eth.accounts ["0xb241b0b47a4d773d5c8b462607f590f3ed1762c8"] |
挖矿首先必须有一个帐户,输入下面的命令,查看当前node中的全部帐户:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
下一篇,我会讲一讲如何搭建 私有网络节点群: