区块链技术区块链研习社区块链大学

hyperledger fabric1.0启用couchdb功能

2017-09-05  本文已影响55人  剑有偏锋

背景:非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即可

上一篇下一篇

猜你喜欢

热点阅读