{"id":27742554,"url":"https://github.com/astarnetwork/dapps-staking-indexer-v3","last_synced_at":"2025-04-28T16:42:58.731Z","repository":{"id":199750920,"uuid":"703576457","full_name":"AstarNetwork/dapps-staking-indexer-v3","owner":"AstarNetwork","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-03T07:54:33.000Z","size":1242,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-12-03T08:38:59.795Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AstarNetwork.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-11T13:55:53.000Z","updated_at":"2024-12-03T07:54:37.000Z","dependencies_parsed_at":"2023-12-21T18:41:40.688Z","dependency_job_id":"bfeb3488-d1ee-48c2-aa08-72a5752a8905","html_url":"https://github.com/AstarNetwork/dapps-staking-indexer-v3","commit_stats":null,"previous_names":["astarnetwork/dapps-staking-indexer-v3"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fdapps-staking-indexer-v3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fdapps-staking-indexer-v3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fdapps-staking-indexer-v3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AstarNetwork%2Fdapps-staking-indexer-v3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AstarNetwork","download_url":"https://codeload.github.com/AstarNetwork/dapps-staking-indexer-v3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251347756,"owners_count":21575141,"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":"2025-04-28T16:42:57.945Z","updated_at":"2025-04-28T16:42:58.722Z","avatar_url":"https://github.com/AstarNetwork.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dApps staking indexer\n\n## Prerequisites\n\n- npm, node ≥ v16\n- git\n- docker\n- docker-compose with docker user \u0026 group\n\nThis is the list of install commands of the prerequisites for Ubuntu 22.04 for the program list above.\n\n```bash\n# For node and npm\ncurl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg\nNODE_MAJOR=18\necho \"deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main\" | sudo tee /etc/apt/sources.list.d/nodesource.list\nsudo apt update\nsudo apt install nodejs\n\n# For docker\nsudo install -m 0755 -d /etc/apt/keyrings\nsudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc\nsudo chmod a+r /etc/apt/keyrings/docker.asc\necho \\\n  \"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \\\n  $(. /etc/os-release \u0026\u0026 echo \"$VERSION_CODENAME\") stable\" | \\\n  sudo tee /etc/apt/sources.list.d/docker.list \u003e /dev/null\nsudo apt-get update\nsudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-compose\nsudo gpasswd -a $USER docker\nnewgrp docker\n```\n\n## `sqd` CLI installation\n\n```bash\nsudo npm i -g @subsquid/cli\n```\n\n## Run\n\n```bash\nnpm ci\nsqd up\nsqd process\n```\n\nto beging the ingestion, then start the GraphQL server in a separate terminal.\nAlso note that the endpoint \u0026 block range are stored in the `.env` file.\n\n```bash\nsqd serve\n```\n\nServe starts a local API and webserver for you to look at and play with.\nOpen your browser here: \u003chttp://localhost:4350/graphql\u003e\n\n## Develop\n\n### Types\n\nWhen changes are made to the rpc types, use the following commands:\n\n```bash\nnpm generate-metadata # for local node development\nsqd typegen # operates on metadata or rpc and modifies types\n```\n\n### Schema\n\nWhen you make changes to the schema, use the following commands:\n\n```bash\nsqd codegen\nsqd build # modify your squid to use the new schema until it builds\nsqd down; sqd up\nsqd migration:generate # rerun everytime there is a change to the schema\n```\n\nThis drops then re-creates the database and regenerates any migrations.\n\n## Deploy to the aquarium\n\nThere are 3 manifests, one for each network: astar, shiden and shibuya.\n\n```bash\nsqd deploy . -r --org astar-network -m manifests/astar.yaml\n```\n\nThe -r is optional if no re-indexing is needed\n\n## Data being indexed\n\n| Table                         | Fields                                                                                                                                |\n| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |\n| dapps                         | beneficiary, dappId, id, owner, registeredAt, registrationBlockNumber, stakersCount, state, unregisteredAt, unregistrationBlockNumber |\n| dappAggregatedDailies         | timestamp, stakersCount, id, dappAddress                                                                                              |\n| rewardEvents                  | amount, blockNumber, contractAddress, era, id, period, tierId, timestamp, transaction, userAddress                                    |\n| rewardAggregatedDailies       | amount, beneficiary, id, timestamp                                                                                                    |\n| stakes                        | amount, dappAddress, stakerAddress, blockNumber, expiredAt, expiredBlockNumber, id, timestamp                                         |\n| stakers                       | amount, dappAddress, stakerAddress, id                                                                                                |\n| stakersCount                  | total                                                                                                                                 |\n| stakersCountAggregatedDailies | blockNumber, id, stakersCount, stakersAmount, usdPrice                                                                                |\n| subperiods                    | id, type, blockNumber, timestamp                                                                                                      |\n| tvlAggregatedDailies          | blockNumber, id, tvl, lockersCount, usdPrice                                                                                          |\n| uniqueStakerAddresses         | id                                                                                                                                    |\n| uniqueLockerAddresses         | id, amount                                                                                                                            |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastarnetwork%2Fdapps-staking-indexer-v3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastarnetwork%2Fdapps-staking-indexer-v3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastarnetwork%2Fdapps-staking-indexer-v3/lists"}