create account

Steemd Comment Edit History Plugin - First Version by abit

View this thread on: hive.blogpeakd.comecency.com
· @abit · (edited)
$18.73
Steemd Comment Edit History Plugin - First Version
Just finished first version of comment edit history plugin, source code is here: https://github.com/abitmore/steem/tree/dev-comment-history-plugin

### How to use

1- Compile

In local steemd directory,

```
git remote add abit https://github.com/abitmore/steem.git
git fetch abit
git checkout v0.14.2
git merge abit/dev-comment-history-plugin
git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONTENT_PATCHING=OFF -DLOW_MEMORY_NODE=ON ..
make steemd
```

2- Edit config.ini, enable the plugin and API:
```
# Set an API to be publicly available, may be specified multiple times
public-api = database_api login_api comment_history_api

# Plugin(s) to enable, may be specified multiple times
enable-plugin = witness comment_history
```

3- Start steemd with --rpc-endpoint and --replay
```
cd /parent/path/to/data
/path/to/steemd -s seed.steemed.net:2001 --rpc-endpoint --replay
```

4- Query

```
wscat -c ws://127.0.0.1:8090/ws/
> {"id": 1, "jsonrpc": "2.0", "method": "call", "params": [2, "get_comment_history", ["bluehorseshoe","a-simple-how-to-charcoal-grill-a-damn-good-t-bone-steak"]]}
< {"id":1,"result":[{"author":"bluehorseshoe","permlink":"a-simple-how-to-charcoal-grill-a-damn-good-t-bone-steak","block":5783105,"trx_in_block":2,"op_in_trx":0},{"author":"bluehorseshoe","permlink":"a-simple-how-to-charcoal-grill-a-damn-good-t-bone-steak","block":5783119,"trx_in_block":2,"op_in_trx":0},{"author":"bluehorseshoe","permlink":"a-simple-how-to-charcoal-grill-a-damn-good-t-bone-steak","block":5783196,"trx_in_block":3,"op_in_trx":0},{"author":"bluehorseshoe","permlink":"a-simple-how-to-charcoal-grill-a-damn-good-t-bone-steak","block":5783265,"trx_in_block":5,"op_in_trx":0},{"author":"bluehorseshoe","permlink":"a-simple-how-to-charcoal-grill-a-damn-good-t-bone-steak","block":5783468,"trx_in_block":5,"op_in_trx":0}]}
```
With this API we can get the block number and the transaction id in the block and operation id in the transaction, then we can use `get_block` API to get more detailed data.

### TODO
* return detailed data directly? If do, return patched content or the diff only? 

Please advice.

//Update 1:
Related feature request on github: https://github.com/steemit/steemit.com/issues/21
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 125 others
properties (23)
authorabit
permlinksteemd-comment-edit-history-plugin-first-version
categorysteem
json_metadata{"tags":["steem","dev","plugin"],"links":["https://github.com/abitmore/steem/tree/dev-comment-history-plugin","https://github.com/steemit/steemit.com/issues/21"]}
created2016-10-13 02:44:03
last_update2016-10-13 02:53:45
depth0
children5
last_payout2016-11-13 04:22:42
cashout_time1969-12-31 23:59:59
total_payout_value15.576 HBD
curator_payout_value3.155 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,264
author_reputation141,171,499,037,785
root_title"Steemd Comment Edit History Plugin - First Version"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,520,061
net_rshares28,663,942,214,633
author_curate_reward""
vote details (189)
@bitcoiner ·
Hope to see this in a release soon!
I suggest returning the patched content as this will make it less work for end clients.
👍  
properties (23)
authorbitcoiner
permlinkre-abit-steemd-comment-edit-history-plugin-first-version-20161013t055014154z
categorysteem
json_metadata{"tags":["steem"]}
created2016-10-13 05:50:12
last_update2016-10-13 05:50:12
depth1
children1
last_payout2016-11-13 04:22:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length123
author_reputation28,017,014,641,958
root_title"Steemd Comment Edit History Plugin - First Version"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,520,965
net_rshares155,538,787,840
author_curate_reward""
vote details (1)
@abit ·
Thanks for discussing.
If the node or plugin store a copy of full content for every patch, it will definitely use a lot of RAM. From this point of view I tend to encourage clients to apply patches by their own. If the node/API re-apply patches for every query, it will probably be expensive to compute, but seems doable.
👍  
properties (23)
authorabit
permlinkre-bitcoiner-re-abit-steemd-comment-edit-history-plugin-first-version-20161013t080946005z
categorysteem
json_metadata{"tags":["steem"]}
created2016-10-13 08:09:45
last_update2016-10-13 08:09:45
depth2
children0
last_payout2016-11-13 04:22:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length320
author_reputation141,171,499,037,785
root_title"Steemd Comment Edit History Plugin - First Version"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,521,551
net_rshares7,254,553,702
author_curate_reward""
vote details (1)
@james-show ·
What is the purpose of this? See how one edited his comment?
properties (22)
authorjames-show
permlinkre-abit-steemd-comment-edit-history-plugin-first-version-20161013t025207450z
categorysteem
json_metadata{"tags":["steem"]}
created2016-10-13 02:52:12
last_update2016-10-13 02:52:12
depth1
children1
last_payout2016-11-13 04:22:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length60
author_reputation5,698,866,469,447
root_title"Steemd Comment Edit History Plugin - First Version"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,520,113
net_rshares0
@abit ·
Yes.
properties (22)
authorabit
permlinkre-james-show-re-abit-steemd-comment-edit-history-plugin-first-version-20161013t025248735z
categorysteem
json_metadata{"tags":["steem"]}
created2016-10-13 02:52:48
last_update2016-10-13 02:52:48
depth2
children0
last_payout2016-11-13 04:22:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length4
author_reputation141,171,499,037,785
root_title"Steemd Comment Edit History Plugin - First Version"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,520,117
net_rshares0
@quinneaker ·
cool. Tech Genius FTW!
properties (22)
authorquinneaker
permlinkre-abit-steemd-comment-edit-history-plugin-first-version-20161013t031311194z
categorysteem
json_metadata{"tags":["steem"]}
created2016-10-13 03:13:12
last_update2016-10-13 03:13:12
depth1
children0
last_payout2016-11-13 04:22:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length22
author_reputation326,681,856,591,722
root_title"Steemd Comment Edit History Plugin - First Version"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id1,520,242
net_rshares0