以太坊区块链浏览器搭建
写在前面:
Write it in front:
当然,读者若要实践,那么电脑上必须已经搭建好了geth,并且命令“geth version”能显示版本信息;针对以太坊各个链(私链,公链,测试链)都可以用该篇文章来搭建区块链浏览器,且步骤几乎一模一样,若有疑惑,或者遇到问题,请看文末笔者给出的邮箱地址,欢迎一起探讨学习。
& nbsp; Of course, if the reader is to practice, then the computer must have been set up genth and ordered to show versions of the information; this article can be used to create block-chain browsers for the chains in Etai (private chains, public chains, test chains) and almost identical steps, if there are doubts or problems, please look at the address of the mailbox given by the person who wrote at the end of the text and welcome to study together.
笔者搭建环境:ubuntu16 + npm、nodejs(安装系统自带版本)
I've built the environment: ubuntu16 + npm, nodejs (installation of the system with its own version)
在命令行一直回车,下一步即可。
Go back to the car at the command line, the next step will be fine.
上述两句命令笔者未遇到任何错误。
There were no errors in the two sentences.
选择1,继续完成安装
Option 1, continue installation
到这里,bower工具就已经安装成功了。
By this point, the power tool has been installed.
笔者是在私链上搭建,所以与各位读者在命令上存在一些微小的差别,命令有差异的地方,笔者会标红
The pen was built on a private chain, so there's a slight difference in the command from the reader, and where there's a difference in the command, the pen will be red.
geth --networkid 19303 --nodiscover --datadir "/root/eth_sync/private-chain/" --rpc --rpcapi "db,net,eth,web3,personal" --port 61916 --rpcport 8545 --rpccorsdomain '*' console
这里读者能正常启动geth节点就行,不需要其他任何操作。
Here the reader can start the geth node properly, and no other operation is required.
启动的开始会有很多的 WARN 和 ERR,这个不用管,让他自己跑
There's gonna be lots of Warn and ERR starting up. Don't worry about it. Let him run.
过不了一会儿就会恢复正常,
It'll be back to normal in a few minutes.
目前为止,基本上就已经搭建完成了,在浏览器输入“localhost:8000”即可访问你搭建的区块链浏览器,如下图
& nbsp; so far, it's almost complete. Enter "localhost:8000" on the browser to access the block chain browser you have set up, as follows:
笔者可能会感到迷惑,为什么不显示区块数据呢,难道是节点没连接上?并不是,事实是该源码需要的js库文件是访问的ajax.googleapis.com,如果你没有和(fan)谐(qiang)软件,就不能显示区块数据。
The author may be confused as to why the block data is not shown, or if the node is not connected? No, the fact is that the js library file that the source code requires is accessed ajax.googleapis.com, and if you do not have the (fan) qiang software, you cannot show block data.
笔者给出以下解决方案:
The following solutions were offered by the author:
- 在项目中查找使用“ajax.googleapis.com”的地方,利用sublime提供的搜索功能,如下图
- 和(fan)谐(qiang)下载这两个文件的源码
注:若没有fq资源,亦可以在网上找这两个文件的源码,应该都大同小异 - 把下载的文件放到 explorer-master\app 目录下
- 修改 script 引用的 src 路径
此刻读者只需要刷新一下浏览器页面,大功告成。
At this point, the reader needs to refresh the browser page, and it's done.
1-7步,只能在本地访问。
1-7 steps, only local access.
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。