以太坊区块链浏览器ethereum explorer开源部署过程,以及问题解决。
更多区块链技术与应用分类:
开源区块链部署

1.开源ethereum - explorer下载
git https://github.com/carsenk/explorer.git

2.编辑工程
修改app.js中:GETH_HOSTNAME———>本地IP地址

3.启动geth
geth --rpc --rpcaddr "0.0.0.0" --port 30303 --rpcapi "db,eth,net,web3,personal" --rpccorsdomain "http://localhost:8000" --datadir "data0" --networkid 1108 console

4.启动explorer
(1)进入工程项目文件
(2)npm install
(3)npm start

(4)在浏览器输入:“http://localhost:8000/”,进入浏览器。(必须开启geth)

TroubleShooting
1.http_outgoing JS的错误
错误描述
The header content contains invalid characters

错误原因
低版本的http-server一个bug
解决方法1
将package.json里的"http-server": "^0.6.1",改为"http-server": "^0.9.0",
在命令行输入: npm start(或npm update http-server后再npm start)
问题解决。
解决方法2
若还是不行,解决方案
输入 ”npm install karma --save“
“npm install http-server -D”
2.浏览器不能正常显示
错误描述
GET https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js net::ERR_CONNECTION_RESET...
错误原因
url无效(需要翻墙)
解决方法
修改index.html--><lib>标签下
将https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js
替换为 https://cdn.bootcss.com/angular.js/1.4.5/angular.min.js
将https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js
替换为https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js
若是要跨域请求,如访问公网,修改json

当需跨域访问时,geth启动:
geth --rpc --rpcaddr "0.0.0.0" --port 30303 --rpcapi "db,eth,net,web3,personal" --rpccorsdomain "http://localhost:8000,http://192.168.5.152:8000" --datadir "data0" --networkid 1108 console
提示:
两个访问域名,对应localhost端口也要加上:
geth --rpc --rpcaddr "0.0.0.0" --port 30303 --rpcapi "db,eth,net,web3,personal" --rpccorsdomain "http://localhost:8000,http://localhost:8080,http://192.168.5.152:8000,http://192.168.5.152:8080" --datadir "data0" --networkid 1108 console
注意
- 服务器部署时需用到 https://blog.csdn.net/hexiaodouaipiqiu/article/details/51733176
- npm install 在centos部署的时候要换成 npm install --unsafe-perm
原文链接:以太坊区块链浏览器(一)拿来就用主义