Skip to content

node: add config validation command#1327

Open
malsomesh9 wants to merge 2 commits into
hyperledger-labs:mainfrom
malsomesh9:somesh/issue-209-config-validate
Open

node: add config validation command#1327
malsomesh9 wants to merge 2 commits into
hyperledger-labs:mainfrom
malsomesh9:somesh/issue-209-config-validate

Conversation

@malsomesh9
Copy link
Copy Markdown
Contributor

Summary

  • add a peer validate-config command that loads and validates the FSC node configuration before startup
  • fail with a clear error when the config is missing fsc.id
  • return the concrete config file path via ConfigFileUsed() so the validator can report exactly what it checked

Why

Today, configuration mistakes are often only discovered later during node startup. This adds a lightweight validation tool that helps contributors and operators catch obvious config issues earlier and see which core.yaml was actually loaded.

Testing

  • go test ./node/validate
  • go test ./platform/view/services/config
  • go test ./node/...

Refs #209
Refs #798

@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 24955777958

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage increased (+0.05%) to 66.915%

Details

  • Coverage increased (+0.05%) from the base build.
  • Patch coverage: 6 uncovered changes across 1 file (27 of 33 lines covered, 81.82%).
  • 9 coverage regressions across 5 files.

Uncovered Changes

File Changed Covered %
node/validate/validate.go 31 25 80.65%

Coverage Regressions

9 previously-covered lines in 5 files lost coverage.

File Lines Losing Coverage Coverage
platform/view/services/comm/p2p.go 3 90.24%
platform/view/services/comm/service.go 2 69.07%
platform/view/services/comm/host/websocket/ws/multiplexed_provider.go 2 85.06%
platform/fabric/core/generic/msp/x509/ecdsa.go 1 82.71%
platform/view/services/comm/session.go 1 87.7%

Coverage Stats

Coverage Status
Relevant Lines: 39683
Covered Lines: 26554
Line Coverage: 66.92%
Coverage Strength: 2953.48 hits per line

💛 - Coveralls

Signed-off-by: Somesh Mal <malsomesh9@gmail.com>
Signed-off-by: Somesh Mal <malsomesh9@gmail.com>
@malsomesh9 malsomesh9 force-pushed the somesh/issue-209-config-validate branch from ecc332f to 161291d Compare April 30, 2026 16:06
@malsomesh9
Copy link
Copy Markdown
Contributor Author

@SaidAltury-ibm @mbrandenburger Plz take a look at this.

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