Add steps to setup webapp-ui

This commit is contained in:
Adw8 2024-10-24 14:58:14 +05:30 committed by Prathamesh Musale
parent 4afb79c9ed
commit ea368e888b

View File

@ -1,12 +1,12 @@
## Set up a new service provider
Follow [these steps](https://git.vdb.to/cerc-io/testnet-ops/src/branch/main/service-provider-setup#service-provider-setup) to setup the following services (your setup will look similar to the example below):
Follow steps from <https://git.vdb.to/cerc-io/testnet-ops/src/branch/main/service-provider-setup#service-provider-setup> to setup a service provider. After setup, the following services will be running (your configuration will look similar to the examples listed below):
* laconicd chain RPC endpoint: http://lcn-daemon.laconic.com:26657
* laconicd GQL endpoint: http://lcn-daemon.laconic.com:9473/api
* laconic console: http://lcn-console.laconic.com:8080/registry
* webapp deployer API: https://webapp-deployer-api.pwa.laconic.com
* webapp deployer UI: https://webapp-deployer-ui.pwa.laconic.com
* laconicd chain RPC endpoint: http://lcn-daemon.laconic.com:26657
* laconicd GQL endpoint: http://lcn-daemon.laconic.com:9473/api
* laconic console: http://lcn-console.laconic.com:8080/registry
* webapp deployer API: https://webapp-deployer-api.pwa.laconic.com
* webapp deployer UI: https://webapp-deployer-ui.pwa.laconic.com
## Update webapp deployer after code changes
@ -184,10 +184,11 @@ Follow the steps given below to connect the webapp-deployer to testnet2
### Update laconic console config
* Stop webapp deployer backend
* Stop webapp deployer
```bash
laconic-so deployment --dir webapp-deployer stop
laconic-so deployment --dir webapp-ui stop
```
* Stop laconic-console and fixturenet-laconicd deployment
@ -206,17 +207,20 @@ Follow the steps given below to connect the webapp-deployer to testnet2
# This will be updated later
CERC_LACONICD_BOND_ID=
# RPC endpoint of the chain
CERC_LACONICD_RPC_ENDPOINT=https://laconicd-sapo.laconic.com
# RPC endpoint of the chain, can be pointed to your validator node
# eg: http://console-testnet2.laconic.com
CERC_LACONICD_RPC_ENDPOINT=
# GQL endpoint of the chain
CERC_LACONICD_GQL_ENDPOINT=https://laconicd-sapo.laconic.com/api
# GQL endpoint of the chain, can be pointed to your validator node
# eg: https://laconicd-sapo.laconic.com/api
CERC_LACONICD_GQL_ENDPOINT=
# laconicd chain id
CERC_LACONICD_CHAIN_ID=laconic_9000-2
# Endpoint for the console
LACONIC_HOSTED_ENDPOINT=https://console-sapo.laconic.com
# eg: https://laconic-console.example.com
LACONIC_HOSTED_ENDPOINT=
```
* Start the `laconic-console-deployment`
@ -319,10 +323,10 @@ Follow the steps given below to connect the webapp-deployer to testnet2
services:
registry:
# laconicd RPC endpoint
rpcEndpoint: 'https://laconicd-sapo.laconic.com'
rpcEndpoint:
# laconicd GQL endpoint
gqlEndpoint: 'https://laconicd-sapo.laconic.com/api'
gqlEndpoint:
# Key to your funded account
userKey:
@ -336,16 +340,46 @@ Follow the steps given below to connect the webapp-deployer to testnet2
fees: 500000alnt
```
* Publish the webapp deployer record using the publish-deployer-to-registry command
* Publish the webapp deployer record on the chain
```bash
laconic-so publish-deployer-to-registry \
--laconic-config webapp-deployer/data/config/laconic.yml \
--api-url <api-url-for-your-deployer>
--public-key-file <path-to-your-gpg-pub-key> \
--lrn <lrn-for-your-deployer> \
--min-required-payment 0
```
* Set the following variables
```bash
# Path to the webapp-deployer directory, e.g., /home/dev..
DEPLOYER_DIR=
# API URL of the webapp-deployer
API_URL=
# LRN (logical resource name) of the webapp-deployer
DEPLOYER_LRN=
# Name of the GPG public key file
GPG_PUB_KEY_FILE=
# Path of the GPG public key file
GPG_PUB_KEY_FILE_PATH=
```
* Copy the GPG pub key file used while setting up the webapp-deployer to the `webapp-deployer/data/config` directory. This ensures the Docker container has access to the key during the publish process.
```bash
cp $GPG_PUB_KEY_FILE_PATH webapp-deployer/data/config
```
* Publish the deployer record
```bash
docker run -i -t \
-v $DEPLOYER_DIR/data/config:/home/root/config \
cerc/webapp-deployer-backend:local laconic-so publish-deployer-to-registry \
--laconic-config /home/root/config/laconic.yml \
--api-url $API_URL \
--public-key-file /home/root/config/$GPG_PUB_KEY_FILE \
--lrn $DEPLOYER_LRN \
--min-required-payment 0
```
<details open>
<summary>Update config for webapp deployer</summary>
### Update config for webapp deployer
* Update `webapp-deployer/config.env` with the authority that you reserved
@ -353,6 +387,15 @@ Follow the steps given below to connect the webapp-deployer to testnet2
# Name of reserved authority
DEPLOYMENT_RECORD_NAMESPACE="<authority_name>"
```
* Update `webapp-ui/config.env` with the updated endpoints
```bash
# api url of webapp deployer
LACONIC_HOSTED_CONFIG_app_api_url=
# url of laconic console
LACONIC_HOSTED_CONFIG_app_console_link=http://console-sapo.laconic.com
```
</details>
<details open>
@ -360,29 +403,47 @@ Follow the steps given below to connect the webapp-deployer to testnet2
### Start the deployer
* Start the webapp deployer
* Start the webapp deployer backend
```bash
laconic-so deployment --dir webapp-deployer start
```
* Get the most recent pod id
* Get the most recent pod id
```bash
kubie ctx default
kubectl get pods
```
* Copy the GPG key file to the webapp-deployer container
```bash
# Get the webapp-deployer pod id
kubectl get pods --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1].metadata.name}'
# laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs
# Copy the GPG key files to the pod
kubectl cp <path-to-your-gpg-private-key> laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs:/app
kubectl cp <path-to-your-gpg-public-key> laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs:/app
```
* Check logs
```bash
laconic-so deployment --dir webapp-deployer logs cerc-webapp-deployer
```
* Start the webapp deployer ui
```bash
kubie ctx default
kubectl get pods
laconic-so deployment --dir webapp-ui start
```
* Copy the GPG key file to the webapp-deployer container
* Check logs
```bash
# Get the webapp-deployer pod id
kubectl get pods --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1].metadata.name}'
# laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs
# Copy the GPG key files to the pod
kubectl cp <path-to-your-gpg-private-key> laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs:/app
kubectl cp <path-to-your-gpg-public-key> laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs:/app
```
```bash
laconic-so deployment --dir webapp-ui logs webapp
```
</details>