Skip to content

Commit d8dbfc3

Browse files
Merge branch 'main' into poc/chaincode-to-fsc
2 parents a6e852d + d167aa3 commit d8dbfc3

11 files changed

Lines changed: 1036 additions & 21 deletions

File tree

CONTRIBUTING.md

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,82 @@
22

33
We appreciate your contributions to the Fabric Smart Client project. Any help is welcome and there is still much to do.
44

5-
Please go to the issues page to create a bug report or suggest a new feature. Feel free to create a pull request (PR) and link it to the corresponding issue.
5+
**Jump To:**
6+
- [Code Contributions](#code-contributions)
7+
- [Submitting an Issue](#submitting-an-issue)
68

7-
More info on how to test your contribution you can find in [`docs/development.md`](docs/development.md). The documentation index is available at [`docs/README.md`](docs/README.md).
9+
## Code Contributions
10+
11+
Browse [open, unassigned issues](https://github.com/hyperledger-labs/fabric-smart-client/issues?q=is%3Aissue+is%3Aopen+no%3Aassignee+label%3A%22status%3A+ready+for+dev%22) to find one that matches your interest.
12+
13+
Look for issues with the `status: ready for dev` label — these have been triaged and are ready to be worked on.
14+
Issues also carry a skill-level label (`skill: good first issue`, `skill: beginner`, `skill: intermediate`, `skill: advanced`).
15+
Start with `skill: good first issue` if you are new to the project. See the [Skill System](docs/dev/workflow.md#skill-system) for progression requirements.
16+
17+
### Getting Assigned
18+
19+
To claim an issue, comment on it with:
20+
21+
```
22+
/assign
23+
```
24+
25+
The bot will automatically:
26+
1. Assign you to the issue
27+
2. Update the issue labels
28+
3. Post a welcome message
29+
30+
If you don't meet the prerequisites, the bot will show your progress and link to issues you can work on first.
31+
32+
### Submitting Your Work
33+
34+
Once assigned, follow the [Development Guide](docs/dev/development.md) to:
35+
1. Fork the repository and create a branch
36+
2. Make your changes
37+
3. Sign your commits (`-s -S`). See the [Commit Signing Guide](docs/dev/signing.md)
38+
4. Open a pull request
39+
40+
## Submitting an Issue
41+
42+
### Bug Reports 🐛
43+
44+
⚠️ **Ensure you are using the latest release of the Fabric Smart Client** — it's possible the bug is already fixed.
45+
46+
1. Visit the [Issues page](https://github.com/hyperledger-labs/fabric-smart-client/issues).
47+
2. ⚠️ **Check the bug is not already reported.** If it is, comment to confirm you're also experiencing it.
48+
3. Click **New Issue** and choose the **Bug Report** template.
49+
50+
The template will guide you through providing a description, steps to reproduce, expected vs. actual behavior, and
51+
environment details. The more reproducible the report, the faster a fix can land.
52+
53+
Security vulnerabilities should be disclosed responsibly. Please see [SECURITY.md](SECURITY.md)
54+
55+
### Feature Requests 💡
56+
57+
**Note:** If you intend to implement a feature yourself, please submit the request _before_ writing any code and
58+
ask to be assigned. Features are for user-facing capabilities — new platforms, services, API methods, etc.
59+
Improvements to tooling, CI, or the contribution process are [Tasks](#tasks) instead.
60+
61+
1. Visit the [Issues page](https://github.com/hyperledger-labs/fabric-smart-client/issues).
62+
2. Verify the feature has not already been proposed.
63+
3. Click **New Issue** and choose the **Feature Request** template.
64+
65+
### Tasks 🔧
66+
67+
Use a Task for maintenance, improvement, or operational work: refactoring, dependency updates, documentation
68+
improvements, CI/CD changes, test coverage, or enhancements to existing features.
69+
70+
1. Visit the [Issues page](https://github.com/hyperledger-labs/fabric-smart-client/issues).
71+
2. Verify the work has not already been proposed.
72+
3. Click **New Issue** and choose the **Task** template.
73+
74+
### After Submitting
75+
76+
All three templates automatically apply `status: awaiting triage`. A maintainer will review the issue and prepare it for contributors.
77+
Once finalized, the issue will have `status: ready for dev` and can be claimed via `/assign`.
78+
79+
---
880

981
Note that we follow the [LFDT Charter](https://www.lfdecentralizedtrust.org/about/charter), particularly, all new inbound code contributions to the Fabric Smart Client project shall be made under the Apache License, Version 2.0. All outbound code will be made available under the Apache License, Version 2.0.
1082

11-
You can also reach us on Discord in [#fabric-smart-client](https://discord.gg/hyperledger).
83+
You can also reach us on Discord in [#fabric-smart-client](https://discord.com/channels/905194001349627914/945691888348967012).

README.md

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ It lets you focus on **business logic and distributed workflows**, rather than l
1111
FSC abstracts away the complexity of a DLT network, enabling developers to build distributed applications with ease.
1212

1313
## Key Features
14-
- **High-level APIs** that abstract away the complexity of interactive distribute applications.
15-
- **Peer-to-peer client overlay** enabling interatcting directly as needed.
14+
- **High-level APIs** that abstract away the complexity of interactive distributed applications.
15+
- **Peer-to-peer client overlay** enabling interacting directly as needed.
1616
- **Advanced transaction orchestration** to implement complex application business processes.
1717
- **Integration-ready with Fabric and Fabric-x networks** via simple configuration, with support for multiple versions.
1818
- **Token SDK** as an example of building distributed ledger applications on top of FSC.
@@ -27,7 +27,7 @@ FSC abstracts away the complexity of a DLT network, enabling developers to build
2727

2828
To start developing and testing your application with the Fabric Smart Client:
2929

30-
Ensure you have a working [Go environment](docs/development.md).
30+
Ensure you have a working [Go environment](docs/dev/development.md).
3131

3232
Clone the repository:
3333
```bash
@@ -49,14 +49,7 @@ These examples demonstrate common FSC patterns, transaction flows, and how to wi
4949

5050
We welcome contributions from everyone. Please read [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
5151

52-
In summary:
53-
54-
1. Fork the repository
55-
2. Create a feature branch
56-
3. Add tests and documentation
57-
4. Submit a Pull Request
58-
59-
Join our community on the LFDT Discord [#fabric-smart-client](https://discord.gg/hyperledger).
52+
Join our community on the LFDT Discord [#fabric-smart-client](https://discord.com/channels/905194001349627914/945691888348967012).
6053
We also have a community meeting every Wednesday at 1300 CET on [Zoom](https://zoom-lfx.platform.linuxfoundation.org/meeting/96953495257?password=0517864f-e5ef-4ef5-89fa-8638e15fddec). Please see the [Hyperledger Fabric community calendar](https://zoom-lfx.platform.linuxfoundation.org/meetings/lf-decentralized-trust?view=week) for details.
6154
Meeting notes are available [here](https://docs.google.com/document/d/13t5-9tfA-7L0Ok4DaK3da_3TpAz5CCd5h5_LryhJyRM/edit?usp=sharing).
6255

docs/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ Each platform section includes a local `README.md` plus a `configuration.md` pag
1717

1818
## Development
1919

20-
- [Development guide](development.md)
20+
- [Development guide](dev/development.md)
21+
- [Commit signing (DCO + GPG)](dev/signing.md)
22+
- [Contribution workflow](dev/workflow.md)
2123
- [Contributor guide](../CONTRIBUTING.md)
2224

2325
## Guides and Tutorials
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ For general development best practices, see the following guidelines:
1010

1111
Before you begin, ensure you have the following installed:
1212

13-
- **Go**[Install Go](https://go.dev/doc/install) (see the required version in [`go.mod`](../go.mod))
13+
- **Go**[Install Go](https://go.dev/doc/install) (see the required version in [`go.mod`](../../go.mod))
1414
- **Docker**[Install Docker Engine](https://docs.docker.com/engine) (or a compatible container manager)
1515

1616
## Clone the Repository
@@ -49,7 +49,7 @@ To install a specific Fabric version, set the `FABRIC_VERSION` variable:
4949
FABRIC_VERSION=3.1.0 make install-fabric-bins
5050
```
5151

52-
The default `FABRIC_VERSION` is defined in the project [Makefile](../Makefile).
52+
The default `FABRIC_VERSION` is defined in the project [Makefile](../../Makefile).
5353

5454

5555
### Fabric-x
@@ -69,7 +69,8 @@ Set the `FAB_BINS` environment variable to point to the directory containing the
6969
export FAB_BINS=/home/yourusername/fabric/bin
7070
```
7171

72-
> NOTE: Do *not* store the Fabric binaries inside your fabric-smart-client repository.
72+
> [!NOTE]
73+
> Do *not* store the Fabric binaries inside your fabric-smart-client repository.
7374
Doing so may cause integration tests to fail when installing chaincode.
7475

7576
## Running Tests
@@ -146,7 +147,7 @@ Run all integration tests:
146147
make integration-tests
147148
```
148149

149-
Run a specific integration tests (e.g., Fabric IOU test):
150+
Run a specific integration test (e.g., Fabric IOU test):
150151
```bash
151152
make integration-tests-fabric-iou
152153
```
@@ -189,7 +190,7 @@ go test -race -coverprofile=cov.out ./platform/common/utils/dig
189190
go tool cover -func=cov.out
190191
```
191192

192-
## Write your own integration test
193+
## Write Your Own Integration Test
193194

194195
Creating a new integration test is straightforward.
195196
Each test includes a **test harness** and a **network topology** file.
@@ -205,7 +206,7 @@ touch integration/fabricx/helloworld/helloworld_test.go
205206
- `topology.go` — defines the network topology (organizations, peers, orderers, etc.)
206207
- `helloworld_test.go` — defines the test harness and scenarios
207208

208-
For reference, review existing tests in the [`integration/`](../integration/) directory.
209+
For reference, review existing tests in the [`integration/`](../../integration/) directory.
209210

210211
Run your new integration test:
211212
```bash

docs/dev/merge-conflicts.md

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
# Resolving Merge Conflicts
2+
3+
Merge conflicts are caused by working on outdated versions of the codebase, or another developer merging a change involving similar parts of the codebase to you.
4+
5+
> [!IMPORTANT]
6+
> **Avoid Merge Conflicts** by syncing your branch regularly [Sync Guide](rebasing.md).
7+
8+
## Step-by-Step Guide
9+
10+
### 1. See which files are conflicted
11+
```bash
12+
git status
13+
```
14+
15+
### 2. Understand the conflict markers
16+
You will see sections like:
17+
18+
```text
19+
<<<<<<< HEAD
20+
code from main
21+
=======
22+
your branch’s code
23+
>>>>>>> mybranch
24+
```
25+
26+
### 3. Decide what the final code should be
27+
28+
Have a vision of what you'd like the final code to look like, given what is currently on main and what you'd like to propose.
29+
30+
> [!WARNING]
31+
> - Do not blindly accept both changes
32+
> - Do not blindly accept incoming
33+
> - Do not blindly accept existing
34+
35+
Merge conflicts require: ✅ Human interpretation
36+
37+
Sometimes you'll be:
38+
- Accepting both incoming and current
39+
- Accepting only incoming
40+
- Accepting only current
41+
- Accepting **parts** of both incoming and current
42+
43+
Generally, you want to keep all changes that were merged to main, but additionally, layer on your changes.
44+
45+
### 4. Resolve conflicts in VS Code (recommended):
46+
Once you understand you have a merge conflict and have a vision of the final document, we recommend using VS Code.
47+
48+
49+
VS Code makes solving merge-conflicts easier with a 3-pane interface for resolving conflicts:
50+
51+
- Incoming Change → code from main (left/top)
52+
- Current Change → code from your branch (right/top)
53+
- Result → the lower/third pane, where you create the final merged file.
54+
55+
You want to accept or reject content from the top left and top right panes, and edit the final pane in the bottom so the final code submission reasonably resolves the issue while respecting the work of others.
56+
57+
#### Steps to resolve in VS Code
58+
59+
1. Open the conflicted file in VS Code.
60+
61+
2. Look at both the Incoming Change (left) and Current Change (right) panels.
62+
63+
3. In the Result (lower pane), edit the file so it contains the correct final version.
64+
- Sometimes keep Incoming (main)
65+
- Sometimes keep Current (your branch)
66+
- Often, combine both parts and edit the code manually.
67+
68+
If the conflict is resolved correctly, VS Code will mark it as fixed.
69+
70+
4. Save the lower pane file once there are no more merge conflicts to resolve in this file.
71+
72+
5. Click the add button next to the file to resolve conflicts or:
73+
```bash
74+
git add <file>
75+
```
76+
77+
6. Continue the rebase:
78+
```bash
79+
git rebase --continue
80+
```
81+
82+
7. If there are more conflicts in other files, VS Code will automatically move you to the next one. Repeat until no conflicts remain.
83+
84+
> [!WARNING]
85+
> Do not just click “Accept All Incoming” or “Accept All Current” — that usually **deletes** or **corrupts** important code.
86+
87+
Once the rebase operation completes, your commits will be layered on top of main. It means your commit history will look “different” and you may even see changes to commits from other authors — this is expected, since rebase rewrites history.
88+
89+
8. Push changes. If you already have an open Pull Request, you will need to update it with a **force push**. Before pushing, double-check that your commits are both DCO signed and GPG verified:
90+
```bash
91+
git log -n 10 --pretty=format:'%h %an %G? %s'
92+
```
93+
Ensure you see: `G` = Good (valid signature)
94+
95+
Then:
96+
```bash
97+
git push --force-with-lease
98+
```
99+
100+
> [!TIP]
101+
> To be safe, create a backup branch before force pushing.
102+
103+
## Common Issues
104+
105+
#### 1. Message: *“No changes – did you forget to use git add?”*
106+
- **What it means:** You resolved the conflicts but forgot to stage the files.
107+
- **Solution:** Run `git add <file>` and try again.
108+
109+
#### 2. Message: *“Are you sure you want to continue with conflicts?”*
110+
- **What it means:** Some conflicts are still unresolved or the files were not saved properly.
111+
- **Solution:** Double-check your files in VS Code, make sure they are saved, and resolve any remaining conflict markers:
112+
113+
### If you need to stop
114+
```bash
115+
git rebase --abort
116+
```
117+
118+
> [!TIP]
119+
> At each conflict: resolve → save → stage → continue. Repeat until all conflicts are gone.
120+
121+
### What NOT to do
122+
1. ❌ Do not run git merge main
123+
→ This creates messy merge commits. Always rebase instead.
124+
125+
2. ❌ Do not merge into your local main
126+
→ Keep main as a clean mirror of upstream/main.
127+
128+
3. ❌ Do not open PRs from your fork’s main
129+
→ Always create a feature branch for your changes.
130+
131+
At each conflict instance, you'll have to repeat: fix the conflict, stage the files and continue rebasing.
132+
133+
## Recovery Tips
134+
135+
Undo the last rebase commit, but keep changes staged (while still in rebase):
136+
If you are in the middle of a rebase and realize the last step went wrong, you can undo it while keeping changes staged:
137+
```bash
138+
git reset --soft HEAD~i
139+
```
140+
141+
> [!NOTE]
142+
> The number after HEAD~ refers to how many commits you want to go back.
143+
144+
For example:
145+
- HEAD~1 → go back 1 commit
146+
- HEAD~3 → go back 3 commits
147+
- HEAD~5 → go back 5 commits
148+
149+
### If you are completely stuck
150+
Sometimes a rebase can get too messy to fix conflict by conflict. In that case, it’s often easier to start fresh:
151+
152+
1. Abort the rebase to stop where you are:
153+
```bash
154+
git rebase --abort
155+
```
156+
157+
2. Reset your fork's main to the upstream main and layer your commits on top of that:
158+
``` bash
159+
git checkout main
160+
git reset --hard upstream/main
161+
git push origin main --force-with-lease
162+
git checkout mybranch
163+
git rebase upstream/main -S
164+
```
165+
166+
> [!WARNING]
167+
> Use git stash only if you really want to save some local changes that aren’t yet committed. In most cases, if the rebase is failing, it’s safer to abort or reset rather than reapplying a stash of broken work.

0 commit comments

Comments
 (0)