Skip to content

Commit

Permalink
docs: update README and update generated files (#328)
Browse files Browse the repository at this point in the history
* docs: update `README`

* chore: `make gen`

* ci: bump versions

* fix: issue
  • Loading branch information
leovct authored Jul 19, 2024
1 parent c3e1de2 commit 76d2f3c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ concurrency:

env:
GO_VERSION: "1.21" # https://go.dev/dl/
STRINGER_VERSION: "0.15.0" # https://pkg.go.dev/golang.org/x/tools/cmd/stringer?tab=versions
STRINGER_VERSION: "0.23.0" # https://pkg.go.dev/golang.org/x/tools/cmd/stringer?tab=versions
# Protoc dependencies.
PROTOC_VERSION: "25.3" # https://github.com/protocolbuffers/protobuf/releases
PROTOC_VERSION: "27.1" # https://github.com/protocolbuffers/protobuf/releases
PROTOC_GEN_GO_VERSION: "1.31.0" # https://pkg.go.dev/google.golang.org/protobuf/cmd/protoc-gen-go?tab=versions
PROTOC_GEN_GO_GRPC_VERSION: "1.3.0" # https://pkg.go.dev/google.golang.org/grpc/cmd/protoc-gen-go-grpc?tab=versions
PROTOC_GEN_GO_GRPC_VERSION: "1.4.0" # https://pkg.go.dev/google.golang.org/grpc/cmd/protoc-gen-go-grpc?tab=versions
ARCH: "linux-x86_64"

jobs:
Expand Down
47 changes: 16 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ We run a lot of different blockchain technologies. Different tools often have in
- [Install](#install)
- [Features](#features)
- [Testing](#testing)
- [Contributing](#contributing)
- [Reference](#reference)
- [References](#references)

## Install

Expand All @@ -23,7 +22,7 @@ Requirements:
To install, clone this repo and run:

```bash
$ make install
make install
```

By default, the commands will be in `$HOME/go/bin/`, so for ease, we recommend adding that path to your shell's startup file by adding the following line:
Expand Down Expand Up @@ -85,28 +84,29 @@ Note: Do not modify this section! It is auto-generated by `cobra` using `make ge
To test the features of `polycli`, we'll run geth in `dev` mode but you can run any node you want.

```bash
$ make geth
INFO [07-10|10:43:12.499] Starting Geth in ephemeral dev mode...
...
make geth
```

You can then fund the default load testing account and run some tests.

```bash
$ make geth-loadtest
10:57AM INF Starting Load Test
10:57AM INF Connecting with RPC endpoint to initialize load test parameters
...
make geth-loadtest
```

You can view the state of the chain using `polycli`.

```bash
$ polycli monitor --rpc-url http://127.0.0.1:8545
polycli monitor --rpc-url http://127.0.0.1:8545
```

![polycli monitor](doc/assets/monitor.gif)

Note that if you want to debug the monitor, you can use the following command.

```bash
polycli monitor --rpc-url http://34.117.145.249:80 -v 700 &> log.txt
```

You can also interact manually with your node, you can attach a Javascript console to your node using IPC.

First, wait for the IPC endpoint to open.
Expand All @@ -123,17 +123,7 @@ INFO [07-10|10:44:29.256] Generated ephemeral JWT secret secret=0x7511
Then, attach a console to your node.

```bash
$ geth attach /var/folders/7m/3_x4ns7557x52hb6vncqkx8h0000gn/T/geth.ipc
Welcome to the Geth JavaScript console!

instance: Geth/v1.12.0-stable/darwin-amd64/go1.20.4
coinbase: 0x760f66cae63cb561ed0ef29d5e005f44215e2ba2
at block: 8 (Mon Jul 10 2023 10:49:07 GMT+0200 (CEST))
datadir:
modules: admin:1.0 clique:1.0 debug:1.0 engine:1.0 eth:1.0 miner:1.0 net:1.0 rpc:1.0 txpool:1.0 web3:1.0

To exit, press ctrl-d or type exit
>
geth attach /var/folders/7m/3_x4ns7557x52hb6vncqkx8h0000gn/T/geth.ipc
```

From there, you can do anything such as funding the default load testing account with some currency.
Expand All @@ -149,21 +139,14 @@ true
You can then generate some load to make sure that blocks with transactions are being created. Note that the chain id of local geth is `1337`.

```bash
$ polycli loadtest --verbosity 700 --chain-id 1337 --concurrency 1 --requests 1000 --rate-limit 5 --mode c --rpc-url http://127.0.0.1:8545
polycli loadtest --verbosity 700 --chain-id 1337 --concurrency 1 --requests 1000 --rate-limit 5 --mode c --rpc-url http://127.0.0.1:8545
```

## Monitor Debug
`polycli monitor --rpc-url http://34.117.145.249:80 -v 700 &> log.txt`

# Contributing

- If you add a new loadtest mode, don't forget to update the loadtest mode string by running the following command: `cd cmd/loadtest && stringer -type=loadTestMode`. You can install [stringer](https://pkg.go.dev/golang.org/x/tools/cmd/stringer) with `go install golang.org/x/tools/cmd/stringer@latest`.

## Contact

For more discussions, please head to the [R&D Discord](https://discord.gg/0xPolygonRnD)

# Reference
## References

Sending some value to the default load testing account.

Expand Down Expand Up @@ -195,3 +178,5 @@ curl -v -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0", "id": 1, "meth
websocat ws://34.208.176.205:9944
{"jsonrpc":"2.0", "id": 1, "method": "chain_subscribeNewHead", "params": []}
```

If you add a new loadtest mode, don't forget to update the loadtest mode string by running the following command: `cd cmd/loadtest && stringer -type=loadTestMode`. You can install [stringer](https://pkg.go.dev/golang.org/x/tools/cmd/stringer) with `go install golang.org/x/tools/cmd/stringer@latest`.
2 changes: 1 addition & 1 deletion proto/gen/pb/block.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proto/gen/pb/transaction.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 76d2f3c

Please sign in to comment.