Skip to content

Commit

Permalink
add poseo install
Browse files Browse the repository at this point in the history
  • Loading branch information
hitchhooker committed Jan 16, 2024
1 parent d0dc195 commit 6de54f4
Show file tree
Hide file tree
Showing 11 changed files with 136 additions and 3 deletions.
1 change: 1 addition & 0 deletions bkk01
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ bkk00
[polkadot]
ksm01
dot01
pso01

[proxmox_hosts]
bkk01
Expand Down
1 change: 1 addition & 0 deletions bkk02
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ bkk00
[polkadot]
dot02
ksm02
pso02

[proxmox_hosts]
bkk02
Expand Down
1 change: 1 addition & 0 deletions group_vars/polkadot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ default_base_path: /opt/polkadot
default_database_path: "/opt/polkadot/chains"
default_log_level: info
default_network: polkadot
default_chain_spec: "{{ default_base_path }}/paseo.json"
default_node_type: validator
# pruning options: archive(rpc), archive-canonical(rpc/finalized) 256(default), 1000(validator)
# default_pruning: 1000
Expand Down
28 changes: 27 additions & 1 deletion host_vars/bkk01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ lxc_nodes:
hostname: "{{ hostvars['ksm01']['host_name'] }}"
ostemplate: 'local:vztmpl/{{ default_container_template }}'
netif: "{{ hostvars['ksm01']['netif'] }}"
cores: 4
cores: 2
memory: 30720
swap: 15360
password: "{{ default_password }}"
Expand All @@ -71,4 +71,30 @@ lxc_nodes:
- from_port: "{{ hostvars['ksm01']['default_p2p_port'] }}"
to_host: "{{ hostvars['ksm01']['container_ip'] }}:{{ hostvars['ksm01']['default_p2p_port'] }}"
protocol: "tcp"
- host: "pso01"
proxmox_config:
vmid: "141"
hostname: "{{ hostvars['pso01']['host_name'] }}"
ostemplate: 'local:vztmpl/{{ default_container_template }}'
netif: "{{ hostvars['pso01']['netif'] }}"
cores: 2
memory: 16384
swap: 16384
password: "{{ default_password }}"
disk: "{{ default_storage }}:20"
mounts: '{"mp0":"{{ default_storage }}:80,mp={{ hostvars["pso01"]["default_base_path"] }}"}'
onboot: True
unprivileged: True
validate_certs: False
description: "kusama validator node: {{ hostvars['pso01']['host_name'] }}"
state: present
features:
- nesting=1
port_forwards:
- from_port: "{{ hostvars['pso01']['ansible_port'] }}"
to_host: "{{ hostvars['pso01']['container_ip'] }}:22"
protocol: "tcp"
- from_port: "{{ hostvars['pso01']['default_p2p_port'] }}"
to_host: "{{ hostvars['pso01']['container_ip'] }}:{{ hostvars['pso01']['default_p2p_port'] }}"
protocol: "tcp"
...
26 changes: 26 additions & 0 deletions host_vars/bkk02.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,30 @@ lxc_nodes:
- from_port: "{{ hostvars['ksm02']['default_p2p_port'] }}"
to_host: "{{ hostvars['ksm02']['container_ip'] }}:{{ hostvars['ksm02']['default_p2p_port'] }}"
protocol: "tcp"
- host: "pso02"
proxmox_config:
vmid: "142"
hostname: "{{ hostvars['pso02']['host_name'] }}"
ostemplate: 'local:vztmpl/{{ default_container_template }}'
netif: "{{ hostvars['pso02']['netif'] }}"
cores: 2
memory: 16384
swap: 16384
password: "{{ default_password }}"
disk: "{{ default_storage }}:20"
mounts: '{"mp0":"{{ default_storage }}:80,mp={{ hostvars["pso02"]["default_base_path"] }}"}'
onboot: True
unprivileged: True
validate_certs: False
description: "kusama validator node: {{ hostvars['pso02']['host_name'] }}"
state: present
features:
- nesting=1
port_forwards:
- from_port: "{{ hostvars['pso02']['ansible_port'] }}"
to_host: "{{ hostvars['pso02']['container_ip'] }}:22"
protocol: "tcp"
- from_port: "{{ hostvars['pso02']['default_p2p_port'] }}"
to_host: "{{ hostvars['pso02']['container_ip'] }}:{{ hostvars['pso02']['default_p2p_port'] }}"
protocol: "tcp"
...
28 changes: 28 additions & 0 deletions host_vars/pso01.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
ansible_host: "27.131.160.106"
container_ip: "192.168.69.141"
ansible_port: "2141"
host_name: "pso01.rotko.net"
host_timezone: "Asia/Bangkok"
netif: '{"net0":"name=eth0,gw={{ default_nat_network_forward_cidr.split("/")[0] }},ip={{ default_host_ip }}/24,bridge={{ default_nat_device }}"}'
role: "polkadot"
pinned_service: True

# Variables

default_telemetry_name: "Rotko Networks - {{ host_name.split('.')[0] }} {{ default_node_type | capitalize }}"
default_network: "paseo"
default_chain_spec: "{{ default_base_path }}/paseo.raw.json"
default_chain_spec_dl_url: "https://raw.githubusercontent.com/paseo-network/runtimes/main/chain-specs/paseo.raw.json"
default_node_type: "validator"
default_pruning: 1000
default_database: paritydb
default_syncmode: warp
default_p2p_port: 33141
default_p2p_port_ws: 34141
default_p2p_port_wss: 35141
default_rpc_port: 9141
default_secure_rpc_port: 42141
default_prom_port: 7141
zabbix_ext_port: 10141
...
28 changes: 28 additions & 0 deletions host_vars/pso02.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
ansible_host: "27.131.160.106"
container_ip: "192.168.69.142"
ansible_port: "2142"
host_name: "pso02.rotko.net"
host_timezone: "Asia/Bangkok"
netif: '{"net0":"name=eth0,gw={{ default_nat_network_forward_cidr.split("/")[0] }},ip={{ default_host_ip }}/24,bridge={{ default_nat_device }}"}'
role: "polkadot"
pinned_service: True

# Variables

default_telemetry_name: "Rotko Networks - {{ host_name.split('.')[0] }} {{ default_node_type | capitalize }}"
default_network: "paseo"
default_chain_spec: "{{ default_base_path }}/paseo.raw.json"
default_chain_spec_dl_url: "https://raw.githubusercontent.com/paseo-network/runtimes/main/chain-specs/paseo.raw.json"
default_node_type: "validator"
default_pruning: 1000
default_database: paritydb
default_syncmode: warp
default_p2p_port: 33142
default_p2p_port_ws: 34142
default_p2p_port_wss: 35142
default_rpc_port: 9142
default_secure_rpc_port: 42142
default_prom_port: 7142
zabbix_ext_port: 10142
...
10 changes: 10 additions & 0 deletions roles/setup_install_polkadot/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
- name: Gather facts
ansible.builtin.setup:

- name: Check if default network is Paseo

Check failure on line 35 in roles/setup_install_polkadot/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / build (3.10)

fqcn[action-core]

Use FQCN for builtin module actions (set_fact).
set_fact:
is_paseo_network: "{{ default_network == 'paseo' }}"

- name: Download Paseo chain spec

Check failure on line 39 in roles/setup_install_polkadot/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / build (3.10)

fqcn[action-core]

Use FQCN for builtin module actions (get_url).

Check failure on line 39 in roles/setup_install_polkadot/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / build (3.10)

risky-file-permissions

File permissions unset or incorrect.
get_url:
url: "{{ default_chain_spec_dl_url }}"
dest: "{{ default_chain_spec }}"
when: is_paseo_network

- name: Copy Polkadot systemd service for specific node type
ansible.builtin.template:
src: "{{ 'polkadot_' + default_node_type + '.service.j2' }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ User={{ default_user }}
Group={{ default_group }}
ExecStart={{ default_base_path }}/polkadot \
--name "{{ default_telemetry_name }}" \
--chain {{ default_network }} \
{% if default_network == 'paseo' %}
--chain-spec {{ default_chain_spec }} \
{% else %}
--chain {{ default_network }} \
{% endif %}
--base-path {{ default_base_path }} \
--database paritydb \
--state-pruning 256 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ User={{ default_user }}
Group={{ default_group }}
ExecStart={{ default_base_path }}/polkadot \
--name "{{ default_telemetry_name }}" \
--chain {{ default_network }} \
{% if default_network == 'paseo' %}
--chain-spec {{ default_chain_spec }} \
{% else %}
--chain {{ default_network }} \
{% endif %}
--base-path {{ default_base_path }} \
--database {{ default_database }} \
--state-pruning archive \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ KillSignal=SIGHUP
ExecStart={{ default_base_path }}/polkadot \
--validator \
--base-path {{ default_base_path }} \
{% if default_network == 'paseo' %}
--chain-spec {{ default_chain_spec }} \
{% else %}
--chain {{ default_network }} \
{% endif %}
--database {{ default_database }} \
--name "{{ hostvars[inventory_hostname]['default_telemetry_name'] | default(host_name) }}" \
--telemetry-url 'wss://telemetry-backend.w3f.community/submit 1' \
Expand Down

0 comments on commit 6de54f4

Please sign in to comment.