You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const providerURL = 'https://kovan.infura.io/v3/1234342ba...'
const ipfsGateway = 'https://ipfs.kleros.io'
const archon = new Archon(providerURL, ipfsGateway)
...
const data = await archon.utils.validateFileFromURI('/ipfs/QmRNK2cpW2i4Q9BBp58ALuhHnXuKEPkSBLU5q4mdtBG9i4/dutchx-badge.pdf')
Error and prints the following to the console: GET http://localhost:3000/ipfs/QmRNK2cpW2i4Q9BBp58ALuhHnXuKEPkSBLU5q4mdtBG9i4/dutchx-badge.pdf 404 (Not Found)
Setting the provider with archon.setIpfsGateway(uri) does not solve it.
The text was updated successfully, but these errors were encountered:
This issue here is that utils are not in the context of any of the standard contract apis. So these functions rely on higher level functions to do things like concat gateway and ipfs uri and determine if the file validation is necessary. It is unintuitive, but the correct usage here would be to call this function asking it not to validate the file.
Which essentially is just fetching the file. If you are using a gateway that you trust, then the data integrity is already guaranteed by ipfs so there is no need to re-hash it. The major underlying issue that led to this decision in the first place instead of simply re-hashing everything is ipfs hashes use the CID multiformat (ethereum/EIPs#1497 (comment)) and would have to validated differently than our other standard hashes. I think it isn't a bad idea to use the CID multiformat in the standard, however it would cause extra friction for integrators, as it is another step of difficulty above multi hashes which some people already found unintuitive (see earlier in comment thread)
A refactor that could help with this is to allow for the ipfs gateway to be used in utils. The tradeoff being you need to instantiate the Archon object in order to access utils
Right I understand now. I think just updating the docs to provide this information would suffice but since the file is validated on ipfs anyway is not so urgent.
As the title says, this is the code:
Error and prints the following to the console:
GET http://localhost:3000/ipfs/QmRNK2cpW2i4Q9BBp58ALuhHnXuKEPkSBLU5q4mdtBG9i4/dutchx-badge.pdf 404 (Not Found)
Setting the provider with
archon.setIpfsGateway(uri)
does not solve it.The text was updated successfully, but these errors were encountered: