hyperledger-archives / fabric

THIS IS A READ-ONLY historic repository. Current development is at https://gerrit.hyperledger.org/r/#/admin/projects/fabric . pull requests not accepted
https://gerrit.hyperledger.org/
Apache License 2.0
1.17k stars 1.01k forks source link

Connect chaincode container to a network #1852

Open masterDev1985 opened 8 years ago

masterDev1985 commented 8 years ago

Description

There needs to be a way to connect a chaincode container to a network. In the case where a user runs a peer on one machine, but wants to run that peers chaincode on a different machine, they may need to have additional control over what network the chaincode container connects to. An example of such a scenario would be wanting the peer to communicate with the chaincode container over a docker overlay network.

Proposal

We have implemented a few changes in our fork of the code to deal with this issue, and we are offering our fix as a quick solution.

Added config to core.yaml

Added network configuration to dockercontroller.go

mastersingh24 commented 8 years ago

@masterDev1985 https://github.com/hyperledger/fabric/pull/1269 should handle this?

mrshah-at-ibm commented 8 years ago

@mastersingh24 what we have noticed is when we createContainer, it fails connecting the container to the overlay network. Thus, we connect to the overlay network once the container is created.

@masterDev1985, correct?

gbolo commented 8 years ago

I also have this issue when an overlay network is specified instead of the default host network, the cc will never join the overlay network

masterDev1985 commented 8 years ago

Completely missed your tag, @mastersingh24. My mistake. With @mrshah-at-ibm 's patch, which is linked in the description above, we have been able to perform overlay networking by creating a container and then using the docker library to connect it to a network before starting it. However, this method you have linked to is intriguing. We'll try it out and report back on our findings.