From b3f979e65590175574e1fae70669adafdc1d65f6 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 8 Oct 2024 18:07:54 +0530 Subject: [PATCH 01/17] 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: "" -- 2.45.2 From b9969d805066775cd4ef2561bfc5043c3ab82a88 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 9 Oct 2024 17:01:55 +0530 Subject: [PATCH 02/17] Remove moniker from laconicd config --- service-provider-setup/deploy-backend.yml | 2 +- service-provider-setup/run-laconicd.yml | 2 +- service-provider-setup/templates/configs/laconicd-config.env.j2 | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/service-provider-setup/deploy-backend.yml b/service-provider-setup/deploy-backend.yml index ccc43e4..187bb72 100644 --- a/service-provider-setup/deploy-backend.yml +++ b/service-provider-setup/deploy-backend.yml @@ -44,7 +44,7 @@ - name: Create laconic config file template: src: "./templates/laconic.yml.j2" - dest: "config/laconic.yml" + dest: "{{ ansible_env.HOME }}/config/laconic.yml" - name: Copy the gpg private key file to config dir copy: diff --git a/service-provider-setup/run-laconicd.yml b/service-provider-setup/run-laconicd.yml index c7be97b..35b76fc 100644 --- a/service-provider-setup/run-laconicd.yml +++ b/service-provider-setup/run-laconicd.yml @@ -18,7 +18,7 @@ - name: Build container images command: laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd build-containers --force-rebuild - - name: Generate over spec file for laconicd deployment + - name: Generate spec file for laconicd deployment template: src: "./templates/specs/fixturenet-laconicd-spec.yml.j2" dest: "fixturenet-laconicd-spec.yml" diff --git a/service-provider-setup/templates/configs/laconicd-config.env.j2 b/service-provider-setup/templates/configs/laconicd-config.env.j2 index 617d214..ec68d16 100644 --- a/service-provider-setup/templates/configs/laconicd-config.env.j2 +++ b/service-provider-setup/templates/configs/laconicd-config.env.j2 @@ -1,2 +1 @@ -MONIKER=localtestnet-node CHAINID={{ chain_id }} -- 2.45.2 From dc75382d2d176dc2ff5a8b15c26c42532a206647 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 9 Oct 2024 17:38:16 +0530 Subject: [PATCH 03/17] Add default value for chain id var --- service-provider-setup/vars/laconicd-vars.example.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service-provider-setup/vars/laconicd-vars.example.yml b/service-provider-setup/vars/laconicd-vars.example.yml index 682a744..51884e9 100644 --- a/service-provider-setup/vars/laconicd-vars.example.yml +++ b/service-provider-setup/vars/laconicd-vars.example.yml @@ -1 +1 @@ -chain_id: "" +chain_id: "laconic_9000-1" -- 2.45.2 From d17f954fe6d7b5ff59299c33d9f00040adfb1f0f Mon Sep 17 00:00:00 2001 From: Adw8 Date: Fri, 11 Oct 2024 13:55:37 +0530 Subject: [PATCH 04/17] Remove setup repos step for bridge and nitro-node stacks --- nitro-bridge-setup/run-nitro-bridge.yml | 8 -------- nitro-contracts-setup/deploy-contracts.yml | 11 +---------- nitro-nodes-setup/run-nitro-nodes.yml | 8 -------- service-provider-setup/setup-dns.yml | 12 ++++++------ 4 files changed, 7 insertions(+), 32 deletions(-) diff --git a/nitro-bridge-setup/run-nitro-bridge.yml b/nitro-bridge-setup/run-nitro-bridge.yml index 0d3f2a5..7fbe1d1 100644 --- a/nitro-bridge-setup/run-nitro-bridge.yml +++ b/nitro-bridge-setup/run-nitro-bridge.yml @@ -30,14 +30,6 @@ timeout: 300 ignore_errors: yes - - name: Clone repositories required for nitro-stack - expect: - command: laconic-so --stack {{ ansible_env.HOME }}/cerc/nitro-stack/stack-orchestrator/stacks/bridge setup-repositories --git-ssh --pull - responses: - "Are you sure you want to continue connecting \\(yes/no/\\[fingerprint\\]\\)\\?": "yes" - timeout: 300 - ignore_errors: yes - - name: Build containers command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge build-containers --force-rebuild when: not skip_container_build diff --git a/nitro-contracts-setup/deploy-contracts.yml b/nitro-contracts-setup/deploy-contracts.yml index e68caaa..c46bd6a 100644 --- a/nitro-contracts-setup/deploy-contracts.yml +++ b/nitro-contracts-setup/deploy-contracts.yml @@ -14,7 +14,6 @@ path: "{{ nitro_directory }}" state: directory - - name: Change owner of nitro-directory file: path: "{{ nitro_directory }}" @@ -23,7 +22,7 @@ state: directory recurse: yes - - name: Clone go-nitro stack repo + - name: Clone nitro stack repo expect: command: laconic-so fetch-stack git.vdb.to/cerc-io/nitro-stack --git-ssh --pull responses: @@ -31,14 +30,6 @@ timeout: 300 ignore_errors: yes - - name: Clone repositories required for nitro-stack - expect: - command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge setup-repositories --git-ssh --pull - responses: - "Are you sure you want to continue connecting \\(yes/no/\\[fingerprint\\]\\)\\?": "yes" - timeout: 300 - ignore_errors: yes - - name: Build containers command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge build-containers --force-rebuild when: not skip_container_build diff --git a/nitro-nodes-setup/run-nitro-nodes.yml b/nitro-nodes-setup/run-nitro-nodes.yml index 648f32e..a191ab3 100644 --- a/nitro-nodes-setup/run-nitro-nodes.yml +++ b/nitro-nodes-setup/run-nitro-nodes.yml @@ -37,14 +37,6 @@ timeout: 300 ignore_errors: yes - - name: Clone repositories required for nitro-stack - expect: - command: laconic-so --stack {{ ansible_env.HOME }}/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node setup-repositories --git-ssh --pull - responses: - "Are you sure you want to continue connecting \\(yes/no/\\[fingerprint\\]\\)\\?": "yes" - timeout: 300 - ignore_errors: yes - - name: Build containers command: laconic-so --stack {{ ansible_env.HOME }}/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node build-containers --force-rebuild when: not skip_container_build diff --git a/service-provider-setup/setup-dns.yml b/service-provider-setup/setup-dns.yml index 1e7d424..bf306cd 100644 --- a/service-provider-setup/setup-dns.yml +++ b/service-provider-setup/setup-dns.yml @@ -91,14 +91,14 @@ name: "{{ subdomain_prefix }}" ttl: 43200 - - name: Create wildcard A record for subdomain + - name: Create wildcard CNAME record for subdomain community.digitalocean.digital_ocean_domain_record: state: present oauth_token: "{{ do_api_token }}" name: "{{ subdomain_cluster_control }}.{{ full_domain }}" - data: "{{ service_provider_ip }}" + data: "{{ subdomain_cluster_control }}.{{ full_domain }}" domain: "{{ full_domain }}" - type: A + type: CNAME name: "*.{{ subdomain_prefix }}" ttl: 43200 @@ -112,13 +112,13 @@ name: "pwa" ttl: 43200 - - name: Create wildcard A record for pwa + - name: Create wildcard CNAME record for pwa community.digitalocean.digital_ocean_domain_record: state: present oauth_token: "{{ do_api_token }}" name: "{{ subdomain_cluster_control }}.{{ full_domain }}" - data: "{{ service_provider_ip }}" + data: "{{ subdomain_cluster_control }}.{{ full_domain }}" domain: "{{ full_domain }}" - type: A + type: CNAME name: "*.pwa" ttl: 43200 -- 2.45.2 From ac974f13783cdb104162e0b5e6b4a554344e44d7 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Mon, 14 Oct 2024 12:44:03 +0530 Subject: [PATCH 05/17] Update step to create deployment for webapp-deployer --- service-provider-setup/deploy-backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service-provider-setup/deploy-backend.yml b/service-provider-setup/deploy-backend.yml index 187bb72..a6d497e 100644 --- a/service-provider-setup/deploy-backend.yml +++ b/service-provider-setup/deploy-backend.yml @@ -79,7 +79,7 @@ src: "./templates/specs/webapp-deployer.spec.j2" dest: "webapp-deployer.spec" - - name: Create the deployment directory from the spec file + - name: Create deployment directory for webapp-deployer command: > laconic-so --stack webapp-deployer-backend deploy create --deployment-dir webapp-deployer --spec-file webapp-deployer.spec -- 2.45.2 From aa8137311a3d19471b6aa28d2d0fad85eb12156c Mon Sep 17 00:00:00 2001 From: Adw8 Date: Mon, 14 Oct 2024 18:33:24 +0530 Subject: [PATCH 06/17] Add wildcard CNAME record for pwa --- service-provider-setup/setup-dns.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/service-provider-setup/setup-dns.yml b/service-provider-setup/setup-dns.yml index bf306cd..03f92b5 100644 --- a/service-provider-setup/setup-dns.yml +++ b/service-provider-setup/setup-dns.yml @@ -95,30 +95,28 @@ community.digitalocean.digital_ocean_domain_record: state: present oauth_token: "{{ do_api_token }}" - name: "{{ subdomain_cluster_control }}.{{ full_domain }}" - data: "{{ subdomain_cluster_control }}.{{ full_domain }}" + name: "*.{{ subdomain_prefix }}" + data: "{{ subdomain_prefix }}-cluster-control.{{ full_domain }}" domain: "{{ full_domain }}" type: CNAME - name: "*.{{ subdomain_prefix }}" ttl: 43200 - name: Create CNAME record for pwa community.digitalocean.digital_ocean_domain_record: state: present oauth_token: "{{ do_api_token }}" - data: "{{ subdomain_cluster_control }}.{{ full_domain }}" + name: "pwa" + data: "{{ subdomain_prefix }}-cluster-control.{{ full_domain }}" domain: "{{ full_domain }}" type: CNAME - name: "pwa" ttl: 43200 - name: Create wildcard CNAME record for pwa community.digitalocean.digital_ocean_domain_record: state: present oauth_token: "{{ do_api_token }}" - name: "{{ subdomain_cluster_control }}.{{ full_domain }}" - data: "{{ subdomain_cluster_control }}.{{ full_domain }}" + name: "*.pwa" + data: "{{ subdomain_prefix }}-cluster-control.{{ full_domain }}" domain: "{{ full_domain }}" type: CNAME - name: "*.pwa" - ttl: 43200 + ttl: 43200 \ No newline at end of file -- 2.45.2 From ebe6a3cbd793e5f482a4510f4a75dad50d612674 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Tue, 15 Oct 2024 15:18:24 +0530 Subject: [PATCH 07/17] Add vars for handling auction requests --- service-provider-setup/README.md | 20 ++++++++++--------- service-provider-setup/setup-dns.yml | 2 +- .../configs/webapp-deployer-config.env.j2 | 2 ++ .../vars/k8s-vars.example.yml | 1 - .../vars/webapp-vars.example.yml | 2 ++ 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/service-provider-setup/README.md b/service-provider-setup/README.md index 1715d3d..8b2f343 100644 --- a/service-provider-setup/README.md +++ b/service-provider-setup/README.md @@ -96,12 +96,12 @@ To get started, follow the [installation](../README.md#installation) guide to se full_domain: "" # eg: laconic.com subdomain_prefix: "" # eg: lcn-cad service_provider_ip: "" # eg: 23.111.78.179 - do_api_token: "" # Digital Ocean access token that you generated, eg: dop_v1... + do_api_token: "" # DigitalOcean access token that you generated, eg: dop_v1... # vars/gpg-vars.yml - gpg_user_name: "" # Full name of the user for the GPG key - gpg_user_email: "" # Email address associated with the GPG key - gpg_passphrase: "" # Passphrase for securing the GPG key + gpg_user_name: "" # full name of the user for the GPG key + gpg_user_email: "" # email address associated with the GPG key + gpg_passphrase: "" # passphrase for securing the GPG key # vars/k8s-vars.yml target_host: "deployment_host" @@ -118,12 +118,14 @@ To get started, follow the [installation](../README.md#installation) guide to se 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 - memory_reservation: "" # Minimum amount of memory in GB to be used, eg: 4G - cpu_limit: "" # Maximum number of cpu cores to be used, eg: 6 - memory_limit: "" # Maximum amount of memory in GB to be used, eg: 8G + authority_name: "" # eg: my-org-name + cpu_reservation: "" # minimum number of cpu cores to be used, eg: 2 + memory_reservation: "" # minimum amount of memory in GB to be used, eg: 4G + cpu_limit: "" # maximum number of cpu cores to be used, eg: 6 + memory_limit: "" # maximum amount of memory in GB to be used, eg: 8G deployer_gpg_passphrase: "" # passphrase for creating GPG key used by webapp-deployer, eg: SECRET + handle_auction_requests: "" # whether the webapp deployer should handle deployment auction requests, eg: false + auction_bid_amount: "" # bid amount for deployment auctions in alnt, eg: 50000 ``` - Update the [`hosts.ini`](./hosts.ini) file: diff --git a/service-provider-setup/setup-dns.yml b/service-provider-setup/setup-dns.yml index 03f92b5..fc46b44 100644 --- a/service-provider-setup/setup-dns.yml +++ b/service-provider-setup/setup-dns.yml @@ -119,4 +119,4 @@ data: "{{ subdomain_prefix }}-cluster-control.{{ full_domain }}" domain: "{{ full_domain }}" type: CNAME - ttl: 43200 \ No newline at end of file + ttl: 43200 diff --git a/service-provider-setup/templates/configs/webapp-deployer-config.env.j2 b/service-provider-setup/templates/configs/webapp-deployer-config.env.j2 index d769a9a..4c6d076 100644 --- a/service-provider-setup/templates/configs/webapp-deployer-config.env.j2 +++ b/service-provider-setup/templates/configs/webapp-deployer-config.env.j2 @@ -26,3 +26,5 @@ export OPENPGP_PASSPHRASE="{{ deployer_gpg_passphrase }}" export DEPLOYER_STATE="srv-test/deployments/autodeploy.state" export UNDEPLOYER_STATE="srv-test/deployments/autoundeploy.state" export UPLOAD_DIRECTORY="srv-test/uploads" +export HANDLE_AUCTION_REQUESTS={{ handle_auction_requests }} +export AUCTION_BID_AMOUNT={{ auction_bid_amount }} diff --git a/service-provider-setup/vars/k8s-vars.example.yml b/service-provider-setup/vars/k8s-vars.example.yml index 544cfdb..78e06d6 100644 --- a/service-provider-setup/vars/k8s-vars.example.yml +++ b/service-provider-setup/vars/k8s-vars.example.yml @@ -1,4 +1,3 @@ -target_host: "deployment_host" gpg_key_id: "{{ sec_key_id }}" vault_passphrase: "{{ gpg_passphrase }}" org_id: "" diff --git a/service-provider-setup/vars/webapp-vars.example.yml b/service-provider-setup/vars/webapp-vars.example.yml index 491192c..cf050d3 100644 --- a/service-provider-setup/vars/webapp-vars.example.yml +++ b/service-provider-setup/vars/webapp-vars.example.yml @@ -6,3 +6,5 @@ memory_reservation: "" cpu_limit: "6" memory_limit: "8G" deployer_gpg_passphrase: "" +handle_auction_requests: "false" +auction_bid_amount: "0" -- 2.45.2 From 8fbbbbdd7f33633d2d55804f582a2ce4eb766dfd Mon Sep 17 00:00:00 2001 From: Adw8 Date: Tue, 15 Oct 2024 16:03:36 +0530 Subject: [PATCH 08/17] Add task to fail if full_domain already exists --- service-provider-setup/setup-dns.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/service-provider-setup/setup-dns.yml b/service-provider-setup/setup-dns.yml index fc46b44..3830dd5 100644 --- a/service-provider-setup/setup-dns.yml +++ b/service-provider-setup/setup-dns.yml @@ -6,6 +6,16 @@ - vars/k8s-vars.yml tasks: + - name: Check if domain exists + community.digitalocean.digital_ocean_domain_facts: + oauth_token: "{{ do_api_token }}" + register: existing_domains + + - name: Fail if domain already exists + fail: + msg: "Domain {{ full_domain }} already exists." + when: full_domain in existing_domains.data | map(attribute='name') | list + - name: Create a domain community.digitalocean.digital_ocean_domain: state: present -- 2.45.2 From 95511e9b0cebfb31f9d003eca404249920a6c021 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Wed, 16 Oct 2024 14:53:47 +0530 Subject: [PATCH 09/17] Update README for nitro node setup --- README.md | 1 - nitro-nodes-setup/README.md | 8 -------- nitro-nodes-setup/run-nitro-nodes.yml | 2 +- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/README.md b/README.md index f00deb5..64a60d7 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,6 @@ ## Playbooks - [stack-orchestrator-setup](./stack-orchestrator-setup/README.md) -- [l2-setup](./l2-setup/README.md) - [nitro-node-setup](./nitro-nodes-setup/README.md) - [nitro-bridge-setup](./nitro-bridge-setup/README.md) - [nitro-contracts-setup](./nitro-contracts-setup/README.md) diff --git a/nitro-nodes-setup/README.md b/nitro-nodes-setup/README.md index fd2de53..00b5756 100644 --- a/nitro-nodes-setup/README.md +++ b/nitro-nodes-setup/README.md @@ -4,14 +4,6 @@ To get started, follow the [installation](../README.md#installation) guide to setup ansible on your machine -## Setup for Remote Host - -To run the playbook on a remote host: - -- Follow steps from [setup remote hosts](../README.md#setup-remote-hosts) - -- Update / append the [`hosts.ini`](../hosts.ini) file for your remote host with `` set as `nitro_host` - ## Setup The following commands have to be executed in [`nitro-nodes-setup`](./) directory diff --git a/nitro-nodes-setup/run-nitro-nodes.yml b/nitro-nodes-setup/run-nitro-nodes.yml index a191ab3..e224d1f 100644 --- a/nitro-nodes-setup/run-nitro-nodes.yml +++ b/nitro-nodes-setup/run-nitro-nodes.yml @@ -29,7 +29,7 @@ state: directory recurse: yes - - name: Clone go-nitro stack repo + - name: Clone nitro-stack repo expect: command: laconic-so fetch-stack git.vdb.to/cerc-io/nitro-stack --git-ssh --pull responses: -- 2.45.2 From 62f0be9570342b6954df57414a6c17515d86f6fb Mon Sep 17 00:00:00 2001 From: Adw8 Date: Wed, 16 Oct 2024 15:45:26 +0530 Subject: [PATCH 10/17] Update wildcard manifests file --- .../templates/wildcard-pwa-example.yml.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service-provider-setup/templates/wildcard-pwa-example.yml.j2 b/service-provider-setup/templates/wildcard-pwa-example.yml.j2 index 2326cd1..5b4b6f1 100644 --- a/service-provider-setup/templates/wildcard-pwa-example.yml.j2 +++ b/service-provider-setup/templates/wildcard-pwa-example.yml.j2 @@ -9,7 +9,7 @@ spec: name: letsencrypt-prod-wild kind: ClusterIssuer group: cert-manager.io - commonName: *.pwa.{{ full_domain }} + commonName: "*.pwa.{{ full_domain }}" dnsNames: - - pwa.{{ full_domain }} - - *.pwa.{{ full_domain }} + - "pwa.{{ full_domain }}" + - "*.pwa.{{ full_domain }}" -- 2.45.2 From dc1d9daab7f50f494c92cb5e79e60b74446db651 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Fri, 18 Oct 2024 11:28:45 +0530 Subject: [PATCH 11/17] Update example bid amount in README --- service-provider-setup/README.md | 4 ++-- service-provider-setup/deploy-frontend.yml | 2 +- service-provider-setup/run-laconic-console.yml | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/service-provider-setup/README.md b/service-provider-setup/README.md index 8b2f343..6461cdc 100644 --- a/service-provider-setup/README.md +++ b/service-provider-setup/README.md @@ -124,8 +124,8 @@ To get started, follow the [installation](../README.md#installation) guide to se cpu_limit: "" # maximum number of cpu cores to be used, eg: 6 memory_limit: "" # maximum amount of memory in GB to be used, eg: 8G deployer_gpg_passphrase: "" # passphrase for creating GPG key used by webapp-deployer, eg: SECRET - handle_auction_requests: "" # whether the webapp deployer should handle deployment auction requests, eg: false - auction_bid_amount: "" # bid amount for deployment auctions in alnt, eg: 50000 + handle_auction_requests: "" # whether the webapp deployer should handle deployment auction requests, eg: true + auction_bid_amount: "" # bid amount for deployment auctions in alnt, eg: 500000 ``` - Update the [`hosts.ini`](./hosts.ini) file: diff --git a/service-provider-setup/deploy-frontend.yml b/service-provider-setup/deploy-frontend.yml index 721a743..fd84705 100644 --- a/service-provider-setup/deploy-frontend.yml +++ b/service-provider-setup/deploy-frontend.yml @@ -26,7 +26,7 @@ --image cerc/webapp-deployment-status-ui:local --url https://webapp-deployer-ui.pwa.{{ full_domain }} --env-file ~/cerc/webapp-deployment-status-ui/.env - - name: Push image to container registry + - name: Push webapp-ui images to container registry command: laconic-so deployment --dir webapp-ui push-images - name: Update config file for webapp ui diff --git a/service-provider-setup/run-laconic-console.yml b/service-provider-setup/run-laconic-console.yml index 78000a8..f22b8d6 100644 --- a/service-provider-setup/run-laconic-console.yml +++ b/service-provider-setup/run-laconic-console.yml @@ -41,6 +41,7 @@ dest: "laconic-console-deployment/deployment.yml" remote_src: yes + # TODO handle connecting to other chains - name: Fetch user key from laconicd command: laconic-so deployment --dir fixturenet-laconicd-deployment exec laconicd "echo y | laconicd keys export alice --unarmored-hex --unsafe" register: alice_pk -- 2.45.2 From 7fa197bd1932c4d781d6819d7a35186cdf17c2e7 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 18 Oct 2024 12:39:49 +0530 Subject: [PATCH 12/17] Update asset address export step in Nitro setup --- nitro-contracts-setup/README.md | 6 +++--- nitro-contracts-setup/deploy-contracts.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nitro-contracts-setup/README.md b/nitro-contracts-setup/README.md index 6e3c95d..3110b27 100644 --- a/nitro-contracts-setup/README.md +++ b/nitro-contracts-setup/README.md @@ -27,9 +27,9 @@ The following commands have to be executed in the [`nitro-contracts-setup`](./) geth_deployer_pk: "" # Custom L1 token to be deployed - token_name: "LaconicNetworkToken" - token_symbol: "LNT" - initial_token_supply: "129600" + token_name: "TestToken" + token_symbol: "TST" + initial_token_supply: "100000" ``` ## Deploy Contracts diff --git a/nitro-contracts-setup/deploy-contracts.yml b/nitro-contracts-setup/deploy-contracts.yml index c46bd6a..4a8c9bc 100644 --- a/nitro-contracts-setup/deploy-contracts.yml +++ b/nitro-contracts-setup/deploy-contracts.yml @@ -85,7 +85,7 @@ msg: "VPA_ADDRESS: {{ vpa_address.stdout }}" - name: Export ASSET_ADDRESS - shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"{{ geth_chain_id }}\"[0].contracts.Token.address' /app/deployment/nitro-addresses.json" + shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"{{ geth_chain_id }}\"[0].contracts.{{ token_name }}.address' /app/deployment/nitro-addresses.json" args: chdir: "{{ nitro_directory }}" register: asset_address -- 2.45.2 From 96ba36e80916760a1cd73fda16e8a51f0954d167 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 18 Oct 2024 14:41:17 +0530 Subject: [PATCH 13/17] Add setup repos step in Nitro contracts playbook --- nitro-contracts-setup/deploy-contracts.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nitro-contracts-setup/deploy-contracts.yml b/nitro-contracts-setup/deploy-contracts.yml index 4a8c9bc..0ff53ed 100644 --- a/nitro-contracts-setup/deploy-contracts.yml +++ b/nitro-contracts-setup/deploy-contracts.yml @@ -30,8 +30,16 @@ timeout: 300 ignore_errors: yes + - name: Clone repositories required for nitro-stack + expect: + command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-contracts setup-repositories --git-ssh --pull + responses: + "Are you sure you want to continue connecting \\(yes/no/\\[fingerprint\\]\\)\\?": "yes" + timeout: 300 + ignore_errors: yes + - name: Build containers - command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge build-containers --force-rebuild + command: laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-contracts build-containers --force-rebuild when: not skip_container_build - name: Generate spec file for nitro contracts deployment -- 2.45.2 From abbe732764ecc460332e6c313089e7370759066a Mon Sep 17 00:00:00 2001 From: Adw8 Date: Mon, 21 Oct 2024 11:55:11 +0530 Subject: [PATCH 14/17] Keep deployer lrn consistent with api url --- service-provider-setup/deploy-backend.yml | 2 +- service-provider-setup/setup-container-registry.yml | 2 +- .../templates/configs/webapp-deployer-config.env.j2 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/service-provider-setup/deploy-backend.yml b/service-provider-setup/deploy-backend.yml index a6d497e..1abcb2d 100644 --- a/service-provider-setup/deploy-backend.yml +++ b/service-provider-setup/deploy-backend.yml @@ -66,7 +66,7 @@ --laconic-config /home/root/config/laconic.yml \ --api-url https://webapp-deployer-api.pwa.{{ full_domain }} \ --public-key-file /home/root/config/webapp-deployer-api.{{ full_domain }}.pgp.pub \ - --lrn lrn://{{ authority_name }}/deployers/webapp-deployer-api.{{ full_domain }} \ + --lrn lrn://{{ authority_name }}/deployers/webapp-deployer-api.pwa.{{ full_domain }} \ --min-required-payment 0 register: publish_output diff --git a/service-provider-setup/setup-container-registry.yml b/service-provider-setup/setup-container-registry.yml index 8ae1694..f494a8e 100644 --- a/service-provider-setup/setup-container-registry.yml +++ b/service-provider-setup/setup-container-registry.yml @@ -120,7 +120,7 @@ var: daemonsets_output.stdout ignore_errors: yes - + - name: Deploy the container registry command: > laconic-so deployment --dir container-registry start diff --git a/service-provider-setup/templates/configs/webapp-deployer-config.env.j2 b/service-provider-setup/templates/configs/webapp-deployer-config.env.j2 index 4c6d076..34054f1 100644 --- a/service-provider-setup/templates/configs/webapp-deployer-config.env.j2 +++ b/service-provider-setup/templates/configs/webapp-deployer-config.env.j2 @@ -20,7 +20,7 @@ CHECK_INTERVAL=5 FQDN_POLICY="allow" # lrn of the webapp deployer -LRN="lrn://{{ authority_name }}/deployers/webapp-deployer-api.{{ full_domain }}" +LRN="lrn://{{ authority_name }}/deployers/webapp-deployer-api.pwa.{{ full_domain }}" export OPENPGP_PRIVATE_KEY_FILE="webapp-deployer-api.{{ full_domain }}.pgp.key" export OPENPGP_PASSPHRASE="{{ deployer_gpg_passphrase }}" export DEPLOYER_STATE="srv-test/deployments/autodeploy.state" -- 2.45.2 From b4f7f071c473be4754664355759d9b8cf20e0b10 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Mon, 21 Oct 2024 12:50:13 +0530 Subject: [PATCH 15/17] Update CNAME records in playbook --- service-provider-setup/setup-dns.yml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/service-provider-setup/setup-dns.yml b/service-provider-setup/setup-dns.yml index 3830dd5..38eb412 100644 --- a/service-provider-setup/setup-dns.yml +++ b/service-provider-setup/setup-dns.yml @@ -58,7 +58,7 @@ data: "{{ subdomain_cluster_control }}.{{ full_domain }}" domain: "{{ full_domain }}" type: CNAME - name: "{{ subdomain_prefix }}.{{ full_domain }}" + name: "{{ subdomain_prefix }}" ttl: 43200 - name: Create CNAME record for laconicd endpoint @@ -68,7 +68,7 @@ data: "{{ org_id }}-daemon.{{ full_domain }}" domain: "{{ full_domain }}" type: CNAME - name: "laconicd.{{ full_domain }}" + name: "laconicd" ttl: 43200 - name: Create CNAME record for backend @@ -78,7 +78,7 @@ data: "{{ org_id }}-daemon.{{ full_domain }}" domain: "{{ full_domain }}" type: CNAME - name: "{{ org_id }}-backend.{{ full_domain }}" + name: "{{ org_id }}-backend" ttl: 43200 - name: Create CNAME record for console @@ -88,17 +88,7 @@ data: "{{ org_id }}-daemon.{{ full_domain }}" domain: "{{ full_domain }}" type: CNAME - name: "{{ org_id }}-console.{{ full_domain }}" - ttl: 43200 - - - name: Create CNAME record for org and location - community.digitalocean.digital_ocean_domain_record: - state: present - oauth_token: "{{ do_api_token }}" - data: "{{ org_id }}-daemon.{{ full_domain }}" - domain: "{{ full_domain }}" - type: CNAME - name: "{{ subdomain_prefix }}" + name: "{{ org_id }}-console" ttl: 43200 - name: Create wildcard CNAME record for subdomain -- 2.45.2 From a839ed28eb2998d0b878ee7c8a9191bea0556eeb Mon Sep 17 00:00:00 2001 From: Adw8 Date: Mon, 21 Oct 2024 13:11:35 +0530 Subject: [PATCH 16/17] Update console link in README --- service-provider-setup/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service-provider-setup/README.md b/service-provider-setup/README.md index 6461cdc..fd92387 100644 --- a/service-provider-setup/README.md +++ b/service-provider-setup/README.md @@ -174,7 +174,7 @@ 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: -- laconic console: - laconicd GQL endpoint: +- laconic console: - webapp deployer API: - webapp deployer UI: -- 2.45.2 From f74598575114b1423af04042c79905c89c0ed6a7 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Mon, 21 Oct 2024 14:23:57 +0530 Subject: [PATCH 17/17] Remove unnecessary TODO --- nitro-contracts-setup/README.md | 2 +- service-provider-setup/run-laconic-console.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/nitro-contracts-setup/README.md b/nitro-contracts-setup/README.md index 3110b27..05d103d 100644 --- a/nitro-contracts-setup/README.md +++ b/nitro-contracts-setup/README.md @@ -29,7 +29,7 @@ The following commands have to be executed in the [`nitro-contracts-setup`](./) # Custom L1 token to be deployed token_name: "TestToken" token_symbol: "TST" - initial_token_supply: "100000" + initial_token_supply: "129600" ``` ## Deploy Contracts diff --git a/service-provider-setup/run-laconic-console.yml b/service-provider-setup/run-laconic-console.yml index f22b8d6..78000a8 100644 --- a/service-provider-setup/run-laconic-console.yml +++ b/service-provider-setup/run-laconic-console.yml @@ -41,7 +41,6 @@ dest: "laconic-console-deployment/deployment.yml" remote_src: yes - # TODO handle connecting to other chains - name: Fetch user key from laconicd command: laconic-so deployment --dir fixturenet-laconicd-deployment exec laconicd "echo y | laconicd keys export alice --unarmored-hex --unsafe" register: alice_pk -- 2.45.2