Koios Lite is a streamlined version of the Koios ecosystem, designed for efficient data synchronization and querying on the Cardano blockchain. This setup uses Docker to create a local environment that mirrors the production setup, making it ideal for development and testing.
This setup includes several key components:
cardano-node
: Runs the Cardano node, connecting to either the mainnet or a testnet.cardano-db-sync
: Synchronizes the blockchain data to a PostgreSQL database.postgres
: The PostgreSQL database, storing the synchronized blockchain data.postgrest
: Serves a RESTful API for querying the blockchain data stored in PostgreSQL.haproxy
: A high-performance proxy to distribute network traffic among various components.Each service is containerized and managed via Docker, ensuring easy deployment and scalability.
For local testing:
.env
file based on the provided env.example
.docker compose up -d
to start the services.To deploy Koios Lite:
docker compose up -d
to start all the services in detached mode.Tools
> gLiveView
to monitor that node has reached tip and Docker
> Docker Status
to ensure none of the containers are DOWN
or UP (unhealthy)
state.Setup
> Initialise Postgres
to deploy custom RPCs and test via PostgREST/HAProxy endpoints using curl:
# PostgREST tip check
curl http://127.0.0.1:8050/rpc/tip
curl http://127.0.0.1:8053/api/v1/tip
Remember to secure your deployment according to best practices, including securing your database and API endpoints.
## Admin tool
A simple script to interact with the all the components of a Koios Lite Node:
[Admin Tool Documentation](AdminTool.md)
```bash
>scripts/koios-lite.sh --help
Koios Administration Tool Help Menu:
------------------------------------
Welcome to the Koios Administration Tool Help Menu.
Below are the available commands and their descriptions:
--about: Displays information about the Koios administration tool.
--install-dependencies: Installs necessary dependencies.
--check-docker: Checks if Docker is running.
--handle-env-file: Manage .env file.
--reset-env: Resets the .env file to defaults.
--docker-status: Shows the status of Docker containers.
--docker-up: Starts Docker containers defined in docker compose.yml.
--docker-down: Stops Docker containers defined in docker compose.yml.
--enter-node: Accesses the Cardano Node container.
--logs-node: Displays logs for the Cardano Node container.
--gliveview: Executes gLiveView in the Cardano Node container.
--cntools: Runs CNTools in the Cardano Node container.
--enter-postgres: Accesses the Postgres container.
--logs-postgres: Displays logs for the Postgres container.
--enter-dbsync: Accesses the DBSync container.
--logs-dbsync: Displays logs for the DBSync container.
--enter-haproxy: Accesses the HAProxy container.
--logs-haproxy: Displays logs for the HAProxy container.