diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..d0dbb278 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,18 @@ +# How to Contribute 如何贡献 + +如果你希望为 Tape 提交新的特性或者遇到了任何 Bug,欢迎在 github 仓库中开启新的 [issue](https://github.com/Hyperledger-TWGC/tape/issues),同时也欢迎提交 [pull request](https://github.com/Hyperledger-TWGC/tape/pulls)。 + +If you wish for new features or encounter any bug, please feel free to open [issue](https://github.com/Hyperledger-TWGC/tape/issues), and we always welcome [pull request](https://github.com/Hyperledger-TWGC/tape/pulls). + + +如果你想报告 issue,请通过如下方式打开 debug 日志,并将日志粘贴到 issue 中。 + +``` +export TAPE_LOGLEVEL=debug +``` + +If you are reporting an issue, please generously turn on debug log with `export TAPE_LOGLEVEL=debug` and paste log in the issue + +如果您希望贡献文档翻译,或者学习教程,也欢迎和[维护者](MAINTAINERS.md)联系。 + +Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. \ No newline at end of file diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 00000000..c5f92b78 --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,7 @@ +# Maintainers 维护者信息 + +| 姓名 | 邮箱 | github-ID | +| ------ | ------------------------ | ----------- | +| 郭剑南 Jay Gou | guojiannan1101@gmail.com | guoger | +| 袁怿 Sam Yuan | yy19902439@126.com | SamYuan1990 | +| 程阳 Stone Cheng | chengyang418@163.com | stone-ch | diff --git a/docs/whatis.md b/README-zh.md similarity index 59% rename from docs/whatis.md rename to README-zh.md index 05462bb1..a5431906 100644 --- a/docs/whatis.md +++ b/README-zh.md @@ -1,11 +1,5 @@ -# 介绍 - -Tape 一款轻量级 Hyperledger Fabric 性能测试工具,其设计和功能参考[性能测试白皮书](https://github.com/Hyperledger-TWGC/fabric-performance-wiki/blob/master/performance-whitepaper.md)。 - -Tape由负载生成器客户端和观察者客户端组成。因此Tape仅可以用来对已经完成部署的Fabric网络进行测试。 -- 负载生成器客户端 - - 直接使用了GRPC链接到被测网络而不使用任何SDK。因此避免了connection profile的配置, 减少了SDK的其他功能,如服务发现,可能带来的性能损耗。 -- 观察者客户端会观察在多个peer节点上的提交,但不会进行资源的实时监控。 +# Tape +Tape 是一款轻量级 Hyperledger Fabric 性能测试工具 ## 项目背景 @@ -16,32 +10,26 @@ Tape 项目原名 Stupid,最初由 [TWGC(Technical Working Group China,超 1. **轻量级**, Tape 实现过程中没有使用 SDK,直接使用 gRPC 向 Fabric 节点发送和接收请求; 2. **易操作**,通过简单的配置文件和命令即可快速启动测试; 3. **结果准确**,Tape 直接使用 gRPC 发送交易,并且对交易和区块处理的不同阶段单独拆分,使用协程及通道缓存的方式并行处理,大幅度提升了 Tape 自身的处理效率,从而可以准确的测试出 Fabric 的真实性能。 +4. **参考标准** 其设计和功能参考[性能测试白皮书](https://github.com/Hyperledger-TWGC/fabric-performance-wiki/blob/master/performance-whitepaper.md)。 -## 文档阅读指南 - -如果你想快速使用 Tape 测试 TPS,请参考[快速开始](gettingstarted.md); - -如果你想了解配置文件中各项参数的具体含义,请参考[配置文件说明](configfile.md); - -如果你想详细了解 Tape 工作流程,请参考[工作流程](workflow.md); +Tape由负载生成器客户端和观察者客户端组成。因此Tape仅可以用来对已经完成部署的Fabric网络进行测试。 +- 负载生成器客户端 + - 直接使用了GRPC链接到被测网络而不使用任何SDK。因此避免了connection profile的配置, 减少了SDK的其他功能,如服务发现,可能带来的性能损耗。 +- 观察者客户端会观察在多个peer节点上的提交,但不会进行资源的实时监控。 -如果你想为 Tape 做出贡献,请参考[如何贡献](contribute.md); +## 文档索引 -如果你在使用过程中遇到了问题请参考[FAQ](FAQ.md),如果 FAQ 还不能解决你的问题,请在 github 中提 issue,或者发邮件咨询项目维护者。 +如果你想快速使用 Tape 测试 TPS,请参考[快速开始](docs/gettingstarted.md); +如果你想了解配置文件中各项参数的具体含义,请参考[配置文件说明](docs/configfile.md); -## 欢迎贡献 +如果你想详细了解 Tape 工作流程,请参考[工作流程](docs/workflow.md); -如果你希望提交新的特性或者遇到了任何 Bug,欢迎在 github 仓库中开启新的 [issue](https://github.com/guoger/tape/issues),同时也欢迎提交 [pull request](https://github.com/guoger/tape/pulls)。 +如果你在使用过程中遇到了问题请参考[FAQ](docs/FAQ.md),如果 FAQ 还不能解决你的问题,请在 github 中提 issue,或者发邮件咨询项目维护者。 -## 维护者信息 -| 姓名 | 邮箱 | github-ID | -| ------ | ------------------------ | ----------- | -| 郭剑南 | guojiannan1101@gmail.com | guoger | -| 袁怿 | yy19902439@126.com | SamYuan1990 | -| 程阳 | chengyang418@163.com | stone-ch | +## [如何贡献](CONTRIBUTING.md) ## 使用许可 -Tape 遵守 [Apache 2.0 开源许可](../LICENSE)。 +Tape 遵守 [Apache 2.0 开源许可](LICENSE)。 diff --git a/README.md b/README.md index acda07cb..54dcfd4c 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ -# A simple traffic generator for Hyperledger Fabric +# Tape +A light-weight tool to test performance of Hyperledger Fabric -English/[中文](docs/whatis.md) +English/[中文](README-zh.md) [![Build Status](https://dev.azure.com/guojiannan1101/guojiannan1101/_apis/build/status/guoger.tape?branchName=master)](https://dev.azure.com/guojiannan1101/guojiannan1101/_build/latest?definitionId=1&branchName=master) -## Why Tape Sometimes we need to test performance of a deployed Fabric network with ease. There are many excellent projects out there, i.e. Hyperledger Caliper. However, we sometimes just need a tiny, handy tool, like `tape`. ## What is it -This is a very simple traffic generator: +This includes a very simple traffic generator: - it does not use any SDK - it does not attempt to deploy Fabric - it does not rely on connection profile @@ -33,69 +33,7 @@ You could get `tape` in three ways: 2. Build from source: clone this repo and run `make tape` at root dir. Go1.14 or higher is required. `tape` binary will be available at project root directory. 3. Pull docker image: `docker pull guoger/tape` -### Configure - -Modify `config.yaml` according to your network. This is a sample: -```yaml -endorsers: - - addr: localhost:7051 - tls_ca_cert: /path/to/peer1/tls/ca/cert - - addr: localhost:7051 - tls_ca_cert: /path/to/peer2/tls/ca/cert -committers: - - addr: localhost:7051 - tls_ca_cert: /path/to/peer2/tls/ca/cert -orderer: - addr: localhost:7050 - tls_ca_cert: /path/to/orderer/tls/ca/cert -channel: mychannel -chaincode: basic -commitThreshold: 1 -args: - - GetAllAssets -mspid: Org1MSP -private_key: ./organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/keystore/priv_sk -sign_cert: ./organizations/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/signcerts/User1@org1.example.com-cert.pem -num_of_conn: 10 -client_per_conn: 10 -``` -
-Click to expand details for configuration - -`endorsers`: include the addr and tls ca cert of peers. Peer address is in IP:Port format. You may need to add peer name, i.e. `peer0.org1.example.com,peer0.org2.example.com` to your `/etc/hosts` - -`committers`: observe tx commitment from these peers. If you want to observe over 50% of peers on your network, you should selected and put them here. - -`commitThreshold`: how many committers received the block see as successed. - -`orderer`: include the addr and tls ca cert of orderer. Orderer address is in IP:Port format. It does not support sending traffic to multiple orderers, yet. You may need to add orderer name, i.e. `orderer.example.com` to your `/etc/hosts` - -This tool sends traffic as a Fabric user, and requires following configs - -`mspid`: MSP ID that the user is associated to - -`private_key`: path to the private key. If you are using BYFN as your base, this can be: -``` -crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/keystore/priv_sk -``` - -`sign_cert`: path to the user certificate. If you are using BYFN as your base, this can be: -``` -crypto-config/peerOrganizations/org1.example.com/users/User1@org1.example.com/msp/signcerts/User1@org1.example.com-cert.pem -``` - -`channel`: channel name - -`chaincode`: chaincode to invoke. There is an example chaincode in `chaincodes/sample.go`, which simply puts `key:value`. This is closely related to `args` parameter. - -`version`: the version of chaincode. This is left to empty by default. - -`args`: arguments to send with invocation, depending on your chaincode implementation. The chaincode used by this sample can be found in `chaincodes/sample.go` - -`num_of_conn`: number of gRPC connection established between client/peer, client/orderer. If you think client has not put enough pressure on Fabric, increase this. - -`client_per_conn`: number of clients per connection used to send proposals to peer. If you think client has not put enough pressure on Fabric, increase this. -
+### [Configure](docs/configfile.md) ### Run @@ -120,28 +58,18 @@ Here are possbile values (warn by default) - Put this generator closer to Fabric, or even on the same machine. This is to prevent network bandwidth from being the bottleneck. - Increase number of messages per block in your channel configuration may help +- [Workflow](docs/workflow.md) + -## Help us improve -If you wish for new features or encounter any bug, please feel free to open [issue](https://github.com/guoger/tape/issues), and we always welcome [pull request](https://github.com/guoger/tape/pulls). +## [How to Contribute](CONTRIBUTING.md) -If you are reporting an issue, please generously turn on debug log with `export TAPE_LOGLEVEL=debug` and paste log in the issue +## [Maintainers](MAINTAINERS.md) -## Development -
-Click to expand -### Tape workflow +## LICENSE +Hyperledger Project source code files are made available under the Apache License, Version 2.0 (Apache-2.0), located in the [LICENSE](LICENSE) file. -Tape consists of several workers that run in goroutines, so that the pipeline is highly concurrent and scalable. Workers are connected via buffered channels, so they can pass products around. -![tape workflow](./docs/images/tape.jpeg) -
-## Maintainers -| Name | mail | github-ID -| ------ | ------------------------ | ----------- | -| Jay Gou | guojiannan1101@gmail.com | guoger | -| Sam Yuan | yy19902439@126.com | SamYuan1990 | -| Stone Cheng | chengyang418@163.com | stone-ch | diff --git a/docs/FAQ.md b/docs/FAQ.md index 307d253c..b14d2c1b 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -1 +1 @@ -# 常见问题 \ No newline at end of file +# FAQ 常见问题 \ No newline at end of file diff --git a/docs/configfile.md b/docs/configfile.md index 1fb75d97..9cc99ea1 100644 --- a/docs/configfile.md +++ b/docs/configfile.md @@ -1,9 +1,12 @@ # 配置文件说明 -我们为 Tape 提供了一个示例配置文件 `config.yaml`,你可以在项目根据下找到它。使用 Tape 进行测试之前,请根据您的区块链网络情况修改该配置文件。 +我们为 Tape 提供了一个示例配置文件 `config.yaml`,你可以在项目根目录下找到它。使用 Tape 进行测试之前,请根据您的区块链网络情况修改该配置文件。 +Modify `config.yaml` according to your network `config.yaml` 示例配置文件如下所示: +This is a sample: + ```yaml # Definition of nodes peer1: &peer1 @@ -105,13 +108,17 @@ orderer: *orderer1 分别定义了角色为背书节点(endorsers)、提交节点(committer)和排序节点(orderer)的节点。 `endorsers`: 负责为交易提案背书的节点,Tape 会把构造好的已签名的交易提案发送到背书节点进行背书。 - + - include the addr and tls ca cert of peers. Peer address is in IP:Port format. + - You may need to add peer name, i.e. `peer0.org1.example.com,peer0.org2.example.com` to your `/etc/hosts` `committer`: 负责接收其他节点广播的区块提交成功的信息。 - + - observe tx commitment from these peers. If you want to observe over 50% of peers on your network, you should selected and put them here. `orderer`: 排序节点,目前 Tape 仅支持向一个排序节点发送交易排序请求。 - + - include the addr and tls ca cert of orderer. Orderer address is in IP:Port format. It does not support sending traffic to multiple orderers, yet. + - You may need to add orderer name, i.e. `orderer.example.com` to your `/etc/hosts` Tape 以 Fabric 用户的身份向区块链网络发送交易,所以还需要下边的配置: +This tool sends traffic as a Fabric user, and requires following configs + ```yaml # Invocation configs channel: mychannel @@ -129,6 +136,10 @@ client_per_conn: 10 `chaincode`:要调用的链码名。 +`commitThreshold`: how many committers received the block see as successed. + +`version`: the version of chaincode. This is left to empty by default. + `args`:要调用的链码的参数。参数取决于链码实现,例如,fabric-samples 项目中提供的示例链码 [abac](https://github.com/hyperledger/fabric-samples/blob/master/chaincode/abac/go/abac.go) ,其功能为账户A和账户B之间的转账。如果想要以此链码作为性能测试的链码,执行操作为账户A向账户B转账10,则参数设置如下: ``` diff --git a/docs/contribute.md b/docs/contribute.md deleted file mode 100644 index 961c7963..00000000 --- a/docs/contribute.md +++ /dev/null @@ -1,11 +0,0 @@ -# 如何贡献 - -如果您想为 Tape 添加新的特性,或者修复 bug,非常欢迎您在创建 issue,当然,如果能提交 PR 会更好。 - -如果你想报告 issue,请通过如下方式打开 debug 日志,并将日志粘贴到 issue 中。 - -``` -export TAPE_LOGLEVEL=debug -``` - -如果您希望贡献文档翻译,或者学习教程,也欢迎和我们联系。 diff --git a/docs/workflow.md b/docs/workflow.md index a70a1e69..01a94f8f 100644 --- a/docs/workflow.md +++ b/docs/workflow.md @@ -2,6 +2,9 @@ Tape 有多个工作协程组成,所以该流程是高度并行化且可扩展的。这些协程通过缓存通道互相连接,所以它们可以互相传递数据。 + +Tape consists of several workers that run in goroutines, so that the pipeline is highly concurrent and scalable. Workers are connected via buffered channels, so they can pass products around. + 整体工作流程如下图: ![tape workflow](images/tape.jpeg)