Skip to content

Commit 3b18c87

Browse files
authored
Fix publish workflow (#8)
1 parent 95654f6 commit 3b18c87

File tree

3 files changed

+27
-10
lines changed

3 files changed

+27
-10
lines changed

.github/workflows/python-publish.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and publish to PyPI
1+
name: Publish
22

33
on:
44
release:
@@ -55,6 +55,7 @@ jobs:
5555
pypi-publish:
5656
name: Upload release to PyPI
5757
runs-on: ubuntu-latest
58+
needs: build
5859
environment:
5960
name: release
6061
url: https://pypi.org/project/chainbench

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
</p>
2323

2424
# Chainbench
25+
![checks status](https://github.com/chainstacklabs/chainbench/actions/workflows/checks.yml/badge.svg)
26+
![build status](https://github.com/chainstacklabs/chainbench/actions/workflows/python-publish.yml/badge.svg)
27+
![version](https://img.shields.io/pypi/v/chainbench)
28+
![license](https://img.shields.io/github/license/chainstacklabs/chainbench)
2529

2630
This project allows you to benchmark your blockchain infrastructure. It uses [Locust](https://docs.locust.io/en/stable/index.html) under the hood.
2731

@@ -47,7 +51,14 @@ Check out the [docs](docs/PROFILE.md) for more information about the profile cre
4751

4852
### Using pip
4953

50-
> ⚠️ Installation using pip is not supported yet.
54+
```shell
55+
pip install chainbench
56+
```
57+
58+
After installation, you can run the tool using the following command:
59+
```shell
60+
chainbench start --help
61+
```
5162

5263
### Using Poetry
5364

@@ -61,20 +72,22 @@ Install dependencies:
6172
cd chainbench && poetry install --without dev
6273
```
6374

64-
You might need to run the following command before running the tool:
75+
When installing using Poetry, you can run the tool using the following command:
6576
```shell
66-
poetry shell
77+
poetry run chainbench start --help
6778
```
6879

6980
## Example Usage
81+
All the examples below assume that you have installed the tool using `pip`. If you installed it using `poetry`, replace `chainbench` with `poetry run chainbench`.
82+
7083
To learn about the parameters and flags, run the following command:
7184
```shell
72-
python3 -m chainbench start --help
85+
chainbench start --help
7386
```
7487

7588
Basic usage is:
7689
```shell
77-
python3 -m chainbench start --profile bsc --users 50 --workers 2 --test-time 12h --target https://node-url --headless --autoquit
90+
chainbench start --profile bsc --users 50 --workers 2 --test-time 12h --target https://node-url --headless --autoquit
7891
```
7992

8093
This will run a load test for BSC with 2 workers, 50 users and 12 hours test time in headless mode.
@@ -99,23 +112,23 @@ Run the following command to run a load test for BSC in UI mode. It will start a
99112
Target is not required as you can specify it in the UI along with the number of users, spawn rate and test time.
100113

101114
```shell
102-
python3 -m chainbench start --profile bsc --workers 1
115+
chainbench start --profile bsc --workers 1
103116
```
104117

105118
### Headless Mode
106119

107120
If you want to run a load test for BSC in headless mode, run the following command:
108121

109122
```shell
110-
python3 -m chainbench start --profile bsc --workers 4 --users 100 --test-time 1h --target https://node-url --headless --autoquit
123+
chainbench start --profile bsc --workers 4 --users 100 --test-time 1h --target https://node-url --headless --autoquit
111124
```
112125

113126
It will run a load test for BSC with 4 workers, 100 users and 1 hour test time.
114127

115128
In practice, you will probably want to run the benchmark on a remote server. Here's the example utilizing `nohup`:
116129

117130
```shell
118-
nohup python3 -m chainbench start --profile bsc --workers 4 --users 100 --test-time 1h --target https://node-url --headless --autoquit &
131+
nohup chainbench start --profile bsc --workers 4 --users 100 --test-time 1h --target https://node-url --headless --autoquit &
119132
```
120133

121134
## License

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "chainbench"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
description = ""
55
authors = ["Egor Molodik <egor.molodik@chainstack.com>"]
66
readme = "README.md"
@@ -21,6 +21,9 @@ flake8 = "^6.0.0"
2121
isort = "^5.12.0"
2222
flake8-pyproject = "^1.2.3"
2323

24+
[tool.poetry.scripts]
25+
chainbench = "chainbench.main:cli"
26+
2427
[build-system]
2528
requires = ["poetry-core"]
2629
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)