/* Previously just heard blockchain, not how to know, recently tutor in the blockchain, let me match open blockchain environment, so the bite-bullet with a bit, and quite smooth. Due to the lack of contact with the blockchain, the configuration has any problem also ask you to correct me.
Environment: Ubuntu14.04 x64
First, the preparatory work:
1.Git Client
Ubuntu comes with git client so omit this step
2.Go Environment Configuration
Reference: http://xianglong.me/article/ubuntu-install-golang-env/
(1) Installation dependency:
sudo apt-get install bison ed gawk gcc Libc6-dev make
(2) Download go1.6.2.linux-amd64.tar.gz
From https://golang.org/dl/, download go1.6.2.linux-amd64.tar.gz, because the domestic is often wall, backed up a copy in http://pan.baidu.com/s/1gfDEG0r
(3) Install the Go Language pack
Enter the directory where go1.6.2.linux-amd64.tar.gz is located, unzip go1.6.2 to $home/code (or other directory) and run:
TAR-ZXVF go1.6.2.linux-amd64.tar.gz-c ~/code
(4) Configuring environment variables
Edit ~/.BASHRC, add at the end of the file:
Export goroot= $HOME/code/goexport GOBIN= $GOROOT/binexport PATH= $GOROOT/bin: $PATHexport Gopath= $HOME/code/workspace/go
Exit, run the source ~/.BASHRC to make the environment variable effective
(5) Testing the Go development environment
The help message appears when you enter go on the terminal
Set up the test file Hello.go, which reads as follows
" FMT " Func Main () { fmt. Printf ("Hello world!\n")}
Run: Go run hello.go
If the GO environment is configured correctly, print Hello world!
3.VirtualBox Configuration
Reference: http://www.mamicode.com/info-detail-193664.html
(1) Download Virtualbox-5.0_5.0.20-106931-ubuntu-trusty_amd64.deb
Download in Https://www.virtualbox.org/wiki/Downloads
Virtualbox-5.0_5.0.20-106931-ubuntu-trusty_amd64.deb
(2) Installation Virtualbox-5.0_5.0.20-106931-ubuntu-trusty_amd64.deb
Run at Terminal:
sudo dpkg-i virtualbox-5.0_5.0.20-106931-ubuntu-trusty_amd64.deb
If the hint is missing a dependent package, then perform the sudo apt-get-f install fix dependency and then execute the sudo dpkg-i virtualbox-5.0_5.0.20-106931-ubuntu-trusty_amd64.deb again;
If prompted failed, trying without DKMS, you need sudo apt-get install DKMS;
(3) Test VirtualBox
Virtualbox–help, if the Help document is displayed, the installation is successful
4.vagrant Configuration
(1) Download Vagrant_1.8.1_x86_64.deb
From Https://www.vagrantup.com/downloads.html, the Debian 64-bit version is selected
(2) Installation Vagrant_1.8.1_x86_64.deb
Run sudo dpkg-i vagrant_1.8.1_x86_64.deb at the terminal, install vagrant
(3) test
First configure the box before executing vagrant:
Download the box you need to use:
An official example: Http://files.vagrantup.com/precise32.box
You can also download more different systems here in the http://www.vagrantbox.es/or even have configured the environment directly can use box, although you can directly use the vagrant directly in the URL, by vagrant automatically download the installation, but considering the network situation, It is recommended to download it yourself first.
$ vagrant Box Add {title} {url}/{box_path}$ vagrant init {title}$ vagrant up
This vagrant installation is complete. Other vagrant commands:
$ vagrant Init # Initialize $ vagrant Up # start virtual machine $ vagrant Halt # Shut down virtual machine $ vagrant Reload ssh # SSH to virtual machine $ vagrant Status # View virtual machine run status $ vagrant Destroy # Destroy the current virtual machine
Second, configure the Openblockchain development environment
Reference: HTTPS://GITHUB.COM/OPENBLOCKCHAIN/OBC-DOCS/BLOB/MASTER/DEV-SETUP/DEVENV.MD
And
Https://github.com/openblockchain/obc-peer/blob/master/README.md
1.clone Open Blockchain Project and open Blockchain development environment project
(1) Clone the Open Blockchain Peer Project
Execute the following command to clone open Blockchain Peer project
CD $GOPATH/srcmkdir -P github.com/openblockchaincd github.com/openblockchaingit Clone https://github.com/<username>/obc-peer.git
(2) Clone the Open Blockchain Peer Project
Select a different directory (not under the Gopath directory tree) to create a workspace file (or other filename)
Execute command:
CD Workspacegit clone https: // Github.com/openblockchain/obc-dev-env.git
2. Initial OBC development environment
(1) initialization
Enter workspace/obc-dev-env/
Execution: vagrant up to initialize
Automatically download Virtualbox.box during the process
(2) SSH into the virtual machine
Execute under workspace/obc-dev-env/: Vagrant SSH will enter OBC virtual machine
At this point, the OBC virtual machine configuration is complete
3. Build, run and test the Open Blockchain Peer Project
(1) Building the project
Enter $gopth/src/github.com/openblockchain/obc-peer
(If you don't know the gopth path, run the Echo $GOPATH to see it)
Run go build to build the project
(This process may require root permissions, you can run sudo go build to build, the initial password should be empty, if you want to enter the root user, you can execute sudo passwd root to create the root user password, but the root user does not configure the GO environment variable, you can Configuration in the ROOT/.BASHRC file)
(2) Run
Perform
CD $GOPATH/src/github.com/openblockchain/obc-peer
./obc-peer
The document information will be printed
At this point, Openchain–peer run successfully
(3) Test
Not carefully furnished, ready to be perfected
Note that the test requires the behave module of Python to be installed when the behave test is carried out, for reference
http://pythonhosted.org/behave/
Https://pypi.python.org/pypi/behave
Http://pythonhosted.org/behave/install.html (Install Easy_install tool: sudo apt-get install python-setuptools)
by Xu Yuzhuang
Email:[email protected]
date:2016-05-07
Ubuntu Config Open BlockChain