Archived
Add stack for running osmosis frontend app (#673)
* osmosis FE stack * chmod * dont use 3000 * fix for neww stack format * updates * update osmosis readme * Update stack.yml * Update osmosis frontend stack to serve app * Host osmosis app static build using python server * Fix mapped ports in deployment for containers * Update instructions * Use nginx server to host files and handle page reloads * Fix typo --------- Co-authored-by: zramsay <zach@bluecollarcoding.ca> Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit was merged in pull request #673.
This commit is contained in:
@@ -0,0 +1,141 @@
|
||||
# self-hosted osmosis
|
||||
|
||||
Instructions to build and deploy:
|
||||
- self-hosted gitea
|
||||
- an ipfs node
|
||||
- the osmosis front end
|
||||
- a laconicd chain
|
||||
|
||||
## Setup
|
||||
|
||||
Clone required repositories:
|
||||
|
||||
```bash
|
||||
laconic-so --stack osmosis setup-repositories
|
||||
|
||||
# If this throws an error as a result of being already checked out to a branch/tag in a repo, remove the repositories and re-run the command
|
||||
```
|
||||
|
||||
Build the container images:
|
||||
|
||||
```
|
||||
# support image for the gitea package registry
|
||||
laconic-so --stack build-support build-containers
|
||||
|
||||
laconic-so --stack osmosis 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 osmosis deploy init --output osmosis-spec.yml
|
||||
```
|
||||
|
||||
### Ports
|
||||
|
||||
Edit `network` in spec file to map container ports to same ports in host
|
||||
|
||||
```
|
||||
...
|
||||
network:
|
||||
ports:
|
||||
proxy-server:
|
||||
- '4000:4000'
|
||||
nginx:
|
||||
- '3000:80'
|
||||
```
|
||||
|
||||
### 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 osmosis deploy create --spec-file osmosis-spec.yml --deployment-dir osmosis-deployment
|
||||
```
|
||||
|
||||
## Set env variables
|
||||
|
||||
Inside the deployment directory, open the file `config.env` and set the following env variables:
|
||||
|
||||
```bash
|
||||
# Osmosis API base URL
|
||||
# Set this to proxy server endpoint for uniswap app
|
||||
# (Eg. http://localhost:4000 - in case stack is being run locally with proxy enabled)
|
||||
# (Eg. https://abc.xyz.com - in case https://abc.xyz.com is pointed to the proxy endpoint)
|
||||
CERC_WEB_API_BASE_URL=http://localhost:4000
|
||||
|
||||
# Optional
|
||||
|
||||
# Whether to run the proxy server
|
||||
# (Disable only if proxy not required to be run) (Default: true)
|
||||
CERC_ENABLE_PROXY=
|
||||
|
||||
# Proxy server configuration
|
||||
# Used only if proxy is enabled
|
||||
|
||||
# Upstream API URL
|
||||
CERC_PROXY_UPSTREAM=https://app.osmosis.zone
|
||||
```
|
||||
|
||||
## Start the stack
|
||||
|
||||
Start the deployment:
|
||||
```bash
|
||||
laconic-so deployment --dir osmosis-deployment start
|
||||
```
|
||||
|
||||
* List and check the health status of all the containers using `docker ps` and wait for them to be `healthy`
|
||||
|
||||
* The web app can be accessed at http://localhost:3000
|
||||
|
||||
## Laconic registry
|
||||
|
||||
Setup a test chain:
|
||||
```
|
||||
export CERC_NPM_REGISTRY_URL=https://git.vdb.to/api/packages/cerc-io/npm/
|
||||
|
||||
laconic-so --stack fixturenet-laconic-loaded setup-repositories --include git.vdb.to/cerc-io/laconicd,git.vdb.to/cerc-io/laconic-sdk,git.vdb.to/cerc-io/laconic-registry-cli,git.vdb.to/cerc-io/laconic-console
|
||||
|
||||
laconic-so --stack fixturenet-laconic-loaded build-containers
|
||||
|
||||
export LACONIC_HOSTED_ENDPOINT=http://<your-IP>
|
||||
|
||||
laconic-so --stack fixturenet-laconic-loaded deploy up
|
||||
```
|
||||
|
||||
then `docker exec` into the `laconicd` container and either export the private key or create a new one and send funds to it. Use that private key for `LACONIC_HOTWALLET_KEY`.
|
||||
|
||||
## Clean up
|
||||
|
||||
To stop all osmosis services running in the background, while preserving data:
|
||||
|
||||
```bash
|
||||
# Only stop the docker containers
|
||||
laconic-so deployment --dir osmosis-deployment stop
|
||||
|
||||
# Run 'start' to restart the deployment
|
||||
```
|
||||
|
||||
To stop all osmosis services and also delete data:
|
||||
|
||||
```bash
|
||||
# Stop the docker containers
|
||||
laconic-so deployment --dir osmosis-deployment stop --delete-volumes
|
||||
|
||||
# Remove deployment directory (deployment will have to be recreated for a re-run)
|
||||
rm -r osmosis-deployment
|
||||
```
|
||||
|
||||
To stop stack running Laconic registry
|
||||
|
||||
```bash
|
||||
laconic-so --stack fixturenet-laconic-loaded deploy down
|
||||
|
||||
# Delete volumes
|
||||
laconic-so --stack fixturenet-laconic-loaded deploy down --delete-volumes
|
||||
```
|
||||
@@ -0,0 +1,30 @@
|
||||
version: "0.1"
|
||||
name: osmosis
|
||||
repos:
|
||||
# For gitea
|
||||
# - git.vdb.to/cerc-io/hosting@names-for-so
|
||||
# - gitea.com/gitea/act_runner
|
||||
# For osmosis frontend
|
||||
- github.com/cerc-io/watcher-ts@v0.2.78
|
||||
- github.com/cerc-io/osmosis-frontend@laconic
|
||||
containers:
|
||||
# - cerc/act-runner
|
||||
# - cerc/act-runner-task-executor
|
||||
- cerc/watcher-ts
|
||||
- cerc/osmosis-front-end
|
||||
pods:
|
||||
- kubo
|
||||
- proxy-server
|
||||
- osmosis-front-end
|
||||
# TODO: Fix pod config for deployment command
|
||||
# TODO: mirroring all of osmosis repos: https://git.vdb.to/cerc-io/hosting/pulls/42
|
||||
# - name: gitea
|
||||
# repository: cerc-io/hosting
|
||||
# path: gitea
|
||||
# pre_start_command: "run-this-first.sh"
|
||||
# post_start_command: "initialize-gitea.sh"
|
||||
# - name: act-runner
|
||||
# repository: cerc-io/hosting
|
||||
# path: act-runner
|
||||
# pre_start_command: "pre_start.sh"
|
||||
# post_start_command: "post_start.sh"
|
||||
Reference in New Issue
Block a user