Rename urbit pod and update instructions

This commit is contained in:
Prathamesh Musale 2023-12-06 13:10:14 +05:30
parent 07118a2d72
commit 4b9b4dc63d
7 changed files with 20 additions and 15 deletions

View File

@ -1,10 +1,12 @@
version: '3.7' version: '3.7'
services: services:
# TODO: Describe usage
urbit-fake-ship: urbit-fake-ship:
restart: unless-stopped restart: unless-stopped
image: tloncorp/vere image: tloncorp/vere
environment: environment:
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
CERC_URBIT_APP: ${CERC_URBIT_APP} CERC_URBIT_APP: ${CERC_URBIT_APP}
CERC_IPFS_GLOB_HOST_ENDPOINT: ${CERC_IPFS_GLOB_HOST_ENDPOINT:-http://ipfs-glob-host:5001} CERC_IPFS_GLOB_HOST_ENDPOINT: ${CERC_IPFS_GLOB_HOST_ENDPOINT:-http://ipfs-glob-host:5001}
CERC_IPFS_SERVER_ENDPOINT: ${CERC_IPFS_SERVER_ENDPOINT:-http://ipfs-glob-host:8080} CERC_IPFS_SERVER_ENDPOINT: ${CERC_IPFS_SERVER_ENDPOINT:-http://ipfs-glob-host:8080}
@ -13,7 +15,7 @@ services:
- urbit_data:/urbit - urbit_data:/urbit
- urbit_app_builds:/app-builds - urbit_app_builds:/app-builds
- ../config/urbit/run-urbit-ship.sh:/urbit/run-urbit-ship.sh - ../config/urbit/run-urbit-ship.sh:/urbit/run-urbit-ship.sh
- ../config/uniswap-interface/deploy-uniswap-app.sh:/urbit/deploy-app.sh - ../config/urbit/deploy-app.sh:/urbit/deploy-app.sh
ports: ports:
- "80" - "80"
healthcheck: healthcheck:
@ -23,6 +25,7 @@ services:
retries: 15 retries: 15
start_period: 10s start_period: 10s
# TODO: Refactor this outside
ipfs-glob-host: ipfs-glob-host:
image: ipfs/kubo:master-2023-02-20-714a968 image: ipfs/kubo:master-2023-02-20-714a968
volumes: volumes:

View File

@ -11,8 +11,8 @@ services:
volumes: volumes:
- ../config/uniswap-interface/build-app.sh:/app/build-app.sh - ../config/uniswap-interface/build-app.sh:/app/build-app.sh
- urbit_app_builds:/app-builds - urbit_app_builds:/app-builds
- ../config/uniswap-interface/urbit-files/mar:/app-builds/uniswap/mar - ../config/uniswap-interface/urbit-files/mar:/app/mar
- ../config/uniswap-interface/urbit-files/desk.docket-0:/app-builds/uniswap/desk.docket-0 - ../config/uniswap-interface/urbit-files/desk.docket-0:/app/desk.docket-0
volumes: volumes:
urbit_app_builds: urbit_app_builds:

View File

@ -13,6 +13,9 @@ fi
yarn build yarn build
# Move build to app-builds so urbit can deploy it # Copy over build and other files to app-builds for urbit deployment
mkdir -p /app-builds/uniswap mkdir -p /app-builds/uniswap
cp -r ./build /app-builds/uniswap/ cp -r ./build /app-builds/uniswap/
cp -r mar /app-builds/uniswap/
cp desk.docket-0 /app-builds/uniswap/

View File

@ -22,7 +22,7 @@ app_mark_files=/app-builds/${CERC_URBIT_APP}/mar
app_docket_file=/app-builds/${CERC_URBIT_APP}/desk.docket-0 app_docket_file=/app-builds/${CERC_URBIT_APP}/desk.docket-0
echo "Reading app build from ${app_build}" echo "Reading app build from ${app_build}"
echo "Reading the additional mark files from ${app_mark_files}" echo "Reading additional mark files from ${app_mark_files}"
echo "Reading docket file ${app_docket_file}" echo "Reading docket file ${app_docket_file}"
# Loop until the app's build appears # Loop until the app's build appears
@ -72,9 +72,6 @@ glob_cid=$(echo "$upload_response" | grep -o '"Hash":"[^"]*' | sed 's/"Hash":"//
echo "Glob file uploaded to IFPS:" echo "Glob file uploaded to IFPS:"
echo "{ cid: ${glob_cid}, filename: ${glob_file} }" echo "{ cid: ${glob_cid}, filename: ${glob_file} }"
# Flag to skip installation
# Exit here if the installation not required
# Curl and wait for the glob to be hosted # Curl and wait for the glob to be hosted
glob_url="${ipfs_server_endpoint}/ipfs/${glob_cid}?filename=${glob_file}" glob_url="${ipfs_server_endpoint}/ipfs/${glob_cid}?filename=${glob_file}"
@ -86,20 +83,17 @@ while true; do
echo "File found at $glob_url" echo "File found at $glob_url"
break # Exit the loop if the file is found break # Exit the loop if the file is found
else else
echo "File not found. Retrying in a few seconds..." echo "File not found, retrying in a 5s..."
sleep 5 sleep 5
fi fi
done done
glob_hash=$(echo "$glob_file" | sed "s/glob-\([a-z0-9\.]*\).glob/\1/") glob_hash=$(echo "$glob_file" | sed "s/glob-\([a-z0-9\.]*\).glob/\1/")
# Take the docket file from a volume (/app-builds/uniswap/desk.docket-0)
# Replace glob_url and glob_hash in that (refer landscape CI)
# Replace the docket file for app # Replace the docket file for app
# Substitue the glob URL and hash # Substitue the glob URL and hash
cp ${app_docket_file} ${app_desk_dir}/ cp ${app_docket_file} ${app_desk_dir}/
sed -i "s|REPLACE_WITH_GLOB_URL|${glob_url}|g; s|REPLACE_WITH_GLOB_HASH|${glob_hash}|g" desk.docket-0 sed -i "s|REPLACE_WITH_GLOB_URL|${glob_url}|g; s|REPLACE_WITH_GLOB_HASH|${glob_hash}|g" ${app_desk_dir}/desk.docket-0
# Commit changes and install the app # Commit changes and install the app
hood "commit %uniswap" hood "commit %uniswap"

View File

@ -7,11 +7,13 @@ fi
pier_dir="/urbit/zod" pier_dir="/urbit/zod"
# TODO: Bootstrap fake ship on the first run
# Run urbit ship in daemon mode # Run urbit ship in daemon mode
# Check if the directory exists # Check if the directory exists
if [ -d "$pier_dir" ]; then if [ -d "$pier_dir" ]; then
echo "Pier directory already exists, rebooting..." echo "Pier directory already exists, rebooting..."
urbit -d zod /urbit/zod/.run -d
else else
echo "Creating a new fake ship..." echo "Creating a new fake ship..."
urbit -d -F zod urbit -d -F zod

View File

@ -67,6 +67,9 @@ laconic-so --stack uniswap-urbit-app deploy create --spec-file uniswap-urbit-app
Inside the deployment directory, open the file `config.env` and set the following env variables: Inside the deployment directory, open the file `config.env` and set the following env variables:
```bash ```bash
# App to be installed (Do not change)
CERC_URBIT_APP=uniswap
# External RPC endpoints # External RPC endpoints
# https://docs.infura.io/getting-started#2-create-an-api-key # https://docs.infura.io/getting-started#2-create-an-api-key
CERC_INFURA_KEY= CERC_INFURA_KEY=

View File

@ -10,4 +10,4 @@ containers:
pods: pods:
- uniswap-interface - uniswap-interface
- proxy-server - proxy-server
- uniswap-urbit - fixturenet-urbit