2

Essentially I am looking for some method, e.g. using Python, that I can get results equivalent to the print_pl command that is run inside the daemon.

I.e. I don't want to have to run the daemon to see the contents of p2pstate.bin in human readable form.

Any ideas on how to read the data in the file? I am not sure the formatting of this binary file to decode.

The reason is, I am interested in reading/parsing many different p2pstate.bin files in an automated way. Specifically I want the IP address and last_seen fields from the file.

jtgrassie
  • 19,601
  • 4
  • 17
  • 54
user14547
  • 23
  • 2

1 Answers1

1

I am not sure the formatting of this binary file to decode.

This uses the Boost serialization library (more specifically boost::archive::portable_binary_[io]archive), and so the easiest solution would be to use C++, Boost and include the relevant files from the Monero project (e.g. src/p2p/net_peerlist.cpp).

Trying to parse this in Python is non-trivial.

jtgrassie
  • 19,601
  • 4
  • 17
  • 54