## 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): * 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 * 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 ```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 ``` * Push images 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 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 ``` * 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: "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 ``` * Update `webapp-ui/config.env` ```bash # URL of the webapp deployer backend # 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 ```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 ```bash laconic-so deployment --dir webapp-deployer stop laconic-so deployment --dir webapp-ui 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, 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 ```