How can i build the p2p network?

In principle, yes. Though when you have a 10000 device network a full mesh of connections is very inefficient. You want some different structure for that many devices.