Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions hyperledger-fabric-network/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 2

[*.py]
indent_size = 4

[Makefile]
indent_style = tab
55 changes: 55 additions & 0 deletions hyperledger-fabric-network/.github/workflows/helm-validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Fabric Helm validation
on:
pull_request:
push:
workflow_dispatch:

permissions:
contents: read

jobs:
validate:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install pinned Helm
env:
HELM_VERSION: v3.21.3
run: |
set -euo pipefail
task_tmp=$(mktemp -d)
cd "$task_tmp"
curl --fail --silent --show-error --location --output helm.tar.gz "https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz"
curl --fail --silent --show-error --location --output helm.sha256 "https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz.sha256sum"
expected=$(awk '{print $1}' helm.sha256)
actual=$(sha256sum helm.tar.gz | awk '{print $1}')
test "$actual" = "$expected"
tar -xzf helm.tar.gz
sudo install -m 0755 linux-amd64/helm /usr/local/bin/helm
- name: Locate chart repository
run: |
if [ -f scripts/validate.sh ]; then
echo 'FABRIC_REPO=.' >> "$GITHUB_ENV"
elif [ -f hyperledger-fabric-network/scripts/validate.sh ]; then
echo 'FABRIC_REPO=hyperledger-fabric-network' >> "$GITHUB_ENV"
else
echo 'Cannot locate Fabric repository' >&2
exit 1
fi
- name: Install validation dependencies
run: pip install -r "$FABRIC_REPO/requirements.txt"
- name: Validate production and kind charts and wiring tests
run: make -C "$FABRIC_REPO" validate
- name: Shell syntax
run: |
for script in "$FABRIC_REPO"/scripts/*.sh; do
bash -n "$script"
done

# When copying this directory into treetracker-infrastructure, place this workflow
# in that repository's ROOT .github/workflows/; GitHub ignores nested workflows.
# This workflow has no cluster credentials and cannot deploy anything.
22 changes: 22 additions & 0 deletions hyperledger-fabric-network/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.venv/
__pycache__/
*.py[cod]
.local/
.env
.env.*
!.env.example
*.key
*.pem
*.p12
*.pfx
*.block
*.tx
*.tar.gz
*.tgz
config/msp/
config/consenters/
config/crypto-config/
secrets/
credentials/
rendered/
dist/
16 changes: 16 additions & 0 deletions hyperledger-fabric-network/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Contributing

Keep deployment changes limited to the six Fabric components in README. Runtime
credentials and identity artifacts must stay outside Git. Preserve stable node
names, namespaces and claim names unless the change includes a reviewed migration.

Before a change is merged, run `make validate`, review both profile renders and
update the component documentation and external-input contract if references
changed. Submit image updates with a verified digest and a Fabric compatibility
and rollback plan. A green render/lint run is not a runtime acceptance test.

The desired upstream location is `treetracker-infrastructure/hyperledger-fabric-network/`.
Copy this directory's contents there; do not add another nested network directory.
Merge the provided workflow into the upstream repository's root `.github/workflows/`
so GitHub runs it. Review existing upstream files before copying; preserve unrelated
content. No Git commit or remote change is performed by the supplied scripts.

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions hyperledger-fabric-network/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.PHONY: validate render test
PROFILE ?= production

validate:
./scripts/validate.sh --profile production
./scripts/validate.sh --profile kind
python3 -m unittest discover -s tests -v

render:
./scripts/render.sh --profile $(PROFILE)

test:
@test -n "$(CONTEXT)" || (echo 'Set CONTEXT explicitly'; exit 1)
./scripts/test-network.sh --context "$(CONTEXT)" --profile $(PROFILE)
Loading
Loading