Algorand
$1.41 2.37%
ALGO · 1w

How did I write my first dApp in Reach?

A screenshot from my game How it Works

Pokéchain is an Algorand-based blockchain game where players commit their moves to the blockchain. Moves are played after being confirmed by consensus. Players pay a price for their move which is collected into a pool where it can either be transferred to the creator of that session or distributed among players following various rules.

“Why Algorand”, you might ask. If you are familiar with Ethereum development, the answer is obvious: Algorand is much faster and cheaper on gas fees compared to what Ethereum offers. Gas and transaction fees for a simple game on Ethereum cost roughly 90 dollars. On Algorand, these fees are reduced to below two dollars. Big Surprises

Thinking back on the development process, I was surprised to realize that the easiest part of development was the blockchain part. Thanks to Reach’s abstraction of lower-level Solidity and TEAL code, a game which would normally take hundreds of lines to write in a complex developer environment took only 80 lines of code to write in Reach.

As programming languages go, Reach is relatively straightforward. It’s syntactically and semantically similar to JavaScript; apps are specified in JavaScript syntax. In many scenarios, the design logic Reach applies to contract participants made the coding process as simple as writing a script for the stage.

I had some trouble building out the frontend because it was my first time writing a project for React & Node.js. I really struggled with state management because the nature of Dapp’s was hard to combine with a React app. That’s where my teammate, Namiq (sn#3348) came through with the clutch assist. He helped me style the pages and manage the states of the app.

Although we hit a few snags near the end, I’m much more comfortable writing React code and managing states in a dAapp now. Reach already supports any frontend library. From what I heard from the development team, Reach is going to ...

Continue on medium.com
Recent news
ALGO +2.37% · bbc.co.uk · 10h

Tesla going algo? <1%

The initial decision made by Tesla in March to accept Bitcoin caused an outcry from environmentalists.
ALGO +2.37% · twitter.com · 17h

Like that tweet

We are proud that @Algorand is carbon negative and offsets the very small environmental impact with wind, reforestation, and peatland sustainability projects around the globe. @Tesla could embrace sus...