Utopian Registration: Backend - Account Creation

image.png

This Contribution is part of the Utopian Registration-Project.

The goal for the Utopian Registration is, to allow People who are new to STEEM to create an Utopian ( STEEM ) - Account through Utopian itself (and not how it is currently handled, through STEEMIT).

The most important step for this is the actual Account Creation on STEEM - and that is exactly what I've implemented.

In this Contribution-Post I'll take you through the changes I've made to the backend.

If you are interested to see how it actually looks, then you can read this post: Account Creation - Frontend

The Pull-Request

image.png

You can find the pull-request here: Pull Request

Account Creation

While I already showed you how it looks when an Account is created through Utopian - what I haven't talked about is, how this actually works.

image.png

First of all, the code saves all params from req.body into variables and then checks if the User actually exists. If he doesn't, the Client will receive an error message.

image.png

After that, data is fetched from the steem API and the amount of liquid STEEM and delegation Vests for the Account Creation are calculated. (big thanks to @almost-digital for his guide on doing that via dsteem)

image.png

Since we are using the testnet (and not the main-net) for testing-purposes, the keys have to be edited. This code-snippet right here might not be the most beautiful but it gets the job done by replacing STM with STX.

image.png

After that, the account_create_with_delegation-operation is getting created from all the previous generated data and broadcasted to the test-/main-net.

image.png

If everything goes alright, a User is also getting created in the database. If an error happens, the try-catch should catch it and report it to the Frontend.

image.png

This is the function which creates the actual User from the previous pending-User Object in the Database.

What is next?

There are a few things which will be added to this process in future Pull Requests. However, the next step is to create a TOS and Privacy Agreement incl. the use of Cookies to store data. (Which is actually already done and just needs to be pushed to the server)

Afterwards, I will update everything on signup.utopian.io to let you guys play with it :)



Posted on Utopian.io - Rewarding Open Source Contributors

H2
H3
H4
Upload from PC
Video gallery
3 columns
2 columns
1 column
11 Comments