Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: rewrite setup_aligned #1588

Merged
merged 10 commits into from
Dec 16, 2024
88 changes: 88 additions & 0 deletions docs/3_guides/6.1_explorer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Explorer setup

## Dependencies

Ensure you have the following installed:

- [Erlang 26](https://github.com/asdf-vm/asdf-erlang)
- [Elixir 1.16.2](https://elixir-ko.github.io/install.html), compiled with OTP 26
- [Docker](https://docs.docker.com/get-docker/)
- [NodeJS](https://nodejs.org/en/download/package-manager)
- Tested with node 20 and 22
- [pnpm](https://pnpm.io/installation)

After installing the necessary deps, setup the environment variables by running:

```shell
make explorer_create_env
```

Then start the explorer:

```shell
make explorer_build_db
make run_explorer
```

This will:

- Start a postgres docker container
- Run ecto setup
- Start the explorer on http://localhost:4000.

If you want to run the explorer without docker run:

```shell
make run_explorer_without_docker
```

<details>
<summary>Clean, dump and recover DB</summary>

To clear the DB, you can run:

```bash
make explorer_clean_db
```

If you need to dump the data from the DB, you can run:

```bash
make explorer_dump_db
```

This will create a `dump.$date.sql` SQL script on the `explorer` directory with all the existing data.

Data can be recovered from a `dump.$date.sql` using the following command:

```bash
make explorer_recover_db
```

Then you'll be requested to enter the file name of the dump you want to recover already positioned in the `/explorer` directory.

This will update your database with the dumped database data.

</details>

## Fetching batches and operators data

If you want to fetch past batches that for any reason were not inserted into the DB, you will first need to make sure you have the `ELIXIR_HOSTNAME` in the `.env` file.

You can get the hostname of your elixir by running:

```bash
elixir -e 'IO.puts(:inet.gethostname() |> elem(1))'
```

Then you can run:

```bash
make explorer_fetch_old_batches FROM_BLOCK=<FROM_BLOCK> TO_BLOCK=<TO_BLOCK>
```

To get operators strategies and restakes data:

```bash
make explorer_fetch_old_operators_strategies_restakes FROM_BLOCK<FROM_BLOCK>
```
44 changes: 44 additions & 0 deletions docs/3_guides/6.2_metrics_telemetry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Metrics and telemetry setup

## Dependencies

Ensure you have the following installed:

- [Go](https://go.dev/doc/install)
- [Erlang 26](https://github.com/asdf-vm/asdf-erlang)
- [Elixir 1.16.2](https://elixir-ko.github.io/install.html), compiled with OTP 26
- [Docker](https://docs.docker.com/get-docker/)

## Metrics service

To run Prometheus and Grafana, run:

```bash
make run_metrics
```

This will start containers for Prometheus and Grafana. You can access Grafana on `http://localhost:3000` with the default credentials `admin:admin`.

Alternately, you can access the raw scrapped metrics collected with Prometheus on `http://localhost:9091/metrics`.

## Telemetry service

To setup the telemetry service run:

If it is your first time first you'll need to execute the following commands:

```bash
make telemetry_create_env
make telemetry_build_db
```

Then, to start the service:

```bash
make telemetry_full_start
```

This will:

- Start OpenJaeger container for the traces: available at `http://localhost:16686/`
- Start telemetry server: available at `http://localhost:4001/`
Loading