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

Deploy #495

Merged
merged 12 commits into from
May 2, 2024
6 changes: 2 additions & 4 deletions apps/admin/src/components/HomeDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
widthQuery,
} from '@daohaus/ui';
import {
GRAPH_API_KEYS,
HAUS_NETWORK_DATA,
isValidNetwork,
ValidNetwork,
Expand Down Expand Up @@ -52,10 +53,7 @@ export const HomeDashboard = () => {
daoFilter: { name_contains_nocase: debouncedSearchTerm },
memberFilter: getDelegateFilter(filterDelegate, address),
ordering: SORT_FIELDS[sortBy].ordering,
graphApiKeys: {
'0x1': process.env['NX_GRAPH_API_KEY_MAINNET'],
'0x64': process.env['NX_GRAPH_API_KEY_MAINNET'],
},
graphApiKeys: GRAPH_API_KEYS,
});
if (query.data?.daos && shouldUpdate) {
setDaoData(query.data.daos);
Expand Down
2 changes: 1 addition & 1 deletion apps/moloch-v3-subgraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ To generate subgraph code, run the following command:
`nx run moloch-v3-subgraph:graph-deploy --name=hausdao/daohaus-v3-optimism --network=optimism`
`nx run moloch-v3-subgraph:graph-deploy --name=hausdao/daohaus-v3-arbitrum --network=arbitrum-one`
`nx run moloch-v3-subgraph:graph-deploy --name=hausdao/daohaus-v3-polygon --network=matic`
`nx run moloch-v3-subgraph:graph-deploy --name=hausdao/daohaus-v3-sepolia --network=sepolia`
`nx run moloch-v3-subgraph:graph-deploy --name=hausdao/daohaus-v3-sepolia-2 --network=sepolia`

### mainnet and gnosis chain deployment to studio

Expand Down
3 changes: 3 additions & 0 deletions apps/moloch-v3-subgraph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ type Proposal @entity {
contentURIType: String
"votes scoped to this proposal"
votes: [Vote!] @derivedFrom(field: "proposal")
record: Record
}

type Vote @entity {
Expand Down Expand Up @@ -230,6 +231,8 @@ type Record @entity {
contentType: String!
content: String!
queryType: String
proposals: [Proposal!] @derivedFrom(field: "record")
parentId: String
}

type Member @entity {
Expand Down
5 changes: 5 additions & 0 deletions apps/moloch-v3-subgraph/src/baal-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ export function handleSubmitProposal(event: SubmitProposal): void {
if (contentURIType.error == 'none') {
proposal.contentURIType = contentURIType.data;
}

const relatedRecordId = getStringFromJson(object, 'relatedRecordId');
if (relatedRecordId.error == 'none') {
proposal.record = relatedRecordId.data;
}
}

proposal.save();
Expand Down
6 changes: 6 additions & 0 deletions apps/moloch-v3-subgraph/src/util/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ export function createDaoDatabaseRecord(
entity.contentType = 'json';
entity.content = event.params.content;

// connect to parent record - for comments
const parentId = getStringFromJson(object, 'parentId');
if (parentId.error == 'none') {
entity.parentId = parentId.data;
}

const table = getStringFromJson(object, 'table');
if (table.error != 'none') {
return false;
Expand Down
7 changes: 2 additions & 5 deletions apps/summon-safe/src/utils/graphql.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ValidNetwork } from '@daohaus/keychain-utils';
import { GRAPH_API_KEYS, ValidNetwork } from '@daohaus/keychain-utils';
import { listDaos } from '@daohaus/moloch-v3-data';

export const fetchDaos = async (
Expand All @@ -8,10 +8,7 @@ export const fetchDaos = async (
const query = await listDaos({
networkId,
filter: { safeAddress },
graphApiKeys: {
'0x1': process.env.NX_GRAPH_API_KEY_MAINNET,
'0x64': process.env.NX_GRAPH_API_KEY_MAINNET,
},
graphApiKeys: GRAPH_API_KEYS,
});
if (query.error) {
console.error('An error has occurred', query.error);
Expand Down
17 changes: 11 additions & 6 deletions libs/keychain-utils/src/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ export const ENDPOINTS: KeychainList = {
'https://gateway.thegraph.com/api/[api-key]/subgraphs/id/GfHFdFmiSwW1PKtnDhhcxhArwtTjVuMnXxQ5XcETF1bP',
'0x5': 'https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-goerli',
'0x64':
'https://gateway.thegraph.com/api/[api-key]/subgraphs/id/5oXHJGgAWTSEXHK5FGf7mcxYtk6rSz7MJV5ccvGfoW6q',
'https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/6x9FK3iuhVFaH9sZ39m8bKB5eckax8sjxooBPNKWWK8r',
'0x89':
'https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-polygon',
'https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/A4su27JYXR5TkPZmiFHzzqMJnmYttfU3FyrdNBDnnu8T',
'0xa':
'https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-optimism',
'https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/CgH5vtz9CJPdcSmD3XEh8fCVDjQjnRwrSawg71T1ySXW',
'0xa4b1':
'https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-arbitrum',
'https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/GPACxuMWrrPSEJpFqupnePJNMfuArpFabrXLnWvXU2bp',
'0xaa36a7':
'https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-sepolia-2',
'https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/3k93SNY5Y1r4YYWEuPY9mpCm2wnGoYDKRtk82QZJ3Kvw',
'0x2105':
'https://api.studio.thegraph.com/query/36740/daohaus-v3-base/version/latest',
'https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/7yh4eHJ4qpHEiLPAk9BXhL5YgYrTrRE6gWy8x4oHyAqW',
},
EXPLORER: {
'0x1': 'https://etherscan.io',
Expand Down Expand Up @@ -133,6 +133,11 @@ export const HAUS_RPC = {
export const GRAPH_API_KEYS = {
'0x1': process.env['NX_GRAPH_API_KEY_MAINNET'],
'0x64': process.env['NX_GRAPH_API_KEY_MAINNET'],
'0xaa36a7': process.env['NX_GRAPH_API_KEY_MAINNET'],
'0x2105': process.env['NX_GRAPH_API_KEY_MAINNET'],
'0xa4b1': process.env['NX_GRAPH_API_KEY_MAINNET'],
'0x89': process.env['NX_GRAPH_API_KEY_MAINNET'],
'0xa': process.env['NX_GRAPH_API_KEY_MAINNET'],
};

export type PinataApiKeys = {
Expand Down
10 changes: 6 additions & 4 deletions libs/moloch-v3-fields/src/utils/fieldHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { HAUS_NETWORK_DATA, ValidNetwork } from '@daohaus/keychain-utils';
import {
GRAPH_API_KEYS,
HAUS_NETWORK_DATA,
ValidNetwork,
} from '@daohaus/keychain-utils';
import {
findMember,
FindMemberQuery,
Expand Down Expand Up @@ -155,9 +159,7 @@ export const isActiveMember = async ({
networkId: daochain,
dao: daoid,
memberAddress: address.toLowerCase(),
graphApiKeys: {
'0x1': process.env['NX_GRAPH_API_KEY_MAINNET'],
},
graphApiKeys: GRAPH_API_KEYS,
});

if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const OverviewBox = styled.div<{ $allowLinks?: boolean }>`
}
.description {
margin-bottom: auto;
word-break: break-word;
}
@media ${widthQuery.md} {
.description {
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10513,6 +10513,11 @@ dotenv@^16.0.0:
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e"
integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==

dotenv@^16.4.5:
version "16.4.5"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f"
integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==

dotenv@^8.0.0:
version "8.6.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b"
Expand Down
Loading