區塊鏈——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

相關文章
相關標籤/搜索