Skip to content

added block explorer image in integration test#273

Open
farooqazamwasimnl wants to merge 2 commits into
hyperledger:mainfrom
farooqazamwasimnl:block-explorer-integration
Open

added block explorer image in integration test#273
farooqazamwasimnl wants to merge 2 commits into
hyperledger:mainfrom
farooqazamwasimnl:block-explorer-integration

Conversation

@farooqazamwasimnl

Copy link
Copy Markdown

Type of change

  • Test update

Description

Adds a non-blocking block explorer smoke check to the E2E integration test.

The explorer (ghcr.io/lf-decentralized-trust-labs/fabric-x-block-explorer:latest)
is an independently released component — it is not co-versioned with fabric-x.
The integration follows these principles:

  • The image is pulled as :latest from GHCR in build-e2e.sh (best-effort).
    If the pull fails the core E2E test is unaffected.
  • Two new non-blocking steps are added to run-e2e.sh after step_9_verify_results:
    • Step 10 — starts postgres + explorer compose services, polls /healthz
    • Step 11 — polls GET /blocks/height to confirm at least one block was ingested
  • Both steps always return 0. step_9_verify_results owns the pass/fail decision.
  • No changes to .github/workflows/e2e.yml — it delegates fully to the shell scripts.

Files changed:

  • integration/test/refs.conf — added EXPLORER_IMAGE_NAME + EXPLORER_REPO
  • integration/test/build-e2e.sh — best-effort image pull, writes explorer_available to GITHUB_OUTPUT
  • integration/test/docker-compose.yaml — added postgres and explorer services
  • integration/test/explorerconfig/explorer.yaml — new explorer config (DB + sidecar + REST)
  • integration/test/run-e2e.sh — added step_10_smoke_explorer, step_11_verify_explorer
  • integration/test/README.md — updated image table, steps list, directory structure

Related issues

LF-Decentralized-Trust-labs/fabric-x-block-explorer#18

Signed-off-by: farooqazamwasimnl <Farooq.Azm.Wasim-CIC.Netherlands@ibm.com>
Comment on lines +221 to +240
# ──────────────────────────────────────────────────────────────────────────────
# Pull explorer image (:latest — independently released, non-blocking)
# If the pull fails the E2E test continues without the explorer smoke check.
# ──────────────────────────────────────────────────────────────────────────────
EXPLORER_IMAGE="${EXPLORER_REPO:-}/${EXPLORER_IMAGE_NAME:-}:latest"
EXPLORER_AVAILABLE="false"
if [[ -n "${EXPLORER_REPO:-}" && -n "${EXPLORER_IMAGE_NAME:-}" ]]; then
echo "Pulling explorer image: ${EXPLORER_IMAGE}..."
if docker pull "${EXPLORER_IMAGE}" 2>/dev/null; then
EXPLORER_AVAILABLE="true"
echo " ✅ ${EXPLORER_IMAGE}"
else
echo " ⚠️ Explorer image unavailable — smoke check will be skipped"
fi
fi

if [ -n "${GITHUB_OUTPUT:-}" ]; then
echo "explorer_image=${EXPLORER_IMAGE}" >> "${GITHUB_OUTPUT}"
echo "explorer_available=${EXPLORER_AVAILABLE}" >> "${GITHUB_OUTPUT}"
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We support three ways to do this.

  1. refs.conf holds the url and branch/tag to be used for all dependencies.
  2. override the same with a flag while running build script.
  3. provide branch/tag as input via github action to workflow to test the integration on the CI.

Hence, we need to do the same for explorer too. Given that the docker image PR is merged, we can create a tag at the explorer and update this integration test.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cendhu I have applied the changes , please have a review

Signed-off-by: farooqazamwasimnl <Farooq.Azm.Wasim-CIC.Netherlands@ibm.com>
@farooqazamwasimnl farooqazamwasimnl requested a review from cendhu July 9, 2026 08:09
Comment thread .github/workflows/e2e.yml
required: false
default: ""
explorer-ref:
description: "fabric-x-block-explorer image tag. Empty=use refs.conf default"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for consistency with other refs.

Suggested change
description: "fabric-x-block-explorer image tag. Empty=use refs.conf default"
description: "fabric-x-block-explorer ref. Empty=use refs.conf default"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cendhu
Pin EXPLORER_REF to a real tag in refs.conf (e.g. v0.1.0) once a tag is cut in the explorer repo?
In explorer repo , every tag also get an image with latest tag as well.
What you recommend?

Comment thread .github/workflows/e2e.yml
COMMITTER_IMAGE: ${{ steps.images.outputs.committer_image }}
LOADGEN_IMAGE: ${{ steps.images.outputs.loadgen_image }}
EXPLORER_IMAGE: ${{ steps.images.outputs.explorer_image }}
EXPLORER_AVAILABLE: ${{ steps.images.outputs.explorer_available }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have Explorer available?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cendhu it was added to check availability of the image, now that we will be adding repo , so it will be removed

echo " --fabric-x-ref=REF Tag, branch, or commit for fabric-x tools"
echo " --committer-ref=REF Tag, branch, or commit for fabric-x-committer"
echo " --orderer-ref=REF Tag, branch, or commit for fabric-x-orderer"
echo " --explorer-ref=REF Tag for the explorer image (default: refs.conf)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo " --explorer-ref=REF Tag for the explorer image (default: refs.conf)"
echo " --explorer-ref=REF Tag, branch, or commit for fabric-x-explorer"

echo " --explorer-ref=REF Tag for the explorer image (default: refs.conf)"
echo " --fabric-x-repo=URL Override default fabric-x GitHub repo URL"
echo " --committer-repo=URL Override default committer GitHub repo URL"
echo " --orderer-repo=URL Override default orderer GitHub repo URL"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we also need to introduce a --explorer-repo=URL to override the default one. For example, when we fix some issues, we may use our local fork and branch.

# If the pull fails the E2E test continues without the explorer smoke check.
# ──────────────────────────────────────────────────────────────────────────────
EXPLORER_IMAGE="${EXPLORER_REPO}/${EXPLORER_IMAGE_NAME}:${EXPLORER_REF}"
EXPLORER_AVAILABLE="false"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should always be available. Remove this available check.

11. Prompt user before cleanup (so they can view Grafana dashboards)
11. Explorer smoke check — start explorer + postgres, wait for /healthz (non-blocking)
12. Explorer block ingestion check — poll /blocks/height > 0 (non-blocking)
13. Prompt user before cleanup (so they can view Grafana dashboards)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
13. Prompt user before cleanup (so they can view Grafana dashboards)
13. Prompt user before cleanup (so they can view Grafana dashboards and block explorer)

FABRIC_X_REPO="https://github.com/hyperledger/fabric-x.git"
ORDERER_REPO="https://github.com/hyperledger/fabric-x-orderer.git"
COMMITTER_REPO="https://github.com/hyperledger/fabric-x-committer.git"
EXPLORER_REPO="ghcr.io/lf-decentralized-trust-labs"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should specify the github URL.

Comment on lines +108 to +111
# EXPLORER_AVAILABLE is set to "true" by build-e2e.sh when the image was
# successfully pulled. Default to "false" so the smoke check is skipped
# when run-e2e.sh is invoked standalone without build-e2e.sh.
EXPLORER_AVAILABLE="${EXPLORER_AVAILABLE:-false}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm available

Comment on lines +459 to +462
if [[ "${EXPLORER_AVAILABLE}" != "true" ]]; then
echo "⏭️ Explorer image not available — skipping smoke check"
return 0
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm available


local i height
for ((i = 1; i <= HEALTH_TIMEOUT; i++)); do
height=$(curl -sf http://127.0.0.1:8080/blocks/height 2>/dev/null \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we count the number of transactions and it should be >= 5000? This ensures the explorer works for certain duration.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cendhu test node generates 50 blocks. Are you referring to blocks or transactions in any of the blocks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants