This is a creation in
Article, where the information may have evolved or changed.
HyperLedger Fabcar Study notes (writing the first app based on the Super Ledger)
Translated from: Http://hyperledger-fabric.rea ...
Writing the first application
We need to implement the following three steps
First set up a development environment
Learn some simple parameters of the smart contract that our app will us
Prerequisite
Http://hyperledger-fabric.readthedocs.io/en/latest/prereqs.html
Installation method Vim bootstrap.sh chmod +x bootstrap.sh the copy in the URL into the bootstrap.sh and then executes
Node installation Note Node version
wget https://npm.taobao.org/mirrors/node/v6.9.5/node-v6.9.5-linux-x64.tar.gz
TAR-ZVXF node-v6.9.5-linux-x64.tar.gz MV node-v6.9.5-linux-x64//usr/local/cellar/node
Go install yum install Golang Find/-name Golang set path/u
business data by directly changing the COUCHDB.Let's take the official marble as an example and see what happens when we change couchdb.The following are the steps:1.install,instantiate and initializing data:Peer ChaincodeInstall-N marbles02-v1.0-P github.com/hyperledger/fabric/examples/chaincode/go/Marbles02peer Chaincode Instantiate-O orderer.example.com:7050--tls $CORE _peer_tls_enabled--cafile/opt/gopath/src/github.com/
SummaryFrom copying third-party code into the Project (1994), to pear Installing the Dependency Pack (1999), to the rise of composer, the PHP community has been exploring for nearly 20 years. The ancient language of PHP, also in the continuous development of updates, in the web has been glowing fever. Composer is currently the best tool for PHP package dependency management and deserves to be mastered by ev
Hyperledger Fabric Trading Flow
Hyperledger Fabric v1.1 provides several special chain codes to perform certain special tasks, which are known as system chain codes (Systems Chaincode). The purpose of this paper is to summarize the implementation, function and usage of these chain codes. Similar to the user chain code, the system chain code also implements the Init () and Invoke () methods. There are five t
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
corresponding directory, and then enter the directory, git download source code
# download Install git
$ apt-get install git
# Create source directory
$ mkdir-p/opt/gopath/src/github.com/hyperledger
$ cd/opt/ Gopath/src/github.com/hyperledger
$ git clone https://github.com/hyperledger/fabric.git
$ cd Fabric
# Use Git to get the specified version of
git checkout
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$ sudo apt install git
Installing Curl
$ sudo apt install curl
Install Vim
$ sudo apt install v
First, the Fabric SDK
The latest official document for Hyperledger fabric (V1.1.0-preview), the description of the Fabric SDK is still poor, just a few simple descriptions, plus two GitHub links: Fabric-sdk-node Fabric-sdk-java
In fact, through the Hyperledger project on GitHub we can see that Hyperledger fabric also offers another three kinds of sdk:fabric-sdk-
=/opt/gopath
Then Soorce
source/etc/profile.
Attention
If the mirror is slow, set up with Daocloud to download
curl-ssl https://get.daocloud.io/daotools/set_mirror.sh | sh-s/HTTP/ 6b8ef0e5.m.daocloud.io
Service Docker restart
if the download process encounters protoc-gen-go missing, download and copy to the corresponding directory
go get-u Github.com/golang/protobuf/protoc-gen-go
4 Fabric Mirroring
Install the fabric image (there are 2 methods, the 1th is to download the source code
In
packagist.orgAfter the new submission of a package, has been
composer requireNot a resource.
Don't know how long it will take composer to get there?
# The following is debug information d:\ubuntu_share\composer\hello>php D:\bin\composer require pangou/hello-world-vvvyou is running
First, start the process of developing code on the Java chain 1. Make sure you have grandle tools.2. Download the binary distribution package from the http://gradle.org/gradle-download/3. Unpack, move to the location you want, add the Grandle Bin directory to the system path4. Ensure that the GRANDLE-V command can be executed, the version shown is 2.12 or higher5. Ensure Grandle daemon can be quickly created6. Make sure you've turned jdk8.0 and also make sure that the Java directory is in your p
problems of the project, specific instructions can refer to/usr/lib/python2.7/site.py file:
Docker-compose-f Docker-compose-cli.yaml Down
Execute command
Docker run-it CLI BashAbnormal:
[ROOT@IZ2ZEIVRKCKULQ2DTIDZTMZ e2e_cli]# Docker exec-it CLI bash
Error response from Daemon:container 1f9b6f7d709f26 3F4A67A67AD91B419B13844EFAAA4CAEB6DD571BFA829822C7 is not running
Workaround:
CLI:
container_name:cli ...
Working_dir:/opt/gopath/src/github.com/
Prerequisite conditions
CentOS 7.4 64-bit
Install Docker and configure the Aliyun accelerator
Install Docker Compose
Install Golang
Because of the forbidden relationship, there is no way to direct access to the golang.org site, but the domestic download site a lot of their own Baidu can be.
My installation path is/usr/local/src/go
Edit/etc/profile file Add related environment variables as follows
Install Git
Yum Install git
Download Fabric Source Code
Mkdir-p ~/go/src/github.com/
> Before learning bitcoin and Ethereum, must first learn its block structure, at that time in the bank to do hyperledger related projects, I was very neglected in the structure, only care about the smart contract, incredibly can also initially master and start Project-related development. This shows that the super-Ledger block attribute is actually weaker, and it is important that the properties of the smart contract. Performance is also good. In this
Super Ledger Hyperledger Cello installation deployment and simple use
Cello GitHub
Hyperledger Cello helps manage blockchain networks effectively. use to quickly build a blockchain-as-a-service (BaaS) platform. Immediately provide customizable blockchain, such as Hyperledger Fabric Network v1.0 can be used on bare metal, virtual cloud (virtual machine, virtual c
1, Environmental structure Description:The system uses the container to run, the construction process is simple, each component division of labor is clear:1.docker-compose:docker container management;2.Go Lang Sdk:go language development, compilation environment;3.git:git Mirror Clone and commit;4.Rest client:rest API test;The main operations of the container are: Membersrv and peer;
2. Deployment Environment Readiness
3. Installation and Deployment3.1 Pulling the mirror from the DockerhubA. Ins
Have the version number of the strict as required, encountered a lot of pits1) No requirement to install Git version2) Install the Go 1.9 configuration environment variable3) Install Vagrant 1.9.44) Install VirtualBox 5.1.285) Create the following directory under the Go installation directory/src/(no restrictions on location)D:\Go\src\github.com\hyperledger6) Use Git to draw official source codegit clone https://github.com/hyperledger/fabric.git7) Ope
Then the previous article also recorded the fabric1.0 test process has been in accordance with the "Blockchain Technology Guide" operation, the background log in the start of the output of the following error message
The background error of the cluster will cause the command error, guess the reason is that there is a dependency between the containers, Orderer 7050 has not been opened, Peer0 Grpc failed.
Purely personal guess, because the following error is also shown because GRPC timed out
The
As we all know, the database used by Hyperledger is ROCKSDB, and if you do not modify it, the data will be stored in the/var/hyperledger/production/db directory.
Now let's analyze the relevant code in the gray section of the diagram.
The code structure diagram is as follows
Start the database, initialize the OPENCHAINDB instance, and open the database. Note that this method does not guarantee the correct
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.