ipfs-webui可视化工具搭建

介绍 #

注意这里是私链搭建webui,公链没有这么麻烦

在IPFS项目的组织架构中,有一个IPFS-GUI工作组,主要目的是开发IPFS可视化工具,并使工具更简单、更易用、更美观。

IPFS WebUI是IPFS的Web界面,可以用来检查您的节点统计信息,展示由IPLD驱动的默克尔树结构,查看世界各地的节点并管理您的文件,而无需触摸命令行工具。

这都是粘贴的,废话不多说,直接开始安装

安装 #

  1. 拉取ipfs-webui文件
cd ~
git clone https://github.com/ipfs/ipfs-webui.git
  1. 进入安装
cd ipfs-webui
npm install

报错:

request to https://dist.ipfs.io/go-ipfs/versions failed, reason: connect ECONNREFUSED 69.171.233.24:443
。。。。。。。。。。。。
。。。。。。。。。。。。
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! go-ipfs-dep@0.4.18 install: `node src/bin.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the go-ipfs-dep@0.4.18 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/zcy/.npm/_logs/2019-01-13T13_37_11_707Z-debug.log

问题原因:

网络被限制了

解决办法:

  1. 找到一个工作网关:https : //ipfs.github.io/public-gateway-checker/
  2. 将环境变量设置GO_IPFS_DIST_URL为“https://SOME_WORKING_GATEWAY/ipns/dist.ipfs.io”

注意:进入第一个网址找到的网关要能用,例如:我找的是这个

这种带有绿标的,其他的试了没用。

然后命令行输入   注意这个dweb.link就是你找的那个
export GO_IPFS_DIST_URL="https://dweb.link/ipns/dist.ipfs.io"
npm install
  1. 运行IPFS
重新打开一个命令行
ipfs daemon
  1. 运行开发服务器
回到install那个命令行
npm start
#在监视模式下运行单元测试    
npm run test:unit:watch
#运行 UI 组件查看器 @ http://localhost:9009  这个另开一个命令行 进来打开
npm run storybook
  1. 根据提示走
> ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://localhost:3000", "http://127.0.0.1:5001", "https://webui.ipfs.io"]'
> ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "POST"]'

它会提示你输入这两行命令 重启ipfs

  1. 完成