learn-chaincode | Learn how to write chaincode. (For the latest information, see http://hyperledger-fabric.readthedoc | Blockchain library
kandi X-RAY | learn-chaincode Summary
kandi X-RAY | learn-chaincode Summary
Chaincode is a piece of code that is deployed into a network of Hyperledger fabric peer nodes that enables interaction with that network's shared ledger.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of learn-chaincode
learn-chaincode Key Features
learn-chaincode Examples and Code Snippets
Community Discussions
Trending Discussions on learn-chaincode
QUESTION
I'm following the instructions to deploy some chaincode to the IBM Hyperledger Blockchain, using the swagger API on the IBM Bluemix dashboard.
In order to deploy some chaincode, I need to submit a JSON request, which contains the path to the chaincode repository:
...ANSWER
Answered 2017-Jan-09 at 23:28Try stripping out the 'tree/master' portion of your deployment url. Notice that the example linked below does not include this portion of the url:
https://github.com/IBM-Blockchain/learn-chaincode#deploying-the-chaincode
This url is going to be passed into a go get
command inside the peer, which will download the chaincode so that it can be compiled. So, this url must match the format accepted by this command.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install learn-chaincode
The following tasks take you through the process of building a pipeline that will allow you to build chaincode effectively. In short, your pipeline for iterating on chaincode will consist of the following steps:. "Forking" the repository means creating a copy of this repository under your GitHub account. Note that the fork will fork the entire repository including all the branches. Toggle the Branch button on the left to see the available branches. Now, you have a copy of your fork on your machine. You will develop your chaincode by making changes to these local files, pushing them to your fork on GitHub, and then deploying the code onto your blockchain network using the REST API on one of your peers. In order to turn a piece of Go code into chaincode, all you need to do is implement the chaincode shim interface. The three functions you have to implement are Init, Invoke, and Query. All three functions have the same prototype; they take in a 'stub', which is what you use to read from and write to the ledger, a function name, and an array of strings. The main difference between the functions is when they will be called. In this tutorial you will be building a chaincode to create generic assets.
Make changes to the given chaincode on your local machine and check that the code compiles.
Push your updates to GitHub.
Deploy your updated chaincode to your local Hyperledger network using the fabric REST API.
Test your chaincode using the fabric REST API.
Repeat.
Fork this repository to your GitHub account. This can be accomplished quickly by scrolling up and clicking the Fork button at the top of this repository.
Clone your fork into your $GOPATH.
Notice that we have provided two different versions of the chaincode used in this tutorial: Start - the skeleton chaincode from which you will start developing, and Finished - the finished chaincode.
Make sure it builds in your local environment:
Open a terminal or command prompt
It should compile with no errors/text. If not, make sure that you have correctly installed Go per the development environment setup instructions.
Push the changes back to your fork on GitHub.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page