How to deploy the development zone blockchain digital currency on Ubuntu

Source: Internet
Author: User
Tags curl mkdir git client git clone
Blockchain Enthusiast (qq:53016353)
GitHub Code Address: Setuponubuntu
The OBC and Hyperledger/fabric project procedures for deploying blockchain are complex, first start vagrant download a VirtualBox image, then install Docker in the box and compile the project via Docker.
This can cause two problems:
1, because the project needs to download a lot of outside dependence, the domestic wall slightly high, deployment difficulties
2, using VirtualBox cannot be deployed directly on IASs provider such as Alibaba Cloud.


In order to solve the above two problems, I translated the official deployment to the deployment on Ubuntu, the code is as follows:


#! /bin/bash
# Development on Ubuntu are done with the native OS, not in Vagrant. This script can
# used to set-on Ubuntu, similar to devenv/setup.sh which does the
# Same for Vagrant.
# See
#


if [Xroot! = x$ (WhoAmI)]
Then
echo "You must run as root (Hint:sudo su)"
Exit
Fi

Apt-get Update
Apt-get install git curl gcc g++ yum wget libc6-dev-y
Apt-get install-y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev LLVM
Apt-get upgrade gcc g++-y

#Set the maximum number of open files to 10000 or greater for your OS
Ulimit-n 65535

#TODO: Should really just open a few ports.
Iptables-i INPUT 1-j ACCEPT
Sysctl Vm.overcommit_memory=1


##################
# Install Docker
mkdir $HOME/tmp
Cd/tmp

wget-qo-

#TODO: Install on Boot
Nohup Docker daemon-g/data/docker-h tcp://0.0.0.0:2375-h unix:///var/run/docker.sock&

##################
# Install Golang
Curl-o https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz
Tar-c/usr/local-xzf go1.6.2.linux-amd64.tar.gz

Mkdir-p ~/go; echo "" >> ~/.BASHRC
Cat >> ~/.BASHRC <
Export Gopath= $HOME/go
Export path= $PATH: $HOME/go/bin:/usr/local/go/bin
Eof

SOURCE ~/.BASHRC
Echo ' Go version '

RM go1.6.2.linux-amd64.tar.gz

################
#ROCKSDB BUILD

Apt-get install-y Libsnappy-dev Zlib1g-dev Libbz2-dev
Cd/tmp
git clone https://github.com/facebook/rocksdb.git
CD Rocksdb
git checkout v4.1

Portable=1 make Shared_lib
INSTALL_PATH=/USR make install-shared && ldconfig

################
#Install pyenv Python
Cd/tmp
sudo apt-get install Libc6-dev gcc git-y
sudo apt-get install-y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev LLVM

git clone git://github.com/yyuu/pyenv.git ~/.pyenv

echo ' Export pyenv_root= ' $HOME/.pyenv ' >> ~/.BASHRC
echo ' Export path= ' $PYENV _root/bin: $PATH "' >> ~/.BASHRC
Echo ' eval ' $ (pyenv init-) "' >> ~/.BASHRC

SOURCE ~/.BASHRC

Pyenv Install 3.5.1-v
Pyenv Rehash
Pyenv Global 3.5.1

Pip Install--upgrade pip
Pip install behave nose docker-compose
Pip install-i flask==0.10.1 python-dateutil==2.2 pytz==2014.3 pyyaml==3.10 couchdb==1.0 flask-cors==2.0.1 requests== 2.4.3

##################
# Clone Project
Mkdir-p $HOME/go/src/github.com/hyperledger
CD $HOME/go/src/github.com/hyperledger
git clone https://github.com/hyperledger/fabric.git


CD fabric/
Make Peer Unit-test


In the above script, the following are the main things to do:


Git Client
Go-1.6 or later
ROCKSDB version 4.1 and its dependencies
Docker
Pip
Set the maximum number of open files to 65535


PIP is installed by using pyenv to install Python before installing PIP.
Related Article

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.