From ea368e888b35485833c715588e6a01b269646f1f Mon Sep 17 00:00:00 2001 From: Adw8 Date: Thu, 24 Oct 2024 14:58:14 +0530 Subject: [PATCH] Add steps to setup webapp-ui --- service-provider.md | 135 ++++++++++++++++++++++++++++++++------------ 1 file changed, 98 insertions(+), 37 deletions(-) diff --git a/service-provider.md b/service-provider.md index bef71d0..af126e2 100644 --- a/service-provider.md +++ b/service-provider.md @@ -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 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 - --public-key-file \ - --lrn \ - --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 + ``` + +
+ Update config for webapp deployer + +### 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="" ``` + +* 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 + ```
@@ -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 laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs:/app + kubectl cp 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 laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs:/app - kubectl cp laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs:/app - ``` + ```bash + laconic-so deployment --dir webapp-ui logs webapp + ```