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

useOrganizationDataStore #1051

Closed
wants to merge 12 commits into from

Conversation

@Schwartz10
Copy link
Contributor

Schwartz10 commented Sep 11, 2019

Hey @sohkai @bpierre @AquiGorka this is an initial PR to get the bulk of the heavy lifting done for #902

The idea here is that through the useOrganizationDataStore hook, we expose a number of different stateful variables and wrapper functions for setting and getting data from IPFS.

For example:

const { getData, setData } = useOrganizationDataStore()

const organizationSettingsDag = {
   identityLabels: { ... },
   otherSettings: { ... },
   someOtherValue: 'value'
}

await setData('SETTINGS', organizationSettingsDag)
// uploads organizationSettingsDag to IPFS
// takes the cid from above, and registers it to the storage smart contract under 'SETTINGS' key in the storage mapping

const data = await getData('SETTINGS')
/*
   returns:
   {
      localLabels: { ... },
      otherSettings: { ... },
      someOtherValue: 'value'
   }
*/

Here is the list of vars and fns to grab from the hook: https://github.com/aragon/aragon/pull/1051/files#diff-95b96dc34a5bf5b035b35940dd2d2d60R317

There is some additional logic in this PR that gets us closer to supporting multiple providers (so that the org manager can change off the AA node and onto their own pinata node, temporal, infura (eventually IPFS Cluster)

This is a draft PR at the moment because we're in the process of setting up the aragon-association pinata node. For now, we're using infura instead of AA node to pin data. Once the AA node is ready, I'll make the changes and mark this as ready for review.

In the meantime, any feedback is welcome. I recommend ignoring whitespace changes when reviewing bc the changes to App.js are very small. The future changes to support new AA node should be pretty small

@auto-assign auto-assign bot requested review from AquiGorka, bpierre and sohkai Sep 11, 2019
@now now bot temporarily deployed to staging Sep 11, 2019 Inactive
@now now bot temporarily deployed to staging Sep 11, 2019 Inactive
@Schwartz10 Schwartz10 force-pushed the openworklabs:feat/client-storage branch from 701bbff to 37b9f15 Sep 11, 2019
@Schwartz10 Schwartz10 marked this pull request as ready for review Sep 26, 2019
@now now bot had a problem deploying to staging Sep 26, 2019 Failure
@Schwartz10

This comment has been minimized.

Copy link
Contributor Author

Schwartz10 commented Sep 26, 2019

Hey this PR is ready for review! Not sure why now had a problem deploying this commit, it builds fine on my machine. Although there is one funky linting error i had to fix to get the code pushed up here after fixing merge conflicts: https://github.com/aragon/aragon/pull/1051/files#diff-4e09b59ec3f8803ba6754b36f88ee9b7R4. Do people think this could be causing now to fail?

Let me know what y'all think! Excited to keep moving on this front, we're working on an event based pinning mechanism that is getting close to start testing with the client.

@stellarmagnet stellarmagnet referenced this pull request Sep 30, 2019
@Schwartz10

This comment has been minimized.

Copy link
Contributor Author

Schwartz10 commented Oct 2, 2019

@sohkai should we wait to review this until optimistic pinning is ready? These methods will likely change.

@now now bot had a problem deploying to staging Oct 30, 2019 Failure
@radio-alice

This comment has been minimized.

Copy link

radio-alice commented on src/storage/index.js in 989777f Oct 30, 2019

"sstatus"

@now now bot had a problem deploying to staging Nov 6, 2019 Failure
@now now bot had a problem deploying to staging Nov 6, 2019 Failure
@now now bot had a problem deploying to staging Nov 6, 2019 Failure
* retrieve quasar's associated ipfs node endpoints from backend
@CLAassistant

This comment has been minimized.

Copy link

CLAassistant commented Nov 11, 2019

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

Schwartz10
radio-alice
You have signed the CLA already but the status is still pending? Let us recheck it.

@Schwartz10

This comment has been minimized.

Copy link
Contributor Author

Schwartz10 commented Nov 11, 2019

Will reopen at the right time, once everything is merged

@Schwartz10 Schwartz10 closed this Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.