Skip to content

feat: Add Go implementation of full-stack-asset-transfer-guide smart contract (#1376)#1391

Open
nXtCyberNet wants to merge 4 commits intohyperledger:mainfrom
nXtCyberNet:issue/asset-transfer-go
Open

feat: Add Go implementation of full-stack-asset-transfer-guide smart contract (#1376)#1391
nXtCyberNet wants to merge 4 commits intohyperledger:mainfrom
nXtCyberNet:issue/asset-transfer-go

Conversation

@nXtCyberNet
Copy link

@nXtCyberNet nXtCyberNet commented Mar 11, 2026

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.go entry point to bootstrap the chaincode
  • go.mod / go.sum with required Fabric dependencies
  • Dockerfile and docker-entrypoint.sh for Chaincode-as-a-Service (CaaS) deployment
  • asset-transfer-chaincode-vars.yml for compatibility with workshop automation

Testing
Tested locally in WSL Ubuntu against a live Microfab network.

  • Deployed chaincode in CaaS mode using weft chaincode package caas and the Fabric lifecycle (install → approve → commit)
  • Executed asset operations through the trader-go client on mychannel (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.

@nXtCyberNet nXtCyberNet requested a review from a team as a code owner March 11, 2026 06:12
@nXtCyberNet nXtCyberNet force-pushed the issue/asset-transfer-go branch from 60894c9 to 2d376f1 Compare March 11, 2026 06:16
Signed-off-by: nXtCyberNet <rohantech2005@gmail.com>
Signed-off-by: nXtCyberNet <rohantech2005@gmail.com>
…-transfer-go

Signed-off-by: nXtCyberNet <rohantech2005@gmail.com>
Signed-off-by: nXtCyberNet <rohantech2005@gmail.com>
@nXtCyberNet nXtCyberNet force-pushed the issue/asset-transfer-go branch from f4133c1 to b17085b Compare March 11, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Go implementation of full-stack-asset-transfer-guide smart contract

1 participant