问题描述
我正在研究Hyperledger结构,并尝试从网络检索历史交易记录。因此,我找到了 core.yaml 配置以启用分类帐历史数据库。但是,我找不到在应用程序源存储库中的何处包含 core.yaml 。
我发现没有什么线索可以添加 docker-compose.yaml 中的文件为
CORE_VM_ENDPOINT = core.yaml
那么,在 docker-compose.yaml 文件中添加 core.yaml 是正确的方法吗? >
docker-compose.yaml
版本: '2'
服务:
ca.org1.example.com:
图片:$ {FABRIC_DOCKER_REGISTRY} $ {FABRIC_CA_FIXTURE_IMAGE}:$ {ARCH} $ {ARCH_SEP} $ { FABRIC_CA_FIXTURE_TAG}
主机名:ca.org1.example.com
环境:
-FABRIC_CA_HOME = / etc / hyperledger / fabric-ca-server
-FABRIC_CA_SERVER_CA_NAME = ca.org1.example .com
-FABRIC_CA_SERVER_CA_CERTFILE = / etc / hyperledger / fabric-ca-server-config / ca.org1.example.com-cert.pem
-FABRIC_CA_SERVER_CA_KEYFILE = / etc / hyperledger / fabric-ca-server -confi克/ 0427fbe1849b3e146f05201e1d8c5e570337faaaa19ed37deda69bb7c88c71ef_sk
- FABRIC_CA_SERVER_CFG_AFFILIATIONS_ALLOWREMOVE =真
- FABRIC_CA_SERVER_CFG_IDENTITIES_ALLOWREMOVE =真
- FABRIC_CA_SERVER_PORT = 7054
- FABRIC_CA_SERVER_TLS_ENABLED =假
- FABRIC_CA_SERVER_TLS_CERTFILE =的/ etc / hyperledger /织物-CA -server-config / ca.org1.example.com-cert.pem
-FABRIC_CA_SERVER_TLS_KEYFILE = / etc / hyperledger / fabric-ca-server-config / 0427fbe1849b3e146f05201e1d8c5e570337faaaa19ed37deda69bb7c88c71ef_sk:b $ bbb 7054
公开:
-7054
命令:sh -c'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1 .example.com-cert.pem --ca.keyfile / etc / hyperledger / fabric-ca-server-config / 0427fbe1849b3e146f05201e1d8c5e570337faaaa19ed37deda69bb7c88c71ef_sk -b admin:adminpw -d'
量:
-./o config / peerOrganizations / org1.example.com / ca /:/ etc / hyperledger / fabric-ca-server-config
couchdb.pe er0.org1.example.com:
图片:$ {FABRIC_DOCKER_REGISTRY} $ {FABRIC_COUCHDB_FIXTURE_IMAGE}:$ {ARCH} $ {ARCH_SEP} $ {FABRIC_COUCHDB_FIXTURE_TAG}
主机名:Sofadb.peer0.org1.example.com
环境:
-COUCHDB_USER =管理员
-COUCHDB_PASSWORD = adminpw
端口:
-5984:5984
暴露:
-5984
peer0.org1.example.com:
图片:$ {FABRIC_DOCKER_REGISTRY} $ {FABRIC_PEER_FIXTURE_IMAGE}:$ {ARCH} $ {ARCH_SEP} $ {FABRIC_PEER_FIXTURE_TAG}
主机名:peer0.org1 .example.com
环境:
-CORE_PEER_PROFILE_ENABLED = true
-CORE_PEER_TLS_ENABLED = true
-CORE_PEER_TLS_KEY_FILE = / var / hyperledger / tls / server.key
-CORE_PEER_TLS_CERT_FILE = /var/hyperledger/tls/server.crt
-CORE_PEER_TLS_ROOTCERT_FILE = / var / hyperledger / tls / ca.crt
-CORE_PEER_GOSSIP_USELEADERELECTION = true
-CORE_PEER_GOSSIP_PEGLH ==
$ C真实
-CORE_PEER_ADDRESSAUTODETECT =真实
-CORE_PEER_LIST ENADDRESS = 0.0.0.0:7051
-CORE_PEER_LOCALMSPID = Org1MSP
-CORE_PEER_MSPCONFIGPATH = / var / hyperledger / msp
-CORE_LOGGING_PEER = info
-CORE_LOGGING_CAUTHDSL =警告$ b $ =警告
-CORE_LOGGING_LEDGER =信息
-CORE_LOGGING_MSP =警告
-CORE_LOGGING_POLICIES =警告
-CORE_LOGGING_GRPC =错误
-CORE_CHAINCODE_LOGGING_SHIM =信息
-CORE
-CORE_VM_ENDPOINT = unix:///host/var/run/docker.sock
-CORE_CHAINCODE_BUILDER
-CORE_CHAINCODE_GOLANG_RUNTIME
-CORE_CHAINCODE_EXECUTETIMEOUT = 120s
-CORE_PEER_NETWOGERID = b $ b-CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE
-CORE_LEDGER_STATE_STATEDATABASE = CouchDB
-CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME = admin
-CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD = PE_STORE_BORDER_VM = b_b_b_CER_PE = OUT_BORDER_CER_PE = BORE_C.DB_COREDB_COREDB_CERDB_CERDB_COREDB_CERDB_CORE_LED = CORE_LED_b = b_CERDB_COREDB真实的
-CORE_PEER_GOSSIP_EXTERNALEND POINT = peer0.org1.example.com:7051
-CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS = couchdb.peer0.org1.example.com:5984
-CORE_PEER_TLS_SERVERHOSTOVERRIDE = peer0.org1.example.com_PE_PEER_PE_APER_AP = STR peer1.org1.example.com:8051
working_dir:/opt/gopath/src/github.com/hyperledger/fabric
命令:对等节点启动
量:
-/ var / run /:/ host / var / run /
-./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/var/hyperledger/msp
-./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/var/hyperledger/tls
-core.yaml:/ var / hyperledger /配置
端口:
-7051:7051
-7053:7051
couchdb.peer1.org1.example.com:
图片:$ {FABRIC_DOCKER_REGISTRY } $ {FABRIC_COUCHDB_FIXTURE_IMAGE}:$ {ARCH} $ {ARCH_SEP} $ {FABRIC_COUCHDB_FIXTURE_TAG}
主机名:couchdb.peer1.org1.example.com
环境:
-COUCHDB_USER = admin
-COUCHDB_ PASSWORD = adminpw
端口:
-6984:5984
peer1.org1.example.com:
图片:$ {FABRIC_DOCKER_REGISTRY} $ {FABRIC_PEER_FIXTURE_IMAGE }:$ {ARCH} $ {ARCH_SEP} $ {FABRIC_PEER_FIXTURE_TAG}
主机名:peer1.org1.example.com
环境:
-CORE_PEER_PROFILE_ENABLED = true
-CORE_PEER_TLS_ENABLED = true
-CORE_PEER_TLS_KEY_FILE = / var / hyperledger / tls / server.key
-CORE_PEER_TLS_CERT_FILE = / var / hyperledger / tls / server.crt
-CORE_PEER_TLS_ROOTCERT_FILE = / var / hyperledger / tls / ca。
-CORE_PEER_GOSSIP_USELEADERELECTION = true
-CORE_PEER_GOSSIP_ORGLEADER = false
-CORE_PEER_GOSSIP_SKIPHANDSHAKE = true
-CORE_PEER_ADDRESSAUTODETECT = true
CORE_PEER_PEID = 0.0 $ CAL_PEER_PEED_CAL = CASE_PEER_DDR_CAL = Org1MSP
-CORE_PEER_MSPCONFIGPATH = / var / hyperledger / msp
-CORE_LOGGING_PEER = info
-CORE_LOGGING_CAUTHDSL =警告
-CORE_LOGGING_GOSSIP =警告
$ C $ GER-CORE_LOGGING b- CORE_LOGGING_MSP =警告
-CORE_LOGGING_POLICIES =警告
-CORE_LOGGING_GRPC =错误
-CORE_CHAINCODE_LOGGING_SHIM =信息
-CORE_CHAINCODE_LOGGING_LEVEL =信息
/ CORE_VM /主机/run/docker.sock
-CORE_CHAINCODE_BUILDER
-CORE_CHAINCODE_GOLANG_RUNTIME
-CORE_CHAINCODE_EXECUTETIMEOUT = 120s
-CORE_PEER_NETWORKID = multiorgledger
-CORE_VM_DOC_NETKER_STATE_STATECSTATEDB $ b-CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME =管理员
-CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD = adminpw
-CORE_PEER_ID = peer1.org1.example.com
-CORE_VM_DOCKER_ATTACHSTDOUT = IP_BERTER-CORE_PEER_PESS = PE1_CORE_LED。 :7051
-CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS = couchdb.peer1.org1.example.com:5984
-CORE_PEER_TLS_SERVERHOSTOVERRIDE = peer1.org1.example.com
-CORE_PEER_GOSSIP1.BOOTSTRAP。
working_dir:/opt/gopath/src/github.com/hyperledger/fabric
命令:对等节点启动
卷:
-/ var / run /:/ host / var / run /
-./crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/var/hyperledger/msp
-./crypto-config/peerOrganizations/org1 .example.com / peers / peer1.org1.example.com / tls:/ var / hyperledger / tls
端口:
-8051:7051
-8053:7051
请建议我一些解决方法
不,不是。
CORE_VM_ENDPOINT
在与对等方相同的桥接网络上启动链式代码容器。
您可以将包含core.yaml文件的文件夹的路径安装在对等容器上
如果您使用的是织物样品,请转到下面的路径
将以下代码添加到 peer-base.yaml的卷部分中如果您希望所有对等节点都启用历史记录,或者添加到 docker-compose-base.yaml文件中的选择性对等节点的数量
-路径/到/文件夹/where/core.yaml/exists\":/var/hyperledger/config
如有疑问,请还原。
I am working on Hyperledger fabric and trying to retrieve historical transaction records from the network. So, i found core.yaml config to enable ledger historic database. But, i don't find where to include the "core.yaml" in the application source repository.
I found few clues to add the file in docker-compose.yaml as
CORE_VM_ENDPOINT=core.yaml
So, is it the correct way of adding the "core.yaml" in the docker-compose.yaml file.?
docker-compose.yaml
version: '2'
services:
ca.org1.example.com:
image: ${FABRIC_DOCKER_REGISTRY}${FABRIC_CA_FIXTURE_IMAGE}:${ARCH}${ARCH_SEP}${FABRIC_CA_FIXTURE_TAG}
hostname: ca.org1.example.com
environment:
- FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
- FABRIC_CA_SERVER_CA_NAME=ca.org1.example.com
- FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
- FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/0427fbe1849b3e146f05201e1d8c5e570337faaaa19ed37deda69bb7c88c71ef_sk
- FABRIC_CA_SERVER_CFG_AFFILIATIONS_ALLOWREMOVE=true
- FABRIC_CA_SERVER_CFG_IDENTITIES_ALLOWREMOVE=true
- FABRIC_CA_SERVER_PORT=7054
- FABRIC_CA_SERVER_TLS_ENABLED=false
- FABRIC_CA_SERVER_TLS_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem
- FABRIC_CA_SERVER_TLS_KEYFILE=/etc/hyperledger/fabric-ca-server-config/0427fbe1849b3e146f05201e1d8c5e570337faaaa19ed37deda69bb7c88c71ef_sk
ports:
- 7054:7054
expose:
- 7054
command: sh -c 'fabric-ca-server start --ca.certfile /etc/hyperledger/fabric-ca-server-config/ca.org1.example.com-cert.pem --ca.keyfile /etc/hyperledger/fabric-ca-server-config/0427fbe1849b3e146f05201e1d8c5e570337faaaa19ed37deda69bb7c88c71ef_sk -b admin:adminpw -d'
volumes:
- ./crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
couchdb.peer0.org1.example.com:
image: ${FABRIC_DOCKER_REGISTRY}${FABRIC_COUCHDB_FIXTURE_IMAGE}:${ARCH}${ARCH_SEP}${FABRIC_COUCHDB_FIXTURE_TAG}
hostname: couchdb.peer0.org1.example.com
environment:
- COUCHDB_USER=admin
- COUCHDB_PASSWORD=adminpw
ports:
- 5984:5984
expose:
- 5984
peer0.org1.example.com:
image: ${FABRIC_DOCKER_REGISTRY}${FABRIC_PEER_FIXTURE_IMAGE}:${ARCH}${ARCH_SEP}${FABRIC_PEER_FIXTURE_TAG}
hostname: peer0.org1.example.com
environment:
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_KEY_FILE=/var/hyperledger/tls/server.key
- CORE_PEER_TLS_CERT_FILE=/var/hyperledger/tls/server.crt
- CORE_PEER_TLS_ROOTCERT_FILE=/var/hyperledger/tls/ca.crt
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_PEER_LISTENADDRESS=0.0.0.0:7051
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_MSPCONFIGPATH=/var/hyperledger/msp
- CORE_LOGGING_PEER=info
- CORE_LOGGING_CAUTHDSL=warning
- CORE_LOGGING_GOSSIP=warning
- CORE_LOGGING_LEDGER=info
- CORE_LOGGING_MSP=warning
- CORE_LOGGING_POLICIES=warning
- CORE_LOGGING_GRPC=error
- CORE_CHAINCODE_LOGGING_SHIM=info
- CORE_CHAINCODE_LOGGING_LEVEL=info
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_CHAINCODE_BUILDER
- CORE_CHAINCODE_GOLANG_RUNTIME
- CORE_CHAINCODE_EXECUTETIMEOUT=120s
- CORE_PEER_NETWORKID=multiorgledger
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE
- CORE_LEDGER_STATE_STATEDATABASE=CouchDB
- CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=admin
- CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=adminpw
- CORE_PEER_ID=peer0.org1.example.com
- CORE_VM_DOCKER_ATTACHSTDOUT=true
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb.peer0.org1.example.com:5984
- CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer0.org1.example.com
- CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org1.example.com:8051
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: peer node start
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/var/hyperledger/msp
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/var/hyperledger/tls
- core.yaml:/var/hyperledger/config
ports:
- 7051:7051
- 7053:7051
couchdb.peer1.org1.example.com:
image: ${FABRIC_DOCKER_REGISTRY}${FABRIC_COUCHDB_FIXTURE_IMAGE}:${ARCH}${ARCH_SEP}${FABRIC_COUCHDB_FIXTURE_TAG}
hostname: couchdb.peer1.org1.example.com
environment:
- COUCHDB_USER=admin
- COUCHDB_PASSWORD=adminpw
ports:
- 6984:5984
peer1.org1.example.com:
image: ${FABRIC_DOCKER_REGISTRY}${FABRIC_PEER_FIXTURE_IMAGE}:${ARCH}${ARCH_SEP}${FABRIC_PEER_FIXTURE_TAG}
hostname: peer1.org1.example.com
environment:
- CORE_PEER_PROFILE_ENABLED=true
- CORE_PEER_TLS_ENABLED=true
- CORE_PEER_TLS_KEY_FILE=/var/hyperledger/tls/server.key
- CORE_PEER_TLS_CERT_FILE=/var/hyperledger/tls/server.crt
- CORE_PEER_TLS_ROOTCERT_FILE=/var/hyperledger/tls/ca.crt
- CORE_PEER_GOSSIP_USELEADERELECTION=true
- CORE_PEER_GOSSIP_ORGLEADER=false
- CORE_PEER_GOSSIP_SKIPHANDSHAKE=true
- CORE_PEER_ADDRESSAUTODETECT=true
- CORE_PEER_LISTENADDRESS=0.0.0.0:7051
- CORE_PEER_LOCALMSPID=Org1MSP
- CORE_PEER_MSPCONFIGPATH=/var/hyperledger/msp
- CORE_LOGGING_PEER=info
- CORE_LOGGING_CAUTHDSL=warning
- CORE_LOGGING_GOSSIP=warning
- CORE_LOGGING_LEDGER=info
- CORE_LOGGING_MSP=warning
- CORE_LOGGING_POLICIES=warning
- CORE_LOGGING_GRPC=error
- CORE_CHAINCODE_LOGGING_SHIM=info
- CORE_CHAINCODE_LOGGING_LEVEL=info
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- CORE_CHAINCODE_BUILDER
- CORE_CHAINCODE_GOLANG_RUNTIME
- CORE_CHAINCODE_EXECUTETIMEOUT=120s
- CORE_PEER_NETWORKID=multiorgledger
- CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE
- CORE_LEDGER_STATE_STATEDATABASE=CouchDB
- CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=admin
- CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=adminpw
- CORE_PEER_ID=peer1.org1.example.com
- CORE_VM_DOCKER_ATTACHSTDOUT=true
- CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer1.org1.example.com:7051
- CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb.peer1.org1.example.com:5984
- CORE_PEER_TLS_SERVERHOSTOVERRIDE=peer1.org1.example.com
- CORE_PEER_GOSSIP_BOOTSTRAP=peer0.org1.example.com:7051
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: peer node start
volumes:
- /var/run/:/host/var/run/
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/msp:/var/hyperledger/msp
- ./crypto-config/peerOrganizations/org1.example.com/peers/peer1.org1.example.com/tls:/var/hyperledger/tls
ports:
- 8051:7051
- 8053:7051
Please suggest me some solution
NO its not.
CORE_VM_ENDPOINTstarts chaincode containers on the same bridge network as the peers.
You can mount the path of the folder containing core.yaml file on the peer container
If you are using fabric samples go to bellow path
add the bellow code to the volumes section of peer-base.yaml if you want all peers to have history enabled OR add to the volumes of selective peers in docker-compose-base.yaml file
- "Path/to/the/folder/where/core.yaml/exists":/var/hyperledger/config
If any doubts do revert.
这篇关于Hyperledger Fabric中何处包含core.yaml?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!