@@ -28,7 +28,6 @@ cd /path/to/fabric-chaincode-python
2828python3 -m venv .venv
2929source .venv/bin/activate
3030pip install -r requirements.txt
31- pip install " grpcio>=1.83.1"
3231```
3332
3433### 2. Package the Chaincode
@@ -94,14 +93,18 @@ source .venv/bin/activate
9493cd /path/to/test-network-nano-bash
9594. ./peer1admin.sh
9695PACKAGE_ID=$( peer lifecycle chaincode queryinstalled --output json | \
97- jq -r ' .installed_chaincodes[] | select(.references.mychannel? != null) | \
98- select(.references.mychannel.chaincodes[]? .name=="basic") | .package_id' )
96+ jq -r '
97+ .installed_chaincodes[]
98+ | select(.references.mychannel? != null)
99+ | select(any(.references.mychannel.chaincodes[]?; .name == "basic"))
100+ | .package_id
101+ ' )
99102
100103# Start the server
101104cd /path/to/fabric-chaincode-python
102105export CHAINCODE_ID=" $PACKAGE_ID "
103106export CHAINCODE_SERVER_ADDRESS=127.0.0.1:9999
104- python examples/ccaas/asset-transfer-basic/main.py
107+ ./.venv/bin/ python examples/ccaas/asset-transfer-basic/main.py
105108```
106109
107110### 6. Invoke & Query
@@ -183,7 +186,8 @@ Tells Fabric that this is a CCAAS package:
183186### Server won't start
184187- Ensure ` CHAINCODE_ID ` matches the package-id from ` peer lifecycle chaincode install `
185188- Check that ` connection.json ` address is accessible from the peer
186- - Verify gRPC is installed: ` pip install "grpcio>=1.83.1" `
189+ - Verify dependencies are installed: ` pip install -r requirements.txt `
190+ - Verify you're using the project venv: ` ./.venv/bin/python -c "import grpc; print(grpc.__version__)" `
187191
188192### Peer can't reach chaincode
189193- Check firewall rules allowing port 9999
0 commit comments