Skip to content

Run a node

A node is Intuition Core running on your own machine: two databases, a query API, and workers that parse, classify, and enrich every atom. You start it with Docker Compose. It needs no paid account and no API key, and there is no chain to sync before you can use it.

Requirements

Make is optional. Each make command in this section is a shortcut for a docker compose or bun command defined in the repository's Makefile.

Start the node

  1. Clone the repository:

    git clone https://github.com/0xIntuition/intuition-core
    cd intuition-core
  2. Run the bootstrap script:

    scripts/bootstrap.sh

    The script checks for Docker, Bun, and free disk space. It then creates .env from example.env, installs dependencies, builds and starts the services in the background, and waits up to two minutes for the API to respond. make bootstrap runs the same script.

    The first run builds every service image from source, so it takes longer than later runs. When the node is ready, the script prints:

    OK API is healthy

Verify the node

  1. Check that the API is healthy:

    curl http://localhost:3000/health
    { "status": "ok" }
  2. Check the contents of the knowledge graph:

    curl http://localhost:3000/api/stats
    { "data": { "atoms": 0, "triples": 0, "accounts": 0, "predicates": 14 } }

    A new node has no atoms. The 14 predicates are the baseline set that the database migration adds. See Predicates.

To test the whole stack end to end, run the built-in smoke tests:

make smoke        # Mints an API key, creates atoms and a triple, waits for the workers
make smoke-index  # Indexes a 500-block window of the public testnet

Each smoke test starts its own temporary Compose project on random ports and removes it when it finishes, so it can run alongside your node.

What is running

ServiceHost portRole
postgres-kg5432The knowledge graph database: atoms, triples, accounts, predicates, and API keys
timescale5433The event store database: chain events and the read models built from them
redis6379Redis, reserved for coordinating indexer instances
migrateNoneA one-time job that applies the knowledge graph schema and seeds the baseline predicates
timescale-migrateNoneA one-time job that applies the event store schema
api3000The query API. Reads are open and writes require an API key
atom-services4010Classification and enrichment over HTTP, without a database
workers-parse4110Parses new atoms
workers-enrichment4111Enriches classified atoms with metadata
workers-classification4112Classifies parsed atoms

The two migration jobs exit when they finish. That is expected. The workers have no API of their own; their ports serve health checks. Indexing adds two more services, described in Index the chain.

Start without the bootstrap script

cp example.env .env
bun install --frozen-lockfile
docker compose up -d

Stop the node

make down

This stops every container and keeps your data. To start the node again, run make up. Operate a node covers logs, health checks, upgrades, and backups.

Next steps