Blog

Boost

You can find at Boost Org the fantastic library of free and handy code. I remember writing my first tree structures and data structure code back in the 1980s (during the pre-Internet times) in Pascal and wondering why we had to write this code–it should be available. I remember having to recopy in all of my code into the compiler I wrote to do a tree search. Boost covers much of this and many things that were just ideas–dreams–in the 1980s (like XML parsing).

I first learned of Boost when I was trying to compile some blockchain code. The Boost version of the Raspberry Pi OS, Raspbian was one version too old. Annoyingly, the code for the blockchain solution contained legacy code that would not compile at a higher level. I learned how to build Boost on a slow Raspberry Pi 3. I still could not get the code to run. I moved on but liked the Boost library.

The Boost library is meant to extend C++. I have written C++ for years for so many sketches for the Arduino. I have written some pretty impressive code for robots and other projects in Arduino’s version of C and C++. I was feeling confident I could code C++.

I saw that advertisements on Amazon for Cloud9, a development platform. It was cloud-based and free. This being Amazon Cloud it would likely cost something, usually about the cost of coffee in Starbucks (this is the PNW). I tried it out and create my first server. The IDE was a weak Eclipse version, but it could do all the languages I might need and some I did not need. Go was missing–Google’s language, but as Google is a competitor to Amazon it was not a surprise. It has C++ and version 9 and Python 3.6+, so I was happy.

The editor worked with some coloring for reserved words and some standard completion logic. It has the requirement that you save your work to a file for it to work well. I also noticed that the first compile failed and then worked after that. Again, the file needs to be there for the compile options to work I think.

I had trouble with remembering my C++ and made a few basic mistakes. The Arduino code I worked with over the last four years is not as formal as the includes of GNU C++, but once I finally took a quick online class from YouTube, I got my C++ to run. I do not remember “Hello, World” as this hard!

I used the Linux terminal to update my software and load Boost library 61, newest version. I followed the directions and built a library. It was in my workspace and not in the compile path. I created a link to the director in the correct place, and then it worked.

With Boost now working and an IDE and me remembering my C++, we are ready to start our project. Next post we’ll look at that.

New Project: Blockchain by me

Welcome to my first post.

My plan is to share my designs here.

I am also using editing software to avoid glaring typos. Please let me know if it missed a typo. I would like to get even with it!

So the first item to discuss is what I intend to do. Well, I have learned a lot about blockchain, and I have looked in detail at how to use IBM’s Hyperledger known as Fabric. I was surprised that the source is available, but instances are not really able to be installed and forked. Maybe someone else can find a way to do this, but I was unable to get that to work. I looked at a couple more, and they needed a unique combination of Linux and Boost library levels with all sorts of add-ons that had restricted versions. I did find Etherium was able to be installed and it can be forked. I did require newest releases, and these are not able to run on Raspberry Pi.

I want to run a blockchain example on a group of Raspberry Pis. I have purchased quite a few and intend to use them in a group and exchange information via blockchain like technology. Nothing really seems to work and even if it did the likelihood that it would be stable was small.

I also noticed that I did not like the code and structure of the design. I thought I could do better and I needed something less complex for the Raspberry Pis. Also, I am not sure I understand all the issues and need to account for them in the code and papers I read. I needed something less complex, maybe without all the crypto, and would actually run meaningfully on Pis.

So with a tip-of-the-hat to software heroes, I decided to write my own. But now the question came, on what? So I got the Raspberry Pi running and immediately found it slow and hard to use. The 30 hours to install Boost Library for C++ was still also fresh in my mind. I had spent hours and hours trying to get a descent Pi environment. So I did not really want to run my development on a Raspberry Pi.

My Apple computer is cool (I like to use cool here–the editing software is complaining and suggesting fresh) and fun, but I am not sure I want to test blockchain code and processing on my computer I run my life on. I have a few spare Windows and an Ubuntu server. I decided to try Linux. I tried to get Go to well go, and that was less positive than I expected. Python? Well, I like Python, but I think all of the libraries I will need will be in C++.  So C++.

Next, I found that Amazon has a new Cloud9 offering for well exactly what I was looking for, Linux based development.  Got my account running on Amazon. Cloud9 is free and thus costs about $2.00 a month. “Carrying charges,” I am told by the fat man at the Blue Parrot. 

I then loaded Boost newest. I was worried that the server would just fail. It finished the make in an hour or so. Great! I then hooked it into the library structure. I then wrote a fine C++ program to run an example program for one of the libraries. Success!

So in the first post, we learned that I am building a Raspberry Pi based example blockchain. I cannot find software that I believe will be stable and that I can understand. I decided to use Amazon’s Cloud9. So far I have Boost loaded and working.

A good start, I think.

cropped-mrw-cooking.jpg