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

Siren Docs Upgrade #5979

Merged
merged 21 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update ui docs
  • Loading branch information
antondlr authored and rickimoore committed Jul 23, 2024
commit 3fb540a865070c91d02ed5269a3fb60eb56ea3e1
13 changes: 5 additions & 8 deletions book/src/ui-configuration.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Configuration

Siren requires a connection to both a Lighthouse Validator Client
and a Lighthouse Beacon Node. To enable connection, you must generate .env file based on the provided .env.example
Siren requires a connection to both a Lighthouse Validator Client and a Lighthouse Beacon Node.
To enable connection, you must generate .env file based on the provided .env.example

## Connecting to the Clients

Both the Beacon node and the Validator client need to have their HTTP APIs enabled. These ports should be accessible from the computer running Siren. This allows you to enter the address and ports of the associated Lighthouse
Beacon node and Lighthouse Validator client.
Both the Beacon node and the Validator client need to have their HTTP APIs enabled.
These ports should be accessible from Siren.

To enable the HTTP API for the beacon node, utilize the `--gui` CLI flag. This action ensures that the HTTP API can be accessed by other software on the same machine.

Expand All @@ -18,10 +18,7 @@ If you require accessibility from another machine within the network, configure

In a similar manner, the validator client requires activation of the `--http` flag, along with the optional consideration of configuring the `--http-address` flag. If `--http-address` flag is set on the Validator Client, then the `--unencrypted-http-transport` flag is required as well. These settings will ensure compatibility with Siren's connectivity requirements.

If you run Siren in the browser (by entering `localhost` in the browser), you will need to allow CORS in the HTTP API. This can be done by adding the flag `--http-allow-origin "*"` for both beacon node and validator client.

A green tick will appear once Siren is able to connect to both clients. You
can specify different ports for each client by clicking on the advanced tab.
If you run the Docker container, it will fail to startup if your BN/VC are not accessible, or if you provided a wrong API token.

## API Token

Expand Down
40 changes: 5 additions & 35 deletions book/src/ui-faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,49 +14,19 @@ If you receive a red notification with a BEACON or VALIDATOR NODE NETWORK ERROR

## 4. How do I connect Siren to Lighthouse from a different computer on the same network?

The most effective approach to enable access for a local network computer to Lighthouse's HTTP API ports is by configuring the `--http-address` to match the local LAN IP of the system running the beacon node and validator client. For instance, if the said node operates at `192.168.0.200`, this IP can be specified using the `--http-address` parameter as `--http-address 192.168.0.200`. When this is set, the validator client requires the flag `--beacon-nodes http://192.168.0.200:5052` to connect to the beacon node.
Subsequently, by designating the host as `192.168.0.200`, you can seamlessly connect Siren to this specific beacon node and validator client pair from any computer situated within the same network.
Siren is a webapp, you can access it like any other website. We don't recommend exposing it to the internet; if you require remote access a VPN or (authenticated) reverse proxy is highly recommended.

## 5. How can I use Siren to monitor my validators remotely when I am not at home?

There are two primary methods to access your Beacon Node and Validator Client remotely: setting up a VPN or utilizing SSH-reverse tunneling.

Most contemporary home routers provide options for VPN access in various ways. A VPN permits a remote computer to establish a connection with internal computers within a home network. With a VPN configuration in place, connecting to the VPN enables you to treat your computer as if it is part of your local home network. The connection process involves following the setup steps for connecting via another machine on the same network on the Siren configuration page and [`connecting to clients section`](./ui-configuration.md#connecting-to-the-clients).

In the absence of a VPN, an alternative approach involves utilizing an SSH tunnel. To achieve this, you need remote SSH access to the computer hosting the Beacon Node and Validator Client pair (which necessitates a port forward in your router). In this context, while it is not obligatory to set a `--http-address` flag on the Beacon Node and Validator Client, you can configure an SSH tunnel to the local ports on the node and establish a connection through the tunnel. For instructions on setting up an SSH tunnel, refer to [`Connecting Siren via SSH tunnel`](./ui-faqs.md#6-how-do-i-connect-siren-to-lighthouse-via-a-ssh-tunnel) for detailed guidance.

## 6. How do I connect Siren to Lighthouse via a ssh tunnel?

If you would like to access Siren beyond the local network (i.e across the internet), we recommend using an SSH tunnel. This requires a tunnel for 3 ports: `80` (assuming the port is unchanged as per the [installation guide](./ui-installation.md#building-from-docker-recommended)), `5052` (for beacon node) and `5062` (for validator client). You can use the command below to perform SSH tunneling:

```bash

ssh -N -L 80:127.0.0.1:80 -L 5052:127.0.0.1:5052 -L 5062:127.0.0.1:5062 username@local_ip

```

Where `username` is the username of the server and `local_ip` is the local IP address of the server. Note that with the `-N` option in an SSH session, you will not be able to execute commands in the CLI to avoid confusion with ordinary shell sessions. The connection will appear to be "hung" upon a successful connection, but that is normal. Once you have successfully connected to the server via SSH tunneling, you should be able to access Siren by entering `localhost` in a web browser.

You can also access Siren using the app downloaded in the [Siren release page](https://github.com/sigp/siren/releases). To access Siren beyond the local computer, you can use SSH tunneling for ports `5052` and `5062` using the command:

```bash

ssh -N -L 5052:127.0.0.1:5052 -L 5062:127.0.0.1:5062 username@local_ip

```

## 7. Does Siren support reverse proxy or DNS named addresses?

Yes, if you need to access your beacon or validator from an address such as `https://merp-server:9909/eth2-vc` you should follow the following steps for configuration:

1. Toggle `https` as your protocol
2. Add your address as `merp-server/eth2-vc`
3. Add your Beacon and Validator ports as `9909`
## 6. Does Siren support reverse proxy or DNS named addresses?

If you have configured it correctly you should see a green checkmark indicating Siren is now connected to your Validator Client and Beacon Node.
Yes, if you need to access your beacon or validator from an address such as `https://merp-server:9909/eth2-vc` you should configure Siren as follows:
`VALIDATOR_URL=https://merp-server:9909/eth2-vc`

If you have separate address setups for your Validator Client and Beacon Node respectively you should access the `Advance Settings` on the configuration and repeat the steps above for each address.

## 8. Why doesn't my validator balance graph show any data?
## 7. Why doesn't my validator balance graph show any data?

If your graph is not showing data, it usually means your validator node is still caching data. The application must wait at least 3 epochs before it can render any graphical visualizations. This could take up to 20min.
12 changes: 6 additions & 6 deletions book/src/ui-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ To ensure proper functionality, the Siren app requires Lighthouse v4.3.0 or high

## Running the Docker container (Recommended)

The most convenient way to run Siren is to use the images built and published by Sigma Prime.
The most convenient way to run Siren is to use the Docker images built and published by Sigma Prime.

They can be found on [Docker hub](https://hub.docker.com/r/sigp/siren/tags), or pulled directly with `docker pull sigp/siren`

Configuration is done through environment variables, the best way to get started is by copying `.env.example` to `.env` and editing the relevant sections (typically, this would at least include adding `BEACON_URL`, `VALIDATOR_URL` and `API_TOKEN`)
Configuration is done through environment variables, the easiest way to get started is by copying `.env.example` to `.env` and editing the relevant sections (typically, this would at least include adding `BEACON_URL`, `VALIDATOR_URL` and `API_TOKEN`)
rickimoore marked this conversation as resolved.
Show resolved Hide resolved

Then to run the image:

`docker compose up`
or
`docker run --rm -ti --name siren -p 3443:443 --env-file $PWD/.env sigp/siren`
`docker run --rm -ti --name siren -p 4443:443 --env-file $PWD/.env sigp/siren`

This command will open port 3443, allowing your browser to connect.
This command will open port 4443, allowing your browser to connect.

To start Siren, visit `https://localhost:3443` in your web browser.
To start Siren, visit `https://localhost:4443` in your web browser.

Advanced users can mount their own certificates, see the `SSL Certificates` section below

Expand All @@ -36,7 +36,7 @@ The docker image can be built with the following command:

### Building locally

To build from source, ensure that your system has `Node v18.18` and `yarn` installed. Start by configuring your environment variables. The recommended approach is to duplicate the `.env.example` file, rename it to `.env`, and modify the necessary settings. Essential variables typically include `BEACON_URL`, `VALIDATOR_URL`, and `API_TOKEN`.
To build from source, ensure that your system has `Node v18.18` and `yarn` installed.

#### Build and run the backend

Expand Down
2 changes: 1 addition & 1 deletion book/src/ui-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The account earnings component accumulates reward data from all registered valid

Below in the earning section, you can also view your total earnings or click the adjacent buttons to view your estimated earnings given a specific time frame based on current device and network conditions.

Keep in mind, if validators have updated withdrawal credentials, this balance will only reflect the balance before the accumulated rewards are paid out and will subsequently be reset to a zero balance and start accumulating rewards until the next reward payout.
Keep in mind, if validators have updated (`0x01`) withdrawal credentials, this balance will only reflect the balance before the accumulated rewards are paid out and will subsequently be reset to a zero balance and start accumulating rewards until the next reward payout.

![earning](imgs/ui-account-earnings.png)

Expand Down