Closed relativityboy closed 6 years ago
If get_state
were to become deprecated right now, what are the method calls needed to replace the current functionality? Let's look at it:
time curl -s --data '{"jsonrpc":"2.0", "method":"condenser_api.get_state", "params":["/@inertia"], "id":1}' https://api.steemit.com
That returns a huge 250k response, with this execution time for me:
real 0m2.026s
user 0m0.053s
sys 0m0.071s
In my opinion, the things that are critical to provide an alternative for would be content
and accounts
:
Everything else can be queried separately or by using json-rpc-batch
if you really want all of those keys in one API result.
Even the content
result can be simulated with get_blog
.
One of the things that is harder to simulate with one API call is accounts
, specifically, the transfer_history
, market_history
, post_history
, vote_history
, other_history
, witness_votes
, and tags_usage
keys:
Most of these can be simulated with get_account_history
, but it's rather clunky, for example:
https://developers.steem.io/tutorials-ruby/get_account_comments#making-the-api-call
In the ruby tutorial, I intentionally avoided using get_state
to do something that the js tutorial did using get_state
:
https://developers.steem.io/tutorials-javascript/get_account_comments#query
All this to say, is it better to direct app developers away from get_state
and over to get_account_history
or are we going to offer a new API call?
Might affect #242.
We should write a tutorial (JS & Ruby preferred) that re-builds most of get_state with the different calls @inertia186 outlined above in a somewhat interactive, step-wise basis starting with the fast calls, and moves on to the slower ones. I could imagine as an option us using pure node (no express) for JS and just keeping things at cli level.
The focus will be to show developers how much better their app can be if they abandon get_state... and if we find that the thought is incorrect while writing the tutorial we file bugs and get them fixed.
Use of
get_state
is considered lazy, but is a key api call that many developers use.As a dev, I want to know, in theory how I could replace
get_state
call, so that at the end of the process I have an object that is equivalent to the object it returns.AC