{"id":18493023,"url":"https://github.com/graphprotocol/ethdenver-dapp","last_synced_at":"2025-04-08T22:30:36.560Z","repository":{"id":36364156,"uuid":"170899610","full_name":"graphprotocol/ethdenver-dapp","owner":"graphprotocol","description":"ETHDenver example dApp built on The Graph","archived":false,"fork":false,"pushed_at":"2022-12-10T03:43:03.000Z","size":1498,"stargazers_count":42,"open_issues_count":29,"forks_count":25,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-23T18:51:48.077Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-15T17:02:42.000Z","updated_at":"2025-02-26T12:14:41.000Z","dependencies_parsed_at":"2022-08-27T00:53:13.945Z","dependency_job_id":null,"html_url":"https://github.com/graphprotocol/ethdenver-dapp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphprotocol%2Fethdenver-dapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphprotocol%2Fethdenver-dapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphprotocol%2Fethdenver-dapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphprotocol%2Fethdenver-dapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphprotocol","download_url":"https://codeload.github.com/graphprotocol/ethdenver-dapp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247939711,"owners_count":21021832,"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:17.536Z","updated_at":"2025-04-08T22:30:31.544Z","avatar_url":"https://github.com/graphprotocol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Getting started\n\n### Local Development\n\n#### Install tools and start Ganache\n\nInstall dependencies:\n\n```sh\nnpm install -g ganache-cli truffle @graphprotocol/graph-cli\n```\n\nStart Ganache:\n\n```sh\nganache-cli\n```\n\n#### Start a local Graph Node\n\nThis assumes you already have Ganache running and have performed\nthe above migration steps.\n\n1. Clone `https://github.com/graphprotocol/graph-node/`\n2. Enter the Graph Node's Docker directory:\n   ```sh\n   cd graph-node/docker\n   ```\n3. Start a local Graph Node that will connect to Ganache on your host:\n   ```sh\n   docker-compose up\n   ```\n\n#### Deploy the subgraph to the local Graph Node\n\n1. Ceate a new example subgraph with:\n   ```sh\n   graph init --from-example \u003cGITHUB_USERNAME\u003e/example-subgraph\n   ```\n2. Follow the instructions for installing dependencies and running\n   the code generation (typically: `yarn \u0026\u0026 yarn codegen`).\n3. Deploy the example contract to Ganache (in another terminal):\n\n   ```sh\n   truffle compile\n   truffle migrate\n   ```\n\n   This willl also create a couple of example transactions.\n\n   **Important: Remember the address of the `GravityRegistry` contract\n   printed by the migrations. You will need this later.**\n\n4. Replace the contract address with the one from Ganache (this is\n   the one that you remembered or copied earlier):\n   ```sh\n   sed -i -e \\\n     's/0x2E645469f354BB4F5c8a05B3b30A929361cf77eC/\u003cGANACHE_CONTRACT_ADDRESS\u003e/g' \\\n     subgraph.yaml\n   ```\n    Check out the [docs](https://www.gnu.org/software/sed/manual/sed.html) if you don't know what sed does. Basically, it replaces the hardcoded contract address `0x2E645469f354BB4F5c8a05B3b30A929361cf77eC` with the address of your locally-deployed `GravityRegistry` contract.\n\n5. Deploy the subgraph to your local Graph Node:\n   ```sh\n   graph create --node http://localhost:8020/ \u003cGITHUB_USERNAME\u003e/example-subgraph\n   graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001/ \u003cGITHUB_USERNAME\u003e/example-subgraph\n   ```\n6. You can now go to `http://localhost:8000/subgraphs/name/\u003cGITHUB_USERNAME\u003e/example-subgraph`\n   to query our subgraph. Try the following query, for example:\n   ```graphql\n   {\n     gravatars {\n       id\n       owner\n       displayName\n       imageUrl\n     }\n   }\n   ```\n\n#### Connect this dApp to the subgraph\n\n1. Write the the GraphQL endpoint of our subgraph to `.env` in this directory:\n   ```sh\n   echo \"REACT_APP_GRAPHQL_ENDPOINT=http://localhost:8000/subgraphs/name/\u003cGITHUB_USERNAME\u003e/example-subgraph\" \u003e .env\n   ```\n2. Then, start this app:\n   ```sh\n   yarn install\n   yarn start\n   ```\n\n### Hosted Service\n\n#### Create and deploy the subgraph\n\n1. Sign up on https://thegraph.com/explorer/\n2. Create a new subgraph on https://thegraph.com/dashboard/\n3. Install Graph CLI with `npm install -g @graphprotocol/graph-cli`\n4. Run `graph init \u003cGITHUB_USERNAME\u003e/\u003cSUBGRAPH_NAME\u003e` to create a subgraph template locally.\n5. Follow the instructions `graph init` prints for you to deploy the subgraph to the Hosted Service.\n\n#### Connect this dApp to the subgraph\n\n1. Go to `https://thegraph.com/explorer/subgraph/\u003cGITHUB_USERNAME\u003e/\u003cSUBGRAPH_NAME\u003e/`\n2. Copy the GraphQL HTTP endpoint (e.g. `https://api.thegraph.com/subgraphs/name/github-username/subgraph-name`)\n3. Write it to `.env` in this directory:\n   ```sh\n   echo \"REACT_APP_GRAPHQL_ENDPOINT=https://api.thegraph.com/subgraphs/name/github-username/subgraph-name\" \u003e .env\n   ```\n4. Start this app:\n   ```sh\n   yarn install\n   yarn start\n   ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphprotocol%2Fethdenver-dapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphprotocol%2Fethdenver-dapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphprotocol%2Fethdenver-dapp/lists"}