edicted Blog Banner

edicted

dsteem commentWithOptions()

I'm trying to use the dsteem commentWithOptions() function, I was having a lot of trouble. This post was created using dsteem's broadcast.commentWithOptions() function. I will now explain what happened. Everything below this text has been added after posting.

Alright first of all I was thinking I could simply pick and choose which options I wanted. No dice. If you want to use the commentWithOptions() function you have to provide all 7 options:

  • author
  • permlink
  • allow_votes
  • allow_curation_rewards
  • max_accepted_payout
  • percent_steem_dollars
  • extensions

I have no idea why author and permlink are required here. They are totally redundant and already listed as attributes in the comment object. If there is a reason why these would be different it escapes me.

My original intention was to test allow_curation_rewards. Can you really prevent curation and siphon all rewards to your own account? Is this really what it means or am I misinterpreting? I guess we'll find out, because this option has been disabled on this post.

This would be a pretty amazing development because I am going to wage a war on curation and show this platform how broken it is. Curation is a job for everyone, not just the elite. I propose a much different solution. I'll save that for another post though.

comment with options dsteem curation.png

I am also testing percent_steem_dollars. Can we really force the blockchain to create SBD? I doubt it but we will see.

On top of that I've also figured out how to add beneficiaries. These are basically like SMTs version 0.1.0. If you create an app that posts to the blockchain, you can add your account as a beneficiary and siphon off a percentage of the rewards for yourself. It's important to note that percents on the Steem API are measured by 1/10000 (0.01%) per point, so it takes 10000 points to reach 100%.

We can clearly see that I will get 1.5% beneficiary rewards. @fulltimegeek will get 2.22%. @krnel will get 1% and @taskmaster4450 will get 0.4%. I'll be monitoring this post and give an update when it pays out to report how much went where. The interesting thing about this is that you get an error if you don't put the accounts in alphabetical order.

error beneficiaries order.png

Weird.

Perhaps you're wondering why I had so much trouble posting this with dsteem. We'll, I kept getting the same errors over and over again.

permlink size error.png

This dreaded permlink size error had me very confused. I kept trying to change the length of my permlink to fix it, but nothing was working. I also thought there might be errors with the extension option. This is where you add beneficiaries and the formatting is completely unintuitive. I also didn't know what the json_metadata was for. There was just too much going on here, so I decided to use Occam's Razor to simplify the problem. Instead of posting a comment with options I would simply try posting a comment.

This is why I posted this previous post. I got the exact same error here, but now I knew that the extensions attribute wasn't causing the problem. Could it be that the error was talking about the blank parent_permlink? No... that can't be right... because it says so right in the Steemit API documentation:

comment parameters steem api.png

So everything should have been correct. However, my post still didn't have tags. Perhaps this is what the json_metadata was for? Who knows? dsteem has literally zero documentation outside of listing function inputs and outputs. Then, nine lines down, I noticed this:

comment operation example steem api.png

Gee, look at that. Not only is this confirmation that the json_metadata is used for tags, but the documentation has just contradicted itself within the same nine lines. Seriously, Steemit Inc. I address your fearless leader @ned. This is embarrassing. Is this the experience you want developers to have when interacting with the Steem blockchain? A bunch of disorganized documentation, terrible tutorials, and information that flat out contradicts itself on the same page? This is a joke.

Steemit should have NEVER put so much emphasis on SMTs. You're literally ignoring everything else and racing to the finish line, as if SMTs were the finish line. SMTs mean nothing if developers are going to be immediately fed up with how unprofessional and inefficient this entire learning curve is.

Honestly, what's the excuse for this? As if an entire blockchain doesn't have the resources to hire one full time person to clean up this mess. Maybe you should hire me? Dun know... it's not exactly the most exciting work. Then again, why hire me when I'm already trying to do it for free amirite?

We all know my stance on ERC-20 and SMTs. They are a shortsighted incentivizer fueled by greed. Personally, I will only create an SMT if I can show that it's even more fair and decentralized than Steem itself. It would be hilariously ironic for an SMT to roll in here and be superior to the genesis coin. Honestly, I hope to see the same thing with Ethereum. I would be great if a project like Golem was somehow valued higher than Ethereum itself.

Ranting-Homer.jpg

Rant Over

In any case, this is what ended up being the problem. Not only is a parent_permlink required for a top level post, it also counts as your main tag. Interestingly enough, by using the json_metadata attribute, I was able to choose more than 5 tags for my post. I'll do some more testing on this later so see if it can actually be exploited.

What else did I learn?

The extensions attribute looks so needlessly overcomplicated. It looks like an array of an array with a number followed by a beneficiaries object that contains an array of objects containing account names and percent weights. Seriously wtf. If you're wondering what that looks like:

extensions: // [] is the valid empty option [ [ 0, { "beneficiaries": [ {"account": "edicted", "weight": 150}, {"account": "fulltimegeek", "weight": 222}, {"account": "krnel", "weight": 100}, {"account": "taskmaster4450", "weight": 40} ] } ] ]

Hm yeah, it's not pretty. Like I said, "very unintuitive."

Here's the code I used to generate the first paragraph of this post:

You can see that I cleaned up the json_metadata a little.

'{"tags":["utopian-io","curation","javascript","dsteem"]}'

The original examples use all double quotes, so they have to be escaped with \ so the compiler doesn't get confused.

"{"tags":["steemit","example","tags"]}"

Changing the outside quotes to singles seemed much more readable.

I also learned that capital letters are not allowed in the permlink and max_accepted_payout requires a weird string called an 'asset' that has the currency label attached to it ("1000.000 SBD").

Baby steps.


Return from dsteem commentWithOptions() to edicted's Web3 Blog

dsteem commentWithOptions() was published on and last updated on 08 Sep 2018.