FireDream avatar

Fortune Cookie HIVE

firedream

Published: 27 Nov 2021 › Updated: 27 Nov 2021Fortune Cookie HIVE

Fortune Cookie HIVE

" " \" \"image.png\"\"""

Who doesn't like fortune cookies? This post is in fact linked to a small application in node-js At any upvote, it will send a comment to this post - with your name mentioned- some wise words as from a fortune cookie.

It streams the HIVE chain in a server, checks for the votes on this post and mentiones you with some small nice words. I made it opensource, so anybody interested can check the code at : https://github.com/firedreamgames/hive_cookie

Cookies for upvotes :)

Stay Positive

FD ps: thanks to deathwing@deathwing for unstucking me in discord!

Edit:

Learning while doing - it seems I have to solve the below kink.


RPCError: Assert Exception:( _now - auth.last_post ) >= HIVE_MIN_REPLY_INTERVAL_HF20: You may only comment once every 3 seconds.


Kink #2: When the server crash, the streamer stops and fails to send the cookies for upvotes.


Solution :

  • At start check all the voters
  • Check all the replies to the post and extract mentioned names
  • Compare list and send the cookie to the names that voted but didn't get a reply.

Not too difficult, I am on it!

Edit#2:
Messed up a bit but solved it :) Now it is working fine.

Leave Fortune Cookie HIVE to:

Written by

engineer, thinker

Read more #hive posts


Best Posts From FireDream

We have not curated any of firedream's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From FireDream