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.

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.