Skip to content

Commit

Permalink
Merge pull request #162 from metagov/index-old
Browse files Browse the repository at this point in the history
index mainnetv0 graph
  • Loading branch information
crazyyuan authored Oct 18, 2023
2 parents 779804f + 596add0 commit 163f3bd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
6 changes: 3 additions & 3 deletions daostar-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@
"react-three-fiber": "^6.0.13",
"three": "^0.148.0",
"ts-jest": "^29.0.5",
"typescript": "^4.9.4",
"typescript": "^5.2.2",
"typewriter-effect": "^2.19.0",
"validator": "^13.7.0",
"wagmi": "^0.11.4",
"wagmi": "^1.1.1",
"web-vitals": "^2.1.4",
"web3": "^1.8.1"
},
"scripts": {
"start": "PORT=8000 REACT_APP_API_URL=https://api.daostar.org react-scripts start",
"start": "PORT=8000 REACT_APP_API_URL=http://localhost:8080/https://api.daostar.org react-scripts start",
"build": "REACT_APP_API_URL=https://api.daostar.org react-scripts build",
"predeploy": "REACT_APP_API_URL=https://api.daostar.org npm run build",
"deploy": "REACT_APP_API_URL=https://api.daostar.org gh-pages -d build",
Expand Down
20 changes: 16 additions & 4 deletions daostar-website/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ function App() {
context: { apiName: "mainnet" },
variables: { id: "mainnet" },
});
const mainnetv0Res = useQuery(queries.REGISTRATIONS, {
context: { apiName: "mainnetv0" },
variables: { id: "mainnet" },
});
const goerliRes = useQuery(queries.REGISTRATIONS, {
context: { apiName: "goerli" },
variables: { id: "goerli" },
Expand All @@ -54,7 +58,11 @@ function App() {
context: { apiName: "optimism" },
variables: { id: "optimism" },
});

const {
loading: mainnetv0Loading,
error: mainnetv0Error,
data: mainnetv0Data,
} = mainnetv0Res;
const {
loading: optimismLoading,
error: optimismError,
Expand Down Expand Up @@ -90,19 +98,22 @@ function App() {
error: gnosisError,
data: gnosisData,
} = gnosisRes;
console.log({ mainnetData, goerliData, gnosisData, optimismGoerliData, arbitrumGoerliData, chapelData });
console.log({ mainnetData, goerliData, gnosisData, optimismGoerliData, arbitrumGoerliData, chapelData, mainnetv0Data });

if (error || goerliError || optimismGoerliError || arbitrumGoerliError || chapelError || optimismError ) {
if (error || goerliError || optimismGoerliError || arbitrumGoerliError || chapelError || optimismError || mainnetv0Error ) {
console.error("Mainnet Error "+ error);
console.error("Mainnet v0 Error "+ mainnetv0Error);
console.error("Goerli Error "+ goerliError);
console.error("Optimism Goerli Error "+ optimismGoerliError);
console.error("Arbitrum Goerli Error" + arbitrumGoerliError);
console.error("Chapel Error" + chapelError);
console.error("Optimism Error" + optimismError)
};
if (loading || goerliLoading || gnosisLoading || optimismGoerliLoading || arbitrumGoerliLoading || chapelLoading || optimismLoading) return "loading...";
if (loading || mainnetv0Loading || goerliLoading || gnosisLoading || optimismGoerliLoading || arbitrumGoerliLoading || chapelLoading || optimismLoading) return "loading...";
const mainnetRegistrations =
mainnetData?.registrationNetwork?.registrations || [];
const mainnetv0Registrations =
mainnetv0Data?.registrationNetwork?.registrations || [];
const goerliRegistrations =
goerliData?.registrationNetwork?.registrations || [];
const optimismGoerliRegistrations =
Expand All @@ -116,6 +127,7 @@ function App() {
const chapelRegistrations =
chapelData?.registrationNetwork?.registrations || [];
const allRegistrationInstances = mainnetRegistrations.concat(
mainnetv0Registrations,
goerliRegistrations,
gnosisRegistrations,
optimismGoerliRegistrations,
Expand Down
3 changes: 2 additions & 1 deletion daostar-website/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ const client = new ApolloClient({
gnosis: `https://api.thegraph.com/subgraphs/name/rashmi-278/daostar-gnosis`,
arbitrumGoerli: `https://api.thegraph.com/subgraphs/name/crazyyuan/daostar-arbitrum-goerli`,
chapel:`https://api.thegraph.com/subgraphs/name/crazyyuan/daostar-bnb-bruno`,
optimism: `https://api.thegraph.com/subgraphs/name/crazyyuan/daostar-optimism`
optimism: `https://api.thegraph.com/subgraphs/name/crazyyuan/daostar-optimism`,
mainnetv0: `https://api.thegraph.com/subgraphs/name/crazyyuan/daostar-ethereum-main-v0`

},
// defaultEndpoint: 'https://api.thegraph.com/subgraphs/name/ipatka/daostar',
Expand Down

0 comments on commit 163f3bd

Please sign in to comment.