1.基礎軟件安裝
更新一下ubuntu的軟件包資源列表,方便下面安裝軟件
sudo apt-get update
安裝ssh服務
安裝了這個東西,你就可以使用一些工具遠程連接你的ubuntu系統了,比如 SecureCRT,filezilla之類的
sudo apt-get install ssh
安裝git
這個東西是代碼管理工具,這裏方便你下載fabirc的源碼
sudo apt-get install git
執行 git --version 驗證一下
安裝Pip
這個東西是python語言的一個模塊,安裝之後,可以用 pip命令來安裝一些軟件
sudo apt-get install python-pip
安裝go語言
fabric是go語言開發的,所以要安裝go語言來編譯解釋運行它
安裝參考我的另一篇博客,寫的很詳細:https://blog.csdn.net/hantangduhey/article/details/81162700
安裝docker
Fabric使用的docker容器來進行數據存儲和服務運行,所以要安裝docker
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get -y update
sudo apt-get -y install docker-ce
到這裏docker安裝好了,但是現在當前用戶並有沒有權限執行docker命令,還需要把當前用戶zengchen(這是我的用戶名,你們要替換成你們的)加入到docker用戶組裏
sudo usermod -aG docker zengchen
註銷並重新登錄,或者重啓一下系統,纔會生效,已經可以執行docker命令了
安裝docker-compose
跟docker配套使用的
安裝參考我的另外一篇博客:https://blog.csdn.net/hantangduhey/article/details/81184426
2.下載fabric源碼
還記得安裝go語言,設置的環境變量$GOPATH嗎?得把源碼下載到那個目錄裏,我的$GOPATH目錄是
/home/zengchen/go
你們可以用 echo $GOPATH命令 輸出一下看看,如果$GOPATH是空的,那說明安裝go的時候,/etc/profile沒有配置好,再去配置一下
接下來cd進入$GOPATH目錄,創建目錄
mkdir -p src/github.com/hyperledger
進入剛剛創建的目錄,使用git下載源碼
git clone https://github.com/hyperledger/fabric.git
下載速度慢的讓人難以置信,放棄這種源碼下載方式,git好像白安裝了
未完待續。。。
參考博客:https://blog.csdn.net/flyinguy/article/details/79502559