Skip to content

Hyperledger Explorer does not show blocks, transactions, and chaincodes for Fabric v3.0.0 #511

@umitkilic

Description

@umitkilic

What happened?

I'm using Hyperledger Fabric (HLF) v3.0.0 to create a blockchain network. I formed the network with two organizations (with a peer in each organization) and an orderer. Since there is no need for a system channel in HLF v3.0.0, I created a genesis block for the application channel (named ukchannel), and the orderer was joined to this channel with the osnadmin command. Then, the other two organizations were joined to this channel. Here are the steps I followed:

1- cryptogen generate --config=./cryptogen-input/crypto-config-org1.yaml --output="crypto-material"
2- cryptogen generate --config=./cryptogen-input/crypto-config-org2.yaml --output="crypto-material"
3- cryptogen generate --config=./cryptogen-input/crypto-config-orderer.yaml --output="crypto-material"
4- docker-compose -f docker/docker-compose-orderer.yaml up -d
5- docker-compose -f docker/docker-compose-org1.yaml up -d
6- docker-compose -f docker/docker-compose-org2.yaml up -d
7- configtxgen -profile NoSystemChannel -outputBlock ./channel-artifacts/ukchannel.block -channelID ukchannel
8- osnadmin channel join -c ukchannel --config-block ./channel-artifacts/ukchannel.block -o localhost:7080 --ca-file ./crypto-material/ordererOrganizations/uk.com/orderers/orderer0.uk.com/tls/ca.crt --client-cert ./crypto-material/ordererOrganizations/uk.com/users/Admin\@uk.com/tls/client.crt --client-key ./crypto-material/ordererOrganizations/uk.com/users/Admin\@uk.com/tls/client.key

When I checked whether the orderer joined the channel:

osnadmin channel list -o localhost:7080 --ca-file ./crypto-material/ordererOrganizations/uk.com/orderers/orderer0.uk.com/tls/ca.crt --client-cert ./crypto-material/ordererOrganizations/uk.com/users/Admin\@uk.com/tls/client.crt --client-key ./crypto-material/ordererOrganizations/uk.com/users/Admin\@uk.com/tls/client.key

The output says it joined:

Status: 200
{
        "systemChannel": null,
        "channels": [
                {
                        "name": "ukchannel",
                        "url": "/participation/v1/channels/ukchannel"
                }
        ]
}

I changed the environment variable for Org1 and Org2 and run the command

9- peer channel join -b ./channel-artifacts/ukchannel.block
for both. Then checked them with the command

peer channel list
the output says they joined the channel also.

After this point, when I started the Hyperledger Explorer and checked the network, I saw that only the node count was written as 2 (for the two organizations). The transactions and blocks counts were shown as 0. The orderer was not included in the node count either. What could be the reason why the orderer, transactions and blocks are not seen when it sees the two organizations? Am I making a mistake with authorization? You can see the files related to the explorer below.

./docker-compose.yaml (for explorer):

# SPDX-License-Identifier: Apache-2.0
version: '2.1'

volumes:
  pgdata:
  walletstore:

networks:
  mynetwork.com:
    name: hlf3_phd_uk_uknet

services:

  explorerdb.mynetwork.com:
    image: ghcr.io/hyperledger-labs/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: ghcr.io/hyperledger-labs/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=info
      - LOG_LEVEL_DB=info
      - LOG_LEVEL_CONSOLE=debug
      - LOG_CONSOLE_STDOUT=true
      - DISCOVERY_AS_LOCALHOST=false
      - PORT=${PORT:-8080}
    volumes:
      - ${EXPLORER_CONFIG_FILE_PATH}:/opt/explorer/app/platform/fabric/config.json
      - ${EXPLORER_PROFILE_DIR_PATH}:/opt/explorer/app/platform/fabric/connection-profile
      - ./crypto-config:/tmp/crypto
      - walletstore:/opt/explorer/wallet
    ports:
      - ${PORT:-8080}:${PORT:-8080}
    depends_on:
      explorerdb.mynetwork.com:
        condition: service_healthy
    networks:
      - mynetwork.com

./config.json:

{
"network-configs": {
    "test-network": {
        "name": "Test Network",
        "profile": "./connection-profile/test-network.json"
    }
},
"license": "Apache-2.0"
}

./connection-profile/test-network.json:

{
    "name": "test-network",
    "version": "1.0.0",
    "client": {
        "tlsEnable": true,
        "adminCredential": {
            "id": "exploreradmin",
            "password": "exploreradminpw"
        },
        "enableAuthentication": false,
        "organization": "Org1MSP",
        "connection": {
            "timeout": {
                "peer": {
                    "endorser": "300"
                },
                "orderer": "300"
            }
        }
    },
    "channels": {
        "ukchannel": {
            "peers": {
                "peer0.org1.uk.com": {}
            }
        }
    },
    "organizations": {
        "Org1MSP": {
            "mspid": "Org1MSP",
            "adminPrivateKey": {
                "path": "/tmp/crypto/peerOrganizations/org1.uk.com/users/[email protected]/msp/keystore/priv_sk"
            },
            "peers": ["peer0.org1.uk.com"],
            "signedCert": {
                "path": "/tmp/crypto/peerOrganizations/org1.uk.com/users/[email protected]/msp/signcerts/[email protected]"
            }
        }
    },
    "peers": {
        "peer0.org1.uk.com": {
            "tlsCACerts": {
                "path": "/tmp/crypto/peerOrganizations/org1.uk.com/peers/peer0.org1.uk.com/tls/ca.crt"
            },
            "url": "grpcs://peer0.org1.uk.com:7051"
        }
    }
}

./startExplorer.sh:

rm -rf crypto-config

mkdir -p crypto-config
cp -r ../crypto-material/ordererOrganizations/ crypto-config/
cp -r ../crypto-material/peerOrganizations/ crypto-config/

sleep 5
docker-compose up -d

Here is the HL Explorer screenshot. You can see it shows the channel and two nodes:
https://i.sstatic.net/T5YB3QJj.png

I also packaged, installed, approved and commited a chaincode. I can query the chain code although it does not appear on Explorer. Sorry if I gave to many details. I have been dealing with this problem for days and want to get rid of this problem. I can add further details if you need.

What did you expect to happen?

I expected to see the correct number of nodes, transactions, chaincode(s) etc., on Hyperledger Explorer.

How can we reproduce it (as minimally and precisely as possible)?

Hyperledger Explorer should be tested on Hyperledger Fabric v3.0+ for compatibility.

Anything else we need to know?

No response

OS version

# On Linux:
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.5 LTS"

NAME="Ubuntu"

VERSION_ID="22.04"

VERSION="22.04.5 LTS (Jammy Jellyfish)"

VERSION_CODENAME=jammy

ID=ubuntu

ID_LIKE=debian

HOME_URL="https://www.ubuntu.com/"

SUPPORT_URL="https://help.ubuntu.com/"

BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"

PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"

UBUNTU_CODENAME=jammy

$ uname -a
Linux umit 5.15.0-124-generic #134-Ubuntu SMP Fri Sep 27 20:20:17 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions