-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ADD: Besu Update Changes * ADD: logging for debuging * FIX: Replace loop * ADD: logging * FIX: File not Found * FIX: Jest Test
- Loading branch information
Showing
23 changed files
with
194 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
vars_files: | ||
- ../../../../defaults/stereum_defaults.yaml | ||
|
||
tasks: | ||
- name: "Include update-changes" | ||
include_role: | ||
name: "update-changes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
#dependency: | ||
# name: galaxy | ||
driver: | ||
name: docker | ||
platforms: | ||
- name: "update-changes--2.2.1--ubuntu-23.04" | ||
image: ubuntu:lunar | ||
# - name: "configure-updates--default--centos-8" | ||
# image: geerlingguy/docker-centos8-ansible | ||
provisioner: | ||
name: ansible | ||
env: | ||
ANSIBLE_PIPELINING: "True" | ||
lint: | | ||
set -e | ||
yamllint . | ||
ansible-lint . | ||
scenario: | ||
test_sequence: | ||
- destroy | ||
- create | ||
- prepare | ||
- converge | ||
- idempotence | ||
- verify | ||
- destroy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: "Include update-changes" | ||
include_role: | ||
name: "update-changes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
- name: Prepare | ||
hosts: all | ||
tasks: | ||
- name: Make sure Stereum's config path exists | ||
file: | ||
path: "/etc/stereum/services" | ||
state: directory | ||
owner: "root" | ||
group: "root" | ||
mode: 0644 | ||
become: yes | ||
|
||
- name: Create Besu config | ||
copy: | ||
dest: "/etc/stereum/services/9bf280d1-72ae-d8f3-f4da-3684727e06a0.yaml" | ||
owner: "root" | ||
group: "root" | ||
mode: 0644 | ||
content: | | ||
service: BesuService | ||
id: 9bf280d1-72ae-d8f3-f4da-3684727e06a0 | ||
configVersion: 1 | ||
command: | ||
- --network=holesky | ||
- --data-path=/opt/app/data | ||
- --data-storage-format=BONSAI | ||
- --sync-mode=SNAP | ||
- --p2p-port=30303 | ||
- --p2p-host=0.0.0.0 | ||
- --rpc-http-enabled=true | ||
- --rpc-http-host=0.0.0.0 | ||
- --rpc-http-cors-origins=* | ||
- --rpc-http-port=8545 | ||
- --rpc-ws-enabled=true | ||
- --rpc-ws-host=0.0.0.0 | ||
- --rpc-ws-port=8546 | ||
- --host-allowlist=* | ||
- --metrics-enabled | ||
- --metrics-host=0.0.0.0 | ||
- --metrics-port=9545 | ||
- --logging=INFO | ||
- --engine-host-allowlist=* | ||
- --engine-rpc-port=8551 | ||
- --engine-jwt-secret=/engine.jwt | ||
- --pruning-enabled=false | ||
- --pruning-blocks-retained=0 | ||
- --pruning-block-confirmations=0 | ||
entrypoint: | ||
- besu | ||
env: | ||
JAVA_OPTS: -Xmx4g | ||
image: hyperledger/besu:24.3.3 | ||
ports: | ||
- 0.0.0.0:30303:30303/tcp | ||
- 0.0.0.0:30303:30303/udp | ||
- 127.0.0.1:8545:8545/tcp | ||
- 127.0.0.1:8546:8546/tcp | ||
volumes: | ||
- /opt/stereum/besu-9bf280d1-72ae-d8f3-f4da-3684727e06a0/data:/opt/app/data | ||
- /opt/stereum/besu-9bf280d1-72ae-d8f3-f4da-3684727e06a0/engine.jwt:/engine.jwt | ||
user: "2000" | ||
autoupdate: true | ||
network: holesky | ||
dependencies: | ||
executionClients: [] | ||
consensusClients: [] | ||
mevboost: [] | ||
otherServices: [] | ||
become: yes | ||
|
||
#EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: false | ||
tasks: | ||
# Besu | ||
- name: Read Besu file | ||
slurp: | ||
src: "/etc/stereum/services/9bf280d1-72ae-d8f3-f4da-3684727e06a0.yaml" | ||
register: Besu_service_configuration_raw | ||
|
||
- name: Parse Service configurations | ||
set_fact: | ||
Besu_service_configuration: "{{ Besu_service_configuration_raw['content'] | b64decode | from_yaml }}" | ||
|
||
- debug: | ||
msg: "{{ Besu_service_configuration }}" | ||
- debug: | ||
msg: "{{ Besu_service_configuration_raw['content'] | b64decode }}" | ||
|
||
- assert: | ||
that: | ||
- Besu_service_configuration.command | select('match', '--pruning-enabled=false') | length == 0 | ||
- Besu_service_configuration.command | select('match', '--pruning-blocks-retained=0') | length == 0 | ||
- Besu_service_configuration.command | select('match', '--pruning-block-confirmations=0') | length == 0 | ||
# EOF |
22 changes: 22 additions & 0 deletions
22
controls/roles/update-changes/tasks/2.2.1/besu_changes.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
- name: Read service file | ||
slurp: | ||
src: "{{ config_file.path }}" | ||
register: service_configuration_raw | ||
|
||
- name: Parse service's configuration | ||
set_fact: | ||
service_configuration: "{{ service_configuration_raw['content'] | b64decode | from_yaml }}" | ||
service_configuration_text: "{{ service_configuration_raw['content'] | b64decode }}" | ||
|
||
- name: Remove tags from Besu Config | ||
lineinfile: | ||
path: "{{ config_file.path }}" | ||
regexp: "{{ item }}" | ||
state: absent | ||
loop: | ||
- pruning-enabled | ||
- pruning-blocks-retained | ||
- pruning-block-confirmations | ||
when: | ||
- service_configuration.service == "BesuService" |
11 changes: 11 additions & 0 deletions
11
controls/roles/update-changes/tasks/2.2.1/updates-221.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- name: Find service configs | ||
find: | ||
paths: "/etc/stereum/services" | ||
register: service_config_files | ||
|
||
- name: Include Besu Changes | ||
include_tasks: besu_changes.yaml | ||
loop: "{{ service_config_files.files }}" | ||
loop_control: | ||
loop_var: config_file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
- name: Include 2.1.5 Update Scripts | ||
include_tasks: "2.1.5/updates-215.yaml" | ||
ignore_errors: yes | ||
|
||
- name: Include 2.2.1 Update Scripts | ||
include_tasks: "2.2.1/updates-221.yaml" | ||
ignore_errors: yes | ||
# EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters