kleros / gtcr

Web client for the kleros generalized token curated list
https://curate.kleros.io
MIT License
17 stars 10 forks source link

Graceful degradation / fallback / backup IPFS node #300

Open marsrobertson opened 1 year ago

marsrobertson commented 1 year ago

Kleros node: https://ipfs.kleros.io/ipfs/QmcpSAbiwZC3W4pu5ZfEuin94EMtreuEoTBqFigBp114hy

Default: https://gateway.ipfs.io/ipfs/QmcpSAbiwZC3W4pu5ZfEuin94EMtreuEoTBqFigBp114hy

(by the time you click it might have propagated)

EDIT / UPDATE: I've clicked now and it works. Probably some indexing delay.

image

I used https://app.pinata.cloud/ to upload new policies and then change arbitration params.

marsrobertson commented 1 year ago

Follow up

Because GTCR front-end is using Kleros node, I was thinking - let's just use Kleros IPFS node for uploading.

When running this repo on localhost - uploading works.

When running code from this repo in my own project - uploading does not work 🤷‍♀️

Code from this repo: https://github.com/kleros/gtcr/blob/9acd78d79e49cf023c9724b60fd79093faf7af10/src/utils/ipfs-publish.js

My stanalone version: https://plnkr.co/edit/kMigKchizDCDPJMg?preview

To run on localhost: python3 -m http.server

EDIT / UPDATE:

  1. Request that works ----> OK status ----> CORS setup properly

  2. Request with wrong data format ---> 500 status -----> no CORS on error codes

telegram-cloud-photo-size-4-5796178187405868693-y

Basically problems with https://www.jsdelivr.com/package/npm/buffer VS Uint8Array