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
Make sure GO environment is setup (GOPATH, GOROOT)
Go get this repo
go get github.com/predix/chaincode_example
Make sure it compiles
cd $GOPATH/src/github.com/predix/chaincode_example/predix-sample-chaincode
go build example.go
Make required changes to example.go as per requirement for your smart contract.
Make sure the changes compile
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.