-
1、下载Geth.exe 运行文件,并安装
https://github.com/ethereum/go-ethereum/releases/
下载后,只有一个Geth.exe的文件 -
2、cmd进入按章目录运行:
geth -help
看看是否可用geth命令 -
3、在Geth安装目录下放置初始化创世块文件
genesis.json
{ "nonce":"0x0000000000000042", "mixhash":"0x0000000000000000000000000000000000000000000000000000000000000000", "difficulty": "0x4000", "alloc": {}, "coinbase":"0x0000000000000000000000000000000000000000", "timestamp": "0x00", "parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000", "extraData": "PICC GenesisBlock", "gasLimit":"0xffffffff"}复制代码
-
4、初始化创世块
geth --datadir "%cd%\chain" init genesis.json
%cd%:代表Geth安装目录
-
5、打开geth控制台
geth -datadir "%cd%\chain" console
-
6、创建账号,键入:
personal.newAccount()
会提示输入密码,输入:
yourpassword
生成后:
"0xdc96ed19ac0efa363166ba32d9f887280a9ce710"
-
7、下载打开图形化钱包
https://github.com/ethereum/mist/releases/
下载解压缩后,Ethereum-Wallet即为以太坊图形化界面,打开Ethereum Wallet.exe
-
8、连接其他节点
首先要知道自己的节点信息,在Geth命令行界面下输入命令,注意大小写
admin.nodeInfo 系统会显示enode:"enode://1e3c1727cd3bee9f25edeb5dbb3b880e03e41f8eec99566557f3ee0422734a8fcad17c161aa93d61bdbfb28ed152c143c7eb501db58bc63502a104a84b62d742@0.0.0.0:30303
其中enode://1e3c1727cd3bee9f25edeb5dbb3b880e03e41f8eec99566557f3ee0422734a8fcad17c161aa93d61bdbfb28ed152c143c7eb501db58bc63502a104a84b62d742@0.0.0.0:30303
就是自己节点的信息,注意要把“0.0.0.0“换成你自己的IP。将这个信息发送给其他节点,在其他节点的命令行中输入:admin.addPeer(‘enode://1e3c1727cd3bee9f25edeb5dbb3b880e03e41f8eec99566557f3ee0422734a8fcad17c161aa93d61bdbfb28ed152c143c7eb501db58bc63502a104a84b62d742@192.168.1.101:30303’)
如果添加成功,输入admin.peers会显示出新添加的节点。 -
9、挖矿
开始挖矿
结束挖矿miner.start()
miner.stop()