simbit is a javascript p2p network simulator which focuses on consensus networks like Bitcoin. It can be executed with Node (in clustered simulations) or in the web browser with visualization. It is a general framework for simulating any number of latency-sensitive networks, strategies and protocols.
Project page:
http://github.com/ebfull/simbitThe standard bitcoin simulation includes a working blockchain (with difficulty adjustment, reorgs), maporphans, mempool, UTXO, orphan transactions, inventory system, peer manager and mining simulator.
This is still in alpha. In fact the TCP-like network interface for nodes does not yet account for the size of messages between nodes, and nodes do not yet (but can) simulate computational delay. Also, the network topography is really arbitrary and probably does not represent the real bitcoin network. It also does not come close to perfectly representing the reference client.
I would love feedback, and if you have anything you'd like added or simulated using this framework feel free to bring it up to me. The goal of this framework isn't exactly to be the most efficient possible, but fun and easy to develop with.