Roper
Roper

Reputation: 121

Can Hyperledger Fabric chaincode call an external local application/binary?

I have a scenario in which it would be required for the chaincode to call an external application to do a complex proprietary job.

I know that it is basically possible (also not recommended) to call an external service e. g. via HTTP.

However, I'd like to call a binary that is locally installed on the peer simply by for example exec.Command("some application") from the chaincode and work with its result.

The problem I am facing is that Fabric runs the chaincode itself in another docker container and not directly in the peer container, making the binary unavailable. Is there a way to share maybe a peer's volume with the runtime containers created by Fabric for chaincode execution?

Upvotes: 2

Views: 270

Answers (1)

yacovm
yacovm

Reputation: 5140

You can package the binary with the chaincode package and then it will be able to execute it at the time of the chaincode execution.

Upvotes: 1

Related Questions