Skip to content

Commit

Permalink
Merge branch 'master' into adding-mev-relay
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Oct 12, 2023
2 parents 55eea3c + a78004b commit 9ae53cd
Show file tree
Hide file tree
Showing 17 changed files with 709 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ A collection of reusable ansible components used by the EthPandaOps team.
- [ethereum_genesis](roles/ethereum_genesis)
- [ethereum_metrics_exporter](roles/ethereum_metrics_exporter)
- [ethstats](roles/ethstats)
- [xatu_sentry](roles/xatu_sentry)
- [goomy](roles/goomy)
- [mev_boost](roles/mev_boost)
- [mev_relay](roles/mev_relay)
- [powfaucet](roles/powfaucet)
- [xatu_sentry](roles/xatu_sentry)

### Ethereum client pair
- [ethereum_node](roles/ethereum_node)
Expand Down Expand Up @@ -48,6 +50,7 @@ A collection of reusable ansible components used by the EthPandaOps team.
- [json_rpc_snooper](roles/json_rpc_snooper)
- [k3s](roles/k3s)
- [litestream](roles/litestream)
- [logsprout](roles/logsprout)
- [oh_my_zsh](roles/oh_my_zsh)
- [prometheus](roles/prometheus)
- [s3_cron_backup](roles/s3_cron_backup)
Expand Down
38 changes: 38 additions & 0 deletions roles/goomy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# ethpandaops.general.goomy

This role will run a [goomy](https://github.com/ethpandaops/goomy-blob) blob-spammer within a docker container.

## Requirements

You'll need docker on the target system. Make sure to install it upfront.

## Role Variables

Default variables are defined in [defaults/main.yaml](defaults/main.yaml)

## Dependencies

You'll need docker to run this role. One way of installing docker could be via ansible galaxy with the following dependencies set within `requirements.yaml`:

```yaml
roles:
- src: geerlingguy.docker
version: latest
- src: geerlingguy.pip
version: latest
```
## Example Playbook
Your playbook could look like this:
```yaml
- hosts: localhost
become: true
roles:
- role: geerlingguy.docker
- role: geerlingguy.pip
pip_install_packages:
- name: docker
- role: ethpandaops.general.goomy
```
26 changes: 26 additions & 0 deletions roles/goomy/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
goomy_user: "goomy"
goomy_cleanup: false # when set to "true" it will remove the container

goomy_container_name: "goomy"
goomy_container_image: "ethpandaops/goomy-blob:master"
goomy_container_pull: false
goomy_container_env: {}
goomy_container_ports: []
goomy_container_volumes: []

goomy_container_stop_timeout: "300"
goomy_container_networks: []

goomy_command:
- ./blob-spammer
- --privkey
- "{{ goomy_private_key }}"
- "{{ goomy_scenario }}"
goomy_rpc_args: "{{ ['--rpchost '] | product(goomy_rpc_urls) | map('join') | join(' ') | split(' ') }}"
goomy_container_command: "{{ goomy_command + goomy_rpc_args + goomy_extra_args }}"

goomy_rpc_urls:
- your-execution-node:8545
goomy_private_key: ""
goomy_scenario: "combined"
goomy_extra_args: ["--sidecars", "2", "--throughput", "2", "--max-pending", "3"]
5 changes: 5 additions & 0 deletions roles/goomy/handlers/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- name: Restart goomy sentry container
community.docker.docker_container:
name: "{{ goomy_container_name }}"
state: started
restart: true
5 changes: 5 additions & 0 deletions roles/goomy/tasks/cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- name: Remove goomy container
community.docker.docker_container:
name: "{{ goomy_container_name }}"
state: absent
when: goomy_cleanup
7 changes: 7 additions & 0 deletions roles/goomy/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: Setup goomy
ansible.builtin.import_tasks: setup.yaml
when: not goomy_cleanup

- name: Cleanup goomy
ansible.builtin.import_tasks: cleanup.yaml
when: goomy_cleanup
25 changes: 25 additions & 0 deletions roles/goomy/tasks/setup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
- name: Add goomy user
ansible.builtin.user:
name: "{{ goomy_user }}"
shell: /bin/nologin

- name: Get goomy uid
ansible.builtin.getent:
database: passwd
key: "{{ goomy_user }}"
register: goomy_user_getent

- name: Run goomy container
community.docker.docker_container:
name: "{{ goomy_container_name }}"
image: "{{ goomy_container_image }}"
user: "{{ goomy_user_getent.ansible_facts.getent_passwd[goomy_user][1] }}"
state: started
restart_policy: always
stop_timeout: "{{ goomy_container_stop_timeout }}"
ports: "{{ goomy_container_ports }}"
volumes: "{{ goomy_container_volumes }}"
env: "{{ goomy_container_env }}"
pull: "{{ goomy_container_pull | bool }}"
networks: "{{ goomy_container_networks }}"
command: "{{ goomy_container_command }}"
39 changes: 39 additions & 0 deletions roles/logsprout/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# ethpandaops.general.logsprout

This role will run a [logsprout](https://github.com/gliderlabs/logspout) within a docker container. It can be used to ship logs to a remote syslog server.

## Requirements

You'll need docker on the target system. Make sure to install it upfront.

## Role Variables

Default variables are defined in [defaults/main.yaml](defaults/main.yaml)

## Dependencies

You'll need docker to run this role. One way of installing docker could be via ansible galaxy with the following dependencies set within `requirements.yaml`:

```yaml
roles:
- src: geerlingguy.docker
version: latest
- src: geerlingguy.pip
version: latest
```
## Example Playbook
Your playbook could look like this:
```yaml
- hosts: localhost
become: true
roles:
- role: geerlingguy.docker
- role: geerlingguy.pip
pip_install_packages:
- name: docker
- role: ethpandaops.general.logsprout

```
18 changes: 18 additions & 0 deletions roles/logsprout/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
logsprout_cleanup: false

logsprout_container_name: "logsprout"
logsprout_container_image: "gliderlabs/logspout:v3.2.14"
logsprout_container_env: {}
logsprout_container_ports: []
logsprout_container_volumes:
- /var/run/docker.sock:/var/run/docker.sock
# The syslog adapter will look for the file /etc/host_hostname
# and, if the file exists and it is not empty, will configure
# the hostname field with the content of this file.
- /etc/hostname:/etc/host_hostname:ro

logsprout_container_stop_timeout: "120"
logsprout_container_networks: []

logsprout_container_command:
- syslog://localhost:514
4 changes: 4 additions & 0 deletions roles/logsprout/tasks/cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Remove logsprout container
community.docker.docker_container:
name: "{{ logsprout_container_name }}"
state: absent
7 changes: 7 additions & 0 deletions roles/logsprout/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: Setup logsprout
ansible.builtin.import_tasks: setup.yaml
when: not logsprout_cleanup

- name: Cleanup logsprout
ansible.builtin.import_tasks: cleanup.yaml
when: logsprout_cleanup
12 changes: 12 additions & 0 deletions roles/logsprout/tasks/setup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- name: Run logsprout container
community.docker.docker_container:
name: "{{ logsprout_container_name }}"
image: "{{ logsprout_container_image }}"
state: started
restart_policy: always
stop_timeout: "{{ logsprout_container_stop_timeout }}"
ports: "{{ logsprout_container_ports }}"
volumes: "{{ logsprout_container_volumes }}"
env: "{{ logsprout_container_env }}"
networks: "{{ logsprout_container_networks }}"
command: "{{ logsprout_container_command }}"
43 changes: 43 additions & 0 deletions roles/powfaucet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# ethpandaops.general.powfaucet

Setup [PoWFaucet](https://github.com/pk910/PoWFaucet) and all required dependencies all in one server.

## Requirements

You'll need docker on the target system. Make sure to install it upfront.

## Role Variables

Default variables are defined in [defaults/main.yaml](defaults/main.yaml)

## Dependencies

You'll need docker to run this role. One way of installing docker could be via ansible galaxy with the following dependencies set within `requirements.yaml`:

```yaml
roles:
- src: geerlingguy.docker
version: 6.0.3
- src: geerlingguy.pip
version: 2.2.0
```
## Example Playbook
Your playbook could look like this:
```yaml
- hosts: powfaucet
become: true
roles:
# Docker. Required dependency
- role: geerlingguy.docker
tags: [docker]
- role: geerlingguy.pip
pip_install_packages:
- name: docker
tags: [docker]
# dora
- role: powfaucet
tags: [powfaucet]
```
Loading

0 comments on commit 9ae53cd

Please sign in to comment.