Koios Lite is a streamlined version of the Koios ecosystem, designed for efficient data synchronization and querying on the Cardano blockchain. This setup uses Podman 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 Podman, ensuring easy deployment and scalability.
For local testing:
- Clone the repository to your local machine.
- Make sure Podman and Podman Compose are installed.
- Configure the environment variables in a
.env
file based on the providedenv.example
. - Run
podman compose up --quiet --pull-always --remove-orphans -d
to start the services. - Access the local endpoints as needed for testing.
To deploy Koios Lite:
- Ensure all environment variables are correctly set for the production environment.
- Use the command
podman compose up -d
to start all the services in detached mode. - Use Admin tool to browse to
Tools
>gLiveView
to monitor that node has reached tip andPodman
>Podman Status
to ensure none of the containers areDOWN
orUP (unhealthy)
state. - Execute
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
# HAProxy tip check
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.
A simple script to interact with the all the components of a Koios Lite Node: Admin Tool Documentation
>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-podman: Checks if Podman is running.
--handle-env-file: Manage .env file.
--reset-env: Resets the .env file to defaults.
--podman-status: Shows the status of Podman containers.
--podman-up: Starts Podman containers defined in podman-compose.yml.
--podman-down: Stops Podman containers defined in podman-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.