mirror of
https://github.com/matter-labs/ansible-en-role.git
synced 2025-12-06 10:59:56 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a77daacf3 | |||
| 8290a1cd9b | |||
| 191ebeced5 | |||
| 0cdbf98bf1 | |||
| ce94f307e7 | |||
| 9a8b0af6c3 | |||
| 7500e2b2da | |||
| ace0df965b |
@ -100,7 +100,7 @@ Basic auth secret can be generated by `htpasswd` and `sed` for interpolation:
|
||||
Skip this step if you are recovering from a snapshot!
|
||||
|
||||
* [Era Mainnet latest dump](https://storage.googleapis.com/zksync-era-mainnet-external-node-backups/external_node_latest.pgdump)
|
||||
* [Era Sepolia Testnet latest dump](https://storage.googleapis.com/zksync-era-boojnet-external-node-snapshots/external_node_latest.pgdump)
|
||||
* [Era Sepolia Testnet latest dump](https://storage.googleapis.com/zksync-era-testnet-sepolia-external-node-backups/external_node_latest.pgdump)
|
||||
|
||||
Downloaded dump file should be placed into `{{ storage_directory }}/pg_backups` directory (`/usr/src/en/pg_backups` by default)
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ docker_compose_version: "v2.23.0"
|
||||
# Versions of External Node and 3rd party components
|
||||
traefik_version: 2.11
|
||||
postgres_version: 14
|
||||
external_node_version: 24.6.0
|
||||
external_node_version: 24.16.0
|
||||
external_node_raw_docker_tag: ""
|
||||
vmagent_version: 1.100.1
|
||||
cadvisor_version: 0.47.2
|
||||
@ -73,6 +73,12 @@ force_pg_restore: false
|
||||
enable_snapshots_recovery: false
|
||||
snapshots_bucket_base_url: ""
|
||||
|
||||
# https://github.com/matter-labs/zksync-era/blob/main/docs/guides/external-node/09_decentralization.md
|
||||
enable_consensus: false
|
||||
consensus_secrets_file: ""
|
||||
consensus_port: 3054
|
||||
consensus_outbound: []
|
||||
|
||||
# External Node and database options
|
||||
database_name: ""
|
||||
database_username: ""
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
when: vars[item] == ""
|
||||
with_items: "{{ en_required_variables }}"
|
||||
|
||||
- name: Copy main configs
|
||||
- name: Create main configs
|
||||
ansible.builtin.template:
|
||||
src: '{{ item.src }}'
|
||||
dest: '{{ item.dest }}'
|
||||
@ -51,7 +51,7 @@
|
||||
- src: "templates/postgres.env.j2"
|
||||
dest: "{{ configuration_directory }}/postgres.env"
|
||||
|
||||
- name: Copy restore script
|
||||
- name: Create restore script
|
||||
register: restore_dump_script
|
||||
ansible.builtin.template:
|
||||
src: 'templates/restore_dump.sh.j2'
|
||||
@ -64,7 +64,7 @@
|
||||
when: enable_monitoring and ( vars[item] == "" )
|
||||
with_items: "{{ monitoring_required_variables }}"
|
||||
|
||||
- name: Copy monitoring configs
|
||||
- name: Create monitoring configs
|
||||
when: enable_monitoring
|
||||
ansible.builtin.template:
|
||||
src: '{{ item.src }}'
|
||||
@ -76,6 +76,21 @@
|
||||
- src: "templates/vmagent-config.yml.j2"
|
||||
dest: "{{ configuration_directory }}/vmagent-config.yml"
|
||||
|
||||
- name: Create consensus config
|
||||
when: enable_consensus
|
||||
ansible.builtin.template:
|
||||
src: "templates/consensus_config.yaml.j2"
|
||||
dest: "{{ configuration_directory }}/consensus_config.yaml"
|
||||
mode: '0644'
|
||||
|
||||
- name: Decrypt consensus_secrets
|
||||
when: enable_consensus
|
||||
ansible.builtin.copy:
|
||||
src: "{{ consensus_secrets_file }}"
|
||||
dest: "{{ configuration_directory }}/consensus_secrets.yaml"
|
||||
decrypt: true
|
||||
mode: '0600'
|
||||
|
||||
- name: Run docker-compose without monitoring
|
||||
when: not enable_monitoring
|
||||
ansible.builtin.shell:
|
||||
|
||||
9
templates/consensus_config.yaml.j2
Normal file
9
templates/consensus_config.yaml.j2
Normal file
@ -0,0 +1,9 @@
|
||||
server_addr: '0.0.0.0:3054'
|
||||
public_addr: '{{ ansible_default_ipv4.address }}:{{ consensus_port }}'
|
||||
max_payload_size: 5000000
|
||||
gossip_dynamic_inbound_limit: 100
|
||||
gossip_static_outbound:
|
||||
{% for item in consensus_outbound %}
|
||||
- key: {{ item.key }}
|
||||
addr: {{ item.addr }}
|
||||
{% endfor %}
|
||||
@ -82,6 +82,9 @@ services:
|
||||
- {{ rpc_ws_port }}
|
||||
- {{ healthcheck_port }}
|
||||
- {{ metrics_port }}
|
||||
{% if enable_consensus %}
|
||||
- {{ consensus_port }}
|
||||
{% endif %}
|
||||
environment:
|
||||
ZKSYNC_HOME: "/"
|
||||
EN_STATE_CACHE_PATH: /db/state_keeper
|
||||
@ -96,6 +99,10 @@ services:
|
||||
EN_MAX_BLOCKS_PER_TREE_BATCH: 200
|
||||
MISC_LOG_FORMAT: json
|
||||
RUST_LOG: {{ rust_log }}
|
||||
{% if enable_consensus %}
|
||||
EN_CONSENSUS_CONFIG_PATH: /etc/consensus_config.yaml
|
||||
EN_CONSENSUS_SECRETS_PATH: /run/secrets/consensus_secrets.yaml
|
||||
{% endif %}
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://localhost:{{ healthcheck_port }}/health" ]
|
||||
interval: 1m
|
||||
@ -104,10 +111,24 @@ services:
|
||||
start_period: 1m
|
||||
volumes:
|
||||
- "{{ storage_directory }}/db:/db"
|
||||
{% if enable_consensus %}
|
||||
- "consensus_config.yaml:/etc/consensus_config.yaml"
|
||||
{% endif %}
|
||||
env_file:
|
||||
- "external_node.env"
|
||||
- "postgres.env"
|
||||
{% if enable_snapshots_recovery %}
|
||||
command:
|
||||
{% if enable_snapshots_recovery %}
|
||||
- --enable-snapshots-recovery
|
||||
{% endif %}
|
||||
{% if enable_consensus %}
|
||||
- --enable-consensus
|
||||
secrets:
|
||||
- consensus_secrets
|
||||
{% endif %}
|
||||
|
||||
{% if enable_consensus %}
|
||||
secrets:
|
||||
consensus_secrets:
|
||||
file: consensus_secrets.yaml
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user