Story about one small library

3 minute read

babel

Introduction

A couple of years ago I got interested in Ethereum. My favourite programming language at the time was Elixir (by the way, Elixir is still my favourite language). My first contribution to the Ethereum community was Ethereumex - Elixir JSON-RPC client for the Ethereum.

In this post, I’ll describe its evolution. I have got a couple of other open source projects that I wrote or was a part of the team. But I want to describe the evolution of Ethereumex because this small library is a good example of a hobby project that was written on the weekend and then got relatively popular in the community. I won’t go into too much detail about the technical details of Ethereumex as I want this post to be about the open source, not about technology that it implements.

History

From the first days of the project, I tried to follow community guides of good open source projects. One of the things I did for this was to add a CHANGELOG.md file to more easily track changes between versions. I’ll use this file to describe the development of Ethereumex.

0.1.x

As described in the introduction, the first version (0.1.0) was written literally over the weekend at the beginning of the summer of 2017. Most of my open source work is done in my free time. And I’m sure I’m not alone at this.

This version was pretty simple: JSON-RPC functions were generated by a macro. Unfortunately, automatic code generation has its downsides. Macros certainly shouldn’t be used for defining public functions that a user will interact with. The only difference between these functions was their names. They all accepted a list of params.

Surprisingly, some people used this version, I even received one pull request that was published in 0.1.1 version.

0.2.0 - 0.3.x

In October of 2017, I decided to take a week-long holiday. My full-time job at the time was pretty exhausting: I was writing digital book/comic-book processing services in Java and Kotlin and physically didn’t have time for anything else.

On this holiday I rewrote Ethereumex from scratch. I got rid of automatic code generation, using Elixir’s behaviours instead. There is a detailed post called “Elixir macros are evil (sometimes)” about this rewrite on my blog. I was satisfied with what I ended up with. I even got a comment from Jose Valim (creator of Elixir). Read my post about rewrite if you’re interested.

The rewritten library was published as 0.2.0 version. After releasing this version, I took back seat and no new features were developed by me. I only have been reviewing pull requests and releasing new versions. Also, I created a couple of issues in the GitHub repo for the community. One of these issues was to implement IPC client that uses UNIX sockets under the hood.

After releasing 0.2.0 version the library got much more popular and it has been getting more contributions from the community. I was even contacted by Gitcoin, and they funded a couple of issues.

From October of 2017 to September of 2018 five more new versions with small features and fixes were released:

  • 0.3.0 - Use :url config variable instead of :host, :port and :scheme
  • 0.3.1 - Handle failed HTTP requests more gracefully
  • 0.3.2 - Fix eth_getLogs method params
  • 0.3.3 - Added dynamic url input
  • 0.3.4 - Allow configuring GenServer timeout for requests

0.4.0

At the beginning of October of 2018 a new pull request was submitted to the GitHub repository. It was IPC client implementation. This contribution is the biggest of all contributions to the project to date.

Projects that use Ethereumex

One advantage of open source software is that anybody can use it in their own projects. There’re a couple of open source projects that use Ethereumex:

  • elixir-omg - OmiseGO’s Elixir implementation of Plasma and forms the basis for the OMG Network.
  • eth - Ethereum utilities for Elixir.
  • eth_contract - A set of helper methods for calling ETH Smart Contracts via JSON RPC.
  • exw3 - A high level Ethereum JSON RPC Client for Elixir

Conclusion

I hope this article will motivate somebody to write open source projects or contribute to existing open source projects. The more people are involved in open source community, the higher quality of open source software on average.

PS

At the beginning of this post is an illustration of the Tower of Babel. It’s not accidental. In my opinion, open source community (GitHub) is like this tower - people are working together to create something wonderful. I hope big corporations (Microsoft) won’t destroy it.

See also

Categories:

Updated:

Comments