The Blog

Crystal blockchain - beyond the basics part 2

Posted 04 Mar 2020

In this post we follow up from my previous one. Check that out first. Until now, we have a node which mines blocks, and allows us to send data to be included in said blocks. It’s all nice and well, but something is missing to make it useful. Since blocks are guaranteed by the difficulty of producing a valid chain of the same length as the one we already have, our chain is as secure as the total computation power we’ve used to produce it. That is not very secure if the entire chain is generated on a single computer. Many computers could generate a longer chain in a short time. We need to start mining on multiple computers.

Crystal blockchain - beyond the basics part 1

Posted 23 Feb 2020

This is follow-up post to how to build your own blockchain with crystal. I was following along this tutorial on how to build a basic blockchain in crystal to familiarize myself with the syntax, and while it was a very helpful blockpost - I wasn’t completely happy with where it ended. True, the concept of mining had been explained, somewhat. The block integrity was there. But then I went on with the guide, I deployed it to AWS ECS / Fargate, and the limitations started to annoy me even more. We are scaling with individual blockchains - we have a centralized blockchain - a node has a chain, and is the authority on blocks it creates. difficulty is at it’s discretion.

Ruby crash course

Posted 15 May 2017

I recently had the pleasure of doing a workshop for my non-ruby programmer colleagues. For unknown reasons I decided to write the crash-course from scratch in slide form, and now that the workshop is over I felt like persisting that work somewhere. So here goes: A ruby syntax crash course for programmers!

Creating convenience queries on Ecto models

Posted 06 Jan 2016

These days most of my free time coding is taking place in elixir, and as anyone who knows anything knows, that means Phoenix. Phoenix is trying to win grounds by being Rails, but with less loading everything all the time, less magic, and much better performance. In many ways I’m loving it, but one of the first things I got really tired of was working with my database in a console. In Rails, my console sessions will often look something like this: