Conversation
uri-99
left a comment
There was a problem hiding this comment.
looks good but im not devops
MarcosNicolau
left a comment
There was a problem hiding this comment.
The targets worked well for me. I wonder if we can make an script that does everything automatically (maybe via ansible). Also, I’m curious on why we are building the explorer on /tmp and then moving it. Can't we just build the explorer directly in /home/app? We could avoid cloning the repository, installing dependencies, etc., every time we redeploy. That repetitive step was a bit frustrating.
| mix assets.deploy | ||
| mix release --overwrite | ||
|
|
||
| # on /tmp/aligned_layer/explorer/ as app |
There was a problem hiding this comment.
Personally, I would remove these comments or make them a little more specific.
| 3. Head to the `explorer/` folder and run the following command: | ||
| ``` | ||
| RPC_URL= | ||
| ENVIRONMENT= | ||
| ALIGNED_CONFIG_FILE= | ||
| PHX_HOST= | ||
| ELIXIR_HOSTNAME= | ||
| PHX_SERVER=true | ||
| DB_NAME= | ||
| DB_USER= | ||
| DB_PASS= | ||
| DB_HOST= | ||
| TRACKER_API_URL= | ||
| SECRET_KEY_BASE= | ||
| KEYFILE_PATH=/home/app/.ssl/key.pem | ||
| CERTFILE_PATH=/home/app/.ssl/cert.pem | ||
| make create_env |
There was a problem hiding this comment.
Why don't we instead pass a .env file path instead of providing all the vars in the console? I find it a little uncomfortable. Or instead, the create_env just creates the template, and then you go to the created file and fill in the variables.
| 7. Enable the systemd service. | ||
| ``` | ||
| make run_service | ||
| ``` |
There was a problem hiding this comment.
Add a comment saying this should be run as app user.
| | MIX_ENV | Elixir environment for compiling the binaries | prod | prod | prod | | ||
| | RPC_URL | RPC's URL for the explorer to pull data from | `<RPC_URL>` | `<RPC_URL>` | `<RPC_URL>` | | ||
| | ENVIRONMENT | Build environment for aligned internal use | holesky | holesky | mainnet | | ||
| | ALIGNED_CONFIG_FILE | JSON config file for aligned | /home/app/repos/explorer/aligned_layer/contracts/script/output/holesky/alignedlayer_deployment_output.stage.json | /home/app/repos/explorer/aligned_layer/contracts/script/output/holesky/alignedlayer_deployment_output.json | /home/app/repos/explorer/aligned_layer/contracts/script/output/mainnet/alignedlayer_deployment_output.json | |
There was a problem hiding this comment.
If you don't have a explorer built into /home/app (on first build) you can't build the explorer as if can't find the .jsons with the addresses.
|
|
||
| # on /tmp/aligned_layer/explorer/ as app | ||
| build_explorer: export MIX_ENV=prod | ||
| build_explorer: |
There was a problem hiding this comment.
Isn't this missing: explorer_ecto_setup_db to do the migrations if needed?
|
|
||
| 4. Move the built binary outside `/tmp/` and move it to the actual location. | ||
| ``` | ||
| make install_explorer |
There was a problem hiding this comment.
I had to run this with sudo (I was logged as admin).
Makefile for explorer
Description
Adds a makefile for building and deploying the explorer
Type of change
Checklist
testnet, everything else tostaging