Notice of upcoming changes to anyx.io API

in #steem5 years ago

TL;DR: The anyx.io API will become hivemind only post-hardfork 21. Developers using Tags or Follow API plugins will need to update their code; if you don't use these, no changes are needed.


web-3967926_1920.jpg

I offer a steemd API full node via anyx.io.[1][2] It is a high-performance public API infrastructure, rivaling performance of Steemit Inc's own public API via api.steemit.com. This infrastructure was originally built in such a way as to help legacy applications transition with new changes, such as supporting Vessel (which requires websockets), as well as supporting the deprecated plugins called "Follow" and "Tags". These plugins were deprecated as the developed replacement by Steemit (hivemind) aimed to offer less RAM usage and enable future feature upgrades. Unfortunately, the swap came as a shock to many developers, so having legacy support was useful at the time.

However, with hardfork 21, these plugins are now beyond deprecated -- they are now unstable and can be considered broken. In the course of my testing over the past few weeks, I have had them fail (causing corrupted databases) on two occasions, without being able to track the issue properly.

Due to this, anyx.io is sadly forced to become hivemind-only post HF21. My previous separate domain name for hivemind infrastructure -- hive.anyx.io -- will be deprecated.

If you use follow or tags plugins directly (refer to them here: https://developers.steem.io/apidefinitions/), you need to change your calls to only use the below calls.

  get_followers
  get_following
  get_follow_count
  get_content
  get_content_replies
  get_state
  get_trending_tags
  get_discussions_by_trending
  get_discussions_by_hot
  get_discussions_by_promoted
  get_discussions_by_created
  get_discussions_by_blog
  get_discussions_by_feed
  get_discussions_by_comments
  get_replies_by_last_update
  get_blog
  get_blog_entries
  get_discussions_by_author_before_date

In addition, if you were already using any of the above calls, make sure you check and update your application to handle any differences in the result format. Notably, not all API calls have drastically changed, and most users should be unaffected.

Finally, if you currently use anyx.io and api.steemit.com interchangeably, you already do not need to change anything -- Steemit's API has been hivemind-only for months now. This is also an easy way to test your application.

Support for Vessel will continue post Hardfork 21.

Sort:  

Can you check uft-8 support on your API server?

from beem import Steem
stm  = Steem("https://anyx.io")
from beem.block import Block
b = Block(35097419, steem_instance=stm)
print(b.operations[-22]["value"]["title"])

returns:
<스파ì�´ë�”맨 : 파 프롬 홈> ë¸”ë£¨ì—”ì ¤ 니어 프롬 (퓨처) 홈 💙
whereas

from beem import Steem
stm  = Steem("https://api.steemit.com")
from beem.block import Block
b = Block(35097419, steem_instance=stm)
print(b.operations[-22]["value"]["title"])

returns
<스파이더맨 : 파 프롬 홈> 블루엔젤 니어 프롬 (퓨처) 홈 💙

You've done something wrong in beem; likely you've assumed data in steem operations is always uft-8. It is not guaranteed to be so.
I believe Jussi re-formats steem data to be uft-8. This is not a good thing, it means they alter the inline data, and by doing so, the signature of the transaction will no longer match.

My implementation returns the exact result as you would get if you ran it against a steemd node directly.

A good json parser, like jq, understands things fine. Your example in jq would be:

curl -sd '{"jsonrpc":"2.0", "method":"block_api.get_block", "params":{"block_num":35097419}, "id":"0"}' https://anyx.io | jq '.result.block.transactions[1].operations[0].value.title'

As you can see with this, the result is parsed correctly.

I suggest you try running beem against a steemd node directly to better debug your issue. As an example; the md5sum of the block you have is as reported as follows:

direct to steemd:
curl -sd '{"jsonrpc":"2.0", "method":"block_api.get_block", "params":{"block_num":35097419}, "id":"0"}' localhost:8090 | md5sum
3708e49c94c77626f74ab4958920dc9c  -

anyx.io:
curl -sd '{"jsonrpc":"2.0", "method":"block_api.get_block", "params":{"block_num":35097419}, "id":"0"}' anyx.io | md5sum
3708e49c94c77626f74ab4958920dc9c  -

api.steemit.com:
curl -sd '{"jsonrpc":"2.0", "method":"block_api.get_block", "params":{"block_num":35097419}, "id":"0"}' https://api.steemit.com | md5sum
34bc46f946b44bc4863d3d6434b6c945  -

Thanks a lot, this will definitely help me fixing this issue on beem.

Posted using Partiko Android

Hi @anyx, thank you for providing great api servers. I'm helping Busy from time to time, and Busy's default server is yours :)

btw, could you check this?

https://steemit.com/steemfinex/@steemfinex/steemfinex-2019-08-26#@blockchainstudio/re-cheetah-cheetah-re-steemfinexsteemfinex-2019-08-26-20190826t001908767z

not sure if you remember this, but I've contributed many to steem/busy/keychain etc, and providing some free services (@scotauto, @scotview, etc) some of which makes a daily post. some are informative (@steemfinex), and some may be not so much I admit :) (@scotauto), but in that case, it's like steemauto.

So please take @cheetah bot from my service accounts: @scotauto (by definition of daily report, it may be similar, as steemauto), @steemfinex (cheetah keeps saying that s/he found a similar content on https://steemfinex.com of course, cause both are mine :) Thanks!

ps. use @steemfinex when you need to exchange STEEM/STEEMP :)

There's nothing explicitly negative about a cheetah comment. You can just ignore it if you know you're not doing anything wrong, nothing will come of it.

The "daily post" stuff she will figure out eventually. I haven't improved that logic in a while, but it should still work.

sure thanks! maybe i'm wrong, but i heard that she will eventually attack :) but it seems not :) I have a bear (@gomdory) bot, so if she attack, I'll let him know :)

it might be great if there's whitelist function. but of course, she may not trust anybody :(

ps. reading your post in detail made me worry if I'm actually using one of deprecated APIs. Personally I'm using api.steemit.com as my main server, so I guess in that case, I'm already okay, right?

No, there's only the automated message. Anything further is dealing with steemcleaners, who are humans. :)
I had a whitelist before but it is too cumbersome to manage.

If you use Steemit's API interchangeably already, you are fine, as mentioned in the post.

Thanks! hope busy is also okay...

Thanks for providing this API. It is one of the three APIs used by the steemstem.io app and various steemstem scripts allowing us to internally function well.

This post has been included in the latest edition of The Steem News - a compilation of the key news stories on the Steem blockchain.

Yes, I misunderstood that hivemind supports get_content fully. It unfortunately does not. I updated it the other day to direct to the full steemd node rather than hivemind.

If you try again, results should match. :)

Thanks for the downvote. Great witness.

Try reading my content so people can enjoy your blog. Instead of attacking me for no commented reason. Steem the centralized decentralized block claim. I wont drag it down with content. Bye.

steemcleaners

Posted using Partiko Android