-
Notifications
You must be signed in to change notification settings - Fork 370
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
Added Makefile for explorer. #1665
base: testnet
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good but im not devops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 .json
s 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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