区块链——hyperledger之安装fabric

1、Window安装

1. 安装vagrant

1) 下载和安装html

下载地址:https://www.vagrantup.com/downloads.htmlgit

Windows版本下载URL:https://releases.hashicorp.com/vagrant/1.8.4/vagrant_1.8.4.msigithub

下载完成以后,直接双击下载的vagrant_1.8.4.msi安装包便可。golang

2) 基本使用docker

帮助文档:https://www.vagrantup.com/docs/ubuntu

搜索box的URL : https://atlas.hashicorp.com/boxes/searchwindows

1) Install boxapi

Adding a box from the catalog is very easy. Each box shows you instructions with how to add it, but they all follow the same format:session

$ vagrant box add USER/BOXless

For example: vagrant box add hashicorp/precise64. You can also quickly initialize a Vagrant  environment with vagrant init hashicorp/precise64.

另外,若是直接下载了box,能够经过以下命令安装:

$ vagrant box add xxx.box

2) vagrant up

It is time to boot your first Vagrant environment. Run the following from your terminal:

$ vagrant up

In less than a minute, this command will finish and you will have a virtual machine running Ubuntu.

3) vagrant ssh

This command will drop you into a full-fledged SSH session.

$ vagrant ssh

The SSH session can be terminated with CTRL+D.

2. 安装virtualbox

1) 下载

http://download.virtualbox.org/virtualbox/5.1.0/VirtualBox-5.1.0-108711-Win.exe

2) 安装

直接双击exe文件安装便可。

3. 安装go

1) 下载

https://storage.googleapis.com/golang/go1.6.2.windows-amd64.msi

2) 安装

双击下载的msi文件便可完成安装。

3) 配置环境变量

貌似不用单独配置,安装的时候就已经配置好了。

4. Git安装

1) 下载

https://github.com/git-for-windows/git/releases/download/v2.9.0.windows.1/Git-2.9.0-64-bit.exe

2) 安装

直接双击下载的exe文件便可。

5. 源码下载

1) 下载hyperledger/fabric源代码

a) 经过git:git clone https://github.com/hyperledger/fabric.git

b) 或者直接下载zip包:https://github.com/hyperledger/fabric/archive/master.zip

2) 运行安装对应的环境

参考文档:https://github.com/hyperledger/fabric/blob/master/docs/dev-setup/devenv.md

下载源码以后,进入fabric-master/devenv文件夹。而后运行vagrant up命令启动Ubuntu镜像。

 

3) 镜像启动完成以后,就能够运行vagrant ssh进入Ubuntu命令行。

 

或者经过virtualbox启动镜像,而后进入命令行,这种状况下须要输入用户名和密码:vagrant/vagrant。

 

 

Once inside the VM, you can find the peer project under $GOPATH/src/github.com/hyperledger/fabric (as well as /hyperledger).

6. Docker安装

执行下面两个命令:

$ sudo apt-get update

$ sudo apt-get install -y docker.io

2、Linux安装

1.Go安装

经过下面三个命令安装go:

$ sudo add-apt-repository ppa:ubuntu-lxc/lxd-stable

$ sudo apt-get update

$ sudo apt-get install golang

安装完成以后,执行which go,查看安装的路径:

 

查看版本:

 

 

3、运行chaincore示例

【参考:https://github.com/hyperledger/fabric/blob/master/docs/Setup/Chaincode-setup.md

相关文章
相关标签/搜索