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

Aragon API issues #18

Closed
FRYoussef opened this issue Oct 15, 2020 · 10 comments
Closed

Aragon API issues #18

FRYoussef opened this issue Oct 15, 2020 · 10 comments
Labels
bug Something isn't working
Milestone

Comments

@FRYoussef
Copy link
Collaborator

Add Aragon as a new ecosystem in DAO-Analyzer.

Unlike DAOstack and DAOhaus, which have a unique API, Aragon is composed of several. They provide a library, Aragon Connect, used as middleware of all of its APIs. However, DAO-Analyzer uses directly GraphQL to fetch its data.

So, here are the main Aragon APIs which DAO-Analyzer will use:

  • Aragon-Mainnet allows fetching data of DAOs(Organization schema) and its Apps(App schema).
  • Aragon-Tokens allows fetching data of DAO members (Token Holder schema), and the data of tokens (MiniMeToken schema).
  • Aragon-Voting allows fetching data of proposals (vote schema), and for votes (Cast schema).
  • Aragon-Finance allows fetching data of transactions (Transaction schema).
@FRYoussef FRYoussef added enhancement New feature or request good first issue Good for newcomers labels Oct 15, 2020
@FRYoussef
Copy link
Collaborator Author

There are no names for organizations and no creation date for token holders.

However, they could be added.

@FRYoussef FRYoussef changed the title DAOs of Aragon Aragon DAOs Oct 15, 2020
@FRYoussef FRYoussef reopened this May 20, 2021
@FRYoussef FRYoussef changed the title Aragon DAOs Aragon API issues May 20, 2021
@FRYoussef
Copy link
Collaborator Author

Aragon Voting app for xDai network is not available.

@FRYoussef FRYoussef removed enhancement New feature or request good first issue Good for newcomers labels May 20, 2021
@daviddavo
Copy link
Member

Aragon Connect changed the data type of voter and removed voterStake at aragon/connect@0601614

This is causing issues displaying cast votes among other things

@daviddavo daviddavo added this to the v0.6 milestone Oct 8, 2021
@daviddavo daviddavo added the bug Something isn't working label Oct 11, 2021
@daviddavo daviddavo mentioned this issue Oct 11, 2021
19 tasks
@daviddavo
Copy link
Member

The subgraphs aragon-voting, aragon-finance, etc don't exist any more
aragon/connect#328

@daviddavo
Copy link
Member

To show the name, we could download and use https://github.com/aragon/client/blob/master/src/known-organizations/index.js

@daviddavo
Copy link
Member

Aragon API Issues Overview

  • Some subgraphs like aragon-finance don't exist any more. But maybe they could be re-deployed.
  • There is a node.js API called Aragon Connect, but it hasn't had a commit since 2020, and the code uses the subgraphs that ceased to exist.
  • Now they are focusing on Aragon Client, and reading the docs I just found out that they sometimes use aragonAPI, but it seems to be mainly focused on apps. Reading the code, we could extract how they access the info, or we could use ipfs (or an ipfs gateway) to "scrape" the data, but I still don't know enough about neither IPFS nor how Aragon Client works

@daviddavo
Copy link
Member

The subgraphs aragon-voting, aragon-finance, etc don't exist any more aragon/connect#328

I redeployed them and updated the endpoints.

The only thing missing now are the organization names. We can:

  • Manually get this file and translate it to Python
  • Use something like js2py to "run" the file

@daviddavo
Copy link
Member

daviddavo commented Oct 19, 2021

Use something like js2py to "run" the file

Impossible, the file uses ECMAScript 6

Instead of manually translating the file to python, maybe creating a simple bash (or node) script that clones the repo and updates the file in a GitHub action would be better? It could be set-up to run weekly, so it gets timely updates from the client repo

@daviddavo
Copy link
Member

I can't seem to create a simple script to get the KnownOrganizations constant from the module, keep only the needed data, and write it to a file to json. After two days trying, I still don't know how to "get" the constant from my script.

The error:

./scripts/extract-known-orgs
/home/davo/Documents/GRASIA/client/src/known-organizations/index.js:1
import aragonGovernanceImage from './images/aragon-governance.svg'
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1031:15)
    at Module._compile (node:internal/modules/cjs/loader:1065:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/davo/Documents/GRASIA/client/scripts/extract-known-orgs:3:12)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)

And the script:

#!/usr/bin/env node

const ko = require('../src/known-organizations').KnownOrganizations
console.log(ko.KnowOrganizations)

I think I'll have to somehow extract what we want with awk and bash

@daviddavo
Copy link
Member

Not a lot of names yet, but we have 27 of them...

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants