Is the code of the Tor directory servers open sourced?
If i would like to run my own for the purpose of experimenting, what is the easiest way to do it?
To be a directory server, it is merely a configuration change in your TORRC. Anyone can be or advertise that you are a directory server but none of the clients would trust it. The source code for Tor is available here: https://gitweb.torproject.org/tor.git/