Skip to content

Commit

Permalink
Used Debian bullseye as the base, updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jclapis committed Sep 6, 2022
1 parent 765391d commit caa97d8
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rocketpool/smartnode-base
FROM debian:bullseye-slim

ARG TARGETARCH
COPY ./Releases/treegen-linux-${TARGETARCH} /treegen
55 changes: 53 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,60 @@

This is a standalone tool for creating the rewards tree and minipool attestation files for rewards intervals on the Rocket Pool network.
It can recreate trees for past rewards intervals, or it can "simulate" the tree for the current interval ending at the latest finalized block (for testing purposes).
It uses the same codebase as the Smartnode, so you can be assured that `treegen` will generate the same trees as the Smartnode stack.


## Running Treegen

There are currently three ways to run `treegen`:

1. Run the precompiled binaries locally (Linux only, using `glibc`)
2. Run the Docker image (Linux, Windows, and macOS)
3. Build from source and run locally


### Running the Binary Locally

Run the binary as follows:

```
$ ./treegen-linux-amd64 [options]
```

Options:

```
--bn-endpoint value, -b value The URL of the Beacon Node's REST API. Note that for past interval generation, this must have Archive capability (ability to replay arbitrary historical states). (default: "http://localhost:5052")
--ec-endpoint value, -e value The URL of the Execution Client's JSON-RPC API. Note that for past interval generation, this must be an Archive EC. (default: "http://localhost:8545")
--interval value, -i value The rewards interval to generate the artifacts for. A value of -1 indicates that you want to do a "dry run" of generating the tree for the current (active) interval, using the current latest finalized block as the interval end. (default: -1)
--output-dir value, -o value Optional output directory to save generated files (default is the current working directory).
--pretty-print, -p Toggle for saving the files in pretty-print format so they're human readable. (default: true)
```


### Running via the Docker Image

`treegen` is also available in a Docker image for users not on Linux systems, or on systems incompatible with the precompiled binaries.
To run it, use the following command:

```
$ ./treegen.sh -e <EC endpoint> -b <BN endpoint> [options]
```

Options:

```
--bn-endpoint value, -b value The URL of the Beacon Node's REST API. Note that for past interval generation, this must have Archive capability (ability to replay arbitrary historical states). (default: "http://localhost:5052")
--ec-endpoint value, -e value The URL of the Execution Client's JSON-RPC API. Note that for past interval generation, this must be an Archive EC. (default: "http://localhost:8545")
--interval value, -i value The rewards interval to generate the artifacts for. A value of -1 indicates that you want to do a "dry run" of generating the tree for the current (active) interval, using the current latest finalized block as the interval end. (default: -1)
--pretty-print, -p Toggle for saving the files in pretty-print format so they're human readable. (default: true)
```

NOTE: Do *not* use the `-o` flag if you are using this script, as it is already built into the script.
Output files will be stored in the `out` directory.


## Building

To build it, simply enter this folder and run `go build`.
You will need to have Go v1.19 set up already.
To build the binary locally, simply enter this folder and run `go build`.
You will need to have Go v1.19 or higher set up already.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

const (
version string = "0.1.0"
version string = "1.0.0"
colorReset string = "\033[0m"
colorRed string = "\033[31m"
)
Expand Down

0 comments on commit caa97d8

Please sign in to comment.