Skip to content

Commit 3695fe7

Browse files
authored
Merge branch 'main' into test/config-unit-tests
2 parents 00003ab + 2b0ba32 commit 3695fe7

File tree

4,368 files changed

+45317
-1922
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,368 files changed

+45317
-1922
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Bug Report
2+
description: Create a report to help us improve.
3+
title: "[BUG]: <short-description>"
4+
labels: ["bug"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
## Thanks for submitting a bug report! 😊
10+
11+
Before submitting, please:
12+
1. **Search existing issues** to see if your issue has already been reported.
13+
2. **Consult the Resources**:
14+
- [Documentation Overview](https://github.com/hyperledger-labs/fabric-token-sdk/blob/main/docs/README.md)
15+
- [Development Guidelines](https://github.com/hyperledger-labs/fabric-token-sdk/blob/main/docs/development/development.md)
16+
- [Testing Guide](https://github.com/hyperledger-labs/fabric-token-sdk/blob/main/docs/development/testing.md)
17+
3. **Join [Hyperledger Discord](https://discord.gg/hyperledger)** and ask in the `#fabric-token-sdk` channel if you're unsure.
18+
19+
---
20+
21+
- type: textarea
22+
id: description
23+
attributes:
24+
label: 👾 Description
25+
description: What happened and what did you expect to happen?
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
id: reproduce
31+
attributes:
32+
label: 🛠️ Steps to reproduce
33+
description: Steps to reproduce the behavior.
34+
placeholder: |
35+
1. Setup the network with `make ...`
36+
2. Run the command `tokengen ...`
37+
3. See error: `...`
38+
validations:
39+
required: true
40+
41+
- type: textarea
42+
id: logs
43+
attributes:
44+
label: 📋 Logs and Screenshots
45+
description: Attach any logs or screenshots relevant to the problem.
46+
placeholder: |
47+
```bash
48+
# Paste relevant logs here
49+
```
50+
validations:
51+
required: false
52+
53+
- type: dropdown
54+
id: network
55+
attributes:
56+
label: 🌐 Network Environment
57+
description: Which network environment did the issue occur on?
58+
options:
59+
- Local (NWO / Integration Test)
60+
- Fabric
61+
- FabricX
62+
- Other
63+
validations:
64+
required: true
65+
66+
- type: input
67+
id: sdk-version
68+
attributes:
69+
label: 📦 Fabric Token SDK Version
70+
description: Which version or commit hash are you using?
71+
placeholder: e.g. v1.0.0 or 5a3f2b1
72+
validations:
73+
required: true
74+
75+
- type: input
76+
id: go-version
77+
attributes:
78+
label: 🐹 Go Version
79+
description: Output of `go version`.
80+
placeholder: e.g. go1.22.2 darwin/arm64
81+
validations:
82+
required: true
83+
84+
- type: dropdown
85+
id: os
86+
attributes:
87+
label: 💻 Operating System
88+
description: Which OS did the issue occur on?
89+
options:
90+
- Linux (Ubuntu/Debian)
91+
- Linux (Other)
92+
- macOS
93+
- Windows (WSL2)
94+
- Other
95+
validations:
96+
required: true
97+
98+
- type: textarea
99+
id: additional
100+
attributes:
101+
label: ➕ Additional context
102+
description: Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Hyperledger Discord
4+
url: https://discord.gg/hyperledger
5+
about: Join the #fabric-token-sdk channel for real-time discussion.
6+
- name: Documentation
7+
url: https://github.com/hyperledger-labs/fabric-token-sdk/blob/main/docs/README.md
8+
about: Read the official documentation.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Feature
2+
description: Suggest an idea for this project
3+
labels: [enhancement]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
## Thanks for submitting a feature request! 😊
9+
10+
Before submitting:
11+
* **Search existing issues** and discussions to see if something similar has been discussed previously.
12+
* **Consult the Resources**:
13+
- [Documentation Overview](https://github.com/hyperledger-labs/fabric-token-sdk/blob/main/docs/README.md)
14+
- [Development Guidelines](https://github.com/hyperledger-labs/fabric-token-sdk/blob/main/docs/development/development.md)
15+
- [Testing Guide](https://github.com/hyperledger-labs/fabric-token-sdk/blob/main/docs/development/testing.md)
16+
* **Consider opening a GitHub discussion** first to gather feedback and reach consensus.
17+
* If this is a major architectural change, please provide as much detail as possible.
18+
19+
---
20+
21+
- type: textarea
22+
id: problem
23+
attributes:
24+
label: Problem
25+
description: What is the problem you are trying to solve?
26+
placeholder: I'm always frustrated when ...
27+
validations:
28+
required: true
29+
30+
- type: textarea
31+
id: solution
32+
attributes:
33+
label: Solution
34+
description: What solution do you propose to solve the problem?
35+
placeholder: |
36+
- Add a config property
37+
- Change the schema
38+
- ...
39+
validations:
40+
required: true
41+
42+
- type: textarea
43+
id: alternatives
44+
attributes:
45+
label: Alternatives
46+
description: What alternative solutions have you considered?
47+
placeholder: I considered using ... but ...
48+
49+
- type: textarea
50+
id: additional
51+
attributes:
52+
label: Additional Context
53+
description: Add any other context or screenshots about the feature request here.
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Good First Issue
2+
description: Create a Good First Issue for new contributors
3+
title: "[Good First Issue]: "
4+
labels: ["good first issue"]
5+
assignees: []
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
---
11+
## **Thanks for creating a good first issue!** 😊
12+
13+
We truly appreciate your time and effort. This template helps create a **Good First Issue (GFI)**: a small, well-scoped task that helps new contributors learn the codebase and workflow.
14+
---
15+
16+
- type: textarea
17+
id: intro
18+
attributes:
19+
label: 🆕🐥 Newcomer Friendly
20+
description: Who is this issue for?
21+
value: |
22+
This **[Good First Issue](https://github.com/hyperledger-labs/fabric-token-sdk/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22good%20first%20issue%22)** is a guided, well-scoped task intended for new human contributors to the Fabric Token SDK.
23+
24+
#### What you’ll do
25+
- ✅ Understand the project structure
26+
- ✅ Practice the standard Hyperledger contribution workflow
27+
- ✅ Submit and merge your first Pull Request
28+
29+
#### Support
30+
A maintainer or mentor actively monitors this issue and will help **guide it to completion**.
31+
32+
> [!IMPORTANT]
33+
> **This issue does not require deep blockchain knowledge.**
34+
> - No prior Hyperledger Fabric experience needed
35+
> - **Basic Go and Git are sufficient**
36+
37+
> [!NOTE]
38+
> ⏱️ **Typical time to complete:** 30–90 minutes (once setup is done)
39+
> 🧩 **Difficulty:** Small, well-contained change
40+
> 🎓 **Best for:** New contributors
41+
42+
- type: textarea
43+
id: issue
44+
attributes:
45+
label: 👾 Issue description
46+
description: |
47+
Describe the issue clearly. Explain why this change is useful.
48+
Avoid jargon where possible. Links to code are very welcome.
49+
placeholder: |
50+
Describe the problem here...
51+
validations:
52+
required: true
53+
54+
- type: textarea
55+
id: solution
56+
attributes:
57+
label: 💡 Proposed Solution
58+
description: Describe what a good solution looks like at a high level.
59+
placeholder: |
60+
Briefly explain the fix...
61+
validations:
62+
required: true
63+
64+
- type: textarea
65+
id: implementation
66+
attributes:
67+
label: 🛠️ Implementation Steps
68+
description: |
69+
Provide guided steps to help the contributor:
70+
- Which files to change
71+
- Which functions are involved
72+
- Expected output/result
73+
value: |
74+
- [ ] Step 1: ...
75+
- [ ] Step 2: ...
76+
- [ ] Step 3: Verify with `make unit-tests`
77+
validations:
78+
required: true
79+
80+
- type: textarea
81+
id: setup_guide
82+
attributes:
83+
label: 📋 Setup Guide
84+
description: Quick links for setting up the environment.
85+
value: |
86+
#### Setup the Fabric Token SDK
87+
- [ ] **Fork & Clone**: Follow the [Contributing Guide](https://github.com/hyperledger-labs/fabric-token-sdk/blob/main/CONTRIBUTING.md)
88+
- [ ] **Install Tools**: Run `make install-tools`
89+
validations:
90+
required: true
91+
92+
- type: textarea
93+
id: contribution_workflow
94+
attributes:
95+
label: 📋 Contribution Workflow
96+
description: Step-by-step for new contributors.
97+
value: |
98+
- [ ] **Claim the issue**: Comment "I would like to work on this" to be assigned.
99+
- [ ] **Create a branch**: `git checkout -b feature/my-fix`
100+
- [ ] **Implement & Test**: Run `make unit-tests` or specific integration tests.
101+
- [ ] **Commit with DCO**: Use `git commit -s -m "feat: description"` (The `-s` is mandatory).
102+
- [ ] **Push & PR**: Push to your fork and open a Pull Request.
103+
validations:
104+
required: true
105+
106+
- type: textarea
107+
id: acceptance_criteria
108+
attributes:
109+
label: ✅ Acceptance Criteria
110+
value: |
111+
- [ ] The issue is solved as described.
112+
- [ ] Unit tests pass (`make unit-tests`, `make unit-tests-race`, and `make unit-tests-regression`).
113+
- [ ] Linting passes (`make lint` and `make checks`).
114+
- [ ] Commits are signed off (`-s`).
115+
validations:
116+
required: true
117+
118+
- type: textarea
119+
id: getting_help
120+
attributes:
121+
label: 🧭 Getting Help
122+
value: |
123+
If you get stuck, don't hesitate to ask!
124+
- Comment on this issue.
125+
- Join us on **Discord**: [#fabric-token-sdk](https://discord.gg/hyperledger)
126+
127+
- type: markdown
128+
attributes:
129+
value: |
130+
---
131+
### 📚 Useful Resources
132+
- [Documentation Overview](https://github.com/hyperledger-labs/fabric-token-sdk/blob/main/docs/README.md)
133+
- [Development Guidelines](https://github.com/hyperledger-labs/fabric-token-sdk/blob/main/docs/development/development.md)
134+
- [Testing Guide](https://github.com/hyperledger-labs/fabric-token-sdk/blob/main/docs/development/testing.md)

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ jobs:
2727
- name: golangci-lint
2828
uses: golangci/golangci-lint-action@v8
2929
with:
30-
version: v2.10.1
30+
version: v2.11.4
3131
args: --timeout=30m

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ go.work
77
go.work.sum
88
fabric-samples/
99
fabric-smart-client/
10+
/.bob/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ lint-auto-fix:
220220
# install golangci-lint
221221
install-linter-tool:
222222
@echo "Installing golangci Linter"
223-
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(HOME)/go/bin v2.10.1
223+
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(HOME)/go/bin v2.11.4
224224

225225
.PHONY: fmt
226226
fmt: ## Run gofmt on the entire project

checks.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ checks: licensecheck gofmt goimports govet misspell ineffassign staticcheck
44
.PHONY: licensecheck
55
licensecheck:
66
@echo Running license check
7-
@find . -name '*.go' | xargs addlicense -check || (echo "Missing license headers"; exit 1)
7+
@find . -path './.git' -prune -o -name '*.go' -print | xargs addlicense -check || (echo "Missing license headers"; exit 1)
88

99
.PHONY: gofmt
1010
gofmt:
1111
@echo Running gofmt
1212
@{ \
13-
OUTPUT="$$(gofmt -l -s . || true)"; \
13+
OUTPUT="$$(find . -path './.git' -prune -o -name '*.go' -print | xargs gofmt -l -s || true)"; \
1414
if [ -n "$$OUTPUT" ]; then \
1515
echo "The following gofmt issues were flagged:"; \
1616
echo "$$OUTPUT"; \
@@ -23,7 +23,7 @@ gofmt:
2323
goimports:
2424
@echo Running goimports
2525
@{ \
26-
OUTPUT="$$(goimports -l .)"; \
26+
OUTPUT="$$(find . -path './.git' -prune -o -name '*.go' -print | xargs goimports -l || true)"; \
2727
if [ -n "$$OUTPUT" ]; then \
2828
echo "The following files contain goimports errors"; \
2929
echo "$$OUTPUT"; \
@@ -41,7 +41,7 @@ govet:
4141
misspell:
4242
@echo Running misspell
4343
@{ \
44-
OUTPUT="$$(find . -type f | grep -v '.golangci.yml' | grep -v 'testdata' | xargs misspell || true)"; \
44+
OUTPUT="$$(find . -path './.git' -prune -o -type f -print | grep -v '.golangci.yml' | grep -v 'testdata' | xargs misspell || true)"; \
4545
if [ -n "$$OUTPUT" ]; then \
4646
echo "The following files are have spelling errors:"; \
4747
echo "$$OUTPUT"; \

cmd/tokengen/cobra/certfier/keypairgen.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ func keyPairGen() error {
7171
if err != nil {
7272
return errors.Wrapf(err, "failed unmarshalling public parameters loaded from [%s], len [%d]", ppPath, len(ppRaw))
7373
}
74+
err = pp.Validate()
75+
if err != nil {
76+
return errors.Wrapf(err, "failed validating public parameters loaded from [%s]", ppPath)
77+
}
7478
ppm, err := s.NewPublicParametersManager(pp)
7579
if err != nil {
7680
return errors.Wrapf(err, "failed instantiating public parameters manager")
@@ -91,10 +95,10 @@ func keyPairGen() error {
9195
skPath := filepath.Join(output, "certifier.sk")
9296
pkPath := filepath.Join(output, "certifier.pk")
9397
fmt.Printf("Store key-pair to [%s,%s]...\n", skPath, pkPath)
94-
if err := os.WriteFile(skPath, skRaw, 0600); err != nil {
98+
if err := os.WriteFile(skPath, skRaw, 0600); err != nil { //nolint:gosec
9599
return errors.Wrap(err, "failed writing certifier secret key to file")
96100
}
97-
if err := os.WriteFile(pkPath, pkRaw, 0600); err != nil {
101+
if err := os.WriteFile(pkPath, pkRaw, 0600); err != nil { //nolint:gosec
98102
return errors.Wrap(err, "failed writing certifier public key to file")
99103
}
100104

cmd/tokengen/cobra/pp/zkatdlognoghv1/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func Update(args *UpdateArgs) error {
136136
if _, err := os.Stat(path); err == nil {
137137
return errors.Errorf("%s exists in current directory. Specify another output folder with -o", fileName)
138138
}
139-
if err := os.WriteFile(path, raw, 0755); err != nil {
139+
if err := os.WriteFile(path, raw, 0755); err != nil { //nolint:gosec
140140
return errors.Wrap(err, "failed writing public parameters to file")
141141
}
142142

0 commit comments

Comments
 (0)