Skip to content

Commit

Permalink
Merge pull request #503 from HausDAO/develop
Browse files Browse the repository at this point in the history
deploy v0.5.0
  • Loading branch information
skuhlmann authored May 9, 2024
2 parents 0392668 + b4567d6 commit 5112ad4
Show file tree
Hide file tree
Showing 24 changed files with 79 additions and 78 deletions.
70 changes: 25 additions & 45 deletions apps/moloch-v3-subgraph/README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,51 @@
# DAOhaus v3 Subgraph

The v3 subgraph currently supports goerli. It's deployed here: https://api.thegraph.com/subgraphs/name/hausdao/daohaus-v3-goerli/graphql
## Deployment

Complete steps 1-3 for each network.

These require installing the graph cli locally and auth tokens for deployment to the hosted service or studio subgraphs

`npm install -g @graphprotocol/graph-cli`

## Local Development
`graph auth --studio <DEPLOY KEY>`

### Subgraph yaml Generation
### 1. Subgraph yaml Generation

`nx run moloch-v3-subgraph:generate-config --network=goerli`

`nx run moloch-v3-subgraph:generate-config --network=xdai`

`nx run moloch-v3-subgraph:generate-config --network=mainnet`

`nx run moloch-v3-subgraph:generate-config --network=optimism`

`nx run moloch-v3-subgraph:generate-config --network=arbitrum-one`

`nx run moloch-v3-subgraph:generate-config --network=matic`
`nx run moloch-v3-subgraph:generate-config --network=sepolia`
`nx run moloch-v3-subgraph:generate-config --network=base`

Supported Networks:
`nx run moloch-v3-subgraph:generate-config --network=sepolia`

- goerli
- gnosis
- mainnet
- optimism
- arbitrum-one
- polygon
`nx run moloch-v3-subgraph:generate-config --network=base`

### Generate Subgraph Code
### 2. Generate Subgraph Code

To generate subgraph code, run the following command:

`nx run moloch-v3-subgraph:generate-code`

## Deployment

`nx run moloch-v3-subgraph:graph-deploy --name=hausdao/daohaus-v3-goerli --network=goerli`
`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-2 --network=sepolia`
## Deploy

### mainnet and gnosis chain deployment to studio
`nx run moloch-v3-subgraph:graph-deploy-studio --name=daohaus-v3 --network=mainnet --semver=<NEW VERSION NUMBER>`

`cd apps/moloch-v3-subgraph`
`graph deploy --studio daohaus-v3`
`nx run moloch-v3-subgraph:graph-deploy-studio --name=daohaus-v3-base --network=base --semver=<NEW VERSION NUMBER>`

todo: get this nx command running with a version:
`nx run moloch-v3-subgraph:graph-deploy-studio --name=daohaus-v3 --network=mainnet`
`nx run moloch-v3-subgraph:graph-deploy-studio --name=daohaus-v3-gnosis --network=gnosis`
`nx run moloch-v3-subgraph:graph-deploy-studio --name=daohaus-v3-base --network=base`

_These require installing the graph cli locally and auth tokens for deployment to the hosted service or studio subgraphs_
`npm install -g @graphprotocol/graph-cli`
`nx run moloch-v3-subgraph:graph-deploy-studio --name=daohaus-v3-sepolia-2 --network=sepolia --semver=<NEW VERSION NUMBER>`

Supported names:
`nx run moloch-v3-subgraph:graph-deploy-studio --name=daohaus-v3-polygon --network=matic --semver=<NEW VERSION NUMBER>`

- `hausdao/daohaus-v3-goerli`
- `hausdao/daohaus-v3-gnosis`
- `hausdao/daohaus-v3-optimism`
- `hausdao/daohaus-v3-arbitrum`
- `hausdao/daohaus-v3-polygon`
- `daohaus-v3`
- `daohaus-v3-gnosis`
`nx run moloch-v3-subgraph:graph-deploy-studio --name=daohaus-v3-arbitrum --network=arbitrum-one --semver=<NEW VERSION NUMBER>`

Playgrounds:
`nx run moloch-v3-subgraph:graph-deploy-studio --name=daohaus-v3-optimism --network=optimism --semver=<NEW VERSION NUMBER>`

- https://thegraph.com/hosted-service/subgraph/hausdao/daohaus-v3-goerli
- https://thegraph.com/hosted-service/subgraph/hausdao/daohaus-v3-optimism
- https://thegraph.com/hosted-service/subgraph/hausdao/daohaus-v3-arbitrum
- https://thegraph.com/hosted-service/subgraph/hausdao/daohaus-v3-polygon
- https://thegraph.com/explorer/subgraph?id=GfHFdFmiSwW1PKtnDhhcxhArwtTjVuMnXxQ5XcETF1bP&view=Overview
- https://thegraph.com/explorer/subgraphs/5oXHJGgAWTSEXHK5FGf7mcxYtk6rSz7MJV5ccvGfoW6q?view=Overview&chain=mainnet
`nx run moloch-v3-subgraph:graph-deploy-studio --name=daohaus-v3-gnosis --network=xdai --semver=<NEW VERSION NUMBER>`
2 changes: 1 addition & 1 deletion libs/abis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/abis",
"version": "0.5.0",
"version": "0.5.1",
"type": "commonjs",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion libs/connect-context/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/connect-context",
"version": "0.5.0",
"version": "0.5.1",
"repository": {
"type": "git",
"url": "https://github.com/HausDAO/monorepo"
Expand Down
2 changes: 1 addition & 1 deletion libs/connect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/connect",
"version": "0.5.0",
"version": "0.5.1",
"peerDependencies": {
"react-router-dom": "^6.4.3"
},
Expand Down
2 changes: 1 addition & 1 deletion libs/contract-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/contract-utils",
"version": "0.5.0",
"version": "0.5.1",
"type": "commonjs",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion libs/data-fetch-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/data-fetch-utils",
"version": "0.5.0",
"version": "0.5.1",
"type": "commonjs",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion libs/form-builder-base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/form-builder-base",
"version": "0.5.0",
"version": "0.5.1",
"repository": {
"type": "git",
"url": "https://github.com/HausDAO/monorepo"
Expand Down
2 changes: 1 addition & 1 deletion libs/form-builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/form-builder",
"version": "0.5.0",
"version": "0.5.1",
"repository": {
"type": "git",
"url": "https://github.com/HausDAO/monorepo"
Expand Down
2 changes: 1 addition & 1 deletion libs/keychain-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/keychain-utils",
"version": "0.5.0",
"version": "0.5.1",
"repository": {
"type": "git",
"url": "https://github.com/HausDAO/monorepo"
Expand Down
2 changes: 1 addition & 1 deletion libs/moloch-v3-data/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/moloch-v3-data",
"version": "0.5.0",
"version": "0.5.1",
"type": "commonjs",
"repository": {
"type": "git",
Expand Down
5 changes: 3 additions & 2 deletions libs/moloch-v3-data/src/daos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
import {
ENDPOINTS,
getGraphUrl,
GRAPH_API_KEYS,
Keychain,
ValidNetwork,
} from '@daohaus/keychain-utils';
Expand All @@ -35,7 +36,7 @@ import { listTokenBalances } from './vaults';
export const findDao = async ({
networkId,
dao,
graphApiKeys,
graphApiKeys = GRAPH_API_KEYS,
includeTokens = false,
}: {
networkId: ValidNetwork;
Expand Down Expand Up @@ -139,7 +140,7 @@ export const listDaos = async ({
pageSize: DEFAULT_RECORDS_PER_PAGE,
offset: 0,
},
graphApiKeys,
graphApiKeys = GRAPH_API_KEYS,
}: IListQueryArguments<Dao_OrderBy, Dao_Filter>): Promise<
IListQueryResults<Dao_OrderBy, Dao_Filter, ListDaosQueryResDaos>
> => {
Expand Down
15 changes: 10 additions & 5 deletions libs/moloch-v3-data/src/members.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import {
IListQueryArguments,
IListQueryResults,
} from '@daohaus/data-fetch-utils';
import { getGraphUrl, Keychain, ValidNetwork } from '@daohaus/keychain-utils';
import {
getGraphUrl,
GRAPH_API_KEYS,
Keychain,
ValidNetwork,
} from '@daohaus/keychain-utils';
import { nowInSeconds, MolochV3MembershipQuery } from '@daohaus/utils';
import {
Dao_Filter,
Expand Down Expand Up @@ -39,7 +44,7 @@ export const findMember = async ({
networkId,
dao,
memberAddress,
graphApiKeys,
graphApiKeys = GRAPH_API_KEYS,
}: {
networkId: ValidNetwork;
dao: string;
Expand Down Expand Up @@ -80,7 +85,7 @@ export const listMembers = async ({
pageSize: DEFAULT_RECORDS_PER_PAGE,
offset: 0,
},
graphApiKeys,
graphApiKeys = GRAPH_API_KEYS,
}: IListQueryArguments<Member_OrderBy, Member_Filter>): Promise<
IListQueryResults<Member_OrderBy, Member_Filter, ListMembersQuery['members']>
> => {
Expand Down Expand Up @@ -122,7 +127,7 @@ export const listDaosByMember = async ({
orderDirection: 'desc',
},
networkIds,
graphApiKeys,
graphApiKeys = GRAPH_API_KEYS,
}: ICrossNetworkMemberListArguments<
Dao_OrderBy,
Dao_Filter,
Expand Down Expand Up @@ -170,7 +175,7 @@ export const listProposalVotesByMember = async ({
pageSize: DEFAULT_RECORDS_PER_PAGE,
offset: 0,
},
graphApiKeys,
graphApiKeys = GRAPH_API_KEYS,
}: IListQueryArguments<Proposal_OrderBy, Proposal_Filter> & {
memberAddress: string;
}): Promise<
Expand Down
9 changes: 7 additions & 2 deletions libs/moloch-v3-data/src/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import {
IListQueryArguments,
IListQueryResults,
} from '@daohaus/data-fetch-utils';
import { getGraphUrl, Keychain, ValidNetwork } from '@daohaus/keychain-utils';
import {
getGraphUrl,
GRAPH_API_KEYS,
Keychain,
ValidNetwork,
} from '@daohaus/keychain-utils';
import {
ListVotesDocument,
ListVotesQuery,
Expand Down Expand Up @@ -37,7 +42,7 @@ export const findProposal = async ({
dao,
proposalId,
connectedAddress,
graphApiKeys,
graphApiKeys = GRAPH_API_KEYS,
}: {
networkId: ValidNetwork;
dao: string;
Expand Down
11 changes: 8 additions & 3 deletions libs/moloch-v3-data/src/records.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import {
IListQueryArguments,
IListQueryResults,
} from '@daohaus/data-fetch-utils';
import { getGraphUrl, Keychain, ValidNetwork } from '@daohaus/keychain-utils';
import {
getGraphUrl,
GRAPH_API_KEYS,
Keychain,
ValidNetwork,
} from '@daohaus/keychain-utils';
import {
addParsedContent,
createPaging,
Expand All @@ -30,7 +35,7 @@ import {
export const findRecord = async ({
networkId,
recordId,
graphApiKeys,
graphApiKeys = GRAPH_API_KEYS,
}: {
networkId: ValidNetwork;
recordId: string;
Expand Down Expand Up @@ -72,7 +77,7 @@ export const listRecords = async ({
pageSize: DEFAULT_RECORDS_PER_PAGE,
offset: 0,
},
graphApiKeys,
graphApiKeys = GRAPH_API_KEYS,
}: IListQueryArguments<Record_OrderBy, Record_Filter>): Promise<
IListQueryResults<
Record_OrderBy,
Expand Down
11 changes: 8 additions & 3 deletions libs/moloch-v3-data/src/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import {
IListQueryArguments,
IListQueryResults,
} from '@daohaus/data-fetch-utils';
import { getGraphUrl, Keychain, ValidNetwork } from '@daohaus/keychain-utils';
import {
getGraphUrl,
GRAPH_API_KEYS,
Keychain,
ValidNetwork,
} from '@daohaus/keychain-utils';
import { createPaging, DEFAULT_RECORDS_PER_PAGE } from './utils';
import {
EventTransaction_Filter,
Expand All @@ -22,7 +27,7 @@ import {
export const findTransaction = async ({
networkId,
txHash,
graphApiKeys,
graphApiKeys = GRAPH_API_KEYS,
}: {
networkId: ValidNetwork;
txHash: string;
Expand Down Expand Up @@ -62,7 +67,7 @@ export const listTransactions = async ({
pageSize: DEFAULT_RECORDS_PER_PAGE,
offset: 0,
},
graphApiKeys,
graphApiKeys = GRAPH_API_KEYS,
}: IListQueryArguments<
EventTransaction_OrderBy,
EventTransaction_Filter
Expand Down
2 changes: 1 addition & 1 deletion libs/moloch-v3-fields/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/moloch-v3-fields",
"version": "0.5.0",
"version": "0.5.1",
"repository": {
"type": "git",
"url": "https://github.com/HausDAO/monorepo"
Expand Down
2 changes: 1 addition & 1 deletion libs/moloch-v3-hooks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/moloch-v3-hooks",
"version": "0.5.0",
"version": "0.5.1",
"peerDependencies": {
"react-query": "^3.39.3"
},
Expand Down
2 changes: 1 addition & 1 deletion libs/moloch-v3-legos/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/moloch-v3-legos",
"version": "0.5.0",
"version": "0.5.1",
"type": "commonjs",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion libs/moloch-v3-macro-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/moloch-v3-macro-ui",
"version": "0.5.0",
"version": "0.5.1",
"peerDependencies": {
"react-router-dom": "^6.4.3"
},
Expand Down
2 changes: 1 addition & 1 deletion libs/profile-data/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/profile-data",
"version": "0.5.0",
"version": "0.5.1",
"type": "commonjs",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion libs/tx-builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/tx-builder",
"version": "0.5.0",
"version": "0.5.1",
"repository": {
"type": "git",
"url": "https://github.com/HausDAO/monorepo"
Expand Down
2 changes: 1 addition & 1 deletion libs/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/ui",
"version": "0.5.0",
"version": "0.5.1",
"repository": {
"type": "git",
"url": "https://github.com/HausDAO/monorepo"
Expand Down
2 changes: 1 addition & 1 deletion libs/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daohaus/utils",
"version": "0.5.0",
"version": "0.5.1",
"repository": {
"type": "git",
"url": "https://github.com/HausDAO/monorepo"
Expand Down
Loading

0 comments on commit 5112ad4

Please sign in to comment.