一、下載以太坊源碼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 |
|
下一篇,我會講一講如何搭建 私有網絡節點羣: