IBM-Blockchain-Archive / ibm-blockchain.github.io

WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode.
30 stars 23 forks source link

The connection profile for the Interacting with your blockchain for K8s is not valid for Composer #38

Closed davidkel closed 7 years ago

davidkel commented 7 years ago

the section here https://github.com/IBM-Blockchain/ibm-blockchain.github.io/blob/master/_pages/03_Interacting%20with%20your%20blockchain.md#connections-profile-for-external-apps-to-talk-to-your-blockchain-network

provides connection details in the form of a JSON document, which adheres to the new format discussed around a common connection profile.

Unfortunately, this format is not supported by composer yet and people are getting confused thinking this is the connection profile to use with composer.

We should provide and test a connection profile that would work with composer to interact with that blockchain or provide details on how to convert it to a format that composer can use based on the same process given in 08_HSBN Deployment.md document.

dhyey20 commented 7 years ago

@davidkel Do you have a sample of json that works with composer?

dwakeman commented 7 years ago

Here is my connection.json content for my fabric running in K8S in Bluemix. I used the IBM Container Service scripts to set it up a few months ago, so it's not the latest version of anything, but it works.

{
    "type": "hlfv1",
    "orderers": [
        "grpc://169.51.9.76:31010"
    ],
    "ca": "http://169.51.9.76:30000",
    "peers": [
        {
            "requestURL": "grpc://169.51.9.76:30110",
            "eventURL": "grpc://169.51.9.76:30111"
        }
    ],
    "keyValStore": "/Users/dwakeman/.hfc-key-store-kubebmx-de",
    "channel": "channel1",
    "mspID": "Org1MSP",
    "deployWaitTime": "300",
    "invokeWaitTime": "100"
}
davidkel commented 7 years ago

@dhyey20 Composer connection profiles are designed for a single org and channel. So if I take the current document and create one for org1 it would look like this

{
    "name": "hlfv1-org1",
    "description": "A description for a V1 Profile",
    "type": "hlfv1",
    "orderers": [
        {
            "url": "grpc://INSERT_PUBLIC_IP:31010"
        }
    ],
    "ca": {
        "url": "http://INSERT_PUBLIC_IP:30000",
        "name": "CA1"
    },
    "peers": [
        {
            "requestURL": "grpc://INSERT_PUBLIC_IP:30110",
            "eventURL": "grpc://INSERT_PUBLIC_IP:30111"
        }
    ],
    "keyValStore": "<INSERT_SOME_EXISTING_DIRECTORY_HERE_TO_STORE_CERTIFICATES>",
    "channel": "mychannel",
    "mspID": "Org1MSP",
    "timeout": 300
}

And then there would be similar one for users from org2 The above works on the simple case scenario where the default endorsement policy is used.

sstone1 commented 7 years ago

@davidkel fixed!

booboothefool commented 6 years ago

@dwakeman @davidkel Are these sample connection profiles still up to date?

For example after https://ibm-blockchain.github.io/, I followed 1. Prepare & Setup, 2. Simple Install, 3. Interacting with your Blockchain to get Fabric running on Kubernetes.

bx cs workers blockchain to get MY_PUBLIC_IP.

Then I just stick that same MY_PUBLIC_IP in connection.json for orderers, ca, peers, yes?

Do I need to move anything into the keyValStore dir? What is the point of keyValStore when there are cards?

davidkel commented 6 years ago

@booboothefool KeyValStore is not required, however we use business network cards to manage connectivity to hyperledger composer now so you would have to build an appropriate card with appropriate credentials in order to interact with a business network. If look at the section interacting with your blockchain there is information about how to export the required business network card from playground that was used to deploy the network. You then run a tool to update that card for you to ensure the IP address is correct. Then you can use that business network card to interact with your playground deployed business network.