
Tower is a REST API service on the top Hivemind. It allows you to query a Hivemind database in terms of REST practices.
I have pushed a couple of updates to the Tower in the last couple of days.
Filtering posts by tags (including multiple selections)
With the traditional RPC nodes, you can only filter posts with one tag. If you need to see the posts have both tagA
and tagB
, it's not possible.
Since Hive stores an intersection table between posts and tags, it is possible to query the database for multiple tag filtering. Here is an example SQL query demonstrates that:
SELECT author,
permlink
FROM hive_posts
WHERE id IN (SELECT post_id
FROM hive_post_tags
WHERE tag = 'python'
intersect
SELECT post_id
FROM hive_post_tags
WHERE tag = 'development'
intersect
SELECT post_id
FROM hive_post_tags
WHERE tag = 'utopian-io')
ORDER BY created_at DESC
LIMIT 10;
This query returns the last 10 post with the tags: utopian-io
, development
, and python
. Using that query, I have implemented a filter_by_tags
sub-route on the post_cache.
If you want to get the same list with Tower:
You can add any amount of tags to the filter.
Route changes on /api/v1/posts
and api/v1/post_cache
To retrieve a Post
object or PostCache
object, tower was expecting an internal ID (id on the PostgreSQL) in the detail endpoint.
Since STEEM post objects are unique with the author
/permlink
couple, I have changed to use author/permlink instead of IDs.

Examples:
/api/v1/post_cache/blocktrades/pros-and-cons-of-two-versions-of-steem-proposal-system/
/api/v1/posts/blocktrades/pros-and-cons-of-two-versions-of-steem-proposal-system/
Note: It's required for clients' to update their logic on these endpoints since this change is not backward compatible.
Resteems
Hive stores Resteem actions in its hive_reblogs
table. Tower wasn't exposing that table before, but it's now possible to get the Resteem info in different ways.
- Account's resteems (
/api/v1/accounts/<user>/reblogs
)

- Post's resteems (
post_cache/<author>/<permlink>/reblogs/
)

Votes to the Post
Also added a new endpoint to the post_cache namespace where you can a get a list of votes on a specific post.

Each vote object includes voter
, rshares
, and percent
:
{
"voter": "raphaelle",
"rshares": "1626665936",
"percent": "300"
}
Reputation
field is not exposed since it doesn't have a real use case here.
Public tower nodes
https://tower.emrebeyler.me
by @emrebeylerhttps://hivemind.steemviz.com
by @ausbitbank.https://tower.hive.oracle-d.com
by @oracle-d, @wehmoen.
Pull Requests
- https://github.com/emre/tower/pull/7
- https://github.com/emre/tower/pull/8
- https://github.com/emre/tower/pull/9
- https://github.com/emre/tower/pull/10
- https://github.com/emre/tower/pull/11
- https://github.com/emre/tower/pull/12
Vote for my witness
I do my best to support the blockchain with my skills. If you like what I do, consider casting a vote on via Steemconnect or on steemit.com