Skip to content

Commit ca705c2

Browse files
authored
Merge branch 'main' into main
Signed-off-by: Claudia <153988396+technomad01@users.noreply.github.com>
2 parents 4c8f316 + cb8bee6 commit ca705c2

File tree

12 files changed

+490
-49
lines changed

12 files changed

+490
-49
lines changed

.vscode/launch.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66
"type": "extensionHost",
77
"request": "launch",
88
"args": ["--extensionDevelopmentPath=${workspaceFolder}"]
9-
},
10-
{
11-
"name": "Debug Hyperledger Chaincode (Delve Server)",
12-
"type": "go",
13-
"request": "launch",
14-
"mode": "debug",
15-
"program": "${workspaceFolder}/Go/main.go",
16-
"showLog": true
179
}
1810
]
1911
}

Go/Go/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module simple_chaincode
2+
3+
go 1.22.4

Go/Go/go.sum

Whitespace-only changes.

Go/Go/main.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main() {
6+
fmt.Println("Starting the Go debugger test")
7+
8+
counter := 0
9+
for i := 0; i < 5; i++ {
10+
counter++
11+
fmt.Println("Counter value:", counter)
12+
13+
}
14+
15+
fmt.Println("Final Counter value:", counter)
16+
}

Go/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ func main() {
1010
counter++
1111
fmt.Println("Counter value:", counter)
1212

13-
// Set a breakpoint here to step through the loop
1413
}
1514

1615
fmt.Println("Final Counter value:", counter)
1716
}
17+

__debug_bin2909398763

1.93 MB
Binary file not shown.

extension.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { exec } = require("child_process");
99
const fabricsamples = require("./src/fabricsamples");
1010
const { Wallets } = require("fabric-network");
1111
const { TreeViewProvider } = require("./src/admin/treeview");
12-
const DelveDebugAdapterDescriptorFactory = require("./src/debugAdapter/DelveDebugAdapterDescriptorFactory");
12+
const DelveDebugAdapterDescriptorFactory = require("./src/debugAdapter/delveDebugAdapterDescriptorFactory.js");
1313
const {
1414
saveConnectionProfileToStorage,
1515
loadConnectionProfilesFromStorage,
@@ -181,6 +181,12 @@ function activate(context) {
181181
});
182182
}
183183

184+
factory = new DelveDebugAdapterDescriptorFactory();
185+
context.subscriptions.push(
186+
vscode.debug.registerDebugAdapterDescriptorFactory("delve", factory)
187+
);
188+
console.log("Delve Debug Adapter Registered");
189+
184190
const hyperledgerProvider = new fabricsamples();
185191
const treeViewProviderFabric = new TreeViewProvider(
186192
"fabric-network",
@@ -214,7 +220,7 @@ function activate(context) {
214220

215221
if (savedProfiles.length > 0) {
216222
loadedConnectionProfile = savedProfiles[0];
217-
console.log("Loaded connection profile:", loadedConnectionProfile);
223+
// console.log("Loaded connection profile:", loadedConnectionProfile);
218224
} else {
219225
console.warn("No combined profiles found in storage.");
220226
}
@@ -814,14 +820,6 @@ function activate(context) {
814820
})
815821
);
816822

817-
context.subscriptions.push(
818-
vscode.debug.registerDebugAdapterDescriptorFactory(
819-
"delve",
820-
new DelveDebugAdapterDescriptorFactory()
821-
)
822-
);
823-
console.log("Delve Debug Adapter Registered");
824-
825823
context.subscriptions.push(
826824
vscode.debug.onDidStartDebugSession((session) => {
827825
console.log(`Debugging started: ${session.name}`);

0 commit comments

Comments
 (0)