Skip to content

feat: add Go client application for full-stack-asset-transfer-guide#1392

Open
nXtCyberNet wants to merge 1 commit intohyperledger:mainfrom
nXtCyberNet:issue/client
Open

feat: add Go client application for full-stack-asset-transfer-guide#1392
nXtCyberNet wants to merge 1 commit intohyperledger:mainfrom
nXtCyberNet:issue/client

Conversation

@nXtCyberNet
Copy link

Closes: #1378

Summary

This PR adds a Go implementation of the full-stack-asset-transfer-guide client application, mirroring the existing TypeScript implementation in trader-typescript.

What's Included

A new directory: trader-go

main.go
Entry point. Parses CLI arguments, establishes the gRPC connection, and dispatches commands.

connect.go
Creates the gRPC connection and initializes the Fabric Gateway client.

contract.go
Defines the AssetTransfer struct that wraps all smart contract calls (CreateAsset, ReadAsset, UpdateAsset, DeleteAsset, TransferAsset, GetAllAssets).

commands.go
Command registry mapping CLI command names to handler functions.

commands_impl.go
Implementation of all commands (create, delete, getAllAssets, listen, read, transact, transfer).

config.go
Helper functions for reading environment variables (ENDPOINT, MSP_ID, CERTIFICATE, PRIVATE_KEY, CHANNEL_NAME, CHAINCODE_NAME).

expectedError.go
Defines the ExpectedError type to distinguish known application errors from unexpected failures.

go.mod / go.sum
Module definition using fabric-gateway v1.10.0 and grpc v1.76.0.

Usage

The CLI interface is identical to the TypeScript implementation.

Testing

Tested end-to-end in WSL against a live Microfab network with the asset-transfer-typescript chaincode.

All 7 commands execute successfully.

@nXtCyberNet nXtCyberNet requested a review from a team as a code owner March 11, 2026 16:22
Signed-off-by: nXtCyberNet <rohantech2005@gmail.com>
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 client application

1 participant