mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
:tools: Update docs & fix build-docker Makefile target (#2584)
bump alpine version to 3.8
This commit is contained in:
parent
8761b27489
commit
3fcb62b931
@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.7
|
FROM alpine:3.8
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY tm-bench /app/tm-bench
|
COPY tm-bench /app/tm-bench
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
DIST_DIRS := find * -type d -exec
|
DIST_DIRS := find * -type d -exec
|
||||||
VERSION := $(shell perl -ne '/^var version.*"([^"]+)".*$$/ && print "v$$1\n"' main.go)
|
VERSION := $(shell perl -ne '/^TMCoreSemVer = "([^"]+)"$$/ && print "v$$1\n"' ../../version/version.go)
|
||||||
|
|
||||||
all: build test install
|
all: build test install
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ dist: build-all
|
|||||||
|
|
||||||
build-docker:
|
build-docker:
|
||||||
rm -f ./tm-bench
|
rm -f ./tm-bench
|
||||||
docker run -it --rm -v "$(PWD):/go/src/app" -w "/go/src/app" -e "CGO_ENABLED=0" golang:alpine go build -ldflags "-s -w" -o tm-bench
|
docker run -it --rm -v "$(PWD)/../../:/go/src/github.com/tendermint/tendermint" -w "/go/src/github.com/tendermint/tendermint/tools/tm-bench" -e "CGO_ENABLED=0" golang:alpine go build -ldflags "-s -w" -o tm-bench
|
||||||
docker build -t "tendermint/bench" .
|
docker build -t "tendermint/bench" .
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -4,49 +4,72 @@ Tendermint blockchain benchmarking tool:
|
|||||||
|
|
||||||
- https://github.com/tendermint/tools/tree/master/tm-bench
|
- https://github.com/tendermint/tools/tree/master/tm-bench
|
||||||
|
|
||||||
For example, the following:
|
For example, the following: `tm-bench -T 30 -r 10000 localhost:26657`
|
||||||
|
|
||||||
tm-bench -T 10 -r 1000 localhost:26657
|
|
||||||
|
|
||||||
will output:
|
will output:
|
||||||
|
|
||||||
|
```
|
||||||
Stats Avg StdDev Max Total
|
Stats Avg StdDev Max Total
|
||||||
Txs/sec 818 532 1549 9000
|
Txs/sec 3981 1993 5000 119434
|
||||||
Blocks/sec 0.818 0.386 1 9
|
Blocks/sec 0.800 0.400 1 24
|
||||||
|
```
|
||||||
|
|
||||||
|
NOTE: **tm-bench only works with build-in `kvstore` ABCI application**. For it
|
||||||
|
to work with your application, you will need to modify `generateTx` function.
|
||||||
|
In the future, we plan to support scriptable transactions (see
|
||||||
|
[\#1938](https://github.com/tendermint/tendermint/issues/1938)).
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
|
### Docker
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init
|
||||||
|
docker run -it --rm -v "/tmp:/tendermint" -p "26657:26657" --name=tm tendermint/tendermint node --proxy_app=kvstore
|
||||||
|
|
||||||
|
docker run -it --rm --link=tm tendermint/bench tm:26657
|
||||||
|
```
|
||||||
|
|
||||||
|
### Using binaries
|
||||||
|
|
||||||
[Install Tendermint](https://github.com/tendermint/tendermint#install)
|
[Install Tendermint](https://github.com/tendermint/tendermint#install)
|
||||||
This currently is setup to work on tendermint's develop branch. Please ensure
|
|
||||||
you are on that. (If not, update `tendermint` and `tmlibs` in gopkg.toml to use
|
|
||||||
the master branch.)
|
|
||||||
|
|
||||||
then run:
|
then run:
|
||||||
|
|
||||||
|
```
|
||||||
tendermint init
|
tendermint init
|
||||||
tendermint node --proxy_app=kvstore
|
tendermint node --proxy_app=kvstore
|
||||||
|
|
||||||
tm-bench localhost:26657
|
tm-bench localhost:26657
|
||||||
|
```
|
||||||
|
|
||||||
with the last command being in a seperate window.
|
with the last command being in a separate window.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
tm-bench [-c 1] [-T 10] [-r 1000] [-s 250] [endpoints]
|
```
|
||||||
|
Tendermint blockchain benchmarking tool.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
tm-bench [-c 1] [-T 10] [-r 1000] [-s 250] [endpoints] [-output-format <plain|json> [-broadcast-tx-method <async|sync|commit>]]
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
tm-bench localhost:26657
|
tm-bench localhost:26657
|
||||||
Flags:
|
Flags:
|
||||||
-T int
|
-T int
|
||||||
Exit after the specified amount of time in seconds (default 10)
|
Exit after the specified amount of time in seconds (default 10)
|
||||||
|
-broadcast-tx-method string
|
||||||
|
Broadcast method: async (no guarantees; fastest), sync (ensures tx is checked) or commit (ensures tx is checked and committed; slowest) (default "async")
|
||||||
-c int
|
-c int
|
||||||
Connections to keep open per endpoint (default 1)
|
Connections to keep open per endpoint (default 1)
|
||||||
|
-output-format string
|
||||||
|
Output format: plain or json (default "plain")
|
||||||
-r int
|
-r int
|
||||||
Txs per second to send in a connection (default 1000)
|
Txs per second to send in a connection (default 1000)
|
||||||
-s int
|
-s int
|
||||||
Size per tx in bytes
|
The size of a transaction in bytes, must be greater than or equal to 40. (default 250)
|
||||||
-v Verbose output
|
-v Verbose output
|
||||||
|
```
|
||||||
|
|
||||||
## How stats are collected
|
## How stats are collected
|
||||||
|
|
||||||
@ -76,5 +99,7 @@ Each of the connections is handled via two separate goroutines.
|
|||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
```
|
||||||
make get_vendor_deps
|
make get_vendor_deps
|
||||||
make test
|
make test
|
||||||
|
```
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.6
|
FROM alpine:3.8
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY tm-monitor /app/tm-monitor
|
COPY tm-monitor /app/tm-monitor
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
DIST_DIRS := find * -type d -exec
|
DIST_DIRS := find * -type d -exec
|
||||||
VERSION := $(shell perl -ne '/^var version.*"([^"]+)".*$$/ && print "v$$1\n"' main.go)
|
VERSION := $(shell perl -ne '/^TMCoreSemVer = "([^"]+)"$$/ && print "v$$1\n"' ../../version/version.go)
|
||||||
|
|
||||||
all: build test install
|
all: build test install
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ dist: build-all
|
|||||||
|
|
||||||
build-docker:
|
build-docker:
|
||||||
rm -f ./tm-monitor
|
rm -f ./tm-monitor
|
||||||
docker run -it --rm -v "$(PWD):/go/src/github.com/tendermint/tools/tm-monitor" -w "/go/src/github.com/tendermint/tools/tm-monitor" -e "CGO_ENABLED=0" golang:alpine go build -ldflags "-s -w" -o tm-monitor
|
docker run -it --rm -v "$(PWD)/../../:/go/src/github.com/tendermint/tendermint" -w "/go/src/github.com/tendermint/tendermint/tools/tm-monitor" -e "CGO_ENABLED=0" golang:alpine go build -ldflags "-s -w" -o tm-monitor
|
||||||
docker build -t "tendermint/monitor" .
|
docker build -t "tendermint/monitor" .
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -12,18 +12,22 @@ collecting and providing various statistics to the user:
|
|||||||
Assuming your application is running in another container with the name
|
Assuming your application is running in another container with the name
|
||||||
`app`:
|
`app`:
|
||||||
|
|
||||||
|
```
|
||||||
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init
|
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init
|
||||||
docker run -it --rm -v "/tmp:/tendermint" -p "26657:26657" --name=tm --link=app tendermint/tendermint node --proxy_app=tcp://app:26658
|
docker run -it --rm -v "/tmp:/tendermint" -p "26657:26657" --name=tm --link=app tendermint/tendermint node --proxy_app=tcp://app:26658
|
||||||
|
|
||||||
docker run -it --rm -p "26670:26670" --link=tm tendermint/monitor tm:26657
|
docker run -it --rm -p "26670:26670" --link=tm tendermint/monitor tm:26657
|
||||||
|
```
|
||||||
|
|
||||||
If you don't have an application yet, but still want to try monitor out,
|
If you don't have an application yet, but still want to try monitor out,
|
||||||
use `kvstore`:
|
use `kvstore`:
|
||||||
|
|
||||||
|
```
|
||||||
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init
|
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init
|
||||||
docker run -it --rm -v "/tmp:/tendermint" -p "26657:26657" --name=tm tendermint/tendermint node --proxy_app=kvstore
|
docker run -it --rm -v "/tmp:/tendermint" -p "26657:26657" --name=tm tendermint/tendermint node --proxy_app=kvstore
|
||||||
|
|
||||||
docker run -it --rm -p "26670:26670" --link=tm tendermint/monitor tm:26657
|
docker run -it --rm -p "26670:26670" --link=tm tendermint/monitor tm:26657
|
||||||
|
```
|
||||||
|
|
||||||
### Using Binaries
|
### Using Binaries
|
||||||
|
|
||||||
@ -31,16 +35,23 @@ use `kvstore`:
|
|||||||
|
|
||||||
then run:
|
then run:
|
||||||
|
|
||||||
|
```
|
||||||
tendermint init
|
tendermint init
|
||||||
tendermint node --proxy_app=kvstore
|
tendermint node --proxy_app=kvstore
|
||||||
|
|
||||||
tm-monitor localhost:26657
|
tm-monitor localhost:26657
|
||||||
|
```
|
||||||
|
|
||||||
with the last command being in a seperate window.
|
with the last command being in a separate window.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
tm-monitor [-v] [-no-ton] [-listen-addr="tcp://0.0.0.0:26670"] [endpoints]
|
```
|
||||||
|
Tendermint monitor watches over one or more Tendermint core
|
||||||
|
applications, collecting and providing various statistics to the user.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
tm-monitor [-no-ton] [-listen-addr="tcp://0.0.0.0:26670"] [endpoints]
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
# monitor single instance
|
# monitor single instance
|
||||||
@ -53,18 +64,20 @@ with the last command being in a seperate window.
|
|||||||
HTTP and Websocket server listen address (default "tcp://0.0.0.0:26670")
|
HTTP and Websocket server listen address (default "tcp://0.0.0.0:26670")
|
||||||
-no-ton
|
-no-ton
|
||||||
Do not show ton (table of nodes)
|
Do not show ton (table of nodes)
|
||||||
-v verbose logging
|
```
|
||||||
|
|
||||||
### RPC UI
|
### RPC UI
|
||||||
|
|
||||||
Run `tm-monitor` and visit http://localhost:26670 You should see the
|
Run `tm-monitor` and visit http://localhost:26670 You should see the
|
||||||
list of the available RPC endpoints:
|
list of the available RPC endpoints:
|
||||||
|
|
||||||
|
```
|
||||||
http://localhost:26670/status
|
http://localhost:26670/status
|
||||||
http://localhost:26670/status/network
|
http://localhost:26670/status/network
|
||||||
http://localhost:26670/monitor?endpoint=_
|
http://localhost:26670/monitor?endpoint=_
|
||||||
http://localhost:26670/status/node?name=_
|
http://localhost:26670/status/node?name=_
|
||||||
http://localhost:26670/unmonitor?endpoint=_
|
http://localhost:26670/unmonitor?endpoint=_
|
||||||
|
```
|
||||||
|
|
||||||
The API is available as GET requests with URI encoded parameters, or as
|
The API is available as GET requests with URI encoded parameters, or as
|
||||||
JSONRPC POST requests. The JSONRPC methods are also exposed over
|
JSONRPC POST requests. The JSONRPC methods are also exposed over
|
||||||
@ -72,6 +85,8 @@ websocket.
|
|||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
|
```
|
||||||
make get_tools
|
make get_tools
|
||||||
make get_vendor_deps
|
make get_vendor_deps
|
||||||
make test
|
make test
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user