>
可以看到Listening on [::]:30303和Welcome to the Geth JavaScript console!的提示,说明已经启动成功
注意:如果想将Ubuntu作为永久区块链节点使用,当使用nohup命令时,Geth启动参数console必须去掉,否则Geth会自动停止。
2、在windows启动区块链节点
进入Windows下Geth的目录 ,放置配置好的piccgenesis.json文件,执行如下命令:
geth --datadir "%cd%chain" init piccgenesis.json
创建数据存放地址并初始化创世块
geth--identity "PICCetherum" --rpc--rpccorsdomain "*" --datadir "%cd%chain" --port"30303" --rpcapi"db,eth,net,web3" --networkid 95518 console
当看到Listening on [::]:30303和Welcome to the Geth JavaScript console!的提示,说明已经启动成功
五、使用节点创建账号
启动节点成功后,会进入Geth的命令行模式,输入如下命令
personal.newAccount()
系统会提示你输入账号密码,并确认,最后会显示一个新生成的账号。
六、启动Windows下私有链图形节点
首先按上面的步骤启动Geth并创建了账号,然后解压缩Ethereum-Wallet,运行Ethereum-Wallet.exe,即启动成功,如果区块链正常的话,会在右上角显示“PRIVATE-NET”,点击“LAUNCH APPLICATION”进入图形界面即可。
七、连接其他节点
首先要知道自己的节点信息,在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会显示出新添加的节点。ubuntu 3d测试
八、使用节点进行挖矿
在Geth命令行界面下,输入miner.start()即启动挖矿,挖矿后,会不停刷屏,输入miner.stop()即停止,不用管刷屏导致的命令不全,命令会正常执行。
参考文章:
1.
2. #setting-up-a-local-private-testnet
3. https://github.com/ethereum/go-ethereum/wiki/Connecting-to-the-network
4. https://github.com/ethereum/go-ethereum/wiki/JavaScript-Console
5. https://github.com/ethereum/go-ethereum/wiki/Mining
6. https://github.com/ethereum/go-ethereum/wiki/Managing-your-accounts
7. https://github.com/janx/ethereum-bootstrap
本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-84254-4.html
可见一斑