Closed azulika closed 9 months ago
tried via js @ipld/dag-cbor
and got more details
throw new Error(`${decodeErrPrefix2} encountered invalid minor (${minor}) for major ${data[pos] >>> 5}`);
should not be related to issue no 53 because SDK changed lib for websocket. and the current _MAX_MESSAGE_SIZE_BYTES is 5mb
I see. Perhaps I should've chosen a different example.
import requests
from atproto_core.cbor import decode_dag_multi
url = "https://bsky.network/xrpc/com.atproto.sync.getRepo?did=did:plc:ewvi7nxzyoun6zhxrhs64oiz"
data = requests.get(url).content
dag = decode_dag_multi(data)
print(dag)
This only returns:
[26, {'version': 1, 'roots': ['bafyreig67suqxcebtiv453ujpveydtv4doolnebl5yfnqx54evlg6u3tn4']}, None, 1, 1]
Decoding the same PDS instance via js @ipld/dag-cbor
works perfectly. Is decoding a bsky.social instance not supported in decode_dag_multi
or am I missing something?
@azulika you are missing the difference between the CAR file and DAG-CBOR
the right code:
import requests
from atproto import CAR # same as from atproto_core.car import CAR
url = "https://bsky.network/xrpc/com.atproto.sync.getRepo?did=did:plc:ewvi7nxzyoun6zhxrhs64oiz"
data = requests.get(url).content
car = CAR.from_bytes(data)
print(car.root)
print(car.blocks)
@MarshalX Thanks!
Maybe related: https://github.com/MarshalX/atproto/issues/53
only decodes the first part