From 77c911c03b4e0b25826c68a3f2d3a28688affc7e Mon Sep 17 00:00:00 2001 From: Nabarun Date: Wed, 29 Nov 2023 20:06:59 +0530 Subject: [PATCH] Update with deployment command --- .../data/config/uniswap-frontend/build.sh | 6 +- .../data/stacks/uniswap-frontend/README.md | 78 +++++++++++++++++-- .../data/stacks/uniswap-frontend/stack.yml | 2 +- 3 files changed, 76 insertions(+), 10 deletions(-) diff --git a/stack_orchestrator/data/config/uniswap-frontend/build.sh b/stack_orchestrator/data/config/uniswap-frontend/build.sh index e1ca3fbd..a258ab54 100755 --- a/stack_orchestrator/data/config/uniswap-frontend/build.sh +++ b/stack_orchestrator/data/config/uniswap-frontend/build.sh @@ -8,7 +8,7 @@ fi yarn build # Create symlink to host built files with correct URL path -mkdir ./urbit/apps -ln -s ./build/ ./urbit/apps/uniswap +mkdir -p /app/urbit/apps +ln -s /app/build /app/urbit/apps/uniswap -yarn serve build -s -l 3000 +node_modules/.bin/serve urbit -s -l 3000 diff --git a/stack_orchestrator/data/stacks/uniswap-frontend/README.md b/stack_orchestrator/data/stacks/uniswap-frontend/README.md index d567e126..a4508a66 100644 --- a/stack_orchestrator/data/stacks/uniswap-frontend/README.md +++ b/stack_orchestrator/data/stacks/uniswap-frontend/README.md @@ -1,15 +1,81 @@ # self-hosted uniswap frontend +Instructions to setup and deploy uniswap app on urbit + Build and deploy: -- Uniswap front end - Urbit +- Uniswap app - -``` +## Setup + +Clone required repositories: + +```bash laconic-so --stack uniswap-frontend setup-repositories -laconic-so --stack uniswap-frontend build-containers - -laconic-so --stack uniswap-frontend deploy up +# If this throws an error as a result of being already checked out to a branch/tag in a repo, remove the repositories mentioned below and re-run the command +``` + +Build the container images: + +```bash +laconic-so --stack uniswap-frontend build-containers +``` + +## Create a deployment + +First, create a spec file for the deployment, which will map the stack's ports and volumes to the host: +```bash +laconic-so --stack uniswap-frontend deploy init --output uniswap-frontend-spec.yml +``` + +### Ports + +Edit `network` in spec file to map container ports to same ports in host + + + +### Data volumes +Container data volumes are bind-mounted to specified paths in the host filesystem. +The default setup (generated by `laconic-so deploy init`) places the volumes in the `./data` subdirectory of the deployment directory. The default mappings can be customized by editing the "spec" file generated by `laconic-so deploy init`. + +--- + +Once you've made any needed changes to the spec file, create a deployment from it: +```bash +laconic-so --stack uniswap-frontend deploy create --spec-file uniswap-frontend-spec.yml --deployment-dir uniswap-frontend-deployment +``` + +## Set env variables + +Inside the deployment directory, open the file `config.env` and add variable for infura key : + + ```bash + # External RPC endpoints + # https://docs.infura.io/getting-started#2-create-an-api-key + CERC_INFURA_KEY= + ``` + +## Start the stack + +Start the deployment: +```bash +laconic-so deployment --dir uniswap-frontend-deployment start +``` + +* List and check the health status of all the containers using `docker ps` and wait for them to be `healthy` + +## Clean up + +To stop all azimuth services running in the background, while preserving chain data: + +```bash +laconic-so deployment --dir uniswap-frontend-deployment stop +``` + +To stop all azimuth services and also delete data: + +```bash +laconic-so deployment --dir uniswap-frontend-deployment stop --delete-volumes ``` diff --git a/stack_orchestrator/data/stacks/uniswap-frontend/stack.yml b/stack_orchestrator/data/stacks/uniswap-frontend/stack.yml index e3b9e9f3..476fd3b3 100644 --- a/stack_orchestrator/data/stacks/uniswap-frontend/stack.yml +++ b/stack_orchestrator/data/stacks/uniswap-frontend/stack.yml @@ -1,5 +1,5 @@ version: "0.1" -name: urbit-frontend +name: uniswap-frontend repos: # Uniswap interface # TODO: Use release