Skip to content

πŸ—οΈ Docker-based Hyperledger Fabric: Structure Evaluation / Required ImprovementsΒ #9

@apierr

Description

@apierr

πŸ—οΈ Docker-based Hyperledger Fabric: Structure Evaluation

βœ… Current Strengths

Aspect Compliance Rationale
Separation of Concerns βœ… SOLID (SRP) Each directory has single, clear purpose
Docker Foundation βœ… Present docker/ directory with logical organization
Reproducibility βœ… Good Fixtures and automation included

⚠️ Required Improvements

🐳 Enhanced Docker Structure

docker/
β”œβ”€β”€ images/
β”‚   β”œβ”€β”€ fabric-peer/
β”‚   β”œβ”€β”€ fabric-orderer/
β”‚   └── base/                    # πŸ”„ DRY: Shared dependencies
β”œβ”€β”€ compose/
β”‚   β”œβ”€β”€ base/                    # πŸ”„ DRY: Reusable services
β”‚   β”‚   β”œβ”€β”€ peer-base.yaml
β”‚   β”‚   └── orderer-base.yaml
β”‚   β”œβ”€β”€ networks/                # 🎯 KISS: 2/4/10/20 nodes
β”‚   └── overlays/                # πŸ”“ SOLID: Crypto modes
β”‚       β”œβ”€β”€ ecdsa-only.yaml
β”‚       β”œβ”€β”€ pqc-only.yaml
β”‚       └── hybrid.yaml
└── configs/

πŸ“¦ Refactored Source

src/
β”œβ”€β”€ chaincode/              # ✏️ Renamed from fabric/
β”œβ”€β”€ pqc/
β”‚   └── Dockerfile
β”œβ”€β”€ sdk/
β”‚   └── Dockerfile
└── fabric-patches/         # πŸ†• Core modifications

πŸ› οΈ Essential Scripts

tools/scripts/
β”œβ”€β”€ docker/
β”‚   β”œβ”€β”€ network-up.sh        # 🎯 Single entry point
β”‚   β”œβ”€β”€ network-down.sh
β”‚   └── switch-crypto-mode.sh
β”œβ”€β”€ fabric/
β”‚   β”œβ”€β”€ generate-crypto.sh
β”‚   └── deploy-chaincode.sh
└── utils/
    └── validate-config.sh

🌍 Environment Management

.env.example
env/
β”œβ”€β”€ dev.env
β”œβ”€β”€ test.env
└── benchmark.env

Example:

CRYPTO_MODE=hybrid          # ecdsa | pqc | hybrid
NETWORK_SIZE=4              # 2 | 4 | 10 | 20
PQC_ALGORITHM=dilithium3

πŸ“Š Gap Analysis

Component Status Priority
Base Docker configs ❌ Missing πŸ”΄ High
Environment templates ❌ Missing πŸ”΄ High
Reusable compose files ❌ Missing 🟑 Medium

βœ… Implementation Checklist

  • πŸ”΄ Create base Dockerfiles with multi-stage builds (KISS)
  • πŸ”΄ Implement compose inheritance: base + overlays (DRY)
  • πŸ”΄ Add env/ directory with configuration templates
  • 🟑 Rename src/fabric/ β†’ src/chaincode/ (clarity)
  • 🟑 Create tools/scripts/docker/network-up.sh entry point
  • 🟑 Add .dockerignore files
  • 🟒 Implement Docker health checks
  • 🟒 Create smoke test script

🎯 Final Assessment

Readiness: 85%

πŸ”΄ Critical Gaps

  1. No reusable base configurations (DRY violation)
  2. Missing environment management
  3. Ambiguous src/fabric/ naming

πŸ“ˆ Priority Actions

  1. Refactor docker/compose/ β†’ base + overlay pattern
  2. Add env/ with templates
  3. Create unified network-up.sh script
  4. Rename src/fabric/ β†’ src/chaincode/

Result: Principle-compliant, production-grade structure for PQC research.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: To DoThis issue is ready to be picked up by a team member.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions