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
Fabric Source Analysis 2--peer command structure
Peer directory Structure
Peer directory structure itself is very clear, a main.go file, the rest of the folder, in addition to the COMMON,GOSSIP are all sub-command set, there are chaincode,channel,clilogging,node,version five, their respective duties, For Main.go integrated use. In a child command folder, the. Go file with the same name as the folder is the primary source file, and the rest is the so
Application development Configuration and build
You can use Go to develop applications and use the APIs available in the Hyperledger Fabric SDK Go to invoke the chain code to complete transactions in the blockchain network. At this stage we run the test project first.
Steps:
1. Sample application service-side code run
2. Download the certificate
3. Build the Certificate directory
4. Fabric SDK Configuration
Fabric is a Python class library that uses SSH protocol-based command-line tools for application Deployment and System task management, and here are two ways that fabric code runs in parallel:
1: Parameter-P
From FABRIC.API import * host1 = ' root@ip1:22 ' host2 = ' root@ip2:22 ' env.hosts = [Host1, host2] Env.pass Words = { host1: "P1", host2: "P2" }
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) Open the corresponding pathD:\Go\src\github.com\
Fabric is a command-line-based automated deployment framework for Python that uses Docker to open two of containers to learn fabric.#!/usr/bin/env python#-*-coding=utf-8-*- fromFabric.apiImport*env.hosts=[ '[Email protected]:22', '[Email protected]:32',]env.passwords={ '[Email protected]:22':'*****', '[Email protected]:32':'***',} @taskdefTask1 (): Run (' PS') @taskdefTask2 (): Run (' Uname-a')
work, let us see how to achieve a key with fabric: (in fact, with shell script can be directly done, but the advantage of FAB is not here, Here the main bit behind the local + remote operation to prepare, after all, two places to write a script for easy maintenance)from fabric.api import localdef setting_ci(): local("cd /home/project/test/conf/") local("git add settings.py") #后面你懂的,懒得敲了…..Mashup Integration Remote operationAt this point, sup
work, let us see how to achieve a key with fabric: (in fact, with shell script can be directly done, but the advantage of FAB is not here, Here the main bit behind the local + remote operation to prepare, after all, two places to write a script for easy maintenance)from fabric.api import localdef setting_ci(): local("cd /home/project/test/conf/") local("git add settings.py") #后面你懂的,懒得敲了…..Mashup Integration Remote operationAt this point, sup
first, fabric network structure (temporarily excluding CA)
As shown in the figure above, in the Fabric network, o indicates that ORDERER,P represents PEER,EP representative endorsing Peer (endorser), CC represents Chaincode, and client, Channel, Ledger, Transaction, which makes up the entire network, describes each of these elements:
Clients: A client installed at a node (Peer) can initiate a request to
The 1.Chaincode interface must be implemented by all the code on the chain, and the fabric runs the transaction by invoking these specified functions
Call the INIT function to allow code on the chain to initialize internal data after the container has established a connection and then deploys the transaction
Init (stub chaincodestubinterface, function string, args []string) ([]byte, error)
Each call to the transaction invokes the Invoke interface.
Installing Curl (Install curl)
If you do not have curl installed, download and install it.
Note: If it is windows, please look at the following Windows extras;
Docker and Docker Compose
Below you talk about installing Docker and Docker compose.
MAXOSX, *nix, or Windows 10 requires the installation of Docker V1.12 or a later version.
Older versions of Windows need to be installed first: Docker Toolbox before installing Docker V1.12 or later.
You can view your Docker version by entering the fol
GitHub's README.MD format reference on GitHub readme.md IntroductionThe main is "add ========== under the text is the headline text", "Add------------------under the text is in the title text", "Add # # in front of the text #就是小标题文字", "Add 2 tab in front of the text is the code style", " Add * or > etc. to the text in front of the script or quote including service etc. ".More tools to see:iOS developers must have no less than 75 toolsSeven Debug Tools recommended: iOS Development necessary debu
This is a creation in
Article, where the information may have evolved or changed.
Brief introduction
Chaincode is the user chain code, which provides state processing logic based on the blockchain distributed ledger.Fabric, Chaincode is run by default in the Docker container.Peer creates and launches the Chaincode container by calling the Docker API.Chaincode A GRPC connection is created between the container and peer, and both parties communicate interactively by sending Chaincodemessage.
This is a creation in
Article, where the information may have evolved or changed.
Overall structure
Fabric-peer: Mainly peer role, including endorser (endorser), committer two rolesFABRIC-CA: The original MEMBERSRVC, independent into a new projectFabric-order: Play the order role
Core Code Package
BCCSP Package: Support for encryption and decryption algorithms and mechanismsCommon package: Some general-purpose modulesCore package: Most
structure-sized memory spacemarshal.copy (bytes, 0,structptr,size); // obj= marshal.ptrtostructure (Structptr,type); marshal.freehglobal (STRUCTPTR); Returnobj; } } } 3. Last look at the client//1. Create a nested section wordm_s=NewSockets (AddressFamily.InterNetwork, Sockettype.dgram, PROTOCOLTYPE.UDP);//2. Fill in the server IPIPAddress IP=Ipaddress.parse ("127.0.0.1");IPEndPoint Ipe=NewIPEndPoint (IP,4321);//Send this user information to the serverCp2pmessage msg=NewCp2pmessage ();
AgentAn HTTP intermediate entity located between the client and the serverCacheHTTP repositories, so that copies of common pages can be saved closer to the clientGatewayA special Web server that connects other applications, typically used to convert HTTP traffic to other protocol trafficTunnelA special agent for blind forwarding of HTTP communication messagesThe difference between proxy and gateway:The agent is the intermediate substance that connects the two identical protocol endpoints, and th
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.