Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add IPFS helper function #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

topocount
Copy link

@topocount topocount commented Jan 9, 2020

This helper functions allows v0 CIDs to be queried and the results returned and printed in radspec. If the resulting value is not a string or address, a link is returned to the contents of the hash provided.

parses v0 ipfs hashes and returns addresses and strings. Will return a
link to the blob if the hash resolves to anything other than a string or
and address
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 90.037% when pulling 55ca5ce on AutarkLabs:feat/ipfsHelper into 4aef590 on aragon:master.

import Web3Utils from 'web3-utils'

// default endpoints to be queried
const ipfsEndpoints = ['https://ipfs.autark.xyz:5001/api/v0']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this feature, but I don't think it is a good practice to hardcode the autark ipfs node here.

Copy link
Author

@topocount topocount Feb 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was using that for my own tests, but Aragon One is welcome to add the api endpoints they maintain. I just left it in because @sohkai usually puts together suggested changes for stuff like this, and this way it passes tests upon submission, since it's an endpoint I have server-side access to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants