Update with deployment command

This commit is contained in:
Nabarun 2023-11-29 20:06:59 +05:30
parent 4461137948
commit 77c911c03b
3 changed files with 76 additions and 10 deletions

View File

@ -8,7 +8,7 @@ fi
yarn build yarn build
# Create symlink to host built files with correct URL path # Create symlink to host built files with correct URL path
mkdir ./urbit/apps mkdir -p /app/urbit/apps
ln -s ./build/ ./urbit/apps/uniswap ln -s /app/build /app/urbit/apps/uniswap
yarn serve build -s -l 3000 node_modules/.bin/serve urbit -s -l 3000

View File

@ -1,15 +1,81 @@
# self-hosted uniswap frontend # self-hosted uniswap frontend
Instructions to setup and deploy uniswap app on urbit
Build and deploy: Build and deploy:
- Uniswap front end
- Urbit - Urbit
- Uniswap app
<!-- TODO: Use laconic-so deployment command --> ## Setup
```
Clone required repositories:
```bash
laconic-so --stack uniswap-frontend setup-repositories laconic-so --stack uniswap-frontend setup-repositories
laconic-so --stack uniswap-frontend build-containers # 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
```
laconic-so --stack uniswap-frontend deploy up
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
<!-- TODO: Provide example -->
### 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
``` ```

View File

@ -1,5 +1,5 @@
version: "0.1" version: "0.1"
name: urbit-frontend name: uniswap-frontend
repos: repos:
# Uniswap interface # Uniswap interface
# TODO: Use release # TODO: Use release