-
Notifications
You must be signed in to change notification settings - Fork 931
Siren installation improvement #7404
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
Changes from all commits
49fb02b
20108ce
30893f0
d80e2e1
66d501f
2a5d077
b91b850
57f88fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,19 +8,55 @@ To ensure proper functionality, the Siren app requires Lighthouse v4.3.0 or high | |
|
|
||
| ## Configuration | ||
|
|
||
| Siren requires a connection to both a Lighthouse Validator Client and a Lighthouse Beacon Node. | ||
| Siren requires a connection to both a Lighthouse Validator Client and a Lighthouse Beacon Node. | ||
|
|
||
| Both the Beacon node and the Validator client need to have their HTTP APIs enabled. | ||
| Both the Beacon node and the Validator client need to have their HTTP APIs enabled. | ||
| These ports should be accessible from Siren. This means adding the flag `--http` on both beacon node and validator client. | ||
|
|
||
| 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. | ||
|
|
||
| > The Beacon Node must be run with the `--gui` flag set. | ||
|
|
||
| ## Running the Docker container (Recommended) | ||
| ## Running Siren with Docker Compose (Recommended) | ||
|
|
||
| We recommend running Siren's container next to your beacon node (on the same server), as it's essentially a webapp that you can access with any browser. | ||
|
|
||
| 1. Clone the Siren repository: | ||
|
|
||
| ``` | ||
| git clone https://github.com/sigp/siren | ||
| cd siren | ||
| ``` | ||
|
|
||
| 1. Copy the example `.env.example` file to `.env`: | ||
|
|
||
| ``` | ||
| cp .env.example .env | ||
| ``` | ||
|
|
||
| 1. Edit the `.env` file filling in the required fields. A beacon node and validator url needs to be | ||
| specified as well as the validator clients `API_TOKEN`, which can be obtained from the [`Validator Client Authorization Header`](./api_vc_auth_header.md). | ||
| Note that the HTTP API ports must be accessible from within docker and cannot just be listening | ||
| on localhost. This means using the | ||
| `--http-address 0.0.0.0` flag on the beacon node and validator client. | ||
|
|
||
| 1. Run the containers with docker compose | ||
|
|
||
| ``` | ||
| docker compose up -d | ||
| ``` | ||
|
|
||
| 1. You should now be able to access siren at the url (provided SSL is enabled): | ||
|
|
||
| ``` | ||
| https://localhost | ||
| ``` | ||
|
|
||
| > Note: If running on a remote host and the port is exposed, you can access Siren remotely via | ||
| `https://<IP-OF-REMOTE-HOST>` | ||
|
|
||
| ## Running Siren in Docker | ||
|
|
||
| 1. Create a directory to run Siren: | ||
|
|
||
| ```bash | ||
|
|
@@ -29,9 +65,9 @@ We recommend running Siren's container next to your beacon node (on the same ser | |
| cd Siren | ||
| ``` | ||
|
|
||
| 1. Create a configuration file in the `Siren` directory: `nano .env` and insert the following fields to the `.env` file. The field values are given here as an example, modify the fields as necessary. For example, the `API_TOKEN` can be obtained from [`Validator Client Authorization Header`](./api_vc_auth_header.md) | ||
| 1. Create a configuration file in the `Siren` directory: `nano .env` and insert the following fields to the `.env` file. The field values are given here as an example, modify the fields as necessary. For example, the `API_TOKEN` can be obtained from [`Validator Client Authorization Header`](./api_vc_auth_header.md). | ||
|
|
||
| A full example with all possible configuration options can be found [here](https://github.com/sigp/siren/blob/stable/.env.example). | ||
| A full example with all possible configuration options can be found [here](https://github.com/sigp/siren/blob/stable/.env.example). | ||
|
|
||
| ``` | ||
| BEACON_URL=http://localhost:5052 | ||
|
|
@@ -43,32 +79,45 @@ We recommend running Siren's container next to your beacon node (on the same ser | |
| 1. You can now start Siren with: | ||
|
|
||
| ```bash | ||
| docker run --rm -ti --name siren --env-file $PWD/.env --net host sigp/siren | ||
| docker run -ti --name siren --env-file $PWD/.env -p 443:443 sigp/siren | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if this will still work, without the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, I guess maybe its the container trying to access local instances. I use the docker compose for this and it works fine. I guess @antondlr will have to chime in for --net host. My understanding is that it's not needed, but I might be missing something.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, age is 100% right. a solution for that is to use I'm not sure how
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For those running BN and VC without docker (systemd), without
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I run BN and VC without docker using systemd and what I've written here works perfectly fine. I think the only case is if they set their HTTP IP in the CLI of BN and VC to 127.0.0.1 then it won't work.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added a comment about handling this edge case. I dont think we need I've commented on this in the docs now.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @antondlr could you chime in on this? We discussed before that without
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we discussed this in detail at devcon, and it is indeed as age says:
you'd have to do both, simultaneously, and this only works for regular docker installs iirc, not for "snap" installs (like you have on your server?). (and it's I can help debug / find a way for a specific setup like yours but there are no magic solutions here that preserve max security. the tradeoff is between exposing the BN/VC API more broadly, or running Siren with
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I remember, the "lesser of the two evils" - either exposing the API or using So long as it works, then it's good.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the record, this doesn't have anything do with Systemd. I run lighthouse with systemd and without. I don't use the I expose my HTTP API so I can access it and query things, its only accessible on my internal LAN. |
||
| ``` | ||
|
|
||
| Note that, due to the `--net=host` flag, this will expose Siren on ports 3000, 80, and 443. Preferably, only the latter should be accessible. Adjust your firewall and/or skip the flag wherever possible. | ||
| > Note: If you have only exposed your HTTP API ports on the Beacon Node and Validator client to | ||
| localhost, i.e via --http-address 127.0.0.1, you must add | ||
| `--add-host=host.docker.internal:host-gateway` to the docker command to allow docker to access the | ||
| hosts localhost. Alternatively, you should expose the HTTP API to the IP address of the host or | ||
| `0.0.0.0` | ||
|
|
||
| If it fails to start, an error message will be shown. For example, the error | ||
| 1. Siren should be accessible at the url: | ||
|
|
||
| ``` | ||
| http://localhost:5062 unreachable, check settings and connection | ||
| https://localhost | ||
| ``` | ||
|
|
||
| means that the validator client is not running, or the `--http` flag is not provided, or otherwise inaccessible from within the container. Another common error is: | ||
| > Note: If running on a remote host and the port is exposed, you can access Siren remotely via | ||
| `https://<IP-OF-REMOTE-HOST>` | ||
|
|
||
| ``` | ||
| validator api issue, server response: 403 | ||
| ``` | ||
| ## Possible Docker Errors | ||
|
|
||
| Note that when use SSL, you will get an SSL warning. Advanced users can mount their own certificates or disable SSL altogether, see the `SSL Certificates` section below. This error is safe to ignore. | ||
|
|
||
| If it fails to start, an error message will be shown. For example, the error | ||
|
|
||
| ``` | ||
| http://localhost:5062 unreachable, check settings and connection | ||
| ``` | ||
|
|
||
| which means that the API token is incorrect. Check that you have provided the correct token in the field `API_TOKEN` in `.env`. | ||
| means that the validator client is not running, or the `--http` flag is not provided, or otherwise inaccessible from within the container. Another common error is: | ||
|
|
||
| When Siren has successfully started, you should see the log `LOG [NestApplication] Nest application successfully started +118ms`, indicating that Siren has started. | ||
| ``` | ||
| validator api issue, server response: 403 | ||
| ``` | ||
|
|
||
| 1. Siren is now accessible at `https://<the-servers-ip>` (when used with `--net=host`). You will get a warning about an invalid certificate, this can be safely ignored. | ||
| which means that the API token is incorrect. Check that you have provided the correct token in the field `API_TOKEN` in `.env`. | ||
|
|
||
| > Note: We recommend setting a strong password when running Siren to protect it from unauthorized access. | ||
| When Siren has successfully started, you should see the log `LOG [NestApplication] Nest application successfully started +118ms`, indicating that Siren has started (in the docker logs). | ||
|
|
||
| Advanced users can mount their own certificates or disable SSL altogether, see the `SSL Certificates` section below. | ||
| > Note: We recommend setting a strong password when running Siren to protect it from unauthorized access. | ||
|
|
||
| ## Building From Source | ||
|
|
||
|
|
@@ -101,7 +150,7 @@ By default, internally, Siren is running on port 80 (plain, behind nginx), port | |
|
|
||
| [mkcert](https://github.com/FiloSottile/mkcert) is a tool that makes it super easy to generate a self-signed certificate that is trusted by your browser. | ||
|
|
||
| To use it for `siren`, install it following the instructions. Then, run `mkdir certs; mkcert -cert-file certs/cert.pem -key-file certs/key.pem 127.0.0.1 localhost` (add or replace any IP or hostname that you would use to access it at the end of this command). | ||
| To use it for `siren`, install it following the instructions. Then, run `mkdir certs; mkcert -cert-file certs/cert.pem -key-file certs/key.pem 127.0.0.1 localhost` (add or replace any IP or hostname that you would use to access it at the end of this command). | ||
| To use these generated certificates, add this to to your `docker run` command: `-v $PWD/certs:/certs` | ||
|
|
||
| The nginx SSL config inside Siren's container expects 3 files: `/certs/cert.pem` `/certs/key.pem` `/certs/key.pass`. If `/certs/cert.pem` does not exist, it will generate a self-signed certificate as mentioned above. If `/certs/cert.pem` does exist, it will attempt to use your provided or persisted certificates. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.