mirror of
https://github.com/matter-labs/ansible-en-role.git
synced 2025-12-06 02:49:55 +00:00
added an example
This commit is contained in:
@ -14,7 +14,9 @@ This role has been tested on:
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Minimal required variables that has to be set:
|
For a very simple minimal working example, see example_playbooks directory
|
||||||
|
|
||||||
|
Minimal required variables that have to be set:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
database_name: ""
|
database_name: ""
|
||||||
|
|||||||
@ -22,10 +22,6 @@ postgres_arguments:
|
|||||||
- -c
|
- -c
|
||||||
- max_connections=256
|
- max_connections=256
|
||||||
- -c
|
- -c
|
||||||
- shared_buffers=47616MB
|
|
||||||
- -c
|
|
||||||
- effective_cache_size=142848MB
|
|
||||||
- -c
|
|
||||||
- maintenance_work_mem=2GB
|
- maintenance_work_mem=2GB
|
||||||
- -c
|
- -c
|
||||||
- checkpoint_completion_target=0.9
|
- checkpoint_completion_target=0.9
|
||||||
|
|||||||
23
example_playbooks/mainnet_with_snapshots_recovery/README.md
Normal file
23
example_playbooks/mainnet_with_snapshots_recovery/README.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Mainnet Snapshots Recovery playbook
|
||||||
|
|
||||||
|
This directory is simple example how to set up EN using this role. It comes with snapshots recovery enabled by default.\
|
||||||
|
**Note that for simplicity it's using postgres database
|
||||||
|
with a very unsecure password and the EN is just started on the same machine**
|
||||||
|
|
||||||
|
To run this playbook, first install dependencies
|
||||||
|
|
||||||
|
```shell
|
||||||
|
ansible-galaxy install -r requirements.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
and then you can run the playbook using
|
||||||
|
|
||||||
|
```shell
|
||||||
|
ansible-playbook playbook.yml -i hosts.ini -K
|
||||||
|
```
|
||||||
|
|
||||||
|
To see logs you can use
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker logs en-external_node-1
|
||||||
|
```
|
||||||
@ -0,0 +1,2 @@
|
|||||||
|
[local]
|
||||||
|
localhost ansible_connection=local
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
- hosts: all
|
||||||
|
become: true
|
||||||
|
vars:
|
||||||
|
database_name: "zksync_ext_node_mainnet"
|
||||||
|
database_username: "postgres"
|
||||||
|
database_password: "notsecurepassword"
|
||||||
|
eth_l1_url: "https://ethereum-rpc.publicnode.com"
|
||||||
|
main_node_url: "https://zksync2-mainnet.zksync.io"
|
||||||
|
l1_chain_id: "1"
|
||||||
|
l2_chain_id: "324"
|
||||||
|
enable_snapshots_recovery: true
|
||||||
|
snapshots_bucket_base_url: "zksync-era-mainnet-external-node-snapshots"
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- external_node
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
roles:
|
||||||
|
- name: geerlingguy.docker
|
||||||
|
src: https://github.com/geerlingguy/ansible-role-docker
|
||||||
|
version: "7.1.0"
|
||||||
|
|
||||||
|
- name: external_node
|
||||||
|
src: https://github.com/matter-labs/ansible-en-role
|
||||||
|
version: "v3.0.0"
|
||||||
|
|
||||||
|
collections:
|
||||||
|
- name: community.general
|
||||||
|
version: 8.4.0
|
||||||
@ -2,7 +2,7 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
- src: geerlingguy.docker
|
- src: geerlingguy.docker
|
||||||
version: "7.1.0"
|
version: "7.1.0"
|
||||||
when: docker_install
|
when: docker_install_compose
|
||||||
|
|
||||||
galaxy_info:
|
galaxy_info:
|
||||||
role_name: external_node
|
role_name: external_node
|
||||||
|
|||||||
@ -47,7 +47,11 @@ services:
|
|||||||
- {{ argument }}
|
- {{ argument }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
external_node:
|
external_node:
|
||||||
|
{% if not external_node_raw_docker_tag %}
|
||||||
image: "matterlabs/external-node:v{{ external_node_version }}"
|
image: "matterlabs/external-node:v{{ external_node_version }}"
|
||||||
|
{% else %}
|
||||||
|
image: "matterlabs/external-node:{{ external_node_raw_docker_tag }}"
|
||||||
|
{% endif %}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
@ -103,3 +107,7 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- "external_node.env"
|
- "external_node.env"
|
||||||
- "postgres.env"
|
- "postgres.env"
|
||||||
|
{% if enable_snapshots_recovery %}
|
||||||
|
command:
|
||||||
|
- --enable-snapshots-recovery
|
||||||
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user