mirror of
https://github.com/logos-blockchain/logos-blockchain-block-explorer-template.git
synced 2026-02-17 03:23:13 +00:00
Updated logos-blockchain node api url path and deserialization
This commit is contained in:
parent
6fa406f83f
commit
73bcd9cc66
@ -21,4 +21,4 @@ GET {{host}}/cryptarchia/blocks?slot_from=0&slot_to=10
|
||||
|
||||
###
|
||||
|
||||
GET {{host}}/cryptarchia/blocks/stream
|
||||
GET {{host}}/cryptarchia/events/blocks/stream
|
||||
|
||||
@ -24,7 +24,7 @@ class HttpNodeApi(NodeApi):
|
||||
ENDPOINT_INFO = "cryptarchia/info"
|
||||
ENDPOINT_TRANSACTIONS = "cryptarchia/transactions"
|
||||
ENDPOINT_BLOCKS = "cryptarchia/blocks"
|
||||
ENDPOINT_BLOCKS_STREAM = "cryptarchia/blocks/stream"
|
||||
ENDPOINT_BLOCKS_STREAM = "cryptarchia/events/blocks/stream"
|
||||
|
||||
def __init__(self, settings: "NBESettings"):
|
||||
self.host: str = settings.node_api_host
|
||||
@ -89,8 +89,11 @@ class HttpNodeApi(NodeApi):
|
||||
if not line:
|
||||
continue
|
||||
try:
|
||||
block = BlockSerializer.model_validate_json(line)
|
||||
except ValidationError as error:
|
||||
import json
|
||||
|
||||
event = json.loads(line)
|
||||
block = BlockSerializer.model_validate(event["block"])
|
||||
except (ValidationError, KeyError, json.JSONDecodeError) as error:
|
||||
logger.exception(error)
|
||||
continue
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user