predix-sample-chaincode

command
v0.0.0-...-036677f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

README

Sample Chaincode

This repo holds the sample chaincode that can be deployed to hyperledger blockchain network, which is the underlying blockchain implementation used in Predix Blockchain-as-a-service.

This chaincode shows how you can use zone attribute, which is set for each user to enforce zone based access control in chaincode itself.

Use this chaincode as a reference for enforcing zone based access control as well as hyperledger dependencies.

How to use

  1. Make sure GO environment is setup (GOPATH, GOROOT)

  2. Go get this repo

    go get github.com/predix/chaincode_example
    
  3. Make sure it compiles

    cd $GOPATH/src/github.com/predix/chaincode_example/predix-sample-chaincode
    go build example.go
    
  4. Make required changes to example.go as per requirement for your smart contract.

  5. Make sure the changes compile

  6. Create a tar.gz of the chaincode and dependencies and upload it to predix blockchain service

    tar czvf mychaincode.tgz *
    

    Use PUT /v1/chaincodes/:chaincodename endpoint of Predix blockchain service to deploy this chaincode to predix blockchain.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL