Skip to content

Local node configuration

For a single local node (consensus disabled), you can run with or without the indexer:

# Without indexer (faster dev loop; ephemeral)
HYLE_RUN_INDEXER=false cargo run

# With indexer (starts a temporary PostgreSQL; data cleared on stop)
cargo run -- --pg

# With SP1 verifier
cargo run -F sp1

Optional: Persistent storage

For a persistent PostgreSQL:

docker run -d --rm --name pg_hyle -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres

Then, from the Hyli root:

HYLE_RUN_INDEXER=true \
HYLE_DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres \
cargo run

Tip

To reset your local node, delete the ./data folder and restart from Step 1. Otherwise, you risk re-registering a contract that still exists.

Alternative: Start with Docker

Use Docker to run a local node.

Pull the Docker image

docker pull ghcr.io/hyli-org/hyli:v0.12.1

Run the Docker container

Run without indexer:

docker run -v ./data:/hyle/data -p 4321:4321 ghcr.io/hyli-org/hyli:v0.12.1

If you run into an error, try adding the --privileged flag:

docker run --privileged -v ./data:/hyle/data -p 4321:4321 ghcr.io/hyli-org/hyli:v0.12.1

Run with indexer (requires a PostgreSQL container):

docker run -d --rm --name pg_hyle -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgres

docker run -v ./data:/hyle/data \
    -e HYLE_RUN_INDEXER=true \
    -e HYLE_DATABASE_URL=postgres://postgres:postgres@pg_hyle:5432/postgres \
    --link pg_hyle \
    -p 4321:4321 \
    ghcr.io/hyli-org/hyli:v0.7.2

You can now create your first app.

Alternative: Build the Docker image locally

If you prefer to build the image from source, run:

docker build -t hyli-org/hyli . && docker run -dit hyli-org/hyli

Configuration

You can configure your setup using environment variables or by editing a configuration file.

Using a configuration file

Place a config.toml in the node’s working directory to load it automatically at startup.

See the defaults at src/utils/conf_defaults.toml.

Docker users can mount the file:

docker run -v ./data:/hyle/data -v ./config.run:/hyle/config.toml -e HYLE_RUN_INDEXER=false -p 4321:4321 -p 1234:1234 ghcr.io/hyli-org/hyli:v0.12.1
cp ./src/utils/conf_defaults.toml config.toml

For source users, copy the default config template:

cp ./src/utils/conf_defaults.toml config.toml

Using environment variables

All variables can be customized on your single-node instance. The mapping uses 'HYLE_' as a prefix, then '__' where a '.' would be in the config file.

Examples:

HYLE_RUN_INDEXER="true"
HYLE_P2P__ADDRESS="127.0.0.1:4321" # (note the double \_\_ for the dot)