Steemd Comment Edit History Plugin - Update 1

in #steem9 years ago

Working in progress. New node options and API's.

Node options:

  • comment-history-store-timestamp: redundantly store timestamp for each edit
  • comment-history-store-his-content: store full content BEFORE each edit
  • comment-history-store-last-content: store full content AFTER each edit
    (currently, on a full node with only witness plugin and comment_history plugin installed, with all above options enabled, memory usage is 5.8G VIRT, 4.3G RES(seems usable))

API's:

  • get_comment_history: get edit history of a comment in a time range, with contents or not
  • get_comment_history_record: get one history entry (useful for multiple edits in one block)
  • get_comment_at_time: get historical content of a comment at a time point

Remarks:

  • currently, time related API's only work when comment-history-store-timestamp option enabled.
  • currently, contents are returned only when already stored (option enabled) and LOW_MEMERY_NODE=OFF.
  • currently, no hard limits on size of returning data, so, be careful when querying with a large range for a long article.

Latest code is here: https://github.com/abitmore/steem/tree/dev-comment-history-plugin . Please check the hpp file for API details.

Examples:

$ curl -d '{"id": 1, "jsonrpc": "2.0", "method": "call", "params": [2, "get_comment_history", ["abit","steemd-comment-edit-history-plugin-first-version","2016-10-13T01:53:40","2016-10-13T02:53:48",10,true]]}' http://127.0.0.1:8090/

$ curl -d '{"id": 1, "jsonrpc": "2.0", "method": "call", "params": [2, "get_comment_history_record", ["abit","steemd-comment-edit-history-plugin-first-version",5784404,1,0]]}' http://127.0.0.1:8090/

$ curl -d '{"id": 1, "jsonrpc": "2.0", "method": "call", "params": [2, "get_comment_at_time", ["abit","steemd-comment-edit-history-plugin-first-version","2016-10-13T02:53:42"]]}' http://127.0.0.1:8090/

Any question please let me know.

Sort:  

Thanks for the extra info and your dedication to STEEM! All for one and one for all! Namaste :)

oh that's plenty helpful for third party dev like me. It would spare me a lot of boilerplate code.

Many thanks.

I do not understand the subject, but is important, presumes that a lot of work, congratulations on this