-
Notifications
You must be signed in to change notification settings - Fork 22
feat: add standalone quorum list server deploy #747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --- | ||
|
|
||
| quorum_list_server_enabled: true | ||
| quorum_list_server_image: dashpay/quorum-list-server:latest | ||
| quorum_list_server_pull: true | ||
| quorum_list_server_container_name: quorum-list-server | ||
| quorum_list_server_config_dir: /etc/quorum-list-server | ||
| quorum_list_server_config_path: "{{ quorum_list_server_config_dir }}/config.toml" | ||
| quorum_list_server_host: "0.0.0.0" | ||
| quorum_list_server_port: 8080 | ||
| quorum_list_server_previous_blocks_offset: 8 | ||
|
|
||
| quorum_list_server_rpc_host: "{{ (groups['seed_nodes'] | default([]) | first) | default('') }}" | ||
| quorum_list_server_rpc_url: "http://{{ hostvars[quorum_list_server_rpc_host].private_ip }}:{{ dashd_rpc_port }}" | ||
| quorum_list_server_rpc_user: "{{ dashd_rpc_user }}" | ||
| quorum_list_server_rpc_password: "{{ dashd_rpc_password }}" | ||
|
coderabbitai[bot] marked this conversation as resolved.
Comment on lines
+14
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift Sensitive Data Exposure (CWE-319): Cleartext Transmission of Sensitive Information Reachability: Internal · Exploitability: Difficult Do not send Dash Core RPC credentials over cleartext HTTP.
Verify that every deployed hop carrying these credentials is authenticated and encrypted. The public ELB HTTPS listener does not protect this separate seed RPC connection. 🤖 Prompt for AI Agents |
||
| quorum_list_server_network: "{{ dash_network }}" | ||
| quorum_list_server_health_host: "{{ '127.0.0.1' if quorum_list_server_host in ['0.0.0.0', '::'] else quorum_list_server_host }}" | ||
|
|
||
| quorum_list_server_version_check_host: "" | ||
| quorum_list_server_address_host_override: "" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| --- | ||
|
|
||
| - name: Check quorum-list-server RPC target | ||
| ansible.builtin.assert: | ||
| that: | ||
| - groups['seed_nodes'] | default([]) | length > 0 | ||
| - quorum_list_server_rpc_host is defined | ||
| - quorum_list_server_rpc_host | length > 0 | ||
| - quorum_list_server_rpc_host in hostvars | ||
| - hostvars[quorum_list_server_rpc_host].private_ip is defined | ||
| fail_msg: "quorum_list_server_rpc_host must point at an inventory host with a private_ip" | ||
|
|
||
| - name: Create quorum-list-server config dir | ||
| ansible.builtin.file: | ||
| path: "{{ quorum_list_server_config_dir }}" | ||
| state: directory | ||
| owner: root | ||
| group: root | ||
| mode: "0750" | ||
|
|
||
| - name: Write quorum-list-server config | ||
| ansible.builtin.template: | ||
| src: config.toml.j2 | ||
| dest: "{{ quorum_list_server_config_path }}" | ||
| owner: root | ||
| group: root | ||
| mode: "0640" | ||
| no_log: true | ||
| register: quorum_list_server_config | ||
|
|
||
| - name: Start quorum-list-server | ||
| community.docker.docker_container: | ||
| name: "{{ quorum_list_server_container_name }}" | ||
| image: "{{ quorum_list_server_image }}" | ||
| state: started | ||
| restart_policy: always | ||
| pull: "{{ quorum_list_server_pull | bool }}" | ||
| recreate: "{{ quorum_list_server_config.changed }}" | ||
| user: "appuser:root" | ||
| network_mode: host | ||
| volumes: | ||
| - "{{ quorum_list_server_config_path }}:/app/config.toml:ro" | ||
|
|
||
| - name: Wait for quorum-list-server health endpoint | ||
| ansible.builtin.uri: | ||
| url: "http://{{ quorum_list_server_health_host }}:{{ quorum_list_server_port }}/health" | ||
| status_code: 200 | ||
| timeout: 3 | ||
| register: quorum_list_server_health | ||
| until: quorum_list_server_health.status == 200 | ||
| retries: 30 | ||
| delay: 2 | ||
|
infraclaw-dash marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| network = {{ quorum_list_server_network | to_json }} | ||
|
|
||
| [server] | ||
| port = {{ quorum_list_server_port | int }} | ||
| host = {{ quorum_list_server_host | to_json }} | ||
|
|
||
| [rpc] | ||
| url = {{ quorum_list_server_rpc_url | to_json }} | ||
| username = {{ quorum_list_server_rpc_user | to_json }} | ||
| password = {{ quorum_list_server_rpc_password | to_json }} | ||
|
|
||
| [quorum] | ||
| previous_blocks_offset = {{ quorum_list_server_previous_blocks_offset | int }} | ||
|
|
||
| {% if quorum_list_server_version_check_host | length > 0 or quorum_list_server_address_host_override | length > 0 %} | ||
| [docker] | ||
| {% if quorum_list_server_version_check_host | length > 0 %} | ||
| version_check_host = {{ quorum_list_server_version_check_host | to_json }} | ||
| {% endif %} | ||
| {% if quorum_list_server_address_host_override | length > 0 %} | ||
| address_host_override = {{ quorum_list_server_address_host_override | to_json }} | ||
| {% endif %} | ||
| {% endif %} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # Standalone Quorum List Server | ||
|
|
||
| `dash-network-deploy` can provision a standalone `dashpay/quorum-list-server` | ||
| node for networks that need a public quorum API endpoint. | ||
|
|
||
| Each enabled network gets a separate EC2 instance running the | ||
| `dashpay/quorum-list-server` Docker image, a private RPC connection to its seed | ||
| node, and a network-specific public HTTPS endpoint. | ||
|
|
||
| ## Enable | ||
|
|
||
| Set a non-zero `quorum_list_server_count` in the network Terraform vars: | ||
|
|
||
| ```hcl | ||
| quorum_list_server_count = 1 | ||
| ``` | ||
|
|
||
| Optional Terraform settings: | ||
|
|
||
| ```hcl | ||
| quorum_list_server_port = 8080 | ||
| quorum_list_server_instance_size = "micro" | ||
| quorum_list_server_root_disk_size = 20 | ||
| ``` | ||
|
|
||
| Terraform creates: | ||
|
|
||
| - `quorum-list-server-N` EC2 host(s) | ||
| - An Ansible inventory group named `quorum_list_servers` | ||
| - A classic ELB with an HTTPS listener and an internal HTTP health check | ||
| - An ACM certificate for `quorums.<network>.<main_domain>` | ||
| - A Route53 CNAME for `quorums.<network>.<main_domain>` | ||
|
|
||
| For devnets, `<network>` is derived generically from the Terraform workspace | ||
| name: `devnet-<name>` produces `quorums.<name>.<main_domain>`. | ||
|
|
||
| ## Provisioning | ||
|
|
||
| The deploy playbook applies the `quorum_list_server` Ansible role to hosts in | ||
| the `quorum_list_servers` inventory group. The role writes | ||
| `/etc/quorum-list-server/config.toml` as root-readable group material and starts | ||
| the non-root Docker process with the root group so it can read the mounted | ||
| configuration while using host networking. | ||
|
|
||
| By default, the server reads quorum data from the first seed node over the | ||
| private VPC RPC endpoint: | ||
|
|
||
| ```text | ||
| http://<seed-1-private-ip>:20002 | ||
| ``` | ||
|
|
||
| The role uses the network's existing Dash Core RPC credentials from Ansible | ||
| vars. The HTTP JSON-RPC hop stays on private VPC addresses and is restricted by | ||
| the network security groups; it is not exposed through the public ELB. Do not | ||
| commit those credentials into docs or examples. | ||
|
|
||
| Optional Ansible vars: | ||
|
|
||
| ```yaml | ||
| quorum_list_server_image: dashpay/quorum-list-server:latest | ||
| quorum_list_server_pull: true | ||
| quorum_list_server_port: 8080 | ||
| quorum_list_server_previous_blocks_offset: 8 | ||
| quorum_list_server_rpc_host: seed-1 | ||
| quorum_list_server_version_check_host: "" | ||
| quorum_list_server_address_host_override: "" | ||
| ``` | ||
|
|
||
| The role passes the generic Dash network class (`mainnet`, `testnet`, `devnet`, | ||
| or `regtest`) to `quorum-list-server`. The Terraform workspace keeps the | ||
| specific `devnet-<name>` deployment identity, while the service receives | ||
| `devnet` and selects the standard Platform devnet LLMQ settings. Set | ||
| `quorum_list_server_pull: false` only for an image tag built locally on the | ||
| target host. | ||
|
|
||
| ## Verify | ||
|
|
||
| After deploy: | ||
|
|
||
| ```bash | ||
| curl -fsS https://quorums.<network>.<main_domain>/health | ||
| curl -fsS https://quorums.<network>.<main_domain>/quorums | ||
| ``` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.