Discover hyperledger fabric developer tutorial, include the articles, news, trends, analysis and practical advice about hyperledger fabric developer tutorial on alibabacloud.com
This is the Chaincode for developers chapter in the official document of Hyperledger Fabric V1.0.The first translation, the wrong place also asked netizens to point out that we learn together progress.Original address (http://hyperledger-fabric.readthedocs.io/en/latest/chaincode4ade.html) chain code is what
Chaincode is a program written with go, which eventually
first of all thanks to the dark blue habitat, this tutorial is based on his tutorial [http://www.cnblogs.com/studyzy/p/7437157.html] collation, block chain technology developed quickly, in the great God's tutorial a little to add. In addition, there are also in the learning block chain students can contact me, we learn from each other.
In the first contact with
variable:
Enter the. BASHRC Configuration environment variable:
$ sudo vim ~/. BASHRC or: $ sudo vim/etc/profile
Add the following code to the last side:
Export gopath=/usr/local/goexport path= $GOPATH/bin: $PATH
Save, exit.
To make an environment variable effective:
$ source ~/. BASHRC or: $ source/etc/profile
After viewing the version number no problem, the configuration is successful.1.3.2 node. js
Download node. js
$ CURL-SL https://
Install node. js
sudo Install -y Nodejs
Check
the code
The preferred need is to determine that the go environment is installed and properly configured.
For the sake of simplicity, we use the following command:
Mkdir-p $GOPATH/src/asset cd $GOPATH/src/asset
Next, we create the source file
Touch Asset.go
2.2 Introduction Package
Each Chaincode implements the Chaincode interface
Package main
Import (
"FMT"
"Github.com/hyperledger/fabric/cor
written yet) and why it failed. In other words, you can use JUnit testing as a guide to implement code correctly.Now, if it's hard to understand, don't worry; I've provided a solution in com.makotojava.learn.blockchain.chaincode.solution in case you're stuck (or want to help with the implementation by reference).Writing the Java chain codeLet's start by introducing some of the background you need to know to implement the chain code approach in Chaincodelog. The Java chain code communicates with
The environment required to build the fabric under the ubantu environment.Configure Ubantu virtual machine under Mac, tutorial can refer to above.When the Ubantu system is ready, start the environment setup.
Environment construction
Quick Start: http://hyperledger-fabric.readthedocs.io/en/release-1.1/getting_started.html
Premise
Install Git
$ sudo apt update$ sud
There is a entire library of Blockchain APIs which you can select according to the needs that suffice your application. Some Libraries is open-sourced and Some are private. For examples, IBM ' s Hyperledger Fabric Project, Ethereum, Openchain, Multichain is few of the open sourced models which a Re popular in the industry today.This tutorial aims to help you get
If the currency block chain technology represented by the Bitcoin is 1.0, and the contract block chain technology represented by the Ether Square is 2.0, then the Hyperledger project which realizes the complete permission control and the security guarantee will undoubtedly represent the arrival of the block Chain Technology 3.0 ERA.
The Hyperledger project currently consists of
Transferred from: https://www.ibm.com/developerworks/community/blogs/8d277a63-4204-4fd3-8cb8-b7cb222cd522/entry/Steps_to_ Setup_blockchain_hyperledger_fabric_0_6_development_environment_on_ubuntu?lang=zh
We heard about Blockchain technology and understand their value to business. Here we would want to share our learnings with you all, acquired during setting up a single node Hyperledger blockchain de V Environment during a client engagement. This ent
the Go programming language installed and your system is configured correctly.
Now you need to create a subdirectory under your $gopath/src/to store your link code program.
To make things simple, we provide a simple instruction:
Mkdir-p $GOPATH/src/sacc cd $GOPATH/SRC/SACC
We create a source file:
Touch Sacc.go
Housekeeping (coded)
First let's prepare the code. Like every chain code, it implements the Init and invoke functions of the chain code. So let's use the GO Import statement to impo
How to contribute code to the Hyperledger Fabric project
Installation Environment
It is recommended to develop the code in the Ubuntu 14.04+ environment and install the following tools. git: Used to get the code; Golang 1.6+: Environment variables such as configuration $GOPATH after successful installation. Get Code
First register the Linux Foundation ID and log in to https://gerrit.hyperledger.org/to add
First, preparatory work
1. Through the tutorial-"(i) Hyperledger fabric in the CentOS7.2 64-bit system development environment build" to determine has been downloaded Hyperledger Fabric official sample codes.
ii. generation of networks 1. Generate Network Identification
CD
complete, unzip to the/usr/local directory:sudo tar -c/usr/local-xzf go1.10.1.linux-amd64.tar.gz To configure the GO locale variable:Enter the. BASHRC Configuration environment variable:$ sudo vim ~/. BASHRC or: $ sudo vim/etc/profileAdd the following code to the last side:Export gopath=/usr/local/goexport path= $GOPATH/bin: $PATH Save, exit.To make an environment variable effective:$ source ~/. BASHRC or: $ source/etc/profile After viewing the version number no problem, the configuration
Before you begin, you need to export a custom variable to facilitate subsequent operations:Export fabric=/opt/gopath/src/github.com/hyperledger/fabric/devenv1. Perform the following on the real machine to enter the virtual machineCD $FABRICvagrant up // start a virtual machine SSH // Enter virtual machine2. Perform the following actions in the virtual machine, st
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.