From 69da440d7024684e123597c53e18b110c8383d0f Mon Sep 17 00:00:00 2001 From: Al Date: Tue, 28 Jan 2025 21:11:44 +0700 Subject: [PATCH] chore: deployed penumbra-01 and updated systemd .service for penumbra --- bkk06 | 4 ++ bkk07 | 3 -- group_vars/penumbra.yaml | 2 +- host_vars/bkk06.yaml | 26 +++++++++ host_vars/penumbra-01.yaml | 27 ++++++++++ host_vars/penumbra-02.yaml | 5 +- inventory | 1 + roles/setup_install_penumbra/tasks/main.yaml | 53 ++++++++++++------- .../templates/validator.service.j2 | 3 +- 9 files changed, 99 insertions(+), 25 deletions(-) create mode 100644 host_vars/penumbra-01.yaml diff --git a/bkk06 b/bkk06 index 0ad6f4f..382e5ec 100644 --- a/bkk06 +++ b/bkk06 @@ -17,6 +17,7 @@ ajuna polimec unique bifrost +penumbra [routers] bkk50 @@ -27,6 +28,9 @@ haproxy-bkk06 [ajuna] rpc-ajuna-polkadot-01 +[penumbra] +penumbra-01 + [unique] rpc-unique-polkadot-01 diff --git a/bkk07 b/bkk07 index bb77e71..1424db5 100644 --- a/bkk07 +++ b/bkk07 @@ -63,9 +63,6 @@ rpc-hydration-polkadot-02 [kilt] rpc-kilt-polkadot-02 -[penumbra] -penumbra-02 - [kilt] rpc-kilt-polkadot-02 diff --git a/group_vars/penumbra.yaml b/group_vars/penumbra.yaml index 9e2cc67..255e5c6 100644 --- a/group_vars/penumbra.yaml +++ b/group_vars/penumbra.yaml @@ -3,7 +3,7 @@ penumbra_version: "0.81.2" penumbra_chain_id: "" cometbft_version: "0.37.14" -polkachu_version: "2681688" +polkachu_version: "3245417" # dl locations default_git_repo: "https://github.com/penumbra-zone/penumbra" diff --git a/host_vars/bkk06.yaml b/host_vars/bkk06.yaml index 58f7abe..daab512 100644 --- a/host_vars/bkk06.yaml +++ b/host_vars/bkk06.yaml @@ -2188,3 +2188,29 @@ lxc_nodes: - from_port: "{{ hostvars['rpc-bifrost-polkadot-01']['default_p2p_port'] }}" to_host: "{{ hostvars['rpc-bifrost-polkadot-01']['container_ip'] }}:{{ hostvars['rpc-bifrost-polkadot-01']['default_p2p_port'] }}" protocol: "tcp" + - host: "penumbra-01" + proxmox_config: + vmid: "1101" + hostname: "{{ hostvars['penumbra-01']['host_name'] }}" + ostemplate: "local:vztmpl/{{ default_container_template }}" + netif: "{{ hostvars['penumbra-01']['netif'] }}" + cores: 4 + memory: 8192 + swap: 8192 + password: "{{ default_password }}" + disk: "{{ zfs_storage }}:20" + mounts: '{"mp0":"{{ zfs_storage }}:250,mp={{ hostvars["penumbra-01"]["default_database_path"] }}"}' + onboot: True + unprivileged: True + validate_certs: False + description: "{{ hostvars['penumbra-01']['default_network'] }} {{ hostvars['penumbra-01']['default_node_type'] }}: {{ hostvars['penumbra-01']['host_name'] }}" + state: present + features: + - nesting=1 + port_forwards: + - from_port: "{{ hostvars['penumbra-01']['ansible_port'] }}" + to_host: "{{ hostvars['penumbra-01']['container_ip'] }}:{{ ssh_port }}" + protocol: "tcp" + - from_port: "{{ hostvars['penumbra-01']['default_cometbft_p2p_port'] }}" + to_host: "{{ hostvars['penumbra-01']['container_ip'] }}:{{ hostvars['penumbra-01']['default_cometbft_p2p_port'] }}" + protocol: "tcp" diff --git a/host_vars/penumbra-01.yaml b/host_vars/penumbra-01.yaml new file mode 100644 index 0000000..eecac86 --- /dev/null +++ b/host_vars/penumbra-01.yaml @@ -0,0 +1,27 @@ +--- +ansible_host: "160.22.181.181" +container_ip: "192.168.77.81" +ansible_port: 2481 +host_name: "penumbra-01.ct.rotko.net" +host_timezone: "Asia/Bangkok" +netif: '{"net0":"name=eth0,gw={{ default_nat_network_forward_cidr.split("/")[0] }},ip={{ default_host_ip }}/8,bridge={{ default_nat_device }}"}' +role: "penumbra" +pinned_service: True + +default_network: "penumbra" +default_node_type: "validator" +#need to be uniqued +default_cometbft_p2p_port: 26681 + +default_penumbra_metric_port: 9600 +default_cometbft_rpc_port: 26657 +default_acbi_port: 26658 +default_grpc_port: 8080 +default_cometbft_database: "goleveldb" +# default_p2p_port: 33691 +# default_p2p_port_ws: 34691 +# default_p2p_port_wss: 35691 +# default_rpc_port: 9691 +# default_secure_rpc_port: 42691 +# default_prom_port: 7691 +# zabbix_ext_port: 10691 diff --git a/host_vars/penumbra-02.yaml b/host_vars/penumbra-02.yaml index e0054e3..608784e 100644 --- a/host_vars/penumbra-02.yaml +++ b/host_vars/penumbra-02.yaml @@ -10,10 +10,13 @@ pinned_service: True default_network: "penumbra" default_node_type: "validator" -default_penumbra_metric_port: 9600 +#need to be uniqued default_cometbft_p2p_port: 26682 + +default_penumbra_metric_port: 9600 default_cometbft_rpc_port: 26657 default_acbi_port: 26658 +default_grpc_port: 8080 default_cometbft_database: "goleveldb" # default_p2p_port: 33691 # default_p2p_port_ws: 34691 diff --git a/inventory b/inventory index 985af66..d9dbec1 100644 --- a/inventory +++ b/inventory @@ -40,6 +40,7 @@ rpc-kilt-polkadot-01 rpc-kilt-polkadot-02 [penumbra] +penumbra-01 penumbra-02 [cumulus] diff --git a/roles/setup_install_penumbra/tasks/main.yaml b/roles/setup_install_penumbra/tasks/main.yaml index 161eb72..3da0d0e 100644 --- a/roles/setup_install_penumbra/tasks/main.yaml +++ b/roles/setup_install_penumbra/tasks/main.yaml @@ -136,28 +136,43 @@ group: "{{ default_user }}" when: not cometbft_dir.stat.exists - #NOTE: i dont know if this will work, but the wget cmd that commented out below will be working + # NOTE: havent tested it +# - name: Download Polkachu Cometbft snapshot +# ansible.builtin.uri: +# url: "https://snapshots.polkachu.com/snapshots/penumbra/penumbra_{{ polkachu_version }}.tar.lz4" +# dest: "{{ default_database_path }}/node0/penumbra_{{ polkachu_version }}.tar.lz4" +# method: GET +# force: true +# follow_redirects: safe +# use_proxy: true +# validate_certs: true +# mode: "0640" +# owner: "{{ default_user }}" +# group: "{{ default_user }}" +# force_basic_auth: true +# timeout: 3600 +# url_username: "" +# url_password: "" +# creates: "{{ default_database_path }}/node0/penumbra_{{ polkachu_version }}.tar.lz4" +# http_agent: "Mozilla/5.0" +# force_ipv4: true +# become: true +# become_user: "{{ default_user }}" +# when: not cometbft_dir.stat.exists +# register: download_result +# until: download_result is succeeded +# retries: 3 +# delay: 5 + - name: Download Polkachu Cometbft snapshot - ansible.builtin.get_url: - url: "https://snapshots.polkachu.com/snapshots/penumbra/penumbra_{{ polkachu_version }}.tar.lz4" - dest: "{{ default_database_path }}/node0/penumbra_{{ polkachu_version }}.tar.lz4" - owner: "{{ default_user }}" - group: "{{ default_user }}" - mode: "0640" - force: True + ansible.builtin.shell: + cmd: "wget -O {{ default_database_path }}/node0/penumbra_{{ polkachu_version }}.tar.lz4 https://snapshots.polkachu.com/snapshots/penumbra/penumbra_{{ polkachu_version }}.tar.lz4 --inet4-only" become: True become_user: "{{ default_user }}" when: not cometbft_dir.stat.exists - -# - name: Download Polkachu Cometbft snapshot -# ansible.builtin.shell: -# cmd: "wget -O {{ default_database_path }}/node0/penumbra_{{ polkachu_version }}.tar.lz4 https://snapshots.polkachu.com/snapshots/penumbra/penumbra_{{ polkachu_version }}.tar.lz4 --inet4-only" -# become: True -# become_user: "{{ default_user }}" -# when: not cometbft_dir.stat.exists -# # when: ansible_local['noderole']['node']['version'] != penumbra_version -# args: -# executable: /bin/bash + # when: ansible_local['noderole']['node']['version'] != penumbra_version + args: + executable: /bin/bash - name: Extract and decompress Polkachu snapshot ansible.builtin.shell: @@ -169,7 +184,7 @@ become_user: "{{ default_user }}" when: not cometbft_dir.stat.exists -# NOTE: i still commented this out cause its58GB file and still for experimenting in case something wrong +# NOTE: i still commented this out cause its 71GB file and still for experimenting in case something wrong # - name: Remove lz4 archive after decompression # ansible.builtin.file: # path: "{{ default_database_path }}/node0/penumbra_{{ polkachu_version }}.tar.lz4" diff --git a/roles/setup_install_penumbra/templates/validator.service.j2 b/roles/setup_install_penumbra/templates/validator.service.j2 index 1da32f1..62ce0f0 100644 --- a/roles/setup_install_penumbra/templates/validator.service.j2 +++ b/roles/setup_install_penumbra/templates/validator.service.j2 @@ -11,7 +11,8 @@ ExecStart={{ default_home_path }}/pd start \ --home {{ default_database_path }}/node0/pd \ --metrics-bind 0.0.0.0:{{ default_penumbra_metric_port }} \ --cometbft-addr http://127.0.0.1:{{ default_cometbft_rpc_port }} \ - --abci-bind 127.0.0.1:{{ default_acbi_port }} + --abci-bind 127.0.0.1:{{ default_acbi_port }} \ + --grpc-bind 127.0.0.1:{{ default_grpc_port }} # Consider adding an HTTPS URL if you have DNS set up: # ExecStart=/usr/local/bin/pd start --grpc-auto-https www.example.com