As always, please don't log any information on the public Tor network unless you're sure you're only logging your own personal information. Since the data you want to collect is sensitive, you should use a test Tor network generated using something like Chutney. See Tor's Research Safety Board for more information.
- See all circuits that my relay is currently part of
I don't think tor exposes this information. You will need to add custom code to the relay to log when other nodes create new circuits at this relay and when they extend those circuits. If you want this information in real-time, you could expose it through tor's control protocol as a custom command.
- See "unencrypted" Tor packets (512b cells) for exchanging keys and establishing tunnels (in Wireshark or similar)
You might be able to use Wireshark, but it would be a pain to do. If you ignore the older tor link handshakes that include things like client authentication and renegotiation, the TLS connections might still be established with either your relay's certificate or the other relay's certificate depending on which relay first established the connection.
It would probably be easiest to again add custom code to the relay to log this information after the link encryption has been removed.
- See unencrypted headers of encrypted data packets that has to be forwarded (instruction to forward packet to xyz relay)
This information is part of the Relay{Extend2}
cell and is encrypted. You will need to log this information from within your relay by making custom changes to the tor code.
- Configure a Tor client to use my relay when establishing a circuit
You can use tor's control protocol to have a client use a custom circuit path. You can find an example here: https://stem.torproject.org/tutorials/to_russia_with_love.html#custom-path-selection
- See the establishment of circuits and tunnels from the Tor client's perspective
You can use tor's control protocol to list the client's circuits. You can find an example here: https://stem.torproject.org/tutorials/examples/list_circuits.html