1UP backend is finally ready : SteemConnect integration and more

in #utopian-io7 years ago (edited)

image.png

Utopian 1UP server is now up and running at http://utopian-1up.herokuapp.com .
In this last update I have:

  • Integrated SteemConnect v2
  • Changed the workflow
  • Cleaned up the code

SteemConnect v2 integration and new workflow


First, a big thanks to @wehmoen who helped me fix a stupid mistake in my code!
Until now, the backend was coded to receive an url and the username of the people suggesting the 1UP vote. However, that workflow had no way to make sure that the users were really logged in via SteemConnect, they could simply use cURL commands instead of using SteemPlus to cast their vote.

Therefore, in this new iteration, I made sure that the sc2 token will be sent for verification instead of the username. This token is short-lived and is not stored anywhere on the server, it is deleted after authenticating the user.

The new flow goes as follow:

  • Server receives identification token and url to upvote
  • Server checks if the token correspond to an user : if yes, the token is deleted and the username is kept instead, if no, an identification error is sent
  • Server checks if rules are met (no selfvote, 10 votes max per day, 1 vote max per day to the same user)
  • If all rules are met,a new Vote is stored in the database (id,author, url)
  • Once the vote suggestion stored, it will check if other users already voted for that post
  • If no, a new Post object is created and call steem blockchain to get information about the post (author, reputation, title, etc.)
  • If yes, the Post is updated with the new voter username
  • Posts are displayed in here and will fetch additional information from the blockchain (votes, pending payout).

Since I was at it, I also cleaned the post and removed useless files.

Next steps


  • It s finally time to implement the Utopian 1UP button on SteemPlus!
  • Adding it to other platforms
  • Adding additional information to the button

Utopian 1UP button will be here very soon and that s super exciting! It will bring a human factor to the bot in a way. Even if the project is not endorsed by Utopian, the bot takes into account the previous votes, so having a contribution voted by 1UP will assure a bigger upvote from Utopian itself. A great way to push forward good quality contributions compared to the multitude of milkers.

Hope this helps!

@stoodkev



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Amazing information, Thank you sir.

The right move, as you have fixed. I will continue to monitor you, because what you do is a great job.

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @stoodkev I am @utopian-io. I have just upvoted you!

Achievements

  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

I am the first time on steemit blog, please give freedom in my comment! Do not back off before the fight. I see the privilege of steemit @locer76 @utopian.io

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Seriously..

You are not a Utopian Moderator. Please do not pretend to be one.

Please stop pretending to be a Utopian moderator and do not copy comments from the moderators. This behaviour could lead to downvote by Utopian.