[![Telegram](https://badgen.net/badge/icon/telegram?icon=telegram&label)](https://t.me/celatone_announcements) [Osmosis](https://www.github.com/osmosis-labs/osmosis) indexer node implementation for Celatone, an open sourced explorer and CosmWasm development tools. ## Documentation For the most up-to-date Celatone documentation, please visit [docs.celat.one](https://docs.celat.one/) and Osmosis documentation [docs.osmosis.zone](https://docs.osmosis.zone/) The sections below will guide anyone looking to run their own indexer and deploy a local version of Celatone on your own machine. ## Indexing the LocalOsmosis network ### Prerequisite Celatone indexer node comes with a [celatone-docker](./celatone-docker) directory which enables fast and easy deployment. To install Docker for Ubuntu users ```shell cd && mkdir docker && cd docker curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh ``` macOS users can install Docker via [this link](https://docs.docker.com/desktop/install/mac-install/). ### Start the service To start the service, simply run this command ```shell docker compose up -d --build ``` Note that Ubuntu users might need to add `sudo` at the beginning of the command if there is a permission denied error. The command will launch services specified in the [docker-compose](docker-compose.yml) file, which are the following: - **indexer_node** for indexing LocalOsmosis - **postgres** for storing indexed data - **faucet** an optional service for requesting additional tokens - **graphql-engine** for hosting Hasura GraphQL engine and server - **zookeeper** provides an in-sync view of Kafka cluster, topics and messages - **kafka** acts as a message queue for the indexer node - **flusher-init** runs a single command to create required tables and views in the Postgres database - **flusher-daemon** processes messages from Kafka and flushes them into the database - **proxy-ssl-server** hosts a reverse proxy server for the node RPC, LCD and also the Hasura server. All components are required to connect with [celatone-frontend](https://www.github.com/alleslabs/celatone-frontend) ### Track the database Now that all docker-compose services are up and well alive. Database tracking is still required to allow data querying via Hasura GraphQL. Go to Hasura Console [localhost:5433/console](localhost:5433/console). The webpage should look something like this. ![](https://hackmd.io/_uploads/SJ8YaGgOh.png) Click on the `DATA` button at the top of the page. ![](https://hackmd.io/_uploads/HJ8qpfguh.png) There are schemas available shown at the top left of the page. Select the `default` database and `public` schema. ![](https://hackmd.io/_uploads/SkfopMedh.png) Click on `Track All` to track all tables and views available. A confirmation prompt may appear, select `Ok` to confirm. ![](https://hackmd.io/_uploads/SkJhTzlu3.png) The page will reload with all tables tracked. Click `Track All` again but this time for all foreign-key relationships. ![](https://hackmd.io/_uploads/H1cpafe_3.png) Finally, we can go back to the `API` page and try some example queries. Using the subscription script below, new block should come up in realtime. ```graphql subscription LatestBlock { blocks(limit: 1, order_by: {height: desc}) { height hash proposer timestamp } } ``` ![](https://hackmd.io/_uploads/H15d77xdn.png) ## Further Customization Completing the steps above would get vanilla LocalOsmosis indexer up and running, but for anyone looking to customize the chain itself and would like to add more indexer support.