fabric blockchain-explorer安装

  1. 版本v1.0.0-rc1 https://github.com/hyperledger/blockchain-explorer/archive/v1.0.0-rc1.tar.gz
  2. nodejs8.11.x
  3. jq sudo apt install jq
  4. docker 18.09.2+
  5. docker compose 1.14.0
  6. PostgreSQL 9.5+ sudo apt-get install postgresql
  7. cd /etc/postgresql/9.5/main
  8. sudo vim pg_hba.conf

host all all 0.0.0.0/0 trust

local all all trust

  1. sudo vim postgresql.conf

listen_addresses = '*'

  1. systemctl restart postgresql-9.5.service
  2. systemctl status postgresql-9.5.service
  3. cd blockchain-explorer/app/persistence/fabric/postgreSQL
  4. chmod -R 775 db/
  5. cd blockchain-explorer/app/persistence/fabric/postgreSQL/db
  6. sudo -u postgres ./createdb.sh
  7. 配置first-network启动的docker配置文件fabric-samples/first-network/base/docker-compose-base.yaml 。添加红色部分,让explorer能够发现网络拓扑

orderer.example.com:

container_name: orderer.example.com

image: hyperledger/fabric-orderer:$IMAGE_TAG

environment:

- ORDERER_OPERATIONS_LISTENADDRESS=0.0.0.0:8443 # operation RESTful API

- ORDERER_METRICS_PROVIDER=prometheus # prometheus will pull metrics from orderer via /metrics RESTful API

ports:

- 7050:7050

- 8443:8443 # Operation REST

peer0.org1.example.com:

container_name: peer0.org1.example.com

extends:

file: peer-base.yaml

service: peer-base

environment:

- CORE_OPERATIONS_LISTENADDRESS=0.0.0.0:9443 # operation RESTful API

- CORE_METRICS_PROVIDER=prometheus # prometheus will pull metrics from orderer via /metrics RESTful API

ports:

- 7051:7051

- 7053:7053

- 9443:9443

peer1.org1.example.com:

container_name: peer1.org1.example.com

extends:

file: peer-base.yaml

service: peer-base

environment:

- CORE_OPERATIONS_LISTENADDRESS=0.0.0.0:9444 # operation RESTful API

- CORE_METRICS_PROVIDER=prometheus # prometheus will pull metrics from orderer via /metrics RESTful API

ports:

- 8051:7051

- 8053:7053

- 9444:9444

peer0.org2.example.com:

container_name: peer0.org2.example.com

extends:

file: peer-base.yaml

service: peer-base

environment:

- CORE_OPERATIONS_LISTENADDRESS=0.0.0.0:9445 # operation RESTful API

- CORE_METRICS_PROVIDER=prometheus # prometheus will pull metrics from orderer via /metrics RESTful API

ports:

- 9051:7051

- 9053:7053

- 9445:9445

peer1.org2.example.com:

container_name: peer1.org2.example.com

extends:

file: peer-base.yaml

service: peer-base

environment:

- CORE_OPERATIONS_LISTENADDRESS=0.0.0.0:9446 # operation RESTful API

- CORE_METRICS_PROVIDER=prometheus # prometheus will pull metrics from orderer via /metrics RESTful API

ports:

- 10051:7051

- 10053:7053

- 9446:9446

  1. 修改 /blockchain-explorer/app/platform/fabric/connection-profile/first-network.json 中的密钥/fabric-path/fabric-samples/first-network/crypto-config/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/ 有节点发现机制不用全配
  2. 里面的账号密码是CA的账号密码,在配置完登录界面时用
  3. blockchain-explorer/app/platform/fabric/config.json可以修改网络的名字和配置文件路径
  4. cd blockchain-explorer
  5. cnpm install
  6. cd blockchain-explorer/app/test
  7. cnpm install
  8. npm run test (有错误不要紧,是由于一个脚本的pgsql的账号密码没写对,不用管)
  9. cd blockchain-explorer/client
  10. cnpm install
  11. npm run test:ci -- -u --coverage
  12. npm run build
  13. cd blockchain-explorer/
  14. ./start.sh
  15. http://localhost:8080
  16. ./stop.sh

猜你喜欢

转载自blog.csdn.net/qq_25944759/article/details/107922028