trudi-group / ipfs-tools

A collection of tools and schemas in Rust to analyze data on IPFS and BitSwap traces.
MIT License
9 stars 5 forks source link

monitoring-client: add to-disk logging of Bitswap messages #97

Closed mrd0ll4r closed 1 hour ago

mrd0ll4r commented 1 year ago

Draft.

This adds to-disk logging for the monitoring client. Open problems:

  1. The docker setup needs to create files and directories in a mount, which is annoying permission-wise. For now, I fixed this by letting the client run as root, but that creates files and directories as root, which is unwieldy on the host. To fix this, we probably need a small docker entrypoint script that fixes the permissions on the output directory configured in the YAML config file and then launches the client, dropping root as we did before.
  2. The current log file is not finalized correctly on shutdown, because the tasks are not shut down. To fix this, we need to listen for SIGINT as explained here and shut down the main loop, which should cascade to close all channels and whatnot.