Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Ethereum Node Log Retriever

A flexible Bash script to SSH into a remote Ethereum node and retrieve Docker container logs. The script is interactive, allowing for dynamic configuration of the target node, container names, and log filtering methods without needing to edit the file.

Features

  • Interactive Setup: No need to hardcode values. The script prompts for all necessary information at runtime.
  • Flexible Node Targeting: Specify any SSH-accessible node address.
  • Container Confirmation: Confirms the list of target container names before running.
  • Dual Filtering Modes:
    • Time-based (Recommended): Efficiently fetches logs using Docker's --since and --until flags (e.g., 24h, 3d).
    • Slot/Block Search: Performs a text-based search for a specific range of slot or block numbers, useful for targeting specific events.
  • Log Highlighting: When using the slot/block search method, the script automatically highlights the specified numbers in the output files, making them easy to spot in a terminal.
  • Organized Output: Saves logs in a dedicated ~/container_logs directory, with clearly named files.

Prerequisites

  • Local machine must have ssh and bash installed.
  • Remote node must be running Docker and be accessible via SSH from your local machine.
  • SSH keys should be configured for passwordless login to the remote node for the script to run without interruption.

How to Use

  1. Make the script executable:
    chmod +x get_container_logs.sh
  2. Run the script:
    ./get_container_logs.sh
  3. Follow the interactive prompts:
    • Enter node address: Provide the user@hostname for your remote node.
    • Confirm container names: Press Enter to accept the defaults or type a new name and press Enter.
    • Select log filtering method: Choose T for time-based or S for slot/block search.
    • Provide filter values: Enter the time duration (e.g., 48h) or the start/end slot numbers.

The script will then connect to the node, retrieve the logs, and save them to ~/container_logs. If you used the slot/block search, the relevant numbers will be highlighted in red in the output files. To view the highlighted logs, use a command like cat or less -R.

less -R ~/container_logs/charon-distributed-validator-node-charon-1_logs_slot_12186698_to_12186698.txt

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages