hyperledger fabric1.0啟用couchdb功能

背景:非docker形式多機部署fabric 1.0,需要啟用couchdb功能,couchdb的查詢功能比較nb,也方便調試


一 安裝couchdb,安裝教程見 http://docs.couchdb.org/en/2.1.0/install/unix.html

因為我安裝在ubuntu 14.04,主要列舉ubuntu 14.04的安裝步驟

《1》Run the command:

$echo "deb https://apache.bintray.com/couchdb-deb trusty main"\|sudo tee -a /etc/apt/sources.list

《2》install the repository key:

$ curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc\|sudo apt-key add -

《3》update the repository cache and install the package:

$ sudo apt-get update&&sudo apt-get install couchdb

《4》配置couchdb能遠程瀏覽器訪問

$ cd /opt/couchdb/etc/

$ vim default.ini

找到 chttpd節點下的= 127.0.0.1,修改為bind_address = 0.0.0.0,存盤

《5》重啟couchdb

$stop couchdb

$start couchdb?

《6》通過瀏覽器遠程訪問http://127.0.0.1:5984/_utils#setup

配置管理員的用戶名,密碼, 監聽地址(設置為0.0.0.0)


二 修改hyperledger fabric的配置

《1》 停止所有peer進程

《2》到fabric配置文件路徑,編輯fabric的core.yaml

$ vim core.yaml

找到ledger-》blockchain-》state節點

《2.1》stateDatabase的屬性,由goleveldb修改為CouchDB

《2.2》然后配置couchDBConfig節點下的地址,用戶名,密碼

couchDBAddress: 127.0.0.1:5984

username: admin

password: xxxxxx

《2.3》存盤

《3》重新啟動peer進程


三? 查看通道的交易信息? 訪問http://localhost:5984/_utils/#/_all_dbs即可

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容