IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 大数据 -> Caliper测试具体文件配置 --Kakfa共识--CouchDB -> 正文阅读

[大数据]Caliper测试具体文件配置 --Kakfa共识--CouchDB

caliper测试语句

npx caliper launch manager --caliper-workspace . --caliper-benchconfig benchmarks/scenario/simple/config.yaml --caliper-networkconfig networks/fabric/v1/v1.4.0/2org1peergoleveldb_kafka/fabric-go.yaml

fabric-go.yaml文件路径

cd /opt/gopath/src/github.com/hyperledger/caliper-benchmarks/networks/fabric/v1/v1.4.0/2org1peergoleveldb_kafka
gedit fabric-go.yaml
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# 

name: Fabric
version: "1.0"
mutual-tls: false

caliper:
  blockchain: fabric
  command:
    start: export FABRIC_VERSION=1.4.4;export FABRIC_CA_VERSION=1.4.4;docker-compose -f networks/fabric/docker-compose/2org1peergoleveldb_kafka/docker-compose.yaml up -d;sleep 10s
    end: docker-compose -f networks/fabric/docker-compose/2org1peergoleveldb_kafka/docker-compose.yaml down;(test -z \"$(docker ps -aq)\") || docker rm $(docker ps -aq);(test -z \"$(docker images dev* -q)\") || docker rmi $(docker images dev* -q);rm -rf /tmp/hfc-*

info:
  Version: 1.4.0
  Size: 2 Orgs with 1 Peer
  Orderer: Kafka
  Distribution: Single Host
  StateDB: CouchDB

clients:
  client0.org1.example.com:
    client:
      organization: Org1
      credentialStore:
        path: /tmp/hfc-kvs/org1
        cryptoStore:
          path: /tmp/hfc-cvs/org1
      clientPrivateKey:
        path: networks/fabric/config_kafka/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/keystore/key.pem
      clientSignedCert:
        path: networks/fabric/config_kafka/crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/signcerts/User1@org1.example.com-cert.pem

  client0.org2.example.com:
    client:
      organization: Org2
      credentialStore:
        path: /tmp/hfc-kvs/org2
        cryptoStore:
          path: /tmp/hfc-cvs/org2
      clientPrivateKey:
        path: networks/fabric/config_kafka/crypto-config/peerOrganizations/org2.example.com/users/User1@org2.example.com/msp/keystore/key.pem
      clientSignedCert:
        path: networks/fabric/config_kafka/crypto-config/peerOrganizations/org2.example.com/users/User1@org2.example.com/msp/signcerts/User1@org2.example.com-cert.pem


channels:
  mychannel:
    configBinary: networks/fabric/config_kafka/mychannel.tx
    created: false
    orderers:
    - orderer0.example.com
    - orderer1.example.com
    peers:
      peer0.org1.example.com:
        eventSource: true
      peer0.org2.example.com:
        eventSource: true

    contracts:
    - id: marbles
      version: v0
      language: golang
      path: fabric/samples/marbles/go
      metadataPath: src/fabric/samples/marbles/go/metadata
    - id: drm
      version: v0
      language: golang
      path: fabric/scenario/drm/go
    - id: simple
      version: v0
      language: golang
      path: fabric/scenario/simple/go
    - id: smallbank
      version: v0
      language: golang
      path: fabric/scenario/smallbank/go

organizations:
  Org1:
    mspid: Org1MSP
    peers:
    - peer0.org1.example.com
    certificateAuthorities:
    - ca.org1.example.com
    adminPrivateKey:
      path: networks/fabric/config_kafka/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore/key.pem
    signedCert:
      path: networks/fabric/config_kafka/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts/Admin@org1.example.com-cert.pem

  Org2:
    mspid: Org2MSP
    peers:
    - peer0.org2.example.com
    certificateAuthorities:
    - ca.org2.example.com
    adminPrivateKey:
      path: networks/fabric/config_kafka/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/keystore/key.pem
    signedCert:
      path: networks/fabric/config_kafka/crypto-config/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp/signcerts/Admin@org2.example.com-cert.pem

orderers:
  orderer0.example.com:
    url: grpc://localhost:7050
    grpcOptions:
      ssl-target-name-override: orderer0.example.com
  orderer1.example.com:
    url: grpc://localhost:8050
    grpcOptions:
        ssl-target-name-override: orderer1.example.com

peers:
  peer0.org1.example.com:
    url: grpc://localhost:7051
    grpcOptions:
      ssl-target-name-override: peer0.org1.example.com
      grpc.keepalive_time_ms: 600000

  peer0.org2.example.com:
    url: grpc://localhost:8051
    grpcOptions:
      ssl-target-name-override: peer0.org2.example.com
      grpc.keepalive_time_ms: 600000

certificateAuthorities:
  ca.org1.example.com:
    url: http://localhost:7054
    httpOptions:
      verify: false
    registrar:
    - enrollId: admin
      enrollSecret: adminpw

  ca.org2.example.com:
    url: http://localhost:8054
    httpOptions:
      verify: false
    registrar:
    - enrollId: admin
      enrollSecret: adminpw

docker-compose.yaml文件路径

cd /opt/gopath/src/github.com/hyperledger/caliper-benchmarks/networks/fabric/docker-compose/2org1peergoleveldb_kafka
gedit docker-compose.yaml
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# 

version: '2'

services:
    ca.org1.example.com:
        image: hyperledger/fabric-ca:${FABRIC_CA_VERSION}
        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/key.pem
        ports:
        - "7054:7054"
        command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
        volumes:
        - ../../config_kafka/crypto-config/peerOrganizations/org1.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
        container_name: ca.org1.example.com

    ca.org2.example.com:
        image: hyperledger/fabric-ca:${FABRIC_CA_VERSION}
        environment:
        - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server
        - FABRIC_CA_SERVER_CA_NAME=ca.org2.example.com
        - FABRIC_CA_SERVER_CA_CERTFILE=/etc/hyperledger/fabric-ca-server-config/ca.org2.example.com-cert.pem
        - FABRIC_CA_SERVER_CA_KEYFILE=/etc/hyperledger/fabric-ca-server-config/key.pem
        ports:
        - "8054:7054"
        command: sh -c 'fabric-ca-server start -b admin:adminpw -d'
        volumes:
        - ../../config_kafka/crypto-config/peerOrganizations/org2.example.com/ca/:/etc/hyperledger/fabric-ca-server-config
        container_name: ca.org2.example.com

    orderer0.example.com:
        container_name: orderer0.example.com
        image: hyperledger/fabric-orderer:${FABRIC_VERSION}
        environment:
        - FABRIC_LOGGING_SPEC=grpc=debug:debug
        - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
        - ORDERER_GENERAL_GENESISMETHOD=file
        - ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/genesis.block
        - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
        - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp/orderer/msp
        - ORDERER_KAFKA_VERBOSE=true
        working_dir: /opt/gopath/src/github.com/hyperledger/fabric
        command: orderer
        ports:
        - 7050:7050
        volumes:
        - ../../config_kafka/:/etc/hyperledger/configtx
        - ../../config_kafka/crypto-config/ordererOrganizations/example.com/orderers/orderer0.example.com/:/etc/hyperledger/msp/orderer
        depends_on:
        - ca.org1.example.com
        - ca.org2.example.com
        - kafka0
        - kafka1
        - kafka2
        - kafka3

    orderer1.example.com:
        container_name: orderer1.example.com
        image: hyperledger/fabric-orderer:${FABRIC_VERSION}
        environment:
        - FABRIC_LOGGING_SPEC=grpc=debug:debug
        - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0
        - ORDERER_GENERAL_GENESISMETHOD=file
        - ORDERER_GENERAL_GENESISFILE=/etc/hyperledger/configtx/genesis.block
        - ORDERER_GENERAL_LOCALMSPID=OrdererMSP
        - ORDERER_GENERAL_LOCALMSPDIR=/etc/hyperledger/msp/orderer/msp
        - ORDERER_KAFKA_VERBOSE=true
        working_dir: /opt/gopath/src/github.com/hyperledger/fabric
        command: orderer
        ports:
        - 8050:7050
        volumes:
        - ../../config_kafka/:/etc/hyperledger/configtx
        - ../../config_kafka/crypto-config/ordererOrganizations/example.com/orderers/orderer1.example.com/:/etc/hyperledger/msp/orderer
        depends_on:
        - ca.org1.example.com
        - ca.org2.example.com
        - kafka0
        - kafka1
        - kafka2
        - kafka3

    peer0.org1.example.com:
        container_name: peer0.org1.example.com
        image: hyperledger/fabric-peer:${FABRIC_VERSION}
        environment:
        - FABRIC_LOGGING_SPEC=grpc=debug:debug
        - CORE_CHAINCODE_LOGGING_LEVEL=INFO
        - CORE_CHAINCODE_LOGGING_SHIM=INFO
        - CORE_CHAINCODE_EXECUTETIMEOUT=999999
        - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
        - CORE_PEER_ID=peer0.org1.example.com
        - CORE_PEER_ENDORSER_ENABLED=true
        - CORE_PEER_LOCALMSPID=Org1MSP
        - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/msp/
        - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
        - CORE_PEER_GOSSIP_USELEADERELECTION=true
        - CORE_PEER_GOSSIP_ORGLEADER=false
        - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
        - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=2org1peergoleveldb_kafka_default
        - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
        - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb0:5984
        - CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=
        - CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=
        working_dir: /opt/gopath/src/github.com/hyperledger/fabric
        command: peer node start
        ports:
        - 7051:7051
        volumes:
        - /var/run/:/host/var/run/
        - ../../config_kafka/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/:/etc/hyperledger/msp/peer
        depends_on:
        - orderer0.example.com
        - orderer1.example.com
        - couchdb0

    couchdb0:
        container_name: couchdb0
        image: hyperledger/fabric-couchdb:latest
        ports:
        - 5984:5984
        environment:
        - COUCHDB_USER=
        - COUCHDB_PASSWORD=

    peer0.org2.example.com:
        container_name: peer0.org2.example.com
        image: hyperledger/fabric-peer:${FABRIC_VERSION}
        environment:
        - FABRIC_LOGGING_SPEC=grpc=debug:debug
        - CORE_CHAINCODE_LOGGING_LEVEL=INFO
        - CORE_CHAINCODE_LOGGING_SHIM=INFO
        - CORE_CHAINCODE_EXECUTETIMEOUT=999999
        - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
        - CORE_PEER_ID=peer0.org2.example.com
        - CORE_PEER_ENDORSER_ENABLED=true
        - CORE_PEER_LOCALMSPID=Org2MSP
        - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/msp/
        - CORE_PEER_ADDRESS=peer0.org2.example.com:7051
        - CORE_PEER_GOSSIP_USELEADERELECTION=true
        - CORE_PEER_GOSSIP_ORGLEADER=false
        - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051
        - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=2org1peergoleveldb_kafka_default
        - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
        - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb1:5984
        - CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=
        - CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=
        working_dir: /opt/gopath/src/github.com/hyperledger/fabric
        command: peer node start
        ports:
        - 8051:7051
        volumes:
        - /var/run/:/host/var/run/
        - ../../config_kafka/crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/:/etc/hyperledger/msp/peer
        depends_on:
        - orderer0.example.com
        - orderer1.example.com
        - couchdb1

    couchdb1:
        container_name: couchdb1
        image: hyperledger/fabric-couchdb:latest
        ports:
        - 6984:5984
        environment:
        - COUCHDB_USER=
        - COUCHDB_PASSWORD=

    zookeeper0:
        container_name: zookeeper0
        image: hyperledger/fabric-zookeeper
        restart: always
        ports:
        - '2181'
        - '2888'
        - '3888'
        environment:
        - ZOO_MY_ID=1
        - ZOO_SERVERS=server.1=zookeeper0:2888:3888 server.2=zookeeper1:2888:3888 server.3=zookeeper2:2888:3888

    zookeeper1:
        container_name: zookeeper1
        image: hyperledger/fabric-zookeeper
        restart: always
        ports:
        - '2181'
        - '2888'
        - '3888'
        environment:
        - ZOO_MY_ID=2
        - ZOO_SERVERS=server.1=zookeeper0:2888:3888 server.2=zookeeper1:2888:3888 server.3=zookeeper2:2888:3888

    zookeeper2:
        container_name: zookeeper2
        image: hyperledger/fabric-zookeeper
        restart: always
        ports:
        - '2181'
        - '2888'
        - '3888'
        environment:
        - ZOO_MY_ID=3
        - ZOO_SERVERS=server.1=zookeeper0:2888:3888 server.2=zookeeper1:2888:3888 server.3=zookeeper2:2888:3888

    kafka0:
        container_name: kafka0
        image: hyperledger/fabric-kafka
        restart: always
        environment:
        - KAFKA_MESSAGE_MAX_BYTES=1048576 # 1 * 1024 * 1024 B
        - KAFKA_REPLICA_FETCH_MAX_BYTES=1048576 # 1 * 1024 * 1024 B
        - KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
        - KAFKA_BROKER_ID=0
        - KAFKA_MIN_INSYNC_REPLICAS=2
        - KAFKA_DEFAULT_REPLICATION_FACTOR=3
        - KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181,zookeeper1:2181,zookeeper2:2181
        ports:
        - '9092'
        depends_on:
        - zookeeper0
        - zookeeper1
        - zookeeper2

    kafka1:
        container_name: kafka1
        image: hyperledger/fabric-kafka
        restart: always
        environment:
        - KAFKA_MESSAGE_MAX_BYTES=1048576 # 1 * 1024 * 1024 B
        - KAFKA_REPLICA_FETCH_MAX_BYTES=1048576 # 1 * 1024 * 1024 B
        - KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
        - KAFKA_BROKER_ID=1
        - KAFKA_MIN_INSYNC_REPLICAS=2
        - KAFKA_DEFAULT_REPLICATION_FACTOR=3
        - KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181,zookeeper1:2181,zookeeper2:2181
        ports:
        - '9092'
        depends_on:
        - zookeeper0
        - zookeeper1
        - zookeeper2

    kafka2:
        container_name: kafka2
        image: hyperledger/fabric-kafka
        restart: always
        environment:
        - KAFKA_MESSAGE_MAX_BYTES=1048576 # 1 * 1024 * 1024 B
        - KAFKA_REPLICA_FETCH_MAX_BYTES=1048576 # 1 * 1024 * 1024 B
        - KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
        - KAFKA_BROKER_ID=2
        - KAFKA_MIN_INSYNC_REPLICAS=2
        - KAFKA_DEFAULT_REPLICATION_FACTOR=3
        - KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181,zookeeper1:2181,zookeeper2:2181
        ports:
        - '9092'
        depends_on:
        - zookeeper0
        - zookeeper1
        - zookeeper2

    kafka3:
        container_name: kafka3
        image: hyperledger/fabric-kafka
        restart: always
        ports:
        - '9092'
        environment:
        - KAFKA_MESSAGE_MAX_BYTES=1048576 # 1 * 1024 * 1024 B
        - KAFKA_REPLICA_FETCH_MAX_BYTES=1048576 # 1 * 1024 * 1024 B
        - KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE=false
        - KAFKA_BROKER_ID=3
        - KAFKA_MIN_INSYNC_REPLICAS=2
        - KAFKA_DEFAULT_REPLICATION_FACTOR=3
        - KAFKA_ZOOKEEPER_CONNECT=zookeeper0:2181,zookeeper1:2181,zookeeper2:2181
        depends_on:
        - zookeeper0
        - zookeeper1
        - zookeeper2

加密文件路径

cd /opt/gopath/src/github.com/hyperledger/caliper-benchmarks/networks/fabric/config_kafka

将二进制文件复制到当前目录,执行脚本文件生成证书、创世区块等

./generate.sh

项目执行目录

cd /opt/gopath/src/github.com/hyperledger/caliper-benchmarks
  大数据 最新文章
实现Kafka至少消费一次
亚马逊云科技:还在苦于ETL?Zero ETL的时代
初探MapReduce
【SpringBoot框架篇】32.基于注解+redis实现
Elasticsearch:如何减少 Elasticsearch 集
Go redis操作
Redis面试题
专题五 Redis高并发场景
基于GBase8s和Calcite的多数据源查询
Redis——底层数据结构原理
上一篇文章      下一篇文章      查看所有文章
加:2021-08-07 12:09:17  更:2021-08-07 12:10:45 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/17 19:04:25-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码