Skip to content

Commit f5d96b5

Browse files
committed
made changes to local-network
Signed-off-by: urgetolearn <[email protected]>
1 parent 3471ed0 commit f5d96b5

5 files changed

+166
-12
lines changed

extension.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const {
2222
const {
2323
BlockchainTreeDataProvider,
2424
} = require("./src/blockReader/blockchainExplorer.js");
25+
const { log } = require("console");
2526
let loadedConnectionProfile = null;
2627

2728
function activate(context) {
@@ -56,7 +57,6 @@ function activate(context) {
5657
command = `cd "${fabricDebuggerPath}" && bash local-networkdown.sh`;
5758
}
5859

59-
// Execute the command
6060
exec(command, (err, stdout, stderr) => {
6161
if (err) {
6262
vscode.window.showErrorMessage(`Error: ${stderr}`);
@@ -69,7 +69,6 @@ function activate(context) {
6969

7070
context.subscriptions.push(greenButton);
7171
context.subscriptions.push(redButton);
72-
7372
const hyperledgerProvider = new fabricsamples();
7473
const treeViewProviderFabric = new TreeViewProvider(
7574
"fabric-network",
@@ -972,7 +971,7 @@ function extractWalletDetails(walletData) {
972971
return null;
973972
}
974973

975-
function deactivate() {}
974+
function deactivate() { }
976975

977976
module.exports = {
978977
activate,

local-networkdown.sh

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
#!/bin/bash
2-
cd $HOME/go/src/github.com/urgetolearn
3-
cd fabric-samples/test-network
4-
./network.sh down
2+
FABRIC_SAMPLES_PATH="${HOME}/go/src/github.com/urgetolearn/fabric-samples"
3+
if [ -n "$FABRIC_SAMPLES_CUSTOM_PATH" ]; then
4+
FABRIC_SAMPLES_PATH="$FABRIC_SAMPLES_CUSTOM_PATH"
5+
fi
6+
if [ ! -d "$FABRIC_SAMPLES_PATH" ]; then
7+
echo "Error: Fabric samples directory not found at $FABRIC_SAMPLES_PATH."
8+
echo "Please ensure the Fabric samples are cloned from https://github.com/hyperledger/fabric-samples"
9+
exit 1
10+
fi
11+
cd "$FABRIC_SAMPLES_PATH/test-network" || exit
12+
./network.sh down

local-networkup.sh

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
#!/bin/bash
2-
cd $HOME/go/src/github.com/urgetolearn
3-
cd fabric-samples/test-network
2+
FABRIC_SAMPLES_PATH="${HOME}/go/src/github.com/urgetolearn/fabric-samples"
3+
if [ -n "$FABRIC_SAMPLES_CUSTOM_PATH" ]; then
4+
FABRIC_SAMPLES_PATH="$FABRIC_SAMPLES_CUSTOM_PATH"
5+
fi
6+
if [ ! -d "$FABRIC_SAMPLES_PATH" ]; then
7+
echo "Error: Fabric samples directory not found at $FABRIC_SAMPLES_PATH."
8+
echo "Please ensure the Fabric samples are cloned from https://github.com/hyperledger/fabric-samples"
9+
exit 1
10+
fi
11+
cd "$FABRIC_SAMPLES_PATH/test-network" || exit
412
./network.sh up

package-lock.json

+131-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+12-2
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,16 @@
157157
"command": "fabric-network.queryBlocks",
158158
"when": "view == blockchainExplorer",
159159
"group": "navigation"
160+
},
161+
{
162+
"command": "myview.button1",
163+
"when": "view == start-local-network",
164+
"group": "navigation"
165+
},
166+
{
167+
"command": "myview.button2",
168+
"when": "view == start-local-network",
169+
"group": "navigation"
160170
}
161171
],
162172
"view/item/context": [
@@ -244,15 +254,15 @@
244254
]
245255
},
246256
"dependencies": {
257+
"@hyperledger/fabric-gateway": "^1.7.0",
247258
"@hyperledger/fabric-protos": "^0.2.2",
248259
"@vscode/debugadapter": "^1.68.0",
249260
"dotenv": "^16.4.5",
250-
"@hyperledger/fabric-gateway": "^1.7.0",
251261
"fabric-ca-client": "^2.2.20",
252262
"fabric-network": "^2.2.20",
253263
"fabric-protos": "^2.2.20",
254-
"protobufjs": "^7.4.0",
255264
"js-yaml": "^4.1.0",
265+
"protobufjs": "^7.4.0",
256266
"simple-git": "^3.27.0"
257267
},
258268
"publish": {

0 commit comments

Comments
 (0)