Developing Apps That Run On More Than One Blockchain With Reach

Akingbesote Jesulonimi
4 min readJul 11, 2021

In this article, I will be sharing my experience developing in Reach. But first: what is Reach? Reach is a platform-agnostic blockchain framework that allows you to build decentralised applications capable of compiling to any blockchain without a code change. Remember how you had to learn Solidity for Etherium and Teal for Algorand? Well, that’s no longer the case. All you need to know now is Reach and you can launch anywhere.

Well, you might be wondering how I found out about Reach. I first heard about Reach in the Algorand weekly newsletter. In it was a link to the Reach tutorial. I never bothered to find out what it was about until I saw a post on Twitter talking about a global blockchain hackathon for people affiliated with any university in the world. I went through it and was like “this definitely looks like something I can try out”. I registered and was selected for the hackathon in which I was expected to develop a morra app. Morra is an Italian version of Rock, Paper, Scissors. So, who better to share an experience on developing blockchain apps than I?

How Did I Start My Journey Building in Reach?

I started building on Reach by following the Rock, Paper, Scissors tutorial, it was a tutorial that explained how consensus could be achieved between three different players in a game of Rock, Paper, and Scissors without any intermediary like a centralised server, this was probably all I needed since the concept of RPS was very similar to Morra.

Morra is a game where two or more people agree to submit a certain amount of their fingers and make a prediction of the total number of fingers and whoever makes the right prediction of the total number of fingers is the winner. For example, if Alice submitted two fingers and made a prediction of five while Bob submitted three fingers and made a prediction of six, Alice would be the winner. In the variation of Morra I developed, each player submitted their fingers along with a certain number of ALGO tokens, and the winner took the total ALGO tokens submitted.

What Were the Primary Features of My App?

A player could submit fingers, cast a wager and a prediction along with the finger and wait until someone else connected to your contract and decided to play with you. The program would then automatically decide the winner. Even if nobody won, the program and user interface could direct the players to play, play, and play again.

Challenges I Faced

The major challenge I faced specifically while learning the Reach language was wondering how this will interface with a real frontend and user actions like clicking a button, going to a different page, etc. Since this was more of a problem in my mind, I just had to be patient until I got to the tutorials that covered how to supply the RPS game with a frontend. Although it still took a while before I could fully understand this, I overcame this obstacle by discovering that I could use JavaScript’s async/await pattern to actually solve this. It was a really satisfying experience to actually overcome this. But while developing, I had a problem getting my React frontend to connect with the Reach code. I asked a question on Discord and I got a lot of help. At last, I was able to go through an open source React project that works with Reach to understand and fix this. Turns out, I was placing my build folder generated by the `reach compile` command in the wrong directory. 🤦

My Thoughts On Reach

I really do believe that Reach will have a very important role to play in the world of building decentralized software. I mean, I’ve never heard of any other platform or framework that’s doing what Reach does. I will also keep building in Reach. In the days to come, I will be exploring how this can work well on mobile platforms. I hope I will be able to build something great with this. I do advise everyone who ever reads this to try Reach out, they have great docs, tutorials and YouTube videos.

--

--