{"id":18492977,"url":"https://github.com/graphprotocol/graph-network-subgraph","last_synced_at":"2025-04-05T04:08:28.391Z","repository":{"id":38949999,"uuid":"189459409","full_name":"graphprotocol/graph-network-subgraph","owner":"graphprotocol","description":"The subgraph, the smart contracts, the tests, and documents for the Graph Explorer Decentralized Application","archived":false,"fork":false,"pushed_at":"2025-03-31T03:16:11.000Z","size":2764,"stargazers_count":73,"open_issues_count":22,"forks_count":47,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-04-03T23:01:39.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graphprotocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-30T18:00:42.000Z","updated_at":"2025-04-01T19:16:03.000Z","dependencies_parsed_at":"2023-09-28T02:15:23.742Z","dependency_job_id":"c55e5a02-28b4-4a9c-9143-6a97934e58ad","html_url":"https://github.com/graphprotocol/graph-network-subgraph","commit_stats":{"total_commits":475,"total_committers":15,"mean_commits":"31.666666666666668","dds":"0.44842105263157894","last_synced_commit":"6bd8e0dd3e262da72a6aeb7568acf0a91f716588"},"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphprotocol%2Fgraph-network-subgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphprotocol%2Fgraph-network-subgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphprotocol%2Fgraph-network-subgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphprotocol%2Fgraph-network-subgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphprotocol","download_url":"https://codeload.github.com/graphprotocol/graph-network-subgraph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247092376,"owners_count":20882218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T13:12:07.204Z","updated_at":"2025-04-05T04:08:28.349Z","avatar_url":"https://github.com/graphprotocol.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Graph Network Subgraph\n\nThis repository contains the code for the Graph Network Subgraph. The mainnet version of the\n[subgraph can be explored through the playground here](https://thegraph.com/explorer/subgraph/graphprotocol/graph-network-mainnet?version=pending).\n\n# Contributing to the repository\n\nContributions are always welcome! Likely you will want to create a PR against `mainnet-staging`. If you are unsure you can always reach out to us on discord.\n## Submitting bugs\n\nPlease submit bugs as an issue in this repository.\n## Maintaining the repository\n\nThis repository has three different configurations for the `testnet`, `mainnet`, and \n`mainnet-staging` subgraphs. These can be seen in the npm scripts.\n\nWe are using `mustache` to configure two different `subgraph.yaml` manifests. Each manifest\nwill have different contract addresses populated depending on whether we are using rinkeby or\nmainnet. Ensure the npm package for `@graphprotocol/contracts` is set to the newest rinkeby\nor mainnet package, [which you can find here](https://www.npmjs.com/package/@graphprotocol/contracts).\n\n\nThe setup for each branch is:\n\n```\nmaster -            The code on master will always match the subgraph deployed to \n                    graph-network-mainnet in the explorer, as well as the version of the subgraph\n                    the gateway is using. All code must be reviewed before merging to master.\n                    The front end team should also confirm mainnet-staging works before the\n                    master branch can be updated.\n                    When master is updated a hook will automatically deploy the subgraph to the\n                    hosted service.\n\nmainnet-staging -   This branch will be where mainnet subgraph updates are tested. We will let the\n                    subgraph sync here, and confirm it works, before merging into master. \n\ntestnet -           This branch will contain the testnet subgraph. Development work can be done \n                    here first, and then the commits brought into mainnet-staging. In general\n                    it is likely this branch will be used more for new features that might not work\n                    on mainnet-staging, such as contract upgrades. Then the new work would have\n                    to be merged into mainnet-staging when it is appropriate to do so.\n\n```\n\nIn general, the workflow should be:\n- Develop on `mainnet-staging` and get it working, merge to `master` and the hook will auto deploy\n  to the hosted service\n- `testnet` can be rebased on top of `master` or `mainnet-staging`, with a single commit that\n  changes the contracts package imported ny npm. `testnet` can also diverge onto it's own branch\n  path if it has contract updates that do not yet exist on `mainnet`. And then care will have to\n  be taken to cherry-pick these updates into `master` when the contract updates are on `mainnet`.\n\n### Versioning\n\nEverytime a new release is merged into `master` there will be a new github release, following semantic versioning.\n\n# Deploying the subgraph\n\nThe npm scripts are set up to deploy the subgraphs in one command. Mainnet is connected to a hook\nwhere it will be deployed automatically when the `master` branch is updated. Therefore, we never\nhave to use npm scripts to directly deploy to `graph-network-mainnet`.\n### Mainnet Staging\n```\nyarn deploy-mainnet-staging\n```\n\n### Testnet\n```\nyarn deploy-testnet\n```\n\n### Testing the subgraph\n\nIf you need to test the subgraph on your personal account for the explorer (which you will have\nto do if you are not part of the `graphprotocol` organization) you can run the following script:\n```\nyarn deploy-testing\n```\nNote that you will have to fill in your own subgraph name in the npm script, where it says\n`\u003cINSERT_SUBGRAPH_NAME\u003e`. Depending if you are deploying to rinkeby or mainnet, you will also\nhave to fill in `prepare:rinkeby` or `prepare:mainnet` where it has `\u003cINSERT_MAINNET_OR_RINKEBY\u003e`.\n\n## Documentation\n\nFor documentation on the subgraph, please see [DOCUMENTATION.md](./DOCUMENTATION.md).\n\nThis will outline nuances of the subgraph, and help shed light on some of the fields and types in\nthe schema.\n\n## Copyright\n\nCopyright \u0026copy; 2020 The Graph Foundation.\n\nLicensed under the [MIT license](./LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphprotocol%2Fgraph-network-subgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphprotocol%2Fgraph-network-subgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphprotocol%2Fgraph-network-subgraph/lists"}