Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 277b9a9
Showing
16 changed files
with
1,416 additions
and
0 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,4 @@ | ||
/chainload | ||
/tmp.txt | ||
/vendor/ | ||
/keystore |
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,17 @@ | ||
# build stage | ||
FROM golang:1.10-alpine AS build-env | ||
RUN apk --no-cache add build-base git bzr mercurial gcc | ||
ENV D=/go/src/github.com/gochain-io/chainload | ||
# Uncomment once gochain repo is public | ||
# RUN go get -u github.com/golang/dep/cmd/dep | ||
# ADD Gopkg.* $D/ | ||
# RUN cd $D && dep ensure --vendor-only | ||
ADD . $D | ||
RUN cd $D && go build -o chainload && cp chainload /tmp/ | ||
|
||
# final stage | ||
FROM alpine | ||
RUN apk add --no-cache ca-certificates curl | ||
WORKDIR /app | ||
COPY --from=build-env /tmp/chainload /usr/local/bin | ||
ENTRYPOINT ["chainload"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Gopkg.toml example | ||
# | ||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md | ||
# for detailed Gopkg.toml documentation. | ||
# | ||
# required = ["github.com/user/thing/cmd/thing"] | ||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] | ||
# | ||
# [[constraint]] | ||
# name = "github.com/user/project" | ||
# version = "1.0.0" | ||
# | ||
# [[constraint]] | ||
# name = "github.com/user/project2" | ||
# branch = "dev" | ||
# source = "github.com/myfork/project2" | ||
# | ||
# [[override]] | ||
# name = "github.com/x/y" | ||
# version = "2.4.0" | ||
# | ||
# [prune] | ||
# non-go = false | ||
# go-tests = true | ||
# unused-packages = true | ||
|
||
|
||
[[constraint]] | ||
name = "github.com/gochain-io/gochain" | ||
version = "^2.0.22" | ||
|
||
[[constraint]] | ||
name = "github.com/pkg/errors" | ||
version = "^0.8.0" | ||
|
||
[prune] | ||
go-tests = true | ||
unused-packages = true | ||
[[prune.project]] | ||
name = "github.com/gochain-io/gochain" | ||
go-tests = true | ||
non-go = false | ||
unused-packages = false |
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 @@ | ||
.PHONY: dep docker | ||
|
||
dep: | ||
dep ensure --vendor-only | ||
|
||
docker: | ||
docker build -t gochain/chainload . |
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,59 @@ | ||
# chainload | ||
|
||
`chainload` is a GoChain/Ethereum blockchain load generator. | ||
|
||
## How to use | ||
|
||
With at least one pre-existing (and sufficiently funded) account under | ||
`keystore/`, simply executing `chainload` will fire 1 transaction per | ||
second at `http://localhost:8545` with chain id `1234`. Reports are | ||
logged every 30s, with pprof and various metrics are available via expvar. | ||
|
||
The target url(s), transaction rate, chain id, and more can be set via | ||
flags: | ||
|
||
``` | ||
chainload --help | ||
Usage of chainload: | ||
-dur duration | ||
duration to run - omit for unlimited | ||
-gas uint | ||
gas (default 200000) | ||
-id uint | ||
id (default 1234) | ||
-pass string | ||
passphrase to unlock accounts (default "#go@chain42") | ||
-senders int | ||
total number of concurrent senders/accounts - defaults to 1/10 of tps | ||
-tps int | ||
transactions per second (default 1) | ||
-urls string | ||
csv of urls (default "http://localhost:8545") | ||
-v verbose logging | ||
``` | ||
|
||
Example: | ||
|
||
``` | ||
chainload -id 9876 -urls http://node1:8545,http://node2:8545 -tps 100 -senders 50 -dur 5m | ||
``` | ||
|
||
## How it works | ||
|
||
Accounts are managed locally under `keystore/`. Seeder accounts must | ||
be pre-existing. One seeder is started per url, to continually re-claim | ||
funds from other accounts, and to seed funds to senders. Senders may | ||
reuse pre-existing accounts or create new ones. Senders continually send | ||
txs to a set of receivers, while periodically cycling out the sender and | ||
receiver addresses. | ||
|
||
## Problems | ||
|
||
At high volume, the error `Too many open files` may occur. This system | ||
limit can be inspected via `ulimit -n`, and temporarily raised | ||
via `ulimit -n <new limit>`. It can be permanently set in | ||
`/etc/security/limits.conf` by adding a line like: | ||
``` | ||
root soft nofile 100000 | ||
``` |
Oops, something went wrong.