{"id":21177311,"url":"https://github.com/codechain-io/codechain-indexer","last_synced_at":"2025-07-09T22:30:40.089Z","repository":{"id":34013762,"uuid":"147597068","full_name":"CodeChain-io/codechain-indexer","owner":"CodeChain-io","description":"A blockchain data indexing tool for CodeChain","archived":false,"fork":false,"pushed_at":"2023-01-23T22:08:16.000Z","size":2346,"stargazers_count":21,"open_issues_count":57,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-05T07:51:16.456Z","etag":null,"topics":["codechain","indexer"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodeChain-io.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}},"created_at":"2018-09-06T00:53:38.000Z","updated_at":"2023-09-22T04:10:12.000Z","dependencies_parsed_at":"2023-02-13T03:55:21.156Z","dependency_job_id":null,"html_url":"https://github.com/CodeChain-io/codechain-indexer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CodeChain-io/codechain-indexer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeChain-io%2Fcodechain-indexer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeChain-io%2Fcodechain-indexer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeChain-io%2Fcodechain-indexer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeChain-io%2Fcodechain-indexer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeChain-io","download_url":"https://codeload.github.com/CodeChain-io/codechain-indexer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeChain-io%2Fcodechain-indexer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264504571,"owners_count":23618824,"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":["codechain","indexer"],"created_at":"2024-11-20T17:15:35.225Z","updated_at":"2025-07-09T22:30:39.765Z","avatar_url":"https://github.com/CodeChain-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeChain Indexer [![Build Status](https://travis-ci.org/CodeChain-io/codechain-indexer.svg?branch=master)](https://travis-ci.org/CodeChain-io/codechain-indexer) [![codecov](https://codecov.io/gh/CodeChain-io/codechain-indexer/branch/master/graph/badge.svg)](https://codecov.io/gh/Codechain-io/codechain-indexer)\n\nA blockchain data indexing tool for CodeChain\n\n## Table of Contents\n\n- [Install](https://github.com/CodeChain-io/codechain-indexer#install)\n- [Before start](https://github.com/CodeChain-io/codechain-indexer#before-start)\n- [Run](https://github.com/CodeChain-io/codechain-indexer#run)\n\n## Install\n\n#### Requirements\n\nThe software dependencies required to install and run CodeChain-indexer are:\n\n- Latest version of the [CodeChain](https://github.com/CodeChain-io/codechain)\n- PostgreSQL [`v11.*`](https://www.postgresql.org/download/)\n- Nodejs higher than version 10\n\n#### Download\n\nDownload CodeChain-indexer code from the GitHub repository\n\n```\ngit clone git@github.com:kodebox-io/codechain-indexer.git\ncd codechain-indexer\n```\n\n#### Install packages\n\nUse yarn package manager to install packages\n\n```\nyarn install\n```\n\n## Before start\n\n#### Dependency\n\n- Get CodeChain ready with the CodeChain RPC server\n- Get PostgreSQL database ready for indexing block data\n\n#### Create the database and user on the PostgreSQL\n\n##### Update configuration\n\nUpdate ./create_user_and_db.sql and config/* files before creating database schema.\nIf you want to create a production datatabase, please create config/production.json by copying config/dev.json\n\n##### Mac\n\n```\n# Download postgresql with Homebrew\nbrew install postgresql\nbrew services start postgresql\n\n# Create users and databases\npsql postgres -f create_user_and_db.sql\n\n# Create tables for production\nNODE_ENV=production yarn migrate\n\n# Create tables for development\nyarn run migrate\n```\n\n##### Ubuntu\n\n```\n# Download postgresql\nsudo apt install postgresql postgresql-contrib\n\n# Create users and databases\nsudo -u postgres psql -f create_user_and_db.sql\n\n# Create tables for production\nNODE_ENV=production yarn migrate\n\n# Create tables for development\nyarn migrate\n```\n\n## Run (for development)\n\n```\nyarn run start\n\n# You can change the host of CodeChain and DB host on the config/dev.json\n```\n\n### Check CCCChanges\n\nIf you run the Indexer with the environment `ENABLE_CCC_CHANGES_CHECK` variable,\nthe Indexer checks to see if CCCChanges is well calculated.\nIf you want to receive an email when an error is found, please set the `SENDGRID_API_KEY` and `SENDGRID_TO` variables.\nIf you want to receive a slack notification, please set the `SLACK_WEBHOOK` variable.\n\n## Run (for production)\n\n```\nyarn build\nNODE_ENV=production node ./build/index.js\n\n# You can change the host of CodeChain and DB host on the config/production.json\n```\n\n## Test\n\n```\n# Create the test database\nNODE_ENV=test yarn run migrate\n\n# Start testing\nyarn run test\n```\n\n## API document\n\n```\nNODE_ENV=dev yarn run start\n\n# Swagger UI is running at \"http://host:port/api-docs/\"\n```\n\n## Tools\n\n#### Delete all database data\n\n```\nyarn run reset\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodechain-io%2Fcodechain-indexer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodechain-io%2Fcodechain-indexer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodechain-io%2Fcodechain-indexer/lists"}