部署超级账本fabric区块可视化浏览器

这篇具有很好参考价值的文章主要介绍了部署超级账本fabric区块可视化浏览器。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

文件存放路径
在根目录中构建这样的目录结构

hyperledger-explorer/
├── config.json
├── connection-profile
│   └── org1ProdNetworkConnection.json
└── docker-compose-explorer.yaml

编写org1ProdNetworkConnection.json文件,注意自己的端口号和文件路径配置

{
  "name": "prod-network",
  "version": "1.0.0",
  "client": {
    "tlsEnable": true,
    "adminCredential": {
      "id": "exploreradmin",
      "password": "exploreradminpw"
    },
    "enableAuthentication": true,
    "organization": "Org1",
    "connection": {
      "timeout": {
        "peer": {
          "endorser": "300"
        },
        "orderer": "300"
      }
    }
  },
  "channels": {
    "businesschannel": {
      "peers": {
        "peer0.org1.example.com": {
          "endorsingPeer": true,
          "chaincodeQuery": true,
          "ledgerQuery": true,
          "eventSource": true
        },
        "peer1.org1.example.com": {
          "endorsingPeer": true,
          "chaincodeQuery": true,
          "ledgerQuery": true,
          "eventSource": true
        },
        "peer0.org2.example.com": {
          "endorsingPeer": true,
          "chaincodeQuery": true,
          "ledgerQuery": true,
          "eventSource": true
        },
        "peer1.org2.example.com": {
          "endorsingPeer": true,
          "chaincodeQuery": true,
          "ledgerQuery": true,
          "eventSource": true
        }
      }
    }
  },
  "organizations": {
    "Org1": {
      "mspid": "Org1MSP",
      "peers": [
        "peer0.org1.example.com",
        "peer1.org1.example.com"
      ],
      "adminPrivateKey": {
        "path": "/tmp/crypto/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/keystore/priv_sk"
      },
      "signedCert": {
        "path": "/tmp/crypto/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/signcerts/User1@org1.example.com-cert.pem"
      }
    },
    "Org2": {
      "mspid": "Org2MSP",
      "peers": [
        "peer0.org2.example.com",
        "peer1.org2.example.com"
      ],
      "adminPrivateKey": {
        "path": "/tmp/crypto/prod-network/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/keystore/priv_sk"
      },
      "signedCert": {
        "path": "/tmp/crypto/peerOrganizations/org2.example.com/users/User1@org2.example.com/msp/signcerts/User1@org2.example.com-cert.pem"
      }
    }
  },
  "peers": {
    "peer0.org1.example.com": {
      "url": "grpcs://peer0.org1.example.com:7051",
      "grpcOptions": {
        "ssl-target-name-override": "peer0.org1.example.com",
        "hostnameOverride": "peer0.org1.example.com",
        "request-timeout": 120001
      },
      "tlsCACerts": {
        "path": "/tmp/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
      }
    },
    "peer1.org1.example.com": {
      "url": "grpcs://peer1.org1.example.com:8051",
      "grpcOptions": {
        "ssl-target-name-override": "peer1.org1.example.com",
        "hostnameOverride": "peer1.org1.example.com",
        "request-timeout": 120001
      },
      "tlsCACerts": {
        "path": "/tmp/crypto/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls/ca.crt"
      }
    },
    "peer0.org2.example.com": {
      "url": "grpcs://peer0.org2.example.com:9051",
      "grpcOptions": {
        "ssl-target-name-override": "peer0.org2.example.com",
        "hostnameOverride": "peer0.org2.example.com",
        "request-timeout": 120001
      },
      "tlsCACerts": {
        "path": "/tmp/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt"
      }
    },
    "peer1.org2.example.com": {
      "url": "grpcs://peer1.org2.example.com:10051",
      "grpcOptions": {
        "ssl-target-name-override": "peer1.org2.example.com",
        "hostnameOverride": "peer1.org2.example.com",
        "request-timeout": 120001
      },
      "tlsCACerts": {
        "path": "/tmp/crypto/peerOrganizations/org2.example.com/peers/peer1.org2.example.com/tls/ca.crt"
      }
    }
  }
}

编写 config.json 配置文件


{
        "network-configs": {
                "prod-network": {
                        "name": "Prod Network",
                        "profile": "./connection-profile/org1ProdNetworkConnection.json"
                }
        },
        "license": "Apache-2.0"
}

编写 docker-compose-explorer.yaml 文件

version: '2.0'


volumes:
    pgdata:
    walletstore:

services:

    explorerdb.mynetwork.com:
        image: hyperledger/explorer-db:latest
        container_name: explorerdb.mynetwork.com
        hostname: explorerdb.mynetwork.com
        ports:
            - 5432:5432
        environment:
            - DATABASE_DATABASE=fabricexplorer
            - DATABASE_USERNAME=hppoc
            - DATABASE_PASSWORD=password
        healthcheck:
            test: "pg_isready -h localhost -p 5432 -q -U postgres"
            interval: 30s
            timeout: 10s
            retries: 5
        volumes:
            - pgdata:/var/lib/postgresql/data


    explorer.mynetwork.com:
        image: hyperledger/explorer:latest
        container_name: explorer.mynetwork.com
        hostname: explorer.mynetwork.com
        ports:
            - 9090:8080
        extra_hosts:
            - "explorerdb.mynetwork.com:192.168.0.105"
            - "orderer0.example.com:192.168.0.105"
            - "orderer1.example.com:192.168.0.105"
            - "orderer2.example.com:192.168.0.105"
            - "peer0.org1.example.com:192.168.0.109"
            - "peer1.org1.example.com:192.168.0.109"
            - "peer0.org2.example.com:192.168.0.110"
            - "peer1.org2.example.com:192.168.0.110"
        environment:
            - DATABASE_HOST=explorerdb.mynetwork.com
            - DATABASE_DATABASE=fabricexplorer
            - DATABASE_USERNAME=hppoc
            - DATABASE_PASSWD=password
            - LOG_LEVEL_APP=debug
            - LOG_LEVEL_DB=info
            - LOG_LEVEL_CONSOLE=debug
            - LOG_CONSOLE_STDOUT=true
            - DISCOVERY_AS_LOCALHOST=false
        volumes:
            - ./config.json:/opt/explorer/app/platform/fabric/config.json
            - ./connection-profile:/opt/explorer/app/platform/fabric/connection-profile
            - ../crypto-config:/tmp/crypto
            - walletstore:/opt/explorer/wallet
        depends_on:
            explorerdb.mynetwork.com:
                condition: service_healthy

启动 Hyperledger Explorer:
在 Hyperledger Explorer中启动

docker-compose -f docker-compose-explorer.yaml up -d

清理(不删除持久性数据):

docker-compose -f docker-compose-explorer.yaml down

彻底清理:

docker-compose -f docker-compose-explorer.yaml down -v

启动后访问 http://192.168.2.130:9090/
IP地址修改成为自己的即可完成
hyperledge fabric可视化工具,区块链,fabric,java,docker,区块链,ubuntu文章来源地址https://www.toymoban.com/news/detail-519613.html

到了这里,关于部署超级账本fabric区块可视化浏览器的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包