IBC Refresh is an automation tool for IBC relayers, designed to simplify the management of inter-blockchain communication tasks. It supports packet clearance and client updates while integrating structured logging and notifications (Discord/Slack) for monitoring task execution.
- Automated IBC Operations: Handles
clear_packetsandupdate_clienttasks based on a configuration file. - Configurable Task Execution: Define tasks in
config.yamlfor multiple chains. - Comprehensive Logging: Logs stored in a dedicated directory for troubleshooting and auditing.
- Notifications: Supports sending structured alerts to Discord and Slack upon task execution results.
- Python 3.8+
- Dependencies listed in
requirements.txt(installed automatically during setup) - Access to a terminal for CLI execution
You can install IBC Refresh from source by following these steps:
git clone https://your-repository-url/ibc_refresh.git
cd ibc_refreshpip install -r requirements.txtpython -m pip install .Execute IBC Refresh with the required configuration file:
ibc_refresh --config path/to/config.yaml --task clear_packetsclear_packets: Clears pending IBC packets.update_client: Updates client states between chains.
Example:
ibc_refresh --config config.yaml --task update_clientThe config.yaml file contains settings for logging, notification methods, and task definitions.
log_directory: .logs/
task_log_file: task_execution.log
command_log_file: executed_commands.log
notification_log_file: notifications.log
hermes_path: /home/relayer/.local/bin/hermes
notifications:
- type: discord
webhook: "https://discord.com/api/webhooks/YOUR_WEBHOOK_URL"
- type: slack
webhook: "https://hooks.slack.com/services/YOUR_WEBHOOK_URL"
tasks:
- type: clear_packets
entries:
- { chain: osmosis-1, port: transfer, channel: channel-490, destination_chain: acre_9052-1 }
- type: update_client
entries:
- { host_chain: osmosis-1, client: 07-tendermint-2316, destination_chain: acre_9052-1 }To automate IBC Refresh execution, add the following cron jobs to your server's crontab:
*/2 * * * * /bin/bash -c "/home/relayer/.venv/bin/python -m ibc_refresh -c /home/relayer/scripts/ibc_refresh/config.yaml -t clear_packets >> /home/relayer/.logs/cron/cron_clearing.log 2>&1"
0 */2 * * * /bin/bash -c "/home/relayer/.venv/bin/python -m ibc_refresh -c /home/relayer/scripts/ibc_refresh/config.yaml -t update_client >> /home/relayer/.logs/cron/cron_update.log 2>&1"These tasks:
- Run
clear_packetsevery 2 minutes. - Run
update_clientevery 2 hours. - Redirect output and errors to respective log files for monitoring.
IBC Refresh supports notifications via Discord and Slack for task results.
-
Discord Alerts:
- Webhook-based notifications
- Embed messages with execution details
-
Slack Alerts:
- Message blocks with command execution summary
Logs are stored in the directory specified in config.yaml.
- Task Logs: Recorded in
task_execution.log. - Command Logs: Logs executed commands.
- Notification Logs: Records sent notifications.
Contributions are welcome! Please fork the repository and submit pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
Internal tag: 001