{"id":28376776,"url":"https://github.com/threshold-network/staking-subgraphs","last_synced_at":"2026-06-30T09:31:16.979Z","repository":{"id":37094491,"uuid":"475388169","full_name":"threshold-network/staking-subgraphs","owner":"threshold-network","description":"Threshold Network staking subgraphs","archived":false,"fork":false,"pushed_at":"2024-04-08T11:54:29.000Z","size":492,"stargazers_count":2,"open_issues_count":3,"forks_count":2,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-06-26T10:50:01.820Z","etag":null,"topics":["graph","subgraph"],"latest_commit_sha":null,"homepage":"https://threshold.network","language":"TypeScript","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/threshold-network.png","metadata":{"files":{"readme":"README.adoc","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-29T10:18:54.000Z","updated_at":"2025-02-15T07:16:37.000Z","dependencies_parsed_at":"2024-03-25T14:07:23.112Z","dependency_job_id":"ca204a19-2351-4915-9cbf-c2ad1707104e","html_url":"https://github.com/threshold-network/staking-subgraphs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/threshold-network/staking-subgraphs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threshold-network%2Fstaking-subgraphs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threshold-network%2Fstaking-subgraphs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threshold-network%2Fstaking-subgraphs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threshold-network%2Fstaking-subgraphs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/threshold-network","download_url":"https://codeload.github.com/threshold-network/staking-subgraphs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threshold-network%2Fstaking-subgraphs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34961543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-30T02:00:05.919Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["graph","subgraph"],"created_at":"2025-05-30T00:07:51.509Z","updated_at":"2026-06-30T09:31:16.956Z","avatar_url":"https://github.com/threshold-network.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Threshold Network staking subgraph\n\nThis repository contains Threshold Network staking subgraphs.\n\nSubgraphs are open APIs to query data from networks like Ethereum and IPFS. The\ndata is indexed by https://thegraph.com[*The Graph*] decentralized protocol.\n\nBy the moment, there two different subgraphs have been developed:\n- mainnet: collects the data from contracts in Ethereum Mainnet.\n- mumbai: collects the data from contracts in Polygon Mumbai.\n\n\nDevelopment query URL for Ethereum mainnet subgraph:\nhttps://api.studio.thegraph.com/query/24143/main-threshold-subgraph/0.0.7\n\nDevelopment query URL for Polygon subgraph:\nhttps://api.studio.thegraph.com/query/24143/threshold-staking-polygon/0.1.0\n\nDevelopment query URL for Simple PRE Application:\nhttps://api.studio.thegraph.com/query/24143/simple-pre-application/version/latest\n\n== Install, build and deploy subgraph\n\n=== Prerequisites\n\nPlease make sure you have the following prerequisites installed on your machine:\n\n- https://nodejs.org[Node.js] ^18.19.0 - https://yarnpkg.com[Yarn] ^1.22.21\n\n=== Installation\n\nThe Graph CLI can be installed in your computer with npm or yarn:\n\n```\n$ yarn global add @graphprotocol/graph-cli\n```\n\nOnce graph-cli is installed in your system, install linting and formatting\ntools:\n\n```\n$ yarn install\n```\n\nNow, you can navigate to the subgraph of your interest and install this subgraph\ndependencies:\n\n```\n$ cd subgraphs/mainnet/\n$ yarn install\n```\n\n=== Build the subgraph\n\n```\n$ graph codegen \u0026\u0026 graph build\n```\n\n\n=== Run unit tests\n\nThe recommended way to run tests is using a Docker container. It is required to\nhave [Docker installed](https://docs.docker.com/desktop/).\n\nTo run the tests, just execute:\n\n```\n$ yarn test\n```\n\nTests can also be run in the local environment, more info in\n[Unit Testing Framework](https://thegraph.com/docs/en/developing/unit-testing-framework/).\n\n=== Deploy subgraph\n\nSubgraphs can be deployed in Subgraph Studio. It is required to create a new\nsubgraph in https://thegraph.com/studio/[*Subgraph Studio*] and get a `deploy\nkey`.\n\nOnce the new subgraph is created in Subgraph Studio, you have to authenticate in\ngraph-cli:\n\n```\n$ graph auth  --studio \u003cDEPLOY KEY\u003e\n```\n\nAnd then you can deploy the subgraph. Follow the CLI instructions:\n\n```\n$ graph deploy --studio\n```\n\n=== Contributing\n\n==== Lint\n\nWe use https://prettier.io[Prettier] and https://eslint.org[ESLint] for linting\ncode. The scripts are:\n\n```\n$ yarn format \u003cfile_path\u003e           # Prettier\n$ yarn format:fix \u003cfile_path\u003e\n$ yarn lint # eslint \u003cfile_path\u003e    # ESLint\n$ yarn lint:fix \u003cfile_path\u003e\n$ yarn format:lint:fix \u003cfile_path\u003e  # fix files using Prettier and ESLint\n```\n\n== Test the subgraph locally\n\n=== Run local chain eg. Ganache\n\nNote that host set to `0.0.0.0` is necessary for Ganache to be accessible from\nwithin Docker and from other machines. By default, Ganache only binds to\n127.0.0.1, which can only be accessed from the host machine that Ganache runs\non. If you use a ganache-cli run the node with `ganache-cli -h 0.0.0.0`. If you\nuse a Ganche in GUI version go to `settings -\u003e server` and set `HOSTNAME` to\n`0.0.0.0 - All Interfaces`. Make sure the network ID is the same as chaind ID.\nBy default, ganache sets the chaind ID to `1337`. To change the network ID in\nGanache GUI go to `settings -\u003e server` and set `NETWORK ID` to `1337`. If you\nuse a ganache-cli run a node with flag `-i 1337`.\n\n=== Deploy the Threshold Network contracts to local chain\n\nClone https://github.com/threshold-network/solidity-contracts repo and make sure\nthe `development` network config in\nhttps://github.com/threshold-network/solidity-contracts/blob/main/hardhat.config.ts#L42-L44[hardhat.config.ts]\nis correct for your local chain.\n\nNOTE: The deployment scripts assume the `keep-core` contract are already\ndeployed to your local chain.\n\n==== Deploy the Keep Core contracts to local chain\n\nClone https://github.com/keep-network/keep-core repo and make sure the `local`\nnetwork config in\nhttps://github.com/keep-network/keep-core/blob/main/solidity-v1/truffle-config.js#L8-L12[truffle-config.js]\nis correct for your local chain.\n\nGo to root dir and run `./scripts/install.sh --network local --contracts-only`.\n\nGo to `./solidity-v1` and run `yarn link`.\n\n==== Deploy the Threshold Network contracts\n\nInstall dependencies `yarn`.\n\nLink the local `keep-core` contracts by running `yarn link\n@keep-network/keep-core`.\n\nRun `./scripts/prepare-dependencies.sh`.\n\nRun `yarn deploy --network development --reset` to deploy contracts to your\nlocal chain.\n\n=== Update the subgraph manifest\n\nSet the correct `address` and `startBlock` for contracts in `subgraph.yaml`\nfile.\n\n=== Run a local Graph Node\n\n`docker-compose up`\n\n=== Install dependencies\n\n`yarn`\n\n=== Deploy the subgraph to the local Graph Node\n\nRun code generation: `yarn codegen`.\n\nAllocate the subgraph name in the local Graph Node: `yarn create-local`.\n\nNote: use it only if your subgraph is not created in the local Graph node.\n\nDeploy the subgraph to your local Graph Node. `yarn deploy-local`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreshold-network%2Fstaking-subgraphs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreshold-network%2Fstaking-subgraphs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreshold-network%2Fstaking-subgraphs/lists"}