Skip to content

predix/fabric-release

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BOSH release for Hyperledger

This repository is BOSH release for hyperledger fabric.

Deployment

  1. Install and start Bosh lite

  2. Upload stemcell

    bosh upload stemcell https://bosh.io/d/stemcells/bosh-warden-boshlite-ubuntu-trusty-go_agent
    
  3. Fetch release repo

    mkdir -p ~/workspace
    cd ~/workspace
    git clone https://github.com/atulkc/fabric-release.git
    cd fabric-release/
    git submodule update --init
    
  4. Run following command to build and upload bosh release

    bosh create release && bosh upload release
    
  5. Update cloud config on bosh director

    bosh update cloud-config manifests/cloud_config_boshlite.yml
    
  6. Update director_uuid field in manifests/fabric_permissionless.yml with uuid of local BOSH Director

    bosh status --uuid
    
  7. Deploy release

    bosh -d manifests/fabric_permissionless.yml deploy
    

Test

  1. Deploy a chaincode

    curl -X POST 10.244.8.3:5000/chaincode -d '{
    	"jsonrpc": "2.0",
    	"method": "deploy",
    	"params": {
    		"type": 1,
    		"chaincodeID":{
    			"path":"https://github.com/atulkc/chaincode_example/chaincode_example01"
    		},
    		"ctorMsg": {
    			"function":"init",
    			"args":["c", "450", "d", "700"]
    		}
    	},
    	"id": 1
    }'
    

    Response:

    {"jsonrpc":"2.0","result":{"status":"OK","message":"<message-id>"},"id":1}
    
  2. Verify that the chaincode was deployed successfuly

    curl -X POST 10.244.9.2:5000/chaincode -d '
    {
    	"jsonrpc": "2.0",
    	"method": "query",
    	"params": {
    		"type": 1,
    		"chaincodeID":{
    			"name":"<message-id>"
    		},
    		"ctorMsg": {
    			"function":"query",
    			"args":["c"]
    		}
    	},
    	"id": 2
    }'
    

    Response:

    {"jsonrpc":"2.0","result":{"status":"OK","message":"450"},"id":2}
    
  3. Initiate a transaction against deployed chaincode

    curl -X POST 10.244.8.2:5000/chaincode -d '
    {
    	"jsonrpc": "2.0",
    	"method": "invoke",
    	"params": {
    		"type": 1,
    		"chaincodeID":{
    			"name":"<message-id>"
    		},
    		"ctorMsg": {
    			"function":"invoke",
    			"args":["d", "c", "10"]
    		}
    	},
    	"id": 3
    }'
    

    Response:

    {"jsonrpc":"2.0","result":{"status":"OK","message":"<transaction-id>"},"id":3}
    
  4. Verify that the transaction to chaincode was executed

    curl -X POST 10.244.9.2:5000/chaincode -d '
    {
    	"jsonrpc": "2.0",
    	"method": "query",
    	"params": {
    		"type": 1,
    		"chaincodeID":{
    			"name":"<message-id>"
    		},
    		"ctorMsg": {
    			"function":"query",
    			"args":["c"]
    		}
    	},
    	"id": 4
    }'
    

    Response:

    {"jsonrpc":"2.0","result":{"status":"OK","message":"470"},"id":4}