Images required to recompile the Docker development environment after Hyperledger fabric new user

Source: Internet
Author: User
Tags mkdir touch install node git clone docker hub docker toolbox hyperledger fabric liquidweb
Images required to recompile the Docker development environment after Hyperledger/fabric new user Author: Chen Zhao Lin email:chenlin2@ms9.hinet.net Hyperledger does not belong to the public Chain, such as Bitcoin, he is a private chain that requires user review and authentication to join a blockchain transaction, which uses a CA (Certificate authority) for public key, private key, The issuance of digital signature, but also to manage the user's account, to ensure the real name. In addition to the first user authentication level, there are two levels to secure the blockchain information. In the block security and privacy of storage transactions, Hyperledger uses the PKI encryption mechanism's public and private keys to perform digital signatures and block encryption. The third is the consensus mechanism, with 3 per 2 of the ledger participating in the transactions of each other in the validation block. With the consent of the consensus mechanism, a shared ledger (Append only) can be written to ensure that the transaction data is non-tamper (immutable) and permanently saved (finality). The following example is the process by which Hyperledger/fabric adds users to the Docker development environment. Development Environment: Win7 (+ bit, RAM >=8g), vagrant, blockchain, Docker,golang 1. Win7 Installation Cygwin

(https://cygwin.com/install.html) set the installed executable directory (C:\cygwin64\bin) to the console system path variable Win7 Mounting VirtualBox (virtualbox-5.1.6-110634-win.exe)

(https://www.virtualbox.org/) win7 Installing git (https://git-scm.com/downloads) 2. Install fabric (0.6 release)

Enter Win7 command shell:
$mkdir-P D:\GoProjects\src\github.com\hyperledger
$CD D:\GoProjects\src\github.com\hyperledger
$git clone-b v0.6 http://gerrit.hyperledger.org/r/fabric (0.6 release)
$CD d:\GoProjects\src\github.com\hyperledger\fabric\devenv
$vi Vagrantfile
New:
Config.vm.network "Forwarded_port", guest:22, host:22
Config.vm.network "Forwarded_port", guest:3000, host:3000
Correction:
Vb.name = "Hyperledger" (Hyperledger is the VirtualBox virtual machine name)
$vagrant up (it takes a while to create a virtual machine Hyperledger the first time)
3. Log in to the Hyperledger VM (username:vagrant,password:vagrant) using Putty (Appendix 1)

4. Install node's latest version in Hyperledger VM using NVM (see Appendix 4)

$ NVM Use 6.7.0 (select node version)
$ node-v
v6.7.0
$ npm-v
3.10.3 5. Verify that the Hyperledger is mounted Win7 directory

Hyperledger mount point
($GOPATH/src/github.com/hyperledger/fabric)
The win 7 Local machine directory is mounted
(D:\GoProjects\src\github.com\hyperledger\fabric)
New empty file (for example, touch ABCD) test is mounted successfully with touch Directive 6. New Users

$CD $GOPATH/src/github.com/hyperledger/fabric
$ vi Membersrvc/membersrvc.yaml (added user RUBY:6AVZQLWCUEAA)


$vi./core/chaincode/chaincodetest.yaml
7. Recompile Fabric-peer & FABRIC-MEMBERSRVC

$ make Peer-image
$ make Membersrvc-image
$ docker Images

$ docker Tag Hyperledger/fabric-membersrvc:latest chenlin2/fabric-membersrvc:new
$ docker Tag Hyperledger/fabric-peer:latest chenlin2/fabric-peer:new (renamed)
$ docker Push chenlin2/fabric-peer:new (upload docker hub)
$ docker Push chenlin2/fabric-membersrvc:new 8. Reference Appendix (2) Installing Docker Toolbox in Win7 (Install the latest version)

(Win 10 can install Docker directly, please refer to Appendix 3) 9. Desktop Point selection (Docker Quickstart Terminal)


$ docker-v
Docker version 1.12.0, build 8eab29e
$ docker-machine ls (Docker Quickstart terminal interface execution, confirmation Virtual machine default installed)
NAME ACTIVE DRIVER State URL SWARM DOCKER ERRORS
Default VirtualBox Running tcp://192.168.99.101 : 2376 v1.10.3
$ docker-machine env default
Set Docker_tls_verify=1
Set docker_host=tcp://192.168.99.100:237 6
Set Docker_cert_path=c:\users\user.docker\machine\machines\default
Set Docker_machine_name=default
REM Run This command to configure your shell:
REM for/f "tokens=*"%i in (' docker-machine env default ') do%i
$ for/f "tokens=*"%i in (' docker-machine env default ') do%i
$ docker-machine ls (to determine that the virtual machine has been started)
NAME ACTIVE DRIVER State URL SWARM DOCKER ERRORS
Default * VirtualBox Running tcp://192.168.99.100:2376 v1.10.3 10. Use Putty (see Appendix 1) Log in to the virtual machine

ip:192.168.99.100 (Username=docker password=tcuser)

$mkdir-P/c/users/user/ictest/docker_blockchain
$vi docker-compose.yml (e.g. Appendix 5)
$docker-compose up-d (Start container)
11. Log in to the Dockerblockchain_vp0_1 container

$docker exec-it dockerblockchain_vp0_1 Bash
#cd EXAMPLES/CHAINCODE/GO/CHAINCODE_EXAMPLE02
#ls
Chaincode_example02.go
# go build./(Compile Chaincode_example02.go)
# ls
CHAINCODE_EXAMPLE02 Chaincode_example02.go
# Export CORE_CHAINCODE_ID_NAME=MYCC
# Export core_peer_address=0.0.0.0:7051
#./chaincode_example02 & (Chaincode start receiving transactions from the outside world)
12. Download and install Postman in Win7

Https://www.getpostman.com/apps (Postman-win64-4.7.1-setup.exe)
Postman has an easy-to-use HMI, with rest API in the VP deployment Chaincode
13. View the established Blockchain network

REST API Field Input: Http://192.168.99.100:7050/network/peers
192.168.99.100 (IP from virtual machine default), 7050 defined in DOCKER-COMPOSE.YML
user to VP (validating Peer) registration verifies that the new user (RUBY:6AVZQLWCUEAA) is valid

REST API Field Input: Http://192.168.99.100:7050/registrar
{
"Enrollid": "Ruby",
"Enrollsecret": "6AVZQLWCUEAA"
}
Appendix:

1.win7 Installing putty:
Http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
http://download.ithome.com.tw/article/index/id/1649
2.win7 installed Docker Toolbox:
Https://www.docker.com/products/docker-toolbox
http://knight-.iteye.com/blog/2254627
http://rominirani.com/2015/08/15/docker-toolbox-setup-windows/
https://getcarina.com/docs/troubleshooting/troubleshooting-windows-docker-vm-startup/
http://dockone.io/article/594
3.Win 10 Mounted Docker
Http://blog.miniasp.com/post/2016/08/01/Docker-for-Windows-1-12-Released.aspx
4.hyperledger VM Installation NVM & node
http://www.liquidweb.com/kb/how-to-install-nvm-node-version-manager-for-node-js-on-ubuntu-14-04-lts/
https://www.liquidweb.com/kb/how-to-install-node-js-via-nvm-node-version-manager-on-ubuntu-14-04-lts/
5.docker-compose.yaml
MEMBERSRVC:
Image:chenlin2/fabric-membersrvc:new
Command:membersrvc
VP0:
Image:chenlin2/fabric-peer:new
Ports
-"7,050:7,050"
Environment:
-Core_peer_addressautodetect=true
-core_vm_endpoint=http://172.17.0.1:2375
-Core_logging_level=debug
-Core_peer_id=vp0
-core_peer_pki_eca_paddr=membersrvc:7054
-core_peer_pki_tca_paddr=membersrvc:7054
-core_peer_pki_tlsca_paddr=membersrvc:7054
-Core_security_enabled=true
-Core_security_enrollid=test_vp0
-CORE_SECURITY_ENROLLSECRET=MWYPMSRJUPBT
Links
-MEMBERSRVC
Command:sh-c "Sleep 5; Peer Node Start–peer-chaincodedev "
6. Chen Zhaolin Facebook
https://zh-cn.facebook.com/chaolin.chen.18participation in the text:

1.https://github.com/hyperledger/fabric/tree/master/examples/chaincode/go/chaincode_example02
2.https://hyperledger-fabric.readthedocs.io/en/latest/setup/network-setup/
3.https://github.com/hyperledger/fabric/blob/master/docs/setup/chaincode-setup.md
4.https://github.com/ibm-blockchain/learn-chaincode
5.https://github.com/hyperledger/fabric/blob/master/docs/setup/network-setup.md
6.https://github.com/hyperledger/fabric/blob/master/docs/api/coreapi.md#rest-api
7.http://blockgeeks.com/guides/what-is-blockchain-technology-a-step-by-step-guide-than-anyone-can-understand/
8.https://developer.ibm.com/tv/the-creation-of-hyperledger-fabric-v1-for-stable-blockchain-networks/
9.https://yeasy.gitbooks.io/blockchain_guide/content/intro/what.html
10.http://www.ithome.com.tw/news/109182
11.https://1drv.ms/f/s!akbmzwp0h-vxbr7h1utnstmcpwi
12.https://1drv.ms/b/s!akbmzwp0h-vxazobosvz8ngmlpm
13.https://1drv.ms/b/s!akbmzwp0h-vxblk7fojh9il5hhc
14.https://www.youtube.com/watch?v=24jaf9eu1mk&list=uuotze-b_je_ovy9k9uhz4ba&index=74
15.https://www.youtube.com/watch?v=wsmj-rwuo8i&list=uuotze-b_je_ovy9k9uhz4ba&index=73
16.https://www.youtube.com/watch?v=sosn6mvgh60&list=uuotze-b_je_ovy9k9uhz4ba&index=72

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.