Skip to content

Commit

Permalink
Update whatis.md
Browse files Browse the repository at this point in the history
格式更新

Signed-off-by: DavidLiu <[email protected]>
  • Loading branch information
David Liu committed Feb 5, 2021
1 parent d3933be commit 6bae863
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 125 deletions.
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
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>.
7 changes: 7 additions & 0 deletions MAINTAINERS.md
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 |
40 changes: 14 additions & 26 deletions docs/whatis.md → README-zh.md
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 性能测试工具

## 项目背景

Expand All @@ -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)
94 changes: 11 additions & 83 deletions README.md
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
Expand All @@ -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

Expand All @@ -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 |
2 changes: 1 addition & 1 deletion docs/FAQ.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# 常见问题
# FAQ 常见问题
19 changes: 15 additions & 4 deletions docs/configfile.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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,则参数设置如下:

```
Expand Down
11 changes: 0 additions & 11 deletions docs/contribute.md

This file was deleted.

3 changes: 3 additions & 0 deletions docs/workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6bae863

Please sign in to comment.