From 29faefca2f402cdab44eb367ed36dcf1f1c1fcf3 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Mon, 21 Oct 2024 19:06:16 +0530 Subject: [PATCH 01/11] Add steps to connect webapp deployer to stage2 laconicd --- ops/update-deployments.md | 212 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 212 insertions(+) diff --git a/ops/update-deployments.md b/ops/update-deployments.md index 3bfd3b1..5b31d33 100644 --- a/ops/update-deployments.md +++ b/ops/update-deployments.md @@ -254,3 +254,215 @@ Instructions to reset / update the deployments ``` * The laconic console can now be viewed at + +## Connect webapp-deployer with stage2 laconicd chain + +Follow the steps given below to connect the webapp-deployer to stage2 laconicd + +
+ Update laconic console config + +### Update laconic console config + +* Stop webapp deployer backend + + ```bash + laconic-so deployment --dir webapp-deployer stop + ``` + +* Stop laconic-console and fixturenet-laconicd deployment + + ```bash + laconic-so deployment --dir fixturenet-laconicd-deployment stop + laconic-so deployment --dir laconic-console-deployment stop + ``` + +* Update `laconic-console-deployment/config.env` with the following config + + ```bash + # private key to your funded account + CERC_LACONICD_USER_KEY= + + # This will be updated later + CERC_LACONICD_BOND_ID= + + # RPC endpoint of the chain + CERC_LACONICD_RPC_ENDPOINT=https://laconicd.laconic.com + + # GQL endpoint of the chain + CERC_LACONICD_GQL_ENDPOINT=https://laconicd.laconic.com/api + + # laconicd chain id + CERC_LACONICD_CHAIN_ID=laconic_9000-2 + + # Endpoint for the console + LACONIC_HOSTED_ENDPOINT=https://laconicd.laconic.com + ``` + +* Start the `laconic-console-deployment`: + + ```bash + laconic-so deployment --dir laconic-console-deployment start + ``` +
+ +
+ Register an authority + +### Register an authority + +* Create a bond + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry bond create --type alnt --quantity 100000000000" + # {"bondId":"a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3"} + ``` + +* Register an authority + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority reserve " + ``` + +* Obtain the auction ID + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority whois " + # "auction": { + # "id": "73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1" + ``` + +* Commit a bid using the auction ID. A reveal file will be generated + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction bid commit 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 5000000 alnt --chain-id laconic_9000-2" + + # {"reveal_file":"/app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json"} + ``` + +* Reveal a bid using the auction ID and the reveal file generated from the bid commit + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction bid reveal 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 /app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json --chain-id laconic_9000-2" + # {"success": true} + ``` + +* Verify status after the auction ends. It should list a completed status and a winner + + ``` + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction get 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1" + ``` + +* Set the authority using a bond ID. + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority bond set a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3" + # {"success": true} + ``` + +* Verify the authority has been registered. + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority whois " + ``` + +* Stop the laconic-console-deployment + + ```bash + laconic-so deployment --dir laconic-console-deployment stop + ``` + +* Update `CERC_LACONICD_BOND_ID` in `laconic-console-deployment/config.env` with the bond that was created + + ```bash + ... + CERC_LACONICD_BOND_ID=a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3 + ... + ``` + +* Start the `laconic-console-deployment`: + + ```bash + laconic-so deployment --dir laconic-console-deployment start + ``` + +
+ +
+ Publish record for webapp-deployer + +### Publish record for webapp-deployer + +* Update `webapp-deployer/data/config/laconic.yml` with the + + ```bash + services: + registry: + # laconicd RPC endpoint + rpcEndpoint: 'https://laconicd.laconic.com' + + # laconicd GQL endpoint + gqlEndpoint: 'https://laconicd.laconic.com/api' + + # Key to your funded account + userKey: + + # bondId that you just created + bondId: a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3 + + # laconicd chain id + chainId: laconic_9000-2 + gas: 200000 + fees: 500000alnt + ``` + +* Publish the webapp deployer record using the publish-deployer-to-registry command + + ```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 + ``` + +* Update `webapp-deployer/config.env` with the authority that you reserved + + ```bash + # Name of reserved authority + DEPLOYMENT_RECORD_NAMESPACE="" + ``` +
+ +
+ Start the deployer + +### Start the deployer + +* Start the webapp deployer + + ```bash + laconic-so deployment --dir webapp-deployer start + ``` + +* 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 + ``` + +
-- 2.45.2 From 65ba2fd5cfda66158153da820b7a9e1dae4cd705 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Tue, 22 Oct 2024 19:02:11 +0530 Subject: [PATCH 02/11] Add steps to update webapp deployer after code changes --- ops/update-deployments.md | 212 ------------------- ops/update-webapp-deployer.md | 377 ++++++++++++++++++++++++++++++++++ 2 files changed, 377 insertions(+), 212 deletions(-) create mode 100644 ops/update-webapp-deployer.md diff --git a/ops/update-deployments.md b/ops/update-deployments.md index 5b31d33..3bfd3b1 100644 --- a/ops/update-deployments.md +++ b/ops/update-deployments.md @@ -254,215 +254,3 @@ Instructions to reset / update the deployments ``` * The laconic console can now be viewed at - -## Connect webapp-deployer with stage2 laconicd chain - -Follow the steps given below to connect the webapp-deployer to stage2 laconicd - -
- Update laconic console config - -### Update laconic console config - -* Stop webapp deployer backend - - ```bash - laconic-so deployment --dir webapp-deployer stop - ``` - -* Stop laconic-console and fixturenet-laconicd deployment - - ```bash - laconic-so deployment --dir fixturenet-laconicd-deployment stop - laconic-so deployment --dir laconic-console-deployment stop - ``` - -* Update `laconic-console-deployment/config.env` with the following config - - ```bash - # private key to your funded account - CERC_LACONICD_USER_KEY= - - # This will be updated later - CERC_LACONICD_BOND_ID= - - # RPC endpoint of the chain - CERC_LACONICD_RPC_ENDPOINT=https://laconicd.laconic.com - - # GQL endpoint of the chain - CERC_LACONICD_GQL_ENDPOINT=https://laconicd.laconic.com/api - - # laconicd chain id - CERC_LACONICD_CHAIN_ID=laconic_9000-2 - - # Endpoint for the console - LACONIC_HOSTED_ENDPOINT=https://laconicd.laconic.com - ``` - -* Start the `laconic-console-deployment`: - - ```bash - laconic-so deployment --dir laconic-console-deployment start - ``` -
- -
- Register an authority - -### Register an authority - -* Create a bond - - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry bond create --type alnt --quantity 100000000000" - # {"bondId":"a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3"} - ``` - -* Register an authority - - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority reserve " - ``` - -* Obtain the auction ID - - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority whois " - # "auction": { - # "id": "73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1" - ``` - -* Commit a bid using the auction ID. A reveal file will be generated - - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction bid commit 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 5000000 alnt --chain-id laconic_9000-2" - - # {"reveal_file":"/app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json"} - ``` - -* Reveal a bid using the auction ID and the reveal file generated from the bid commit - - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction bid reveal 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 /app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json --chain-id laconic_9000-2" - # {"success": true} - ``` - -* Verify status after the auction ends. It should list a completed status and a winner - - ``` - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction get 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1" - ``` - -* Set the authority using a bond ID. - - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority bond set a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3" - # {"success": true} - ``` - -* Verify the authority has been registered. - - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority whois " - ``` - -* Stop the laconic-console-deployment - - ```bash - laconic-so deployment --dir laconic-console-deployment stop - ``` - -* Update `CERC_LACONICD_BOND_ID` in `laconic-console-deployment/config.env` with the bond that was created - - ```bash - ... - CERC_LACONICD_BOND_ID=a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3 - ... - ``` - -* Start the `laconic-console-deployment`: - - ```bash - laconic-so deployment --dir laconic-console-deployment start - ``` - -
- -
- Publish record for webapp-deployer - -### Publish record for webapp-deployer - -* Update `webapp-deployer/data/config/laconic.yml` with the - - ```bash - services: - registry: - # laconicd RPC endpoint - rpcEndpoint: 'https://laconicd.laconic.com' - - # laconicd GQL endpoint - gqlEndpoint: 'https://laconicd.laconic.com/api' - - # Key to your funded account - userKey: - - # bondId that you just created - bondId: a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3 - - # laconicd chain id - chainId: laconic_9000-2 - gas: 200000 - fees: 500000alnt - ``` - -* Publish the webapp deployer record using the publish-deployer-to-registry command - - ```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 - ``` - -* Update `webapp-deployer/config.env` with the authority that you reserved - - ```bash - # Name of reserved authority - DEPLOYMENT_RECORD_NAMESPACE="" - ``` -
- -
- Start the deployer - -### Start the deployer - -* Start the webapp deployer - - ```bash - laconic-so deployment --dir webapp-deployer start - ``` - -* 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 - ``` - -
diff --git a/ops/update-webapp-deployer.md b/ops/update-webapp-deployer.md new file mode 100644 index 0000000..23a8f84 --- /dev/null +++ b/ops/update-webapp-deployer.md @@ -0,0 +1,377 @@ +## Update webapp deployer after code changes + +* Stop the deployer + + ```bash + cd + laconic-so deployment --dir webapp-deployer stop + laconic-so deployment --dir webapp-ui stop + ``` + +* Fetch and build webapp deployer backend if the source code has changed + + ```bash + # Update code for webapp-deployer backend + cd ~/cerc/webapp-deployment-status-api + + # Pull latest changes, or checkout to the required branch + git pull + + # Confirm the latest commit hash + git log + + # Rebuild the containers + laconic-so --stack webapp-deployer-backend build-containers --force-rebuild + ``` + +* Fetch and build webapp-ui if the source code has changed + + ```bash + # Update code for webapp-deployer backend + cd ~/cerc/webapp-deployment-status-ui + + # Pull latest changes, or checkout to the required branch + git pull + + # Confirm the latest commit hash + git log + + # Rebuild the containers + laconic-so build-webapp --source-repo ~/cerc/webapp-deployment-status-ui --force-rebuild + cd + ``` + +* Push images to the container registry + + * login to the container registry + + ```bash + # Set required variables + CONTAINER_REGISTRY_URL= + CONTAINER_REGISTRY_USERNAME= + CONTAINER_REGISTRY_PASSWORD= + + # login to container registry + docker login $CONTAINER_REGISTRY_URL --username $CONTAINER_REGISTRY_USERNAME --password $CONTAINER_REGISTRY_PASSWORD + + # WARNING! Using --password via the CLI is insecure. Use --password-stdin. + # WARNING! Your password will be stored unencrypted in /home/dev2/.docker/config.json. + # Configure a credential helper to remove this warning. See + # https://docs.docker.com/engine/reference/commandline/login/#credential-stores + + # Login Succeeded + ``` + + * Push images to container registry + + ```bash + laconic-so deployment --dir webapp-deployer push-images + laconic-so deployment --dir webapp-ui push-images + ``` + +* Update `webapp-deployer/data/config/laconic.yml` with the new endpoints + + ```bash + services: + registry: + rpcEndpoint: 'https://laconicd-sapo.laconic.com' + gqlEndpoint: 'https://laconicd-sapo.laconic.com/api' + userKey: "" + bondId: " laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs:/app + kubectl cp laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs:/app + ``` + +* Update the webapp ui config + + ```bash + # URL of the webapp deployer backend + LACONIC_HOSTED_CONFIG_app_api_url= + # URL of the laconic console + LACONIC_HOSTED_CONFIG_app_console_link=https://console-sapo.laconic.com + ``` + +* Start the webapp ui + + ```bash + laconic-so deployment --dir webapp-ui start + ``` + +## Connect webapp-deployer to testnet2 + +Follow the steps given below to connect the webapp-deployer to testnet2 + +
+ Update laconic console config + +### Update laconic console config + +* Stop webapp deployer backend + + ```bash + laconic-so deployment --dir webapp-deployer stop + ``` + +* Stop laconic-console and fixturenet-laconicd deployment + + ```bash + laconic-so deployment --dir fixturenet-laconicd-deployment stop + laconic-so deployment --dir laconic-console-deployment stop + ``` + +* Update `laconic-console-deployment/config.env` with the following config + + ```bash + # private key to your funded account + CERC_LACONICD_USER_KEY= + + # This will be updated later + CERC_LACONICD_BOND_ID= + + # RPC endpoint of the chain + CERC_LACONICD_RPC_ENDPOINT=https://laconicd-sapo.laconic.com + + # GQL endpoint of the chain + CERC_LACONICD_GQL_ENDPOINT=https://laconicd-sapo.laconic.com/api + + # laconicd chain id + CERC_LACONICD_CHAIN_ID=laconic_9000-2 + + # Endpoint for the console + LACONIC_HOSTED_ENDPOINT=https://console-sapo.laconic.com + ``` + +* Start the `laconic-console-deployment` + + ```bash + laconic-so deployment --dir laconic-console-deployment start + ``` +
+ +
+ Register an authority + +### Register an authority + +* Create a bond + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry bond create --type alnt --quantity 100000000000" + # {"bondId":"a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3"} + ``` + +* Register an authority + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority reserve " + ``` + +* Obtain the auction ID + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority whois " + # "auction": { + # "id": "73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1" + ``` + +* Commit a bid using the auction ID. A reveal file will be generated + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction bid commit 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 5000000 alnt --chain-id laconic_9000-2" + + # {"reveal_file":"/app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json"} + ``` + +* Reveal a bid using the auction ID and the reveal file generated from the bid commit + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction bid reveal 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 /app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json --chain-id laconic_9000-2" + # {"success": true} + ``` + +* Verify status after the auction ends. It should list a completed status and a winner + + ``` + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction get 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1" + ``` + +* Set the authority using a bond ID. + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority bond set a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3" + # {"success": true} + ``` + +* Verify the authority has been registered. + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority whois " + ``` + +* Stop the laconic-console-deployment + + ```bash + laconic-so deployment --dir laconic-console-deployment stop + ``` + +* Update `CERC_LACONICD_BOND_ID` in `laconic-console-deployment/config.env` with the bond that was created + + ```bash + ... + CERC_LACONICD_BOND_ID=a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3 + ... + ``` + +* Start the `laconic-console-deployment` + + ```bash + laconic-so deployment --dir laconic-console-deployment start + ``` + +
+ +
+ Publish record for webapp-deployer + +### Publish record for webapp-deployer + +* Update `webapp-deployer/data/config/laconic.yml` with the + + ```bash + services: + registry: + # laconicd RPC endpoint + rpcEndpoint: 'https://laconicd-sapo.laconic.com' + + # laconicd GQL endpoint + gqlEndpoint: 'https://laconicd-sapo.laconic.com/api' + + # Key to your funded account + userKey: + + # bondId that you just created + bondId: a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3 + + # laconicd chain id + chainId: laconic_9000-2 + gas: 200000 + fees: 500000alnt + ``` + +* Publish the webapp deployer record using the publish-deployer-to-registry command + + ```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 + ``` + +* Update `webapp-deployer/config.env` with the authority that you reserved + + ```bash + # Name of reserved authority + DEPLOYMENT_RECORD_NAMESPACE="" + ``` +
+ +
+ Start the deployer + +### Start the deployer + +* Start the webapp deployer + + ```bash + laconic-so deployment --dir webapp-deployer start + ``` + +* 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 + ``` + +
-- 2.45.2 From ce04117d8ee887ae9911f3cf12ac50455d66741d Mon Sep 17 00:00:00 2001 From: Adw8 Date: Wed, 23 Oct 2024 17:44:58 +0530 Subject: [PATCH 03/11] Add steps for setting up a service provider --- ops/update-webapp-deployer.md => service-provider.md | 11 +++++++++++ 1 file changed, 11 insertions(+) rename ops/update-webapp-deployer.md => service-provider.md (94%) diff --git a/ops/update-webapp-deployer.md b/service-provider.md similarity index 94% rename from ops/update-webapp-deployer.md rename to service-provider.md index 23a8f84..bef71d0 100644 --- a/ops/update-webapp-deployer.md +++ b/service-provider.md @@ -1,3 +1,14 @@ +## 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): + +* 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 * Stop the deployer -- 2.45.2 From 50df9a2b363dabed571bc1fe9bf827d9629710f8 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Thu, 24 Oct 2024 14:58:14 +0530 Subject: [PATCH 04/11] 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 + ```
-- 2.45.2 From 4b31a4b7c0d94d213858a46774d201d759e21dc4 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Fri, 25 Oct 2024 15:20:12 +0530 Subject: [PATCH 05/11] Remove build containers step for webapp ui --- service-provider.md | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/service-provider.md b/service-provider.md index af126e2..2dbbe2f 100644 --- a/service-provider.md +++ b/service-provider.md @@ -9,7 +9,7 @@ Follow steps from - ``` - * Push images to the container registry * login to the container registry @@ -77,7 +60,6 @@ Follow steps from " bondId: " Date: Mon, 28 Oct 2024 11:18:20 +0530 Subject: [PATCH 06/11] Update command to get webapp deployer pod id --- service-provider.md | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/service-provider.md b/service-provider.md index 2dbbe2f..847a90e 100644 --- a/service-provider.md +++ b/service-provider.md @@ -8,7 +8,6 @@ Follow steps from @@ -389,24 +388,28 @@ Follow the steps given below to connect the webapp-deployer to testnet2 laconic-so deployment --dir webapp-deployer start ``` - * Get the most recent pod id +* Get the webapp-deployer pod id - ```bash - kubie ctx default - kubectl get pods - ``` + ```bash + laconic-so deployment --dir webapp-deployer ps - * Copy the GPG key file to the webapp-deployer container + # Expected output + # Running containers: + # id: default/laconic-096fed46af974a47-deployment-644db859c7-snbq6, name: laconic-096fed46af974a47-deployment-644db859c7-snbq6, ports: 10.42.2.11:9555->9555 - ```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 + # Set pod id + export POD_ID= + # Example: + # export POD_ID=laconic-096fed46af974a47-deployment-644db859c7-snbq6 + ``` - # Copy the GPG key files to the pod - kubectl cp laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs:/app - kubectl cp laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs:/app - ``` +* Copy the GPG key file to the webapp-deployer container + + ```bash + # Copy the GPG key files to the pod + kubectl cp POD_ID:/app + kubectl cp POD_ID:/app + ```` * Check logs -- 2.45.2 From 025b5907f468a2ac8a9cb4c10ed7b4d72515fb44 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Tue, 29 Oct 2024 18:36:17 +0530 Subject: [PATCH 07/11] Remove redundant steps --- service-provider.md | 117 +++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 72 deletions(-) diff --git a/service-provider.md b/service-provider.md index 847a90e..2b8eb7e 100644 --- a/service-provider.md +++ b/service-provider.md @@ -36,7 +36,7 @@ Follow steps from 9555 + + # Set pod id + export POD_ID= + # Example: + # export POD_ID=laconic-096fed46af974a47-deployment-644db859c7-snbq6 + ``` + * 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 + kubectl cp $POD_ID:/app + kubectl cp $POD_ID:/app ``` -* Update the webapp ui config + * Check logs + + ```bash + laconic-so deployment --dir webapp-deployer logs cerc-webapp-deployer + ``` + +* Update `webapp-ui/config.env` ```bash # URL of the webapp deployer backend @@ -155,6 +177,12 @@ Follow steps from Update config for webapp deployer @@ -407,8 +380,8 @@ Follow the steps given below to connect the webapp-deployer to testnet2 ```bash # Copy the GPG key files to the pod - kubectl cp POD_ID:/app - kubectl cp POD_ID:/app + kubectl cp $POD_ID:/app + kubectl cp $POD_ID:/app ```` * Check logs -- 2.45.2 From 1d685103e83a2b7909835261cc7d6423a58475d4 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Tue, 29 Oct 2024 18:53:58 +0530 Subject: [PATCH 08/11] Add examples for variables --- service-provider.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/service-provider.md b/service-provider.md index 2b8eb7e..be9a423 100644 --- a/service-provider.md +++ b/service-provider.md @@ -40,8 +40,11 @@ Follow steps from Date: Wed, 30 Oct 2024 11:53:37 +0530 Subject: [PATCH 09/11] Add pointer to service provider docs in root README --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c1775e..f62409e 100644 --- a/README.md +++ b/README.md @@ -24,4 +24,8 @@ Follow steps in [Upgrade to SAPO testnet](./testnet-onboarding-validator.md#upgr ## Run testnet Nitro Node -Follow steps in [testnet-nitro-node.md](./testnet-nitro-node.md) to run you Nitro node for the testnet +Follow steps in [testnet-nitro-node.md](./testnet-nitro-node.md) to run your Nitro node for the testnet + +## Set up a Service provider + +Follow steps from [service-provider.md](./service-provider.md) to set up a service provider -- 2.45.2 From 52dfef9f45c13e8eba4b0bc859cfd2d673166959 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 30 Oct 2024 12:35:39 +0530 Subject: [PATCH 10/11] Update service provider instructions --- README.md | 4 +- service-provider.md | 536 +++++++++--------- .../stacks/laconic-console/README.md | 4 +- 3 files changed, 262 insertions(+), 282 deletions(-) diff --git a/README.md b/README.md index f62409e..bd2154d 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,6 @@ Follow steps in [Upgrade to SAPO testnet](./testnet-onboarding-validator.md#upgr Follow steps in [testnet-nitro-node.md](./testnet-nitro-node.md) to run your Nitro node for the testnet -## Set up a Service provider +## Setup a Service Provider -Follow steps from [service-provider.md](./service-provider.md) to set up a service provider +Follow steps in [service-provider.md](./service-provider.md) to setup / update your service provider diff --git a/service-provider.md b/service-provider.md index be9a423..07b76d0 100644 --- a/service-provider.md +++ b/service-provider.md @@ -1,50 +1,219 @@ +# Service Provider + +* Follow [Set up a new service provider](#set-up-a-new-service-provider) to setup a new service provider (SP) +* If you already have a SP setup for stage1, follow [Update service provider for SAPO testnet](#update-service-provider-for-sapo-testnet) to update it for testnet2 + ## Set up a new service provider -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): +Follow steps from [service-provider-setup](). After setup, you will have the following services 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: +* laconicd GQL endpoint: +* laconic console: +* webapp deployer API: +* webapp deployer UI: -## Update webapp deployer +Follow the steps below to point your deployer to the SAPO testnet -* Stop the deployer +## Update service provider for SAPO testnet + +### Prerequisites + +* A SAPO testnet node (see [Join SAPO testnet](./README.md#join-sapo-testnet)) + +### Stop services + +* Stop a laconic-console deployment: ```bash - cd + # In directory where laconic-console deployment was created + laconic-so deployment --dir laconic-console-deployment stop --delete-volumes + ``` + +* Stop webapp deployer: + + ```bash + # In directory where webapp-deployer deployment was created laconic-so deployment --dir webapp-deployer stop laconic-so deployment --dir webapp-ui stop ``` -* Fetch and build webapp deployer backend +### Update laconic console + +* Remove an existing console deployment: ```bash - # Update code for webapp-deployer backend - cd ~/cerc/webapp-deployment-status-api + # In directory where laconic-console deployment was created + # Backup the config if required + rm -rf laconic-console-deployment + ``` - # Pull latest changes, or checkout to the required branch - git pull +* Follow [laconic-console](stack-orchestrator/stacks/laconic-console/README.md) stack instructions to setup a new laconic-console deployment - # Confirm the latest commit hash - git log +* Example configuration: - # Rebuild the containers + ```bash + # CLI configuration + + # laconicd RPC endpoint (can be pointed to your node) + CERC_LACONICD_RPC_ENDPOINT=https://laconicd-sapo.laconic.com + + # laconicd GQL endpoint (can be pointed to your node) + CERC_LACONICD_GQL_ENDPOINT=https://laconicd-sapo.laconic.com/api + + CERC_LACONICD_CHAIN_ID=laconic-testnet-2 + + # your private key + CERC_LACONICD_USER_KEY= + + # your bond id (optional) + CERC_LACONICD_BOND_ID= + + # Gas price to use for txs (default: 0.001alnt) + # Use for auto fees calculation, gas and fees not required to be set in that case + # Reference: https://git.vdb.to/cerc-io/laconic-registry-cli#gas-and-fees + CERC_LACONICD_GASPRICE= + + # Console configuration + + # Laconicd (hosted) GQL endpoint (can be pointed to your node) + LACONIC_HOSTED_ENDPOINT=https://laconicd-sapo.laconic.com + ``` + +### Check authority and deployer record + +* The stage1 testnet state has been carried over to testnet2, if you had authority and records on stage1, they should be present in testnet2 as well + +* Check authority: + + ```bash + # In directory where laconic-console deployment was created + AUTHORITY= + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority whois $AUTHORITY" + ``` + +* Check deployer record: + + ```bash + PAYMENT_ADDRESS= + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type WebappDeployer --paymentAddress $PAYMENT_ADDRESS" + ``` + +### (Optional) Reserve a new authority + +* Follow steps if you want to reserve a new authority + +* Create a bond: + + ```bash + # An existing bond can also be used + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry bond create --type alnt --quantity 100000000000" + # {"bondId":"a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3"} + + # Set bond id + BOND_ID= + ``` + +* Reserve an authority: + + ```bash + AUTHORITY= + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority reserve $AUTHORITY" + + # Triggers an authority auction + ``` + +* Obtain the authority auction id: + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority whois $AUTHORITY" + # "auction": { + # "id": "73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1" + + # Set auction id + AUCTION_ID= + ``` + +* Commit a bid to the auction: + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction bid commit $AUCTION_ID 5000000 alnt --chain-id laconic-testnet-2" + + # {"reveal_file":"/app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json"} + + # Set reveal file + REVEAL_FILE= + + # Wait for the auction to move from commit to reveal phase + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction get $AUCTION_ID" + ``` + +* Reveal your bid using reveal file generated while commiting the bid: + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction bid reveal $AUCTION_ID $REVEAL_FILE --chain-id laconic-testnet-2" + # {"success": true} + ``` + +* Verify auction status and winner address after auction completion: + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction get $AUCTION_ID" + ``` + +* Set the authority with a bond: + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority bond set $AUTHORITY $BOND_ID" + # {"success": true} + ``` + +* Verify the authority has been registered: + + ```bash + laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority whois $AUTHORITY" + ``` + +* Update laconic-console-deployment config (`laconic-console-deployment/config.env`) with created bond: + + ```bash + ... + CERC_LACONICD_BOND_ID=a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3 + ... + ``` + +* Restart the console deployment: + + ```bash + laconic-so deployment --dir laconic-console-deployment stop && laconic-so deployment --dir laconic-console-deployment start + ``` + +### Update webapp deployer + +* Fetch latest stack repos: + + ```bash + # In directory where webapp-deployer deployment was created + laconic-so --stack webapp-deployer-backend setup-repositories --pull + + # Confirm latest commit hash in the ~/cerc/webapp-deployment-status-api repo + ``` + +* Rebuild container images: + + ```bash laconic-so --stack webapp-deployer-backend build-containers --force-rebuild ``` -* Push images to the container registry +* Push stack images to the container registry: - * Login to the container registry + * Login to the container registry: ```bash # Set required variables # eg: container-registry.pwa.laconic.com CONTAINER_REGISTRY_URL= - # eg: dev CONTAINER_REGISTRY_USERNAME= - # eg: password CONTAINER_REGISTRY_PASSWORD= # login to container registry @@ -58,13 +227,13 @@ Follow steps from $POD_ID:/app kubectl cp $POD_ID:/app + + # Required everytime you stop and start the deployer ``` - * Check logs - - ```bash - laconic-so deployment --dir webapp-deployer logs cerc-webapp-deployer - ``` - -* Update `webapp-ui/config.env` +* Check logs: ```bash - # URL of the webapp deployer backend + # Deployer + kubectl logs -f $POD_ID + + # Deployer auction handler + kubectl logs -f $POD_ID -c cerc-webapp-auction-handler + ``` + +* Update deployer UI config (`webapp-ui/config.env`): + + ```bash + # URL of the webapp deployer backend API # eg: https://webapp-deployer-api.pwa.laconic.com LACONIC_HOSTED_CONFIG_app_api_url= + # URL of the laconic console LACONIC_HOSTED_CONFIG_app_console_link=https://console-sapo.laconic.com ``` -* Start the webapp ui +* Start the webapp UI: ```bash laconic-so deployment --dir webapp-ui start ``` - * Check logs - - ```bash - laconic-so deployment --dir webapp-ui logs webapp -f - ``` - -## Connect webapp-deployer to testnet2 - -Follow the steps given below to connect the webapp-deployer to testnet2 - -
- Update laconic console config - -### Update laconic console config - -* Stop webapp deployer +* Check logs ```bash - laconic-so deployment --dir webapp-deployer stop - laconic-so deployment --dir webapp-ui stop + laconic-so deployment --dir webapp-ui logs webapp ``` - -* Stop laconic-console and fixturenet-laconicd deployment - - ```bash - laconic-so deployment --dir fixturenet-laconicd-deployment stop - laconic-so deployment --dir laconic-console-deployment stop - ``` - -* Update `laconic-console-deployment/config.env` with the following config - - ```bash - # private key to your funded account - CERC_LACONICD_USER_KEY= - - # This will be updated later - CERC_LACONICD_BOND_ID= - - # RPC endpoint of the chain, can be pointed to your validator node - # eg: https://laconicd-sapo.laconic.com - CERC_LACONICD_RPC_ENDPOINT= - - # 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-testnet-2 - - # Endpoint for the console - # eg: https://laconic-console.example.com - LACONIC_HOSTED_ENDPOINT= - ``` - Note: Follow steps from [Join as a validator on stage1](./testnet-onboarding-validator.md#join-as-a-validator-on-stage1) to setup your validator node - -* Start the `laconic-console-deployment` - - ```bash - laconic-so deployment --dir laconic-console-deployment start - ``` -
- -
- Register an authority - -### Register an authority - -* Create a bond - - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry bond create --type alnt --quantity 100000000000" - # {"bondId":"a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3"} - ``` - -* Register an authority - - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority reserve " - ``` - -* Obtain the auction ID - - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority whois " - # "auction": { - # "id": "73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1" - ``` - -* Commit a bid using the auction ID. A reveal file will be generated - - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction bid commit 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 5000000 alnt --chain-id laconic-testnet-2" - - # {"reveal_file":"/app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json"} - ``` - -* Reveal a bid using the auction ID and the reveal file generated from the bid commit - - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction bid reveal 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 /app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json --chain-id laconic-testnet-2" - # {"success": true} - ``` - -* Verify status after the auction ends. It should list a completed status and a winner - - ``` - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction get 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1" - ``` - -* Set the authority using a bond ID. - - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority bond set a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3" - # {"success": true} - ``` - -* Verify the authority has been registered. - - ```bash - laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority whois " - ``` - -* Stop the laconic-console-deployment - - ```bash - laconic-so deployment --dir laconic-console-deployment stop - ``` - -* Update `CERC_LACONICD_BOND_ID` in `laconic-console-deployment/config.env` with the bond that was created - - ```bash - ... - CERC_LACONICD_BOND_ID=a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3 - ... - ``` - -* Start the `laconic-console-deployment` - - ```bash - laconic-so deployment --dir laconic-console-deployment start - ``` - -
- -
- Publish record for webapp-deployer - -### Publish record for webapp-deployer - -Follow steps from [Update webapp deployer](#update-webapp-deployer) to publish the deployer record to the chain - -
- Update config for webapp deployer - -### Update config for webapp deployer - -* Update `webapp-deployer/config.env` with the authority that you reserved - - ```bash - # Name of reserved authority - DEPLOYMENT_RECORD_NAMESPACE="" - ``` - -* Update `webapp-ui/config.env` with the updated endpoints - - ```bash - # api url of webapp deployer - # eg: https://webapp-deployer-api.pwa.laconic.com - LACONIC_HOSTED_CONFIG_app_api_url= - # url of laconic console - LACONIC_HOSTED_CONFIG_app_console_link=https://console-sapo.laconic.com - ``` -
- -
- Start the deployer - -### Start the deployer - -* Start the webapp deployer backend - - ```bash - laconic-so deployment --dir webapp-deployer start - ``` - -* Get the webapp-deployer pod id - - ```bash - laconic-so deployment --dir webapp-deployer ps - - # Expected output - # Running containers: - # id: default/laconic-096fed46af974a47-deployment-644db859c7-snbq6, name: laconic-096fed46af974a47-deployment-644db859c7-snbq6, ports: 10.42.2.11:9555->9555 - - # Set pod id - export POD_ID= - # Example: - # export POD_ID=laconic-096fed46af974a47-deployment-644db859c7-snbq6 - ``` - -* Copy the GPG key file to the webapp-deployer container - - ```bash - # Copy the GPG key files to the pod - kubectl cp $POD_ID:/app - kubectl cp $POD_ID:/app - ```` - - * Check logs - - ```bash - laconic-so deployment --dir webapp-deployer logs cerc-webapp-deployer - ``` - -* Start the webapp deployer ui - - ```bash - laconic-so deployment --dir webapp-ui start - ``` - - * Check logs - - ```bash - laconic-so deployment --dir webapp-ui logs webapp - ``` - -
diff --git a/stack-orchestrator/stacks/laconic-console/README.md b/stack-orchestrator/stacks/laconic-console/README.md index 0a7793f..5ac5d95 100644 --- a/stack-orchestrator/stacks/laconic-console/README.md +++ b/stack-orchestrator/stacks/laconic-console/README.md @@ -17,13 +17,13 @@ Instructions for running laconic registry CLI and console * Clone required repositories: ```bash - laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console setup-repositories + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console setup-repositories --pull ``` * Build the container images: ```bash - laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers --force-rebuild ``` This should create the following docker images locally: -- 2.45.2 From e31d311bb543f9069cc80ae972de693c8ba30416 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 30 Oct 2024 18:32:52 +0530 Subject: [PATCH 11/11] Remove hardcoded example bond id --- README.md | 2 +- service-provider.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bd2154d..e89f7eb 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Follow steps in [Upgrade to SAPO testnet](./testnet-onboarding-validator.md#upgr ## Run testnet Nitro Node -Follow steps in [testnet-nitro-node.md](./testnet-nitro-node.md) to run your Nitro node for the testnet +Follow steps in [testnet-nitro-node.md](./testnet-nitro-node.md) to run your Nitro node for the testnet ## Setup a Service Provider diff --git a/service-provider.md b/service-provider.md index 07b76d0..b04bbbf 100644 --- a/service-provider.md +++ b/service-provider.md @@ -178,7 +178,7 @@ Follow the steps below to point your deployer to the SAPO testnet ```bash ... - CERC_LACONICD_BOND_ID=a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3 + CERC_LACONICD_BOND_ID= ... ``` -- 2.45.2