Skip to content

Commit 52a90c3

Browse files
authored
Merge pull request #39 from technomad01/docs-usage-guide
Docs usage guide
2 parents 97a422f + 4bf4b99 commit 52a90c3

24 files changed

+655
-310
lines changed

Go/Go/go.mod

Lines changed: 0 additions & 3 deletions
This file was deleted.

Go/Go/go.sum

Whitespace-only changes.

Go/Go/main.go

Lines changed: 0 additions & 16 deletions
This file was deleted.

Go/__debug_bin2763616131

-1.93 MB
Binary file not shown.

Go/go.mod

Lines changed: 0 additions & 3 deletions
This file was deleted.

Go/go.sum

Whitespace-only changes.

Go/main.go

Lines changed: 0 additions & 16 deletions
This file was deleted.

docs/images/block-query.png

60 KB
Loading
67.3 KB
Loading

docs/images/debugger-start.png

52.6 KB
Loading

docs/images/delve-output.png

2.74 MB
Loading

docs/images/extension-start.png

31.8 KB
Loading

docs/images/extension-ui-launch.png

31.5 KB
Loading

docs/images/other-interface.png

108 KB
Loading

docs/images/select-chaincode-file.png

773 KB
Loading

docs/images/upload-network.png

36.6 KB
Loading

docs/images/upload-wallet.png

31.2 KB
Loading

docs/images/variables-interface.png

260 KB
Loading

docs/usage-guide.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# 🔍 Hyperledger Fabric Debugger - Usage Guide
2+
3+
Welcome to the usage guide for the **Hyperledger Fabric Debugger** VSCode extension. This tool is designed to help developers debug chaincode, interact with local Fabric networks, and manage wallets directly from VSCode.
4+
5+
---
6+
7+
## Table of Contents
8+
- [Installation](#installation)
9+
- [Launching the Extension](#launching-the-extension)
10+
- [Using the Extension Features](#using-the-extension-features)
11+
- [Running the Debugger](#running-the-debugger)
12+
- [Example Flow](#example-flow)
13+
- [Troubleshooting](#troubleshooting)
14+
- [Questions or Feedback?](#questions-or-feedback)
15+
16+
---
17+
18+
## ⚙️ Installation
19+
20+
Before using the debugger, ensure the extension is installed using the `vsce` tool.
21+
22+
```bash
23+
npx vsce package
24+
code --install-extension Hyperledger-Fabric-Debugger.vsix
25+
```
26+
27+
## 🚀 Launching the Extension
28+
Open VSCode and navigate to the Run & Debug tab on the sidebar.
29+
30+
Click the "Run Extension" button.
31+
![Start extension](./images/extension-start.png)
32+
33+
This will open the Extension Development Host, where the debugger's custom UI will appear.
34+
![Extension UI Launch](./images/extension-ui-launch.png)
35+
36+
## 🧩 Using the Extension Features
37+
Once the extension UI is open, you’ll see the main dashboard with the following actions:
38+
39+
- **Upload Network Configuration** (e.g., connection profile)
40+
![Upload Network](./images/upload-network.png)
41+
42+
- **Upload Wallet**
43+
![Upload Wallet](./images/upload-wallet.png)
44+
45+
- **Start Local Network** (e.g., using fabric-samples)
46+
47+
- **Query Blocks**
48+
![Query Blocks](./images/block-query.png)
49+
50+
## 🐛 Running the Debugger
51+
To start debugging your chaincode:
52+
53+
1. Click **Run & Debug**.
54+
55+
2. Select the configuration: **Debug Hyperledger Fabric**.
56+
![Start Debugger](./images/debugger-start.png)
57+
58+
3. A file prompt will appear — select your `chaincode.go` file.
59+
![File Prompt Window](./images/select-chaincode-file.png)
60+
61+
4. The debugger will attach using **Delve**.
62+
63+
5. Set breakpoints in your code.
64+
![Debugger attached](./images/debugger-launched-message.png)
65+
66+
You’ll see the standard VSCode debug interface:
67+
68+
Variables
69+
![Debugger interface](./images/variables-interface.png)
70+
71+
Watch expressions
72+
Call stack
73+
Breakpoints panel
74+
![Debugger interface](./images/other-interface.png)
75+
76+
**Debug Console output from Delve**
77+
![Debugger Message](./images/delve-output.png)
78+
79+
6. Use a Fabric client to invoke chaincode.
80+
81+
## ✅ Example Flow
82+
- Upload network config & wallet.
83+
- Upload your `chaincode.go` file.
84+
- Add breakpoints.
85+
- Use a Fabric client to invoke transactions.
86+
- Observe how the debugger halts at breakpoints, shows local variables, and logs chaincode behavior in real time.
87+
88+
## 🧼 Troubleshooting
89+
If you encounter errors like Delve DAP server not found:
90+
91+
- Ensure `dlv` is installed on your machine:
92+
```bash
93+
go install github.com/go-delve/delve/cmd/dlv@latest
94+
95+
```
96+
97+
Restart the extension host and re-select the debug config.
98+
99+
## 🙋 Questions or Feedback?
100+
101+
Found a bug? Have a suggestion?
102+
Please open an issue or pull request on our [GitHub repository](https://github.com/your-org/your-repo).

0 commit comments

Comments
 (0)