Balance Coin – the Dapp – and a world of pain

What is a dapp? You say toMATEo I say toMATo. I call a dapp any app (web, desktop, embedded, mobile,etc) that interacts with a decentralized blockchain (or even a centralized blockchain like a proof of authority blockchain).   The crux of a dapp is that you need to bring in the contract interface and you need connection to you wallet. I use metamask but this is not the only solution.  And I should probably do some examples that are not reliant upon metamask.  The good thing about metamask is that if you build some sort of middleware caching layer, you can also use metamask as a signin/user identifier (like facebook login).

Most of Thursday I worked on developing the web interfaces for a token (balance coin) in React. The crux of it is you need to bring in the ABI (a javascript version) of the contract into your web app and then call the methods on the abi.  Easier said than done. I had a bunch of integration issues that took a while to debug and that I am still struggling with.

First the initial balance of balance tokens did not show up in my account. I thought this was a dapp issue but then realized it was a problem with my initial token deployment so I redeployed the contract to ropsten. It worked (update… it does not work after a few hours I lose all my tokens this may be because of the test network). But, I am not sure what is happening.

I also have a ton of test ropsten accounts and it was hard for me to figure out which metamask wallet corresponded to this account. If I had the wrong wallet connected the obviously no tokens would show up. Maybe I need a newer version of metamask but it would be nice if metamask allowed a feature to label different accounts.

I started playing around with material-ui which I have not used – and as a result my test app looks a bit jangy, but I am getting more comfortable with it and am confident I can build something that does not look like garbage – using css modules.

I deployed the dapp to heroku, which created a new world of pain since. There is some web3 issue that I have not fixed yet.  However, I did some git architecture – and added a bunch of balance apps as submodules in conscious computation, which I have never done before! I would like to experiment with rust deployments both as web (serving up the react builds) and acting as middleware, and as an application itself use web assembly (wasm).

It took a bit longer than I thought to get here, and I am still not here,  since the app is super buggy.  I still have not formatted the code and it is super hacky, but it is public in github for all to throw toMATEos or toMATos at.

Debugging is like the 80/20 rule. You spend 20% if your time writing code and 80% debugging.   However I know itwill all come together in the end. It is like when you are painting a picture and in the middle it really does not look how you want it to look, but you have to have confidence that the prep and your process will resolve into a masterpiece and you just have to plow ahead with your plan and pain.

The thing I am most happy about with my process is at RC I have treated thinking as writing software and  have gotten into a routine of pushing to git  – even toy projects like a minimum viable shader.   For the next two months I may try to organize my time differently around maximum code production. I am going to play with the idea of daily goals instead of weekly goals- along with the final goal of prayer coin.  This is the reason I wanted to do recurse in the first place, was to change my habits around software development and I feel like I am doing that. Now I just have to use linting and formatting more. At least I am using it in rust.

Finally here is a cool project a Recuser blogged about doing.  I love weird music electronics!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.