Skip to content

Docs usage guide #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 16, 2025
Merged
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
3 changes: 0 additions & 3 deletions Go/Go/go.mod

This file was deleted.

Empty file removed Go/Go/go.sum
Empty file.
16 changes: 0 additions & 16 deletions Go/Go/main.go

This file was deleted.

Binary file removed Go/__debug_bin2763616131
Binary file not shown.
3 changes: 0 additions & 3 deletions Go/go.mod

This file was deleted.

Empty file removed Go/go.sum
Empty file.
16 changes: 0 additions & 16 deletions Go/main.go

This file was deleted.

Binary file added docs/images/block-query.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/debugger-launched-message.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/debugger-start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/delve-output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/extension-start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/extension-ui-launch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/other-interface.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/select-chaincode-file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/upload-network.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/upload-wallet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/variables-interface.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 102 additions & 0 deletions docs/usage-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# 🔍 Hyperledger Fabric Debugger - Usage Guide

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.

---

## Table of Contents
- [Installation](#installation)
- [Launching the Extension](#launching-the-extension)
- [Using the Extension Features](#using-the-extension-features)
- [Running the Debugger](#running-the-debugger)
- [Example Flow](#example-flow)
- [Troubleshooting](#troubleshooting)
- [Questions or Feedback?](#questions-or-feedback)

---

## ⚙️ Installation

Before using the debugger, ensure the extension is installed using the `vsce` tool.

```bash
npx vsce package
code --install-extension Hyperledger-Fabric-Debugger.vsix
```

## 🚀 Launching the Extension
Open VSCode and navigate to the Run & Debug tab on the sidebar.

Click the "Run Extension" button.
![Start extension](./images/extension-start.png)

This will open the Extension Development Host, where the debugger's custom UI will appear.
![Extension UI Launch](./images/extension-ui-launch.png)

## 🧩 Using the Extension Features
Once the extension UI is open, you’ll see the main dashboard with the following actions:

- **Upload Network Configuration** (e.g., connection profile)
![Upload Network](./images/upload-network.png)

- **Upload Wallet**
![Upload Wallet](./images/upload-wallet.png)

- **Start Local Network** (e.g., using fabric-samples)

- **Query Blocks**
![Query Blocks](./images/block-query.png)

## 🐛 Running the Debugger
To start debugging your chaincode:

1. Click **Run & Debug**.

2. Select the configuration: **Debug Hyperledger Fabric**.
![Start Debugger](./images/debugger-start.png)

3. A file prompt will appear — select your `chaincode.go` file.
![File Prompt Window](./images/select-chaincode-file.png)

4. The debugger will attach using **Delve**.

5. Set breakpoints in your code.
![Debugger attached](./images/debugger-launched-message.png)

You’ll see the standard VSCode debug interface:

Variables
![Debugger interface](./images/variables-interface.png)

Watch expressions
Call stack
Breakpoints panel
![Debugger interface](./images/other-interface.png)

**Debug Console output from Delve**
![Debugger Message](./images/delve-output.png)

6. Use a Fabric client to invoke chaincode.

## ✅ Example Flow
- Upload network config & wallet.
- Upload your `chaincode.go` file.
- Add breakpoints.
- Use a Fabric client to invoke transactions.
- Observe how the debugger halts at breakpoints, shows local variables, and logs chaincode behavior in real time.

## 🧼 Troubleshooting
If you encounter errors like Delve DAP server not found:

- Ensure `dlv` is installed on your machine:
```bash
go install github.com/go-delve/delve/cmd/dlv@latest

```

Restart the extension host and re-select the debug config.

## 🙋 Questions or Feedback?

Found a bug? Have a suggestion?
Please open an issue or pull request on our [GitHub repository](https://github.com/your-org/your-repo).
Loading
Loading