A P2P cryptocurrency library

Part of my reorganization of the MicroCash sources is allowing the code to be used as a library. Bitcoin core is finally heading this way also which I think is great. The main reason you want to do this is to allow new developers to use your code in new and interesting ways.

Currently in MicroCash I have encapsulated the entire network into a class which allows you to create “Networks” however you please with whatever rules you deem fit. This may be useful in the future if any altcoins decide to fork from MicroCash with new interpretations. In the meantime this makes it very easy for me to perform various networking tests and to completely debug the networking code.

CMicroCash mc1,mc2;
mc1.StartNetwork(400); **creates a node listening on port 400
mc2.StartNetwork(401); **creates a node listening on port 401
mc2.ConnectToNode(400); **make node2 connect to node1

So in the future it will be easy for a game or app developer to link in with the MicroCash code, call 2 lines of this code and be connected and part of the MicroCash network ready to do whatever they want.

It also means running testnets with whatever rules you want is very easy to implement. As is stress testing, packet dropping, etc. I hope that this will allow the code to be easily read and used by others going forward.

%d bloggers like this: