I have been setting my hyperledger project.
now, fabric is running and have installed and deployed my chaincode.
but... hyperledger explorer is my problem. I failed setup it all time.. I don't know why...
please watch my error logs and docker-compose.yaml, json files, and tell me what I wrong.
error logs
explorerdb.mynetwork.com | 2021-11-01 07:28:22.178 UTC [1] LOG: database system is ready to accept connections
explorer.mynetwork.com | false 'ssl-certs' '/opt/explorer/ssl-certs'
explorerdb.mynetwork.com | 2021-11-01 07:28:52.362 UTC [56] FATAL: role "hppoc" does not exist
explorer.mynetwork.com | error when connecting to db: { error: role "hppoc" does not exist
docker-compose
# SPDX-License-Identifier: Apache-2.0
version: '2.1'
volumes:
pgdata:
walletstore:
networks:
mynetwork.com:
external:
name: net_basic
services:
explorerdb.mynetwork.com:
image: hyperledger/explorer-db:latest
container_name: explorerdb.mynetwork.com
hostname: explorerdb.mynetwork.com
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
networks:
- mynetwork.com
explorer.mynetwork.com:
image: hyperledger/explorer:latest
container_name: explorer.mynetwork.com
hostname: explorer.mynetwork.com
environment:
- DATABASE_HOST=explorerdb.mynetwork.com
- DATABASE_DATABASE=fabricexplorer
- DATABASE_USERNAME=hppoc
- DATABASE_PASSWD=password
- LOG_LEVEL_APP=debug
- LOG_LEVEL_DB=debug
- LOG_LEVEL_CONSOLE=info
- 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
ports:
- 8080:8080
depends_on:
explorerdb.mynetwork.com:
condition: service_healthy
networks:
- mynetwork.com
test-network.json
{
"name": "net_basic",
"version": "1.0.0",
"client": {
"tlsEnable": true,
"adminCredential": {
"id": "exploreradmin",
"password": "exploreradminpw"
},
"enableAuthentication": false,
"organization": "Org1MSP",
"connection": {
"timeout": {
"peer": {
"endorser": "300"
},
"orderer": "300"
}
}
},
"channels": {
"construction": {
"peers": {
"peer0.org1.produce.com": {}
}
}
},
"organizations": {
"Org1MSP": {
"mspid": "Org1MSP",
"adminPrivateKey": {
"path": "/tmp/crypto/peerOrganizations/org1.produce.com/users/[email protected]/msp/keystore/d18828f12121b7251dcf460dc391aca47d9f82864817e91635703ca401e37244_sk"
},
"peers": ["peer0.org1.produce.com"],
"signedCert": {
"path": "/tmp/crypto/peerOrganizations/org1.produce.com/users/[email protected]/msp/signcerts/[email protected]"
}
}
},
"peers": {
"peer0.org1.produce.com": {
"tlsCACerts": {
"path": "/tmp/crypto/peerOrganizations/org1.produce.com/peers/peer0.org1.produce.com/tls/ca.crt"
},
"url": "grpc://peer0.org1.produce.com:7051"
}
}
}
config.json
{
"network-configs": {
"net_basic": {
"name": "net_basic",
"profile": "./connection-profile/test-network.json"
}
},
"license": "Apache-2.0"
}
my folder directory is
explorer
./crypto-config/peerOrganizations/...
./connection-profile/test-network.json
./config.json
./docker-comopse.yaml