Steem Developer logo

Steem Developer Portal

This is a brief overview of the parameters allowed and values passed by the ‘comment’ operation in the broadcast API

Additional info for API definitions is available on the dev portal

Purpose:

A broadcast operation on Steem is a way of expressing intention on the blockchain. It is used to transmit signed transactions to the Steem network.

There are various broadcast types, in this instance we are focusing specifically on the comment operation. Each of the broadcast operations have parameters that are passed with the specific method in order to affect the required change to the blockchain. In other words, the broadcast.comment operation creates a comment or a post (post are also defined as comments) on the Steem blockchain.

Rules:

Parameters:

Additional Parameter Definitions:

A typical comment operation would look similar to the below:

  const post = {
    author :"Joe",
    title :"A post by Joe",
    body :"Look at my awesome post",
    parent_author :'',
    parent_permlink :"steem",
    permlink :"a-post-by-joe",
    json_metadata :"{\"tags\":[\"steemit\",\"example\",\"tags\"]}",
  };

In which case the complete broadcast operation would look like this:

  broadcast.comment(post, privatePostingKey)

With privatePostingKey being the private posting key of the author broadcasting the comment or post

Create_vs_Update:

When a comment is first broadcast, the permlink must be unique for the author. Otherwise, it is interpreted as an update operation. Updating will either replace the entire body with the latest operation or patch the body if using diff-match-patch.

For example, if we have a paragraph that has already been broadcast:

“It’s been quite a lot of fun working with these wonderful folk at Steemit, Inc”

And we want to change it to:

“It’s been quite a lot of fun working with these wonderful people at Steemit, Inc”

We can broadcast the comment operation with the following body:

The blockchain will know that this means we have changed the word ‘folk’ to ‘people’ within that paragraph so when fetching this content, this diff will be applied.

In addition to body, the title and json_metadata fields will also be replaced by the latest operation.

Comment_Options: LINK

Updating_Archived_Content:

Content that is older than 7 days is considered “archived” and cannot be edited unless the author indicates otherwise by broadcasting a custom_json to the witness plugin using their active authority.

As of HF18, the witness plugin has a custom operation called enable_content_editing that allows a user to signal they want to edit their content. By consensus, content is editable indefinitely, but is soft forked to be frozen after payout. This operation requires an active key and is designed to prevent vandalism if a posting key is compromised.

For ‘custom_json’: LINK

Vote: LINK

It should also be noted that a vote operation can accompany a comment in the same transaction when the author self_upvotes