api.hive.blog account history behaviour has changed with Beem
Something has changed with the way api.hive.blog interacts with Beem for the account.history call.
The following two tests give failure with api.hive.blog but deathwing works.
After 5 attempts to connect, Beem gives the following error when calling api.hive.blog
:
BlockDoesNotExistsException('output: None of identifier 81907668')
The call to deathwing.me
's api result in the expected history.
I believe this behaviour changed in the last 15 hours or so.
from datetime import datetime, timedelta
import pytz # type: ignore
from beem import Hive # type: ignore
from beem.account import Account # type: ignore
def test_api_hive_blog_fail() -> None:
"""Test if the API is working."""
try:
hive = Hive(node=["https://api.hive.blog"], nobroadcast=True)
today = datetime.now(pytz.utc)
hive_acc = Account("brianoflondon", blockchain_instance=hive)
for item in hive_acc.history(
start=today - timedelta(days=33), only_ops=["transfer_to_vesting"]
):
print(item)
except Exception as error:
print(error)
assert True
def test_deathwing_fail() -> None:
try:
hive = Hive(node=["https://api.deathwing.me"], nobroadcast=True)
today = datetime.now(pytz.utc)
hive_acc = Account("brianoflondon", blockchain_instance=hive)
for item in hive_acc.history(
start=today - timedelta(days=33), only_ops=["transfer_to_vesting"]
):
print(item)
except Exception as error:
print(error)
assert False
UPDATE:
I'm adding this here because this code comes from Python again but using @emrebeyler 's Lighthive library. This is a log from a piece of software which hasn't changed in over a year and has run day and night on multiple machines sending Podping custom_jsons:
2024-01-14T12:20:16+0000 | INFO | IRI batch_id 6ddc224a-b508-4559-aeba-1e85955666fa - Size of IRIs: 38
2024-01-14T12:20:16+0000 | INFO | Received 1 IRIs
2024-01-14T12:20:20+0000 | ERROR | send_notification error: Request Timeout
2024-01-14T12:20:20+0000 | ERROR | Failed to send 1 IRIs
2024-01-14T12:20:20+0000 | ERROR | Request Timeout
2024-01-14T12:20:20+0000 | WARNING | Malformed error response
2024-01-14T12:20:20+0000 | WARNING | Ignoring node https://api.hive.blog for 3600 seconds
2024-01-14T12:20:20+0000 | INFO | FAILURE COUNT: 1 - RETRYING 1 IRIs
2024-01-14T12:20:21+0000 | INFO | Lighthive Node: https://rpc.podping.org
2024-01-14T12:20:21+0000 | INFO | JSON size: 98
2024-01-14T12:20:21+0000 | INFO | FAILURE CLEARED after 1 retries
This code is built to handle failures better so it will ignore api.hive.blog
but there is definitely something strange going on with it.