参考官方文档:
https://github.com/hyperledger/blockchain-explorer
本文主要用的是fabric first-network为示例区块链网络。本配置文档基于Debian(8.x Jessie)配置,Ubuntu系统基本一致,只在Postgre-SQL安装时要写对应的版本号有所不同,Centos系统可以参考,在安装各项时使用的安装语句不同。下面开始安装说明。
(一)前提条件:
nodejs 8.11.x (Note that v9.x is not yet supported)
PostgreSQL 9.5 or greater
docker 17.06.2-ce
docker-compose 1.14.0
1. nodejs 8.11.3 安装
由于直接安装node时可能会出现版本问题,这里使用nvm严格控制node版本的安装
1. 1开始安装(Linux系统下)
可以通过curl或者wget进行安装,命令如下
curl方式
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
wget方式
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
如果你系统没有安装git的话,请先安装git,安装命令请参考下面
ubuntu系统
sudo apt-get install git
centos
sudo yum install git
1.2 可能遇到的问题
安装完后,如果是用xshell连远程主机的话,先重连一次,不然会发现提示找不到nvm命令
可能出现依旧提示找不到nvm命令,那么请使用source命令,如下
source ~/.bashrc
如果是zsh的话,请用
source ~/.zshrc
如果还是提示找不到nvm命令,那么参照上面安装nvm的命令,重新安装。
1.3