@@ -37,6 +37,11 @@ The Ansible automation deploys a complete aggregation mode stack consisting of:
3737 - Grafana for visualization
3838 - 90-day retention
3939
40+ 5 . ** Task Sender** (1 server)
41+ - Automated proof submission service
42+ - Runs continuously in tmux session
43+ - Configurable interval and proof files
44+
4045## Architecture
4146
4247```
@@ -65,6 +70,11 @@ The Ansible automation deploys a complete aggregation mode stack consisting of:
6570│ │ └─ Grafana (3000) │ │
6671│ └────────────────────────┘ │
6772│ │
73+ │ ┌────────────────────────┐ │
74+ │ │ Task Sender │ │
75+ │ │ (tmux session) │ │
76+ │ └────────────────────────┘ │
77+ │ │
6878└─────────────────────────────────────────────────────────────────┘
6979```
7080
@@ -120,6 +130,9 @@ tls_key_source_path=/path/to/your/key.pem
120130
121131# REQUIRED: Same password for Grafana Postgres datasource
122132grafana_postgres_password =your_secure_password_here
133+
134+ # REQUIRED: Private key for task sender (sends proofs to network)
135+ task_sender_private_key =0xYourPrivateKeyHere
123136```
124137
125138** ⚠️ CRITICAL** : All three password fields must be set to the same value before deploying!
@@ -143,6 +156,9 @@ grafana_postgres_password=your_secure_password_here
143156tls_cert_source_path =/path/to/your/cert.pem
144157tls_key_source_path =/path/to/your/key.pem
145158
159+ # REQUIRED: Private key for task sender
160+ task_sender_private_key =0xYourPrivateKeyHere
161+
146162# TODO: Update these for mainnet deployment
147163gateway_payment_service_address =0xYourMainnetPaymentServiceAddress
148164gateway_eth_rpc_url =https://your-mainnet-rpc-url
@@ -181,6 +197,13 @@ tls_key_source_path= # ← FILL THIS IN
181197# Metrics Configuration
182198grafana_postgres_password = # ← FILL THIS IN (same as db_password)
183199# ... other metrics settings ...
200+
201+ # Task Sender Configuration
202+ task_sender_interval_hours =1
203+ task_sender_proof_path =scripts/test_files/sp1/sp1_fibonacci_5_0_0.proof
204+ task_sender_vk_path =scripts/test_files/sp1/sp1_fibonacci_5_0_0_vk.bin
205+ task_sender_private_key = # ← FILL THIS IN
206+ task_sender_network =hoodi
184207```
185208
186209The Ansible templates will automatically generate two separate database connection URLs for failover:
@@ -204,6 +227,7 @@ This will:
2042272 . Run database migrations
2052283 . Deploy gateway and poller on both servers
2062294 . Deploy Prometheus and Grafana
230+ 5 . Deploy task sender
207231
208232### Step-by-Step Deployment
209233
@@ -279,6 +303,49 @@ make grafana_deploy ENV=hoodi
279303- Prometheus: ` http://<metrics-server-ip>:9090 `
280304- Grafana: ` http://<metrics-server-ip>:3000 ` (default credentials: admin/admin)
281305
306+ #### 4. Deploy Task Sender
307+
308+ ``` bash
309+ # Deploy task sender
310+ make task_sender_deploy ENV=hoodi
311+ ```
312+
313+ The task sender runs in a tmux session and continuously sends proofs to the network at the configured interval (default: 1 hour).
314+
315+ ** Automatic Deposit Check:**
316+
317+ The deployment automatically:
318+ 1 . Derives the wallet address from the configured private key
319+ 2 . Checks if the address has an active subscription on the payment contract
320+ 3 . If not subscribed or expired, automatically deposits 0.0035 ETH to the payment contract
321+ 4 . Waits for transaction confirmation before starting the task sender
322+
323+ ** Requirements:**
324+ - The account must have sufficient ETH for:
325+ - Payment deposit: ** 0.0035 ETH**
326+ - Gas fees: ~ ** 0.001 ETH** (estimated)
327+ - Foundry (cast) will be automatically installed if not present
328+
329+ ** Verify task sender is running:**
330+ ``` bash
331+ make task_sender_status ENV=hoodi
332+ ```
333+
334+ ** View task sender logs:**
335+ ``` bash
336+ # Show how to view logs
337+ make task_sender_logs ENV=hoodi
338+
339+ # Or directly attach to the tmux session
340+ ssh app@agg-mode-hoodi-sender ' tmux attach -t task_sender'
341+ # Press Ctrl+B then D to detach without stopping
342+ ```
343+
344+ ** Restart task sender:**
345+ ``` bash
346+ make task_sender_restart ENV=hoodi
347+ ```
348+
282349## Service Management
283350
284351### Restart Services
@@ -295,6 +362,11 @@ make poller_restart ENV=hoodi HOST=gateway_primary
295362make poller_restart ENV=hoodi HOST=gateway_secondary
296363```
297364
365+ ** Task Sender:**
366+ ``` bash
367+ make task_sender_restart ENV=hoodi
368+ ```
369+
298370### Check Service Status
299371
300372** PostgreSQL Cluster:**
@@ -324,6 +396,13 @@ ssh admin@agg-mode-hoodi-metrics "systemctl --user status prometheus"
324396ssh admin@agg-mode-hoodi-metrics " sudo systemctl status grafana-server"
325397```
326398
399+ ** Task Sender:**
400+ ``` bash
401+ make task_sender_status ENV=hoodi
402+ # Or check tmux session directly
403+ ssh app@agg-mode-hoodi-sender " tmux has-session -t task_sender && echo 'Running' || echo 'Not running'"
404+ ```
405+
327406### View Logs
328407
329408** Gateway:**
@@ -341,6 +420,16 @@ ssh app@agg-mode-hoodi-gateway-1 "journalctl --user -u poller -f"
341420ssh admin@agg-mode-hoodi-postgres-1 " sudo journalctl -u pgautofailover -f"
342421```
343422
423+ ** Task Sender:**
424+ ``` bash
425+ # Attach to tmux session to view live logs
426+ ssh app@agg-mode-hoodi-sender ' tmux attach -t task_sender'
427+ # Press Ctrl+B then D to detach
428+
429+ # Or capture current pane output
430+ ssh app@agg-mode-hoodi-sender ' tmux capture-pane -t task_sender -p'
431+ ```
432+
344433## Verification
345434
346435### PostgreSQL Cluster Health
@@ -416,6 +505,23 @@ ssh admin@agg-mode-hoodi-postgres-1 "sudo journalctl -u pgautofailover -f"
416505 - Go to Configuration → Data Sources
417506 - Verify Prometheus and PostgreSQL datasources are connected
418507
508+ ### Task Sender
509+
510+ 1 . ** Check tmux session is running:**
511+ ``` bash
512+ make task_sender_status ENV=hoodi
513+ ```
514+
515+ 2 . ** View recent logs:**
516+ ``` bash
517+ ssh app@agg-mode-hoodi-sender ' tmux capture-pane -t task_sender -p'
518+ ```
519+
520+ 3 . ** Verify proof submissions:**
521+ - Check logs for successful proof submissions
522+ - Look for transaction hashes in the output
523+ - Verify proofs are appearing on the network
524+
419525## Troubleshooting
420526
421527### PostgreSQL Issues
@@ -508,6 +614,83 @@ Check Prometheus config:
508614ssh admin@agg-mode-hoodi-metrics " cat ~/config/prometheus.yaml"
509615```
510616
617+ ### Task Sender Issues
618+
619+ ** Problem: Task sender not running**
620+
621+ Check if tmux session exists:
622+ ``` bash
623+ ssh app@agg-mode-hoodi-sender " tmux list-sessions"
624+ ```
625+
626+ If missing, redeploy:
627+ ``` bash
628+ make task_sender_deploy ENV=hoodi
629+ ```
630+
631+ ** Problem: Task sender crashes or exits**
632+
633+ Check logs for errors:
634+ ``` bash
635+ ssh app@agg-mode-hoodi-sender ' tmux capture-pane -t task_sender -p -S -100'
636+ ```
637+
638+ Common issues:
639+ - Invalid private key → Check ` task_sender_private_key ` in ` config-{{ env }}.ini `
640+ - Missing proof/vk files → Verify files exist: ` task_sender_proof_path ` , ` task_sender_vk_path `
641+ - Network connectivity → Test RPC: ` curl https://aligned-hoodi-rpc-geth.tail665ae.ts.net `
642+ - Insufficient balance → Check account has ETH for gas fees
643+
644+ ** Problem: Proofs not being submitted**
645+
646+ Check interval configuration:
647+ ``` bash
648+ ssh app@agg-mode-hoodi-sender " cat ~/repos/sender/aligned_layer/scripts/.agg_mode.task_sender.env"
649+ ```
650+
651+ Verify ` INTERVAL_HOURS ` is set correctly (default: 1 hour). Attach to session to see live activity:
652+ ``` bash
653+ ssh app@agg-mode-hoodi-sender ' tmux attach -t task_sender'
654+ ```
655+
656+ ** Problem: Deployment fails with insufficient balance**
657+
658+ The automatic deposit check requires the account to have at least ** 0.0045 ETH** (0.0035 for deposit + ~ 0.001 for gas).
659+
660+ Check account balance:
661+ ``` bash
662+ ssh app@agg-mode-hoodi-sender
663+ export PATH=$HOME /.foundry/bin:$PATH
664+ cast balance < YOUR_WALLET_ADDRESS> --rpc-url < RPC_URL>
665+ ```
666+
667+ If balance is insufficient, send ETH to the account and redeploy:
668+ ``` bash
669+ make task_sender_deploy ENV=hoodi
670+ ```
671+
672+ ** Problem: Automatic deposit fails**
673+
674+ If the automatic deposit fails during deployment, check the Ansible output for error messages. Common issues:
675+ - Insufficient ETH balance in the account
676+ - RPC connection issues
677+ - Gas price too high
678+
679+ To manually deposit after fixing the issue:
680+ ``` bash
681+ ssh app@agg-mode-hoodi-sender
682+ export PATH=$HOME /.cargo/bin:$PATH
683+ agg_mode_cli deposit \
684+ --network hoodi \
685+ --rpc-url https://aligned-hoodi-rpc-geth.tail665ae.ts.net \
686+ --private-key < YOUR_PRIVATE_KEY>
687+ ```
688+
689+ Then restart the task sender:
690+ ``` bash
691+ make task_sender_restart ENV=hoodi
692+ ```
693+
511694### General Debugging
512695
513696** Check Tailscale connectivity:**
@@ -663,6 +846,7 @@ infra/aggregation_mode/ansible/
663846 ├── poller.yaml # Poller deployment
664847 ├── prometheus_agg_mode.yaml # Prometheus deployment
665848 ├── grafana_agg_mode.yaml # Grafana deployment
849+ ├── task_sender.yaml # Task sender deployment
666850 ├── postgres_cluster.yaml # Postgres orchestration
667851 ├── gateway_stack.yaml # Gateway + poller orchestration
668852 ├── metrics_stack.yaml # Metrics orchestration
@@ -673,13 +857,15 @@ infra/aggregation_mode/ansible/
673857
6748581 . ** Passwords** : Config files are tracked in git with empty password fields. Fill in passwords locally. Use ` git update-index --assume-unchanged config-*.ini ` after filling passwords to prevent accidentally committing them.
675859
676- 2 . ** TLS Certificates** : Keep private keys secure. The playbooks set appropriate permissions (0600).
860+ 2 . ** Private Keys** : The ` task_sender_private_key ` field must be filled with a valid Ethereum private key. Never commit this value to git. The playbook sets appropriate permissions (0600) on the environment file.
861+
862+ 3 . ** TLS Certificates** : Keep private keys secure. The playbooks set appropriate permissions (0600).
677863
678- 3 . ** SSH Access** : All servers are only accessible via Tailscale VPN (100.64.0.0/10).
864+ 4 . ** SSH Access** : All servers are only accessible via Tailscale VPN (100.64.0.0/10).
679865
680- 4 . ** PostgreSQL** : Uses scram-sha-256 password authentication, not trust mode.
866+ 5 . ** PostgreSQL** : Uses scram-sha-256 password authentication, not trust mode.
681867
682- 5 . ** Firewall** : UFW is configured on all servers with deny-by-default policy.
868+ 6 . ** Firewall** : UFW is configured on all servers with deny-by-default policy.
683869
684870## Support
685871
0 commit comments