Let me preface this post by letting you know that I am not a developer, the only class related to programming that I ever took was 15 years ago, in Pascal — that’s right, Pascal. I am a scientist and I learned how to program Python with friends, colleagues, the internet (thanks StackOverflow). My programming self-education was mostly oriented by challenges related to bioinformatics and scripting tools to analyze atomic trajectories of molecular dynamics simulations.

All that to say that you don’t need to know much about blockchain to make an app like Flotorizer. Why not? Because Alexandria API is a thing.

The beginnings

I started to learn Node.js about two years ago — not full time, I am a scientist remember? — because bioinformatics applications are much more fun (and useful) if they are interactive, and on the web so you can brag about it by sharing a link. I went to one of those NodeTogether seminar given by ashley williams and learned enough to really get me going with Node.js. (Thanks ashley).

I also have a very good friend, Luke Ulrich, who knows a lot of javascript and were working on a project with me… anyways… two years in and I am embarrassed to say that I am still fumbling around with concepts such as promises and callbacks — fun huh?

Anyways, when I started to check out the then florincoin ecosystem, I barely knew what a blockchain was, but I knew that this tx_comment feature was very interesting. Wait… can I just write whatever I want on the blockchain of an ongoing cryptocurrency? How do I do that?

My curiosity took me to Alexandria, where I registered and felt tempted to upload an album that I had recorded with some friends back in Tennessee, it did not work the first few times but it finally went through. In the process, I met Devon Read, the CEO of Alexandria himself and my first contact in the FLO community. I met him because I entered on their chat channel and started asking questions.

At this point, I only had a vague idea of how cryptocurrencies worked: I need to have an address… but where is the address stored? What is wallet? What is paper wallet? What happens to this address that I just made but will never use?

Anyhow… after reading some blogs and wikis I later realized that Alexandria made me a wallet when I registered (thank you Alexandria) and also gave me an address. Cool, now I have a wallet, an address, how can I write on the blockchain?

To write in the FLO blockchain you just need to make a transaction. — Joseph Fiscella, lead dev of FLO project

Wait what? That’s it? No smart contract, no mess of OP_RETURN from bitcoin, no need to download the daemons?

No. All I needed to learn was how to make a transaction.

My first transaction in cryptocurrency

Ok… so I made another address (by the click of a button in the Alexandria wallet), and now I just needed to make a transaction, and BAM.

I am not sure which one was my very first transaction of all, but this is my first transaction with comment: b80cd…

My first transaction programmatically

It was more or less at this time that I discovered the Alexandria API and noticed what they call “Client Library”. Browsing the examples I found very interesting that I could send a transaction using “FloVault” (I had no idea what that was, but hey… there is so much to learn at once, gotta take it slow).

Look how simple they made it look! If you want to make a transaction, you just have to sign in to your wallet:

and…

BAM! Transaction magic will happen!!!

Ohhhh cool! Now I can write a few lines of javascript real quick to do that. I already have a wallet from Alexandria and… wait… this is a “client library” and I don’t want to expose the credentials of my wallet in the code (the your_identifier and your_password part of the declaration of the wallet).

Fine, I am sure I can write a Node command line application (server-side) that can do that in a heart beat. But it wasn’t so easy…

I was so amazed by the simplicity of making a transaction programmatically that I failed to read the highlighted note in the Alexandria API documentation, that says:

and because I did not read it I got back in the Alexandria chat and ask: “Where can I find the SimpleWallet.js file?” They told me to download the new one, SimpleWlletFlorincoin.js , which I did, copied the file to my computer and tried to simply login to my wallet…

I don’t remember now if I succeeded to do that or not, but I know for sure that I could not make a transaction. Errors after errors and I thought I only needed to load the dependencies using require from node.js and done, but…

W hat happened next was a battle trying to halfway understand what was called what and finding out the dependencies needed, but after a few hours I had a working combo of code that worked on server side… and they said it couldn’t be done.

You don’t need to hassle that yourself, just copy: SimpleDeps.js and SimpleWalletFlorincoin.js from the Flotorizer github and you are good to go.

This was a hack, the FLO team is working to release a npm package that will be able to do all that with even less hassle.

Now I finally could execute my first transaction programmatically. Here is the code (or something like that):