Is There a Super Nerd That Can Tell Me What I'm Doing Wrong Here? [SOLVED]

in #steemdev6 years ago (edited)

SCROLL DOWN FOR SOLUTION

<p dir="auto"><center> What am I doing wrong when serializing this <strong>"claim_reward_balance" operation? The server doesn't seem to like it ...<br /> <img src="https://images.hive.blog/0x0/https://cdn.steemitimages.com/DQmeqzb5Y88ekKaakt2HTDje9Dp6FTUafh6GKWZs4rT6WLx/keyboard-smash.gif" alt="keyboard-smash.gif" /><br /> <sup><sup><a href="https://giphy.com/gifs/frustrated-keyboard-g8GfH3i5F0hby" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">src <p dir="auto">Json<br /> <code>["claim_reward_balance",<br /> {"account":"fulltimegeek",<br /> "reward_steem":"0.442 STEEM",<br /> "reward_sbd":"0.364 SBD",<br /> "reward_vests":"1481.978010 VESTS"}]<br /> <p dir="auto">Buffer<br /> <code>390c66756c6c74696d656765656bba0100000000000003535445454d00006c0100000000000003534244000000009a305558000000000656455354530000 <h3>operation_id (39) <div class="table-responsive"><table> <thead> <tr><th>byte<th>value <tbody> <tr><td>01<td>39 <h3>string_len (fulltimegeek) <div class="table-responsive"><table> <thead> <tr><th>byte<th>value <tbody> <tr><td>02<td>0c <h3>"fulltimegeek" string encoded <div class="table-responsive"><table> <thead> <tr><th>byte<th>value <tbody> <tr><td>03<td>66 <tr><td>04<td>75 <tr><td>05<td>6c <tr><td>06<td>6c <tr><td>07<td>74 <tr><td>08<td>69 <tr><td>09<td>6d <tr><td>10<td>65 <tr><td>11<td>67 <tr><td>12<td>65 <tr><td>13<td>65 <tr><td>14<td>6b <h3>STEEM amount (0.442 x 1000 == 442 == 0x1BA) <div class="table-responsive"><table> <thead> <tr><th>byte<th>value <tbody> <tr><td>15<td>ba <tr><td>16<td>01 <tr><td>17<td>00 <tr><td>18<td>00 <tr><td>19<td>00 <tr><td>20<td>00 <tr><td>21<td>00 <tr><td>22<td>00 <h3>STEEM precision <div class="table-responsive"><table> <thead> <tr><th>byte<th>value <tbody> <tr><td>23<td>03 <h3>STEEM symbol ("STEEM") <div class="table-responsive"><table> <thead> <tr><th>byte<th>value <tbody> <tr><td>24<td>53 <tr><td>25<td>54 <tr><td>26<td>45 <tr><td>27<td>45 <tr><td>28<td>4d <tr><td>29<td>00 <tr><td>30<td>00 <p dir="auto">My methods for serializing STEEM, SBD and VESTS are identical, except for the precision ... any thoughts? The sooner I resolve this the sooner I can finish my Steem Android application. <p dir="auto"><span>Paging super nerds: <a href="/@vandeberg">@vandeberg <a href="/@theoretical">@theoretical <a href="/@roadscape">@roadscape <a href="/@anyx">@anyx <hr /> <p dir="auto"><strong>SOLUTION: Byte01 is suppose to be 0x27 not decimal 39<br /><span> <img src="https://images.hive.blog/0x0/https://i.imgur.com/3UmpC9x.gif" />
Sort:  
Loading...

Hey @fulltimegeek,

I think I don't really understand your issue. Maybe it's that you want to automate the process auf claiming your rewards and you struggle with this?

Can you tell me which programming language you are using? And how your current code actually looks like? Here is an issue related to "claiming rewards" in the javascript repo of steemit. https://github.com/steemit/steem-js/issues/215

Maybe this already solves your issue? Otherwise more information would be appreciated to be able to help you. :)

Best

Can you tell me which programming language you are using?

Java

Here is an issue related to "claiming rewards" in the javascript repo of steemit.

I will look into this issue and see if it's related to mine. Thank you for the pointers.

@fulltimegeek So you are directly interacting with the RPC node and creating the operations on your own? Then I'm pretty sure that your need to handle the order also on your own. The RPC API needs an array of parameters, and not an object. But normally the RPC node wrappers are handling this. What are you using? Is there a java implementation for steem?

Otherwise checkout my other comment, I've described my theory there.

So you are directly interacting with the RPC node and creating the operations on your own?

That is correct.

Then I'm pretty sure that your need to handle the order also on your own.

Order should only matter in serialization I believe. Json have maps with keys so order shouldn't be that critical. I'm not 100% sure tho on that. But, I'll play around with it.

I wish STINC had a utility or website that allowed anyone to construct operations and then spit out the raw buffer for one to sign. That would help A LOT ...

This the json that is getting send to the RPC node. Please adapt it and it will work. :)

<pre><code>{"id":2,"jsonrpc":"2.0","method":"call","params":["network_broadcast_api","claim_reward_balance",[account, steem, sbd, vests]]} <p dir="auto">in case it does not work, I'll have a look in a couple of hours.

Well it looks like you are having immense fun here!

Sadly, this is beyond my pay grade, but I've put the link into the Utopian development discord room in the hope some bright spark picks it up and can help you out.

Good luck!

Thank you Asher for passing this on to the Utopian dev crew! Much appreciated :)

lol... well I'm ruled out then... :)

We can sit warming the bench together today Dave :)

I was sitting on the sideline too. Cheering on. :)

good go have you helping too @beeyou! :P

We had to let the brains tackle this one. 😁

lol... yes you and Asher had it covered! I was standing on the sidelines with a megaphone saying "good luck and keep up the good work" :)

lol... glad it got solved without us Asher because this one wasn't anywhere near my wheelhouse! :P

Sorry, can't help... But I loved the gif. It's how I feel when I deal with people and try and explain cryptocurrency!

Hope you get it resolved

The server doesn't seem to like it ...

Do you have a specific error message you are receiving? That may help pinpoint the issue. Also, are you connecting to api.steemit.com or a different node? Lastly, are other operations working for you and it's just this one that is causing a problem, or is this the first operation you are trying to code?

Server is telling me "missing required posting authority:Missing Posting Authority fulltimegeek"

I'm signing this operation+tx just like I do all the other ones, which do work, so I guess there is a problem with serialization before it's signed ...

Appreciate you stopping by Matt. I saw FTG updated the post with a solution. World of finicky numbers that I am lucky to not be involved in. :)

SOLUTION: Byte01 is suppose to be 0x27 not decimal 39

dear @yabapmatt plz check your steem chat i waiting your reply and and check memo in your wallet

@yabapmatt i configure bidding bot with you plz reply

Passing to @bennierex . I'm wondering whether he encountered while developing Steemify.

Steemify is more of a consumer in this regard, but @fulltimegeek, what encoding are you using and how do you sign your transaction?

The problem was I wasn't converting the operation id (39) to hex.

what encoding are you using and how do you sign your transaction?

I'm encoding the strings with UTF-8 and using my own Java lib for signing.

Thanks for stopping by @bennierex and trying to help a nerd in distress :)

Glad you figured it out!

To the question in your title, my Magic 8-Ball says:

Yes

Hi! I'm a bot, and this answer was posted automatically. Check this post out for more information.

I'm also beginning to understand why people downvote bots

Lol

Of he really was a magic ball he would have answered this question correctly.

At least he tried to help, poor bot xD

You lost me at Hello! :(

I'm beginning to understand why I ran away from programming back in the day.

I know some programmer friends who might be able to help though.

Get over here @afolwalex.

I'm beginning to understand why I ran away from programming back in the day.

No, come back! We need more of you! :)

I might come back in the future, but for now a man's gotta focus on writing.

My game development career may not be entirely over.

I always go with "the answer is 4".

I did forward the post to a couple of developers I chat with on discord to see if they can take a look at it.

@taskmaster4450 Actually your answer should be 42, based on this: https://simple.wikipedia.org/wiki/42_(answer) :P

@fulltimegeek I don’t know the answer but I need to thank you for the support. I’ve been grinding 6 months and you’re the first real person invested into the system to show me support. You’re a great example of what a orca should be on Steemit

I wish I could help with this but I don't know much about coding.

Are you developing an steem application? By any chance do you have more info about this?

Android app and not IOS? :( I understand the proprietary limitations though.

Beyond my skillset, unfortunately. The only developer I 'know via the blockchain' is @yabapmatt. I don't know if he check mentions, but I can resteem. From what I can tell about him, he would assist if he has the knowledge.

Reasons why I program for Android and not iOS:

  • Android is open source
  • Java/Groovy are my preferred languages

I don't know if he check mentions, but I can resteem.

Thank you for the resteem! Much appreciated :)

I am fortunate to have my answers readily available on google when I need help with excel formulas or the dreaded photoshop. Don't believe this issue can be 'googled'.

Good luck with finding a solution. I saw others passing it around too; hopefully a nerd will come to the rescue. :)

I really don't know.

What I do know that if you're trying to freeze the whole blockchain again, like happened a few weeks ago, then we're lucky that you didn't succeed 😋😆😜

What I do know that if you're trying to freeze the whole blockchain again

Which blockchain was that? I'm only aware of that happening to EOS.

Steem was also gone for some hours. I think even over half a day.

I could stare at it for a year and still not know what the hell is going on

Haha that GIF is the best. I have it on my computer as well. Seems a bit smaller and less pixelated though.

writing_process.gif

Gah, I need to stop messing around and join in on the Steem programming. I'm a know-nothing who knows nothing.

Fantastic post friend

Hello, I really do not know anything about all that you ask, but I really enjoyed the action of the animated figure hahahaha, careful not to reach those levels of pressure with savage rage. Greets and a hug.

Steem Android application.

That sounds really great!! maybe you could make a post explaining more!

Fantastic post friend

If I knew about programming I would be delighted to help you solve that problem! I hope you manage to find the solution :)