-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
格式更新 Signed-off-by: DavidLiu <[email protected]>
- Loading branch information
David Liu
committed
Feb 5, 2021
1 parent
d3933be
commit 6bae863
Showing
8 changed files
with
69 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)联系。 | ||
|
||
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Maintainers 维护者信息 | ||
|
||
| 姓名 | 邮箱 | github-ID | | ||
| ------ | ------------------------ | ----------- | | ||
| 郭剑南 Jay Gou | [email protected] | guoger | | ||
| 袁怿 Sam Yuan | [email protected] | SamYuan1990 | | ||
| 程阳 Stone Cheng | [email protected] | stone-ch | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | | ||
| ------ | ------------------------ | ----------- | | ||
| 郭剑南 | [email protected] | guoger | | ||
| 袁怿 | [email protected] | SamYuan1990 | | ||
| 程阳 | [email protected] | stone-ch | | ||
## [如何贡献](CONTRIBUTING.md) | ||
|
||
## 使用许可 | ||
|
||
Tape 遵守 [Apache 2.0 开源许可](../LICENSE)。 | ||
Tape 遵守 [Apache 2.0 开源许可](LICENSE)。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected]/msp/keystore/priv_sk | ||
sign_cert: ./organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected] | ||
num_of_conn: 10 | ||
client_per_conn: 10 | ||
``` | ||
<details> | ||
<summary>Click to expand details for configuration</summary> | ||
`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/[email protected]/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/[email protected]/msp/signcerts/[email protected] | ||
``` | ||
|
||
`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. | ||
</details> | ||
### [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 | ||
<details> | ||
<summary>Click to expand</summary> | ||
|
||
### 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) | ||
</details> | ||
|
||
## Maintainers | ||
|
||
| Name | mail | github-ID | ||
| ------ | ------------------------ | ----------- | | ||
| Jay Gou | [email protected] | guoger | | ||
| Sam Yuan | [email protected] | SamYuan1990 | | ||
| Stone Cheng | [email protected] | stone-ch | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# 常见问题 | ||
# FAQ 常见问题 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters