packages/reflex-cache: use better ipfs chunking

This commit is contained in:
Max Headroom 2023-11-10 00:36:26 +01:00
parent bd08dcda97
commit ac6eac4889

View file

@ -26,7 +26,7 @@ class IPFSController:
upload = {"file": ("FILE", content, "application/octet-stream")} upload = {"file": ("FILE", content, "application/octet-stream")}
try: try:
rIpfs = requests_unixsocket.post( rIpfs = requests_unixsocket.post(
f"{self.__nodeAddr}/api/v0/add?pin=false&quieter=true", files=upload f"{self.__nodeAddr}/api/v0/add?pin=false&quieter=true&chunker=buzhash&trickle=true", files=upload
) )
hash = rIpfs.json()["Hash"] hash = rIpfs.json()["Hash"]
print(f"Mapped: {nar} -> /ipfs/{hash}") print(f"Mapped: {nar} -> /ipfs/{hash}")