{"id":19563267,"url":"https://github.com/kodadot/rubick","last_synced_at":"2025-04-27T00:32:08.802Z","repository":{"id":37036677,"uuid":"423474243","full_name":"kodadot/rubick","owner":"kodadot","description":"Implementation SubSquid indexer for Kusama NFTs","archived":false,"fork":false,"pushed_at":"2024-07-04T10:27:05.000Z","size":2173,"stargazers_count":9,"open_issues_count":76,"forks_count":15,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T18:51:51.248Z","etag":null,"topics":["graphql","hacktoberfest","indexing","kusama","nft","polkadot","polkadot-js","rmrk","subsquid"],"latest_commit_sha":null,"homepage":"https://github.com/kodadot/rubick","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/kodadot.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}},"created_at":"2021-11-01T13:26:28.000Z","updated_at":"2024-02-20T05:59:37.000Z","dependencies_parsed_at":"2023-09-28T13:48:31.426Z","dependency_job_id":null,"html_url":"https://github.com/kodadot/rubick","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":"eldargab/hydra-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodadot%2Frubick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodadot%2Frubick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodadot%2Frubick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kodadot%2Frubick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kodadot","download_url":"https://codeload.github.com/kodadot/rubick/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251072279,"owners_count":21532004,"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":["graphql","hacktoberfest","indexing","kusama","nft","polkadot","polkadot-js","rmrk","subsquid"],"created_at":"2024-11-11T05:17:09.516Z","updated_at":"2025-04-27T00:32:08.434Z","avatar_url":"https://github.com/kodadot.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rubick\n\n![](https://media.giphy.com/media/chOyZePGEHDoTSY2CA/giphy.gif)\n\n## Prerequisites\n\n* node 16.x\n* docker\n\n## Quickly running the sample\n\nExample commands below use [make(1)](https://www.gnu.org/software/make/).\nPlease, have a look at commands in [Makefile](Makefile) if your platform doesn't support it.\nOn Windows we recommend to use [WSL](https://docs.microsoft.com/en-us/windows/wsl/).\n\n```bash\n# 1. Install dependencies\nnpm ci\n\n# 2. Compile typescript files\nmake build\n\n# 3. Start target Postgres database and detach\nmake up\n\n# 4. Apply database migrations from db/migrations\nmake migrate\n\n# 5. Start the processor\nmake process\n\n# 6. The command above will block the terminal\n#    being busy with fetching the chain data, \n#    transforming and storing it in the target database.\n#\n#    To start the graphql server open the separate terminal\n#    and run\nmake serve\n\n# 7. Now you can see the resuls by visiting the localhost:4350/graphql\n```\n\n## Project structure\n\nHydra tools expect a certain directory layout:\n\n* `src/generated` - model/server definitions created by `codegen`. Do not alter the contents of this directory manually.\n* `src/server-extension` - module with custom `type-graphql` based resolvers\n* `src/types` - data type definitions for chain events and extrinsics created by `typegen`.\n* `src/mappings` - mapping module.\n* `lib` - compiled js files. The structure of this directory must reflect `src`.\n* `.env` - hydra tools are heavily driven by environment variables defined here or supplied by a shell.\n\nIf you do not plan to extend GraphQl server you can delete `server-extension` module and then remove \n`type-graphql` and `class-validator` dependencies.\n\n## Dev flow\n\n### 1. Define database schema\n\nStart development by defining the schema of the target database via `schema.graphql`.\nSchema definition consists of regular graphql type declarations annotated with custom directives.\nFull description of `schema.graphql` dialect is available [here](https://docs.subsquid.io/schema-file/).\n\n### 2. Generate TypeORM classes\n\nMapping developers use [TypeORM](https://typeorm.io) entities\nto interact with the target database during data processing. All necessary entity classes are\ngenerated by the squid framework from `schema.graphql`. This is done by running `npx squid-typeorm-codegen`\ncommand.\n\n### 3. Generate database migration\n\nAll database changes are applied through migration files located at `db/migrations`.\n`squid-typeorm-migration(1)` tool provides several commands to drive the process.\nIt is all [TypeORM](https://typeorm.io/#/migrations) under the hood.\n\n```bash\n# Connect to database, analyze its state and generate migration to match the target schema.\n# The target schema is derived from entity classes generated earlier.\n# Don't forget to compile your entity classes beforehand!\nnpx squid-typeorm-migration generate\n\n# Create template file for custom database changes\nnpx squid-typeorm-migration create\n\n# Apply database migrations from `db/migrations`\nnpx squid-typeorm-migration apply\n\n# Revert the last performed migration\nnpx squid-typeorm-migration revert         \n```\n\n## Setting up the project for resolvers\n\nIn case you just want to extend resolvers you don't index the whole project and just import the postgres database (last data 29.03.2023):\n\n1. [Contact @vikiival on Discord](https://discord.gg/yfeumhRCuw)\n2. `docker-compose up db`\n3. `docker exec -it rubick-db-1 psql -U postgres -d postgres -c \"CREATE DATABASE squid;\"`\n4. `docker exec -i rubick-db-1 psql -U postgres -d squid \u003c rubick.sql`\n\n⚠️ In case the command does not work, check if the container is called `rubick-db-1`.\n\n## Misc\n\nFor more details, please check out https://docs.subsquid.io.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodadot%2Frubick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkodadot%2Frubick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkodadot%2Frubick/lists"}