In as soon as 7 days (2018-12-07 23:00:00 UTC), the api.steemit.com endpoint will begin to route select steemd methods directly to hivemind. If you rely on this endpoint for any of the methods below, you should begin testing your applications against api.steemitdev.com as soon as possible.
This is in preparation for the removal of tags
and follows
plugins from our full nodes, the functionality of which has been ported to the hivemind service. While hivemind attempts to mimic the existing request/response format as well as all of the underlying logic, there are notable exceptions which will be outlined in this post.
As we disclosed in our last post, Steemit Inc.’s top priority is dramatically lowering the cost of running a Steem node. By routing these API calls to Hivemind, we greatly decrease the amount of resources our full nodes use.
Background
Hive's condenser_api
implementation goal is to port a relevant subset of steemd's tags
and follows
functionalities to support instances of condenser
with minimal changes required. This allows node operators to lower steemd
resource requirements while laying the infrastructure for next-generation social APIs.
While we have attempted to ensure relevant data is still available, in some cases this is simply impossible. A prime example of this is the get_state
call, whose response is a monolith which attempts to account for an extremely wide variety of data. Portions of the returned data is irrelevant to most apps, and some of it is entirely out of hive's scope (example: witness schedule). As another example, when loading a discussion thread, all involved accounts objects are returned in full (including balances, authorities, statistics). This results in a lot of extra bandwidth used when only a small fraction of the information is relevant.
In some cases, portions of API responses unused by condenser
have simply not been implemented in hive -- either to save time or complexity. In other cases, expected values may be slightly different but of a compatible format. Hive cannot guarantee data is accurate as of the latest block. Because interfaces often rely on supporting information such as steem_per_vests
or feed_price
, hive does store and return some marginally-out-of-scope-yet-accessible data, but it will be cached with a TTL of up to several minutes. Those values can still be obtained through other API calls to steemd.
API Changes - Overview
We will migrate the API by overriding specific steemd methods passed to api.steemit.com.
These methods will now be served by hivemind:
Follows Queries
get_followers [following, start_follower, follow_type, limit]
get_following [follower, start_following, follow_type, limit]
get_follow_count [account]
Content Monolith
get_state [path]
Trending Tags
get_trending_tags [start_tag, limit] (!) only supports ('', 250)
Discussion Queries
get_discussions_by_trending {tag, limit, start_author, start_permlink} trending
get_discussions_by_hot {tag, limit, start_author, start_permlink} hot
get_discussions_by_promoted {tag, limit, start_author, start_permlink} promoted
get_discussions_by_created {tag, limit, start_author, start_permlink} created
get_discussions_by_blog {tag, limit, start_author, start_permlink} account-blog
get_discussions_by_feed {tag, limit, start_author, start_permlink} account-feed
get_discussions_by_comments {limit, start_author, start_permlink} account-comments
get_replies_by_last_update [author, permlink, limit]; account-replies
Exceptions
These calls will NOT be forwarded to hivemind, and will be forwarded to a light steemd node:
get_state.params=['@<user>/transfers']
get_state.params=['~witnesses']
Not ported
Deprecated/Unused Discussion Queries - NOT ported!
get_post_discussions_by_payout {tag, limit, start_author, start_permlink} payout
get_comment_discussions_by_payout {tag, limit, start_author, start_permlink} payout_comments
get_discussions_by_cashout {tag, limit, start_author, start_permlink} UNUSED/cashout
get_discussions_by_children {tag, limit, start_author, start_permlink} UNUSED/responses
get_discussions_by_votes {tag, limit, start_author, start_permlink} UNUSED/votes
get_discussions_by_active {tag, limit, start_author, start_permlink} DEPRECATED
get_discussions_by_trending30 {tag, limit, start_author, start_permlink} DEPRECATED (DNE)
get_discussions_by_payout {tag, limit, start_author, start_permlink} UNUSED (DNE)
get_discussions_by_author_before_date [author, start_permlink, before_date, limit] UNUSED
Additionally, the following have not been ported, which means they may become unavailable.
get_feed_entries()
get_feed()
get_blog_entries()
get_blog()
get_account_reputations()
get_reblogged_by()
get_blog_authors()
get_tags_used_by_author()
These may be available for some time, but will be served by a light node. We cannot guarantee their availability.
Many of these calls are very similar (or identical) to one of the supported methods. If this is not the case, please leave a comment and we'll evaluate the options.
Not ported, still available through steemd's condenser_api
As these are still part of consensus and consumers often expect them to be 100% accurate and up-to-date, they are not currently served by hivemind and will continue to be available through steemd.
Content Primitives
get_content [author, permlink]
get_content_replies [parent_author, parent_permlink]
get_active_votes [author, permlink]
get_account_votes [account]
Steemd configuration changes
After a period of testing, the follow
and tags
plugins will be removed from our API nodes. We will however add the reputation
plugin, which allows us to continue using the existing reputation metrict. It used to be a subset of follow
plugin functionality, and it's the only piece logic which is not easily reproducible outside of steemd. If you were relying on reputation methods provided by follow_api
, you will need to update your code to use reputation_api
.
API Changes - Detail
Legacy call
method
call ['condenser_api', method, params]
The legacy-style call
method takes [api, method, [params]]
as parameters. Hive routes these calls to the appropriate internal method.
Concerns
api
must be set tocondenser_api
- It is not recommended to use this method
Follows Queries
condenser_api.get_followers
condenser_api.get_following
condenser_api.get_follow_count
These are straightforward, simple replacements.
Concerns
- steemd follows plugin can hold multiple follow 'states'; hive enforces one
- the feature is undocumented but small chance of edge cases
- internally, hive follow state must be blank, followed or muted
Content Primitives
condenser_api.get_content
condenser_api.get_content_replies
Important: while hive offers these methods as part of its condenser_api
, api.steemit.com will continue to serve these directly from steemd
. However, hive does leverage it internally to build responses for get_state
as well as the various get_discussions_*
methods.
Concerns
- hive's
comment
response format is a subset of steemd's. - deprecated/useless fields have been removed or normalized
- some fields of questionable utility are not unimplemented
Content Monolith
condenser_api.get_state
Notice! Hive will refuse to serve these routes:
/@account/transfers
/witnesses
and/~witnesses
Hive does serve these routes, requested by condenser, which are not mapped to anything, but steemd handles them anyway:
/@account/followed
- dummy/@account/followers
- dummy/@account/permissions
- dummy/@account/password
- dummy/@account/settings
- dummy
Concerns
- embedded get_dynamic_global_properties data is truncated
- hive does not keep up-to-date keys for accounts.. but on
/@account/xxx
pages, it still serves minimal account data.
Trending Tags
condenser_api.get_trending_tags
Concerns
- the parameters
[start_tag, limit]
must be left blank or passed as['', 250]
- only primary tags ("category") counted in these stats (not all tags, as per current implementation)
Discussion Queries
Global
condenser_api.get_discussions_by_trending
condenser_api.get_discussions_by_hot
condenser_api.get_discussions_by_promoted
condenser_api.get_discussions_by_created
Account/blog-specific
condenser_api.get_discussions_by_blog
condenser_api.get_discussions_by_feed
condenser_api.get_discussions_by_comments
condenser_api.get_replies_by_last_update
Concerns
- all
get_content
concerns apply here; otherwise identical
Testing & Feedback
If your app or service relies on any of the above calls and uses api.steemit.com, please begin testing against api.steemitdev.com as soon as possible. If there is an unsupported API call on which you are critically relying on, let us know in the comments and we'll find a solution.
Note that at this time, no steemd
APIs are changing -- only the API as provided by api.steemit.com.
If any apps are still relying on get_state
, we highly recommend ceasing use as soon as possible.
The Steemit Team