Staging
Setting Up Your Environment
Create a .envrc File
Create the .envrc file:
In the root directory of the project, create a file named
.envrc
.The file should contain the following lines (fill in the values or ask Trevor/Britton):
shCopy codeexport ETHEREUM_RPC_URL= export OPTIMISM_RPC_URL= export ARBITRUM_RPC_URL= export AVALANCHE_RPC_URL= export POLYGON_RPC_URL= export PRIV_KEY=
Use direnv to load environment variables:
We recommend using direnv to automatically load the environment variables when you enter the root directory.
Follow the instructions to install direnv and hook into your shell.
Create a Virtual Environment
Create the virtual environment:
shCopy codepython3 -m venv .venv
Activate the virtual environment:
shCopy codesource .venv/bin/activate
Note: If you are using a shell other than bash or zsh, you may need to use a different activate binary.
Install dependencies:
shCopy codepip install -r requirements.txt
Allow direnv to load the .envrc file:
shCopy codedirenv allow
Running the Server Locally
After setting up your environment, run the server locally with:
shCopy codeuvicorn frontend:app --host localhost --port 8080
Working on a Branch Locally
Clone the repository:
Using HTTPS:
shCopy codegit clone https://github.com/tristeroresearch/cache-half-full
Using SSH:
shCopy codegit clone git@github.com:tristeroresearch/cache-half-full
Check out the staging branch (or any other branch):
shCopy codegit checkout staging
Create a new branch:
shCopy codegit checkout -b new_branch_name
Pushing Local Changes
Add your changes:
Add everything:
shCopy codegit add .
Add specific files:
shCopy codegit add <file_path>
Commit your changes:
shCopy codegit commit -m "commit message"
Push your changes:
shCopy codegit push
Push a new branch to origin:
shCopy codegit push -u origin new_branch_name
Reading Logs
Access logs and metrics:
Go to the Fly.io dashboard and ensure you have an invite.
Navigate to the Tristero project:
Changing Secrets/Environment Variables of the Deployed App
Install Flyctl:
Follow the instructions to install Flyctl.
Log in to Flyctl:
shCopy codeflyctl auth login
Push to rebuild:
After making changes to secrets or environment variables, push to rebuild the staging app.
Last updated