I realized that block_raw
is only available in V1 API.
In V2, you manually need to decode the output.
A few strings are not proper UTF-8, so when decoding you need to force raw decoding:
import algosdk.v2client
import msgpack
algod_address = "https://algoexplorerapi.io"
algod_token = ""
algod_headers = {"User-Agent": "DoYouLoveMe?"}
clientV2 = algosdk.v2client.algod.AlgodClient(algod_token, algod_address, algod_headers)
block = msgpack.loads(
clientV2.block_info(17829107, response_format="msgpack"),
raw=True,
strict_map_key=False
)
print(block)