From b3f979e65590175574e1fae70669adafdc1d65f6 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 8 Oct 2024 18:07:54 +0530 Subject: [PATCH] Update service provider setup to configure laconicd chain id --- service-provider-setup/README.md | 14 +++++++++----- service-provider-setup/deploy-backend.yml | 3 ++- service-provider-setup/run-laconic-console.yml | 1 + service-provider-setup/run-laconicd.yml | 8 ++++++++ .../templates/configs/console-config.env.j2 | 1 + .../templates/configs/laconicd-config.env.j2 | 2 ++ service-provider-setup/templates/laconic.yml.j2 | 2 +- .../vars/laconicd-vars.example.yml | 1 + 8 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 service-provider-setup/templates/configs/laconicd-config.env.j2 create mode 100644 service-provider-setup/vars/laconicd-vars.example.yml diff --git a/service-provider-setup/README.md b/service-provider-setup/README.md index 6a9cc78..1715d3d 100644 --- a/service-provider-setup/README.md +++ b/service-provider-setup/README.md @@ -84,6 +84,7 @@ To get started, follow the [installation](../README.md#installation) guide to se cp gpg-vars.example.yml gpg-vars.yml cp k8s-vars.example.yml k8s-vars.yml cp container-vars.example.yml container-vars.yml + cp laconicd-vars.example.yml laconicd-vars.yml cp webapp-vars.example.yml webapp-vars.yml cd - ``` @@ -113,6 +114,9 @@ To get started, follow the [installation](../README.md#installation) guide to se container_registry_username: "" # username to login to the container registry container_registry_password: "" # password to login to the container registry + # vars/laconicd-vars.yml + chain_id: "" # chain id to use for the Laconic chain + # vars/webapp-vars.yml authority_name: "" # eg: my-org-name cpu_reservation: "" # Minimum number of cpu cores to be used, eg: 2 @@ -167,8 +171,8 @@ To get started, follow the [installation](../README.md#installation) guide to se After the playbook finishes executing, the following services will be deployed (your setup should look similar to the example below): -- laconicd chain RPC endpoint: http://lcn-daemon.laconic.com:26657 -- laconic console: http://lcn-daemon.laconic.com:8080/registry -- laconicd GQL endpoint: http://lcn-daemon.laconic.com:9473/api -- webapp deployer API: https://webapp-deployer-api.pwa.laconic.com -- webapp deployer UI: https://webapp-deployer-ui.pwa.laconic.com +- laconicd chain RPC endpoint: +- laconic console: +- laconicd GQL endpoint: +- webapp deployer API: +- webapp deployer UI: diff --git a/service-provider-setup/deploy-backend.yml b/service-provider-setup/deploy-backend.yml index 566e6fa..ccc43e4 100644 --- a/service-provider-setup/deploy-backend.yml +++ b/service-provider-setup/deploy-backend.yml @@ -10,6 +10,7 @@ - vars/container-vars.yml - vars/k8s-vars.yml - vars/dns-vars.yml + - vars/laconicd-vars.yml tasks: - name: Ensure gpg-keys directory exists @@ -100,7 +101,7 @@ dest: "webapp-deployer/data/config/laconic.yml" - name: login to the container registry - command: "docker login container-registry.pwa.{{ full_domain }} --username {{ container_registry_username }} --password {{ container_registry_password}}" + command: "docker login container-registry.pwa.{{ full_domain }} --username {{ container_registry_username }} --password {{ container_registry_password}}" - name: Push images to container registry command: laconic-so deployment --dir webapp-deployer push-images diff --git a/service-provider-setup/run-laconic-console.yml b/service-provider-setup/run-laconic-console.yml index d47e3dd..78000a8 100644 --- a/service-provider-setup/run-laconic-console.yml +++ b/service-provider-setup/run-laconic-console.yml @@ -8,6 +8,7 @@ - vars/webapp-vars.yml - vars/dns-vars.yml - vars/k8s-vars.yml + - vars/laconicd-vars.yml tasks: - name: Clone the stack repo diff --git a/service-provider-setup/run-laconicd.yml b/service-provider-setup/run-laconicd.yml index a148ca9..c7be97b 100644 --- a/service-provider-setup/run-laconicd.yml +++ b/service-provider-setup/run-laconicd.yml @@ -4,6 +4,9 @@ environment: PATH: "{{ ansible_env.PATH }}:/home/{{ansible_user}}/bin" + vars_files: + - vars/laconicd-vars.yml + tasks: - name: Clone the fixturenet-laconicd-stack repo command: laconic-so fetch-stack git.vdb.to/cerc-io/fixturenet-laconicd-stack --pull @@ -29,5 +32,10 @@ command: laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy create --spec-file fixturenet-laconicd-spec.yml --deployment-dir fixturenet-laconicd-deployment when: not deployment_dir.stat.exists + - name: Create laconicd config + template: + src: "./templates/configs/laconicd-config.env.j2" + dest: "fixturenet-laconicd-deployment/config.env" + - name: Start the deployment command: laconic-so deployment --dir fixturenet-laconicd-deployment start diff --git a/service-provider-setup/templates/configs/console-config.env.j2 b/service-provider-setup/templates/configs/console-config.env.j2 index c9e72b3..244d334 100644 --- a/service-provider-setup/templates/configs/console-config.env.j2 +++ b/service-provider-setup/templates/configs/console-config.env.j2 @@ -2,4 +2,5 @@ CERC_LACONICD_USER_KEY={{ALICE_PK}} CERC_LACONICD_BOND_ID={{BOND_ID}} CERC_LACONICD_RPC_ENDPOINT=http://{{ org_id }}-daemon.{{ full_domain }}:26657 CERC_LACONICD_GQL_ENDPOINT=http://{{ org_id }}-daemon.{{ full_domain }}:9473/api +CERC_LACONICD_CHAIN_ID={{ chain_id }} LACONIC_HOSTED_ENDPOINT=http://{{ org_id }}-daemon.{{ full_domain }}:9473 diff --git a/service-provider-setup/templates/configs/laconicd-config.env.j2 b/service-provider-setup/templates/configs/laconicd-config.env.j2 new file mode 100644 index 0000000..617d214 --- /dev/null +++ b/service-provider-setup/templates/configs/laconicd-config.env.j2 @@ -0,0 +1,2 @@ +MONIKER=localtestnet-node +CHAINID={{ chain_id }} diff --git a/service-provider-setup/templates/laconic.yml.j2 b/service-provider-setup/templates/laconic.yml.j2 index c9e625a..27a9198 100644 --- a/service-provider-setup/templates/laconic.yml.j2 +++ b/service-provider-setup/templates/laconic.yml.j2 @@ -4,6 +4,6 @@ services: gqlEndpoint: 'http://{{ org_id }}-daemon.{{ full_domain }}:9473/api' userKey: "{{ ALICE_PK }}" bondId: "{{ BOND_ID }}" - chainId: lorotestnet-1 + chainId: {{ chain_id }} gas: 200000 fees: 200000alnt diff --git a/service-provider-setup/vars/laconicd-vars.example.yml b/service-provider-setup/vars/laconicd-vars.example.yml new file mode 100644 index 0000000..682a744 --- /dev/null +++ b/service-provider-setup/vars/laconicd-vars.example.yml @@ -0,0 +1 @@ +chain_id: ""