wip: Try to save current Website IPFS Hash to FFS storage #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've tried to save the current Website IPFS Hash to FFS storage on local testnet.
To setup I follow these steps:
But I've encountered issues when using FFS as follows, and I've added those concerns as
FIXME
's in this PR, as follows. I've attached screenshots of the outputs below:How to check if any cid's exist in FFS without having to use a try/catch block so it doesn't crash with error
Uncaught (in promise) Error: stored item not found
if no items exist?How to check if a specific cid exists in FFS without having to use a try/catch block so it doesn't crash with error if we try to remove it
Uncaught (in promise) Error: stored item not found
but when it doesn't exist? Note that if we try usingffs.get(cid)
and it doesn't exist then it also crashes with that same error, so we need to use a try/catch block with that too.How to use FFS to check if a cid already exists before running
ffs.pushConfig(cid)
without it crashing when we callffs.get(cid)
but it doesn't exist (e.g. why not add a new FFS functionisCid
?). It appears to be necessary to do this, otherwise if you try to callffs.pushConfig(cid)
when the cid already exists, it crashes with errorcid may have already been pinned, consider using override flag
but where do we find out how to use the override flag?How do we detect when it's been successfully stored to FFS Storage? Do we just watch the job and watch for a specific job status and check the
dealErrorList
is empty? (see screenshot)Why cidData (e.g.
42650d43746dd706dd531ca7bc36dacb0c4c0cc7ab6d69d9019299aa71c1f70156d7
) does not match the cid value (e.g. the Website IPFS Address ofQmUNQ3Rt1wbdUxynvDbaywxMDMerbWnZAZKZqnHB9wFW15
) when usingffs.get(cid)
?