MicroCash at its simplest is just a chain of transactions which makes disk access quite simple. Simply serialize the transactions to disk and load them back when required. Today I began the code which does the actual loading and saving of the data, which is a bit more complicated than it should be due to the fact I have to code a platform independent version of it.
Most people when doing disk access in C++ use something like Boost or the basic C/C++ library functions. The unfortunate part of this is that some platforms don’t properly support UNICODE in the basic libraries and have quite weird issues. So the work-around is to code your own using the native API when appropriate, which is a bit more work and requires a bit more knowledge of the systems you want to target.
MicroCash also needs some code to handle directories, services and things of this nature so I have moved all platform dependent code into a single source file to make it easy to port to any platform. On Windows MicroCash will support being installed as a service or called from the command line. On Linux it will run similar to Bitcoin through command line access. Instead of doing a bloated Qt client which would make compiling MicroCash way more difficult you’ll simply be able to use your web browser to access a graphical client.
Currently MicroCash easily compiles on any platform which has a C++11 compiler (GCC, MSVC, etc) and requires zero other libraries, everything has been custom coded which makes looking at the source, compiling it, debugging it, so much more simpler compared to Bitcoin and other cryptocurrencies.
Back to the point of this post…… with disk saving and loading I can then begin work on the transaction engine which shouldn’t take very long at all. Like I showed before you can actually have multiple MicroCash “Networks” running in the same application due to my design you just have to give each one a different data directory like this.
The above code starts 2 MicroCash services, each listening on a separate port and saving/loading the data from different directories. I then connect one to the other over UDP and from then on they stay in contact with one another. It makes it very easy to test certain edge scenarios and ways to streamline the network communication and disk access. It is one reason I will be able to release MicroCash much faster and hopefully with little or no bugs. 🙂