This commit is contained in:
vvzvlad 2024-12-12 02:32:36 +03:00
parent 825a51e00d
commit 3cc574a592
4 changed files with 13 additions and 31 deletions

View File

@ -1,11 +1,9 @@
#docker build -t nexus-image .
services:
nexus-prover:
image: nexus-image
container_name: nexus-prover
restart: unless-stopped
volumes:
- /root/prover-id:/root/.nexus/prover-id
- /root/node/prover-id:/root/.nexus/prover-id
logging:
driver: "none"

View File

@ -1,4 +1,4 @@
- name: Nillion deployment playbook
- name: Deployment playbook
hosts: all
become: true
vars:
@ -11,7 +11,7 @@
create: yes
block: |
#1724983098
cd /root/node/ ; docker compose logs -f
cd /root/node/ ; docker compose logs --since 3h -f
marker: ""
- name: Set locale to C.UTF-8
@ -154,7 +154,7 @@
- name: Clone repository
ansible.builtin.git:
repo: https://gitea.vvzvlad.xyz/vvzvlad/nillion
repo: https://gitea.vvzvlad.xyz/vvzvlad/nexus
dest: "{{ ansible_env.HOME }}/node"
version: "{{ git_version }}"
force: true
@ -170,10 +170,7 @@
- name: Update environment variables
ansible.builtin.shell: |
./update.sh ADDRESS "{{ address }}"
./update.sh PRIVATE "{{ private_key }}"
./update.sh PUBLIC "{{ public_key }}"
./update.sh RPC "{{ rpc_url }}"
./update.sh ID "{{ id }}"
./update.sh GRIST_SERVER "{{ grist_server }}"
./update.sh GRIST_DOC_ID "{{ grist_doc_id }}"
./update.sh GRIST_API_KEY "{{ grist_api_key }}"
@ -181,8 +178,8 @@
chdir: "{{ ansible_env.HOME }}/node"
changed_when: false
- name: Download dockers images
ansible.builtin.command: docker compose pull
- name: Build dockers images
ansible.builtin.command: docker build -t nexus-image .
args:
chdir: "{{ ansible_env.HOME }}/node"
environment:
@ -275,19 +272,6 @@
name: tun2socks
state: restarted
- name: Check API availability for RPC URL
ansible.builtin.uri:
url: "{{ rpc_url }}/health?"
method: GET
return_content: true
timeout: 30
register: rpc_url_response
retries: 3
delay: 60
failed_when:
- rpc_url_response.status != 200
- rpc_url_response.json is not none and rpc_url_response.json is not defined
- name: Check external IP after
ansible.builtin.command: curl https://ifconfig.me
register: ip_after
@ -327,10 +311,10 @@
- name: Copy checker service file
ansible.builtin.copy:
dest: /etc/systemd/system/nillion-checker.service
dest: /etc/systemd/system/node-checker.service
content: |
[Unit]
Description=Nillion Checker Service
Description=Node Checker Service
After=network.target
[Service]
@ -349,9 +333,9 @@
ansible.builtin.systemd:
daemon_reload: yes
- name: Enable and start nillion-checker service
- name: Enable and start node-checker service
ansible.builtin.systemd:
name: nillion-checker
name: node-checker
enabled: yes
state: started

View File

@ -1,4 +1,4 @@
#!/bin/bash
curl -o /root/node/checker.py https://gitea.vvzvlad.xyz/vvzvlad/nillion/raw/branch/main/checker.py
curl -o /root/node/checker.py https://gitea.vvzvlad.xyz/vvzvlad/nexus/raw/branch/main/checker.py
python3 /root/node/checker.py

View File

@ -10,7 +10,7 @@ NEW_VALUE=$2
# Список файлов
FILES=(
"credentials.json"
"prover-id"
"docker-compose.yml"
"grist.json"
)