0

I have created a multipeer network. I have created 3 orgs StancOrg , StancOrgA ,StancOrgB.Here's the configtx.yaml file.

       Organizations:
        - &StancOrg
           Name: StancOrgMSP
           ID: StancOrgMSP
           MSPDir: crypto-config/peerOrganizations/peerStanc.com/msp
           AnchorPeers:
              - Host: HOSTA.peerStanc.com
                Port: 7051

       - &StancOrgA
            Name: StancOrgAMSP
            ID: StancOrgAMSP
            MSPDir: crypto-config/peerOrganizations/peerStancA.com/msp
            AnchorPeers:
               - Host: HOSTA.peerStancA.com
                 Port: 7051

       - &StancOrgB
            Name: StancOrgBMSP
            ID: StancOrgBMSP
            MSPDir: crypto-config/peerOrganizations/peerStancB.com/msp
            AnchorPeers:
                - Host: HOSTA.peerStancB.com
                  Port: 7051

       - &OrdererOrg
             Name: StancOrderer
             ID: StancOrdererMSP
             MSPDir: crypto-config/ordererOrganizations/StancOrdr.com/msp

    Capabilities:
        Global: &ChannelCapabilities
            V1_1: true
        Orderer: &OrdererCapabilities
            V1_1: true
       Application: &ApplicationCapabilities
            V1_2: true

   Application: &ApplicationDefaults
       Organizations:

   Orderer: &OrdererDefaults
        OrdererType: solo
        Addresses:
             - StancOrderer.StancOrdr.com:7050
        BatchTimeout: 0.1s
        BatchSize:
            MaxMessageCount: 10
            AbsoluteMaxBytes: 99 MB
            PreferredMaxBytes: 512 KB
       Kafka:
           Brokers:
            - 127.0.0.1:9092
           Organizations:

   Profiles:

I have created a masterchannel on my network.

I am trying to setup Hyperledger Explorer for the created fabric network. I have also updated the config.json based on the created fabric network.

{
  "network-configs": {
    "network-1": {
      "version": "1.0",
      "clients": {
        "client-1": {
          "tlsEnable": false,
          "organization": "StancOrgMSP",
          "channel": "masterchannel",
          "credentialStore": {
            "path": "./tmp/credentialStore_Org1/credential",
            "cryptoStore": {
              "path": "./tmp/credentialStore_Org1/crypto"
            }
          }
        }
      },
      "channels": {
        "masterchannel": {
          "peers": {
            "HOSTA.peerStanc.com": {}
          },
          "connection": {
            "timeout": {
              "peer": {
                "endorser": "6000",
                "eventHub": "6000",
                "eventReg": "6000"
              }
            }
          }
        }
      },
      "organizations": {
        "StancOrgMSP": {
          "mspid": "StancOrgMSP",
          "fullpath": false,
          "adminPrivateKey": {
            "path": "~/Documents/Application/fabric-multipeer/crypto-config/peerOrganizations/peerStanc.com/users/Admin@peerStanc.com/msp/keystore"
          },
          "signedCert": {
            "path": "~/Documents/Application/fabric-multipeer/crypto-config/peerOrganizations/peerStanc.com/users/Admin@peerStanc.com/msp/signcerts"
          }
        },
        "StancOrgAMSP": {
          "mspid": "StancOrgAMSP",
          "adminPrivateKey": {
            "path": "~/Documents/Application/fabric-multipeer/crypto-config/peerOrganizations/peerStancA.com/users/Admin@peerStanc.com/msp/keystore"
          }
        },
        "StancOrgBMSP": {
          "mspid": "StancOrgBMSP",
          "adminPrivateKey": {
            "path": "~/Documents/Application/fabric-multipeer/crypto-config/peerOrganizations/peerStancB.com/users/Admin@peerStanc.com/msp/keystore"
          }
        },
        "StancOrdererMSP": {
          "mspid": "StancOrdererMSP",
          "adminPrivateKey": {
            "path": "~/Documents/Application/fabric-multipeer/crypto-config/ordererOrganizations/StancOrdr.com/users/Admin@StancOrdr.com/msp/keystore"
          }
        }
      },
      "peers": {
        "HOSTA.peerStanc.com": {
          "tlsCACerts": {
            "path": "~/Documents/Application/fabric-multipeer/crypto-config/peerOrganizations/peerStanc.com/peers/HOSTA.peerStanc.com/tls/ca.crt"
          },
          "url": "grpc://localhost:7051",
          "eventUrl": "grpc://localhost:7053",
          "grpcOptions": {
            "ssl-target-name-override": "HOSTA.peerStanc.com"
          }
        },
        "HOSTA.peerStancA.com": {
          "url": "grpc://localhost:8051"
        },
        "HOSTA.peerStancB.com": {
          "url": "grpc://localhost:9051"
        }
      },
      "orderers": {
        "StancOrderer.StancOrdr.com": {
          "url": "grpc://localhost:7050"
        }
      }
    },
    "network-2": {}
  },
  "configtxgenToolPath": "~/Documents/Application/bin",
  "license": "Apache-2.0"
}

I got the successful build.But it fails to start the explorer application.

I got the follwing error.

postgres://hppoc:password@127.0.0.1:5432/fabricexplorer

**************************************************************************************
Error : Failed to connect client peer, please check the configuration and peer status
Info :  Explorer will continue working with only DB data
**************************************************************************************

(node:10952) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead
<<<<<<<<<<<<<<<<<<<<<<<<<< Explorer Error >>>>>>>>>>>>>>>>>>>>>
Error :  [ 'Default client peer is down and no channel details available database' ]
Received kill signal, shutting down gracefully
Closed out connections

I have provided tls as false and updated grpc. And also the network is up on specified ports.

Help is appreciated.

  • A couple of thoughts, don't use ~ for the path, set the full path. If do a ping to the node, does it connect? For example the command 'telnet localhost 7051' – emiliomarin Jan 15 '19 at 09:36
  • @emiliomarin telnet localhost 7051 raises the issue connection closed by foreign host. But I have provided the flag CORE_PEER_GOSSIP_EXTERNALENDPOINT –  Jan 15 '19 at 09:47
  • That may be the issue, also can you update with logs from logs/app ? – emiliomarin Jan 15 '19 at 10:10
  • [2019-01-15 17:10:00.246] [DEBUG] Proxy - Message from child {"notify_type":"4","network_name":"network-1","client_name":"client-1","channel_name":"masterchannel","title":"Block 2 added to Channel: masterchannel","type":"block","message":"Block 2 established with 1 tx","time":"2019-01-15T09:52:57.299Z","txcount":1,"datahash":"2be76986dcb2bfd47f81abf63ad61501fd9d92b4d83a99f820e20397607563c8"} –  Jan 15 '19 at 11:41
  • @emiliomarin Here's the log.But still I can't able to connect. –  Jan 15 '19 at 11:41
  • [2019-01-15 17:12:09.777] [DEBUG] pgservice - the getRowByPkOne sql select count(1) as c from peer_ref_chaincode prc where prc.peerid= 'HOSTA.peerStanc.com' and prc.chaincodeid='MasterChainCode' and cc_version='1.0' and channelid='e828ab9af94cce2e8333f26c797ef8b41459a8f7d44c2b27e1761273c7728b72' -->db log -->it shows that I have installed my chaincode –  Jan 15 '19 at 11:43
  • @emiliomarin It worked...Thank you –  Jan 15 '19 at 11:46
  • So was it solved by changing the path from ~ to /home/ ? So I can post an answer and leave it clear for future questions :) @cmr – emiliomarin Jan 15 '19 at 11:51
  • Yes. You proceed. –  Jan 15 '19 at 16:59

2 Answers2

0

Paths should be set using the full path /home/user/yourPath instead of the shortcut ~/yourPath.

Anyway, remember always to check the app logs and not just the console since sometimes they show much more information.

emiliomarin
  • 362
  • 3
  • 22
0

I found this was a npm package issue, you'd better modify the package.json under blockchain-explorer and replase ^ with ~ to download the minor version packages.