hyperledger-labs / hyperledger-labs/microfab

Orderer endpoint required for invocations from Fabric peer CLI

Open
#176 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
80
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Older versions of microfab (maybe v0.0.16?) appeared to allow transaction function invocation and chaincode lifecycle using the Fabric `peer` CLI command without and orderer endpoint being explicitly specified. With current versions of microfab (at least v0.0.19 and v0.0.20), these invocations fail unless the orderer endpoint is explicitly specific in the `peer` CLI command.

From a LF Distributed Trust Discord discussion:

> Hello, hopefully someone can help i am stuck i have been working on the full stack tutorial and everything is correct until when i use the peer command to add and asset: "peer chaincode invoke -C mychannel -n asset-transfer -c '{"Args":["CreateAsset","{"ID":"001", "Color":"Red","Size":52,"Owner":"Fred","AppraisedValue":234234}"]}' --connTimeout 15s". This command is returnin the following error ' Error: error getting broadcast client: orderer client failed to connect to localhost:2006: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 127.0.0.1:2006: connect: connection refused" '. This is all the return after inserting the command ' 2024-12-06 17:51:43.999 GMT 0001 INFO [chaincodeCmd] InitCmdFactory -> Retrieved channel (mychannel) orderer endpoint: localhost:2006
Error: error getting broadcast client: orderer client failed to connect to localhost:2006: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 127.0.0.1:2006: connect: connection refused" '

> Could you try adding a -o orderer-api.127-0-0-1.nip.io:8080 option to your peer chaincode invoke command? I have a vague memory that an update to the version of microfab used might require the orderer to be specified explicitly
The client application code should still work just fine. If this is the issue, it would only affect using the Fabric CLI to do invocation

> That works perfectly. Thank you

Accommodations were required when updating the microfab version used by [fabric-samples](https://github.com/hyperledger/fabric-samples/commit/effe8ff980803ccef4fd61c1ef96411731fe0c1c) and [fabric-chaincode-java](https://github.com/hyperledger/fabric-chaincode-java/commit/d5aa6c5e21bba289b7cfe72245fa13f49e56c585) for this change in behaviour.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.