feat: Add Go implementation of full-stack-asset-transfer-guide smart contract (#1376)
Title: feat: add Go smart contract for full-stack-asset-transfer-guide
Closes: #1376
Summary
This PR adds a Go implementation of the full-stack-asset-transfer-guide smart contract, equivalent to the existing TypeScript contract in asset-transfer-typescript. It allows developers who prefer Go to follow the guide without switching languages.
Changes
Added a new directory asset-transfer-go containing the Go chaincode implementation.
Implemented asset lifecycle operations:
- CreateAsset
- ReadAsset
- UpdateAsset
- DeleteAsset
- AssetExists
- TransferAsset
- GetAllAssets
Additional components:
main.goentry point to bootstrap the chaincodego.mod/go.sumwith required Fabric dependenciesDockerfileanddocker-entrypoint.shfor Chaincode-as-a-Service (CaaS) deploymentasset-transfer-chaincode-vars.ymlfor compatibility with workshop automation
Testing Tested locally in WSL Ubuntu against a live Microfab network.
- Deployed chaincode in CaaS mode using
weft chaincode package caasand the Fabric lifecycle (install → approve → commit) - Executed asset operations through the
trader-goclient onmychannel(org1MSP) - Verified chaincode events (
CreateAsset,UpdateAsset,TransferAsset)
All 7 client commands (getAllAssets, transact, create, read, delete, transfer, listen) executed successfully.
Notes
Uses standard Fabric Go chaincode patterns via github.com/hyperledger/fabric-contract-api-go.
The asset data model mirrors the TypeScript implementation with minor adjustments for Go conventions.
Hi @bestbeforetoday, could I get a review? As far as I understand, the CI failures were due to flakiness.