bitchat-sim โ a simulated physical world for bitchat
Testing a decentralized mesh-based messenger like bitchat is hard. Like, really really hard. Predicting how design decisions will affect real-world behavior in larger crowds is vital though.
That's why I built a simulator.
I started by simulating people. Simulated people that have devices that run a bare-bone abstract javascript version of the bitchat app.
Their simulated device has bluetooth that can scan for other peers like bitchat, and establish connections and send and relay packets.
This is already pretty useful. I can spawn and move around these people, change their simulated phone's battery settings, their bluetooth range and more. I can test message propagation, packet routing, and adjust actual app parameters.
But it gets way better.
Walls, buildings, hills. All these affect how much Bluetooth signal travels from one person's phone to another. In the simulation, the physical environment modulates the Bluetooth strength.
Here you can see how the signal rather travels around the wall than passing through it.
People in the real world move so I gave them basic path-finding skills and put them in a city block.
Using data from OpenStreetMaps, I can now set up different environments and test crowds in them with just a few clicks.
Here you see 140 simulated users around Time Square. Messages propagate through the entire square.
You can contribute here:
Or play around with it here:
GitHub
GitHub - callebtc/bitchat-simulator
Contribute to callebtc/bitchat-simulator development by creating an account on GitHub.
Bitchat Simulator
