Bare-metal installation
Run thestellar-horizon binary with the appropriate environment parameters set (or stellar-horizon-cmd serve if you installed via the package manager, which will automatically import your configuration from /etc/default/stellar-horizon).
Containerized installation
You don’t execute the Horizon binary directly, instead the stellar/stellar-horizon image has a pre-defined entrypoint that will start running Horizon at image startup time. The Horizon process will get all configuration settings from container environment variables.Docker daemon
Usedocker run stellar/stellar-horizon:<tag_version> --env-file <env_filename>, and specify each Horizon configuration flag identified during Configuring as a separate line in <env_filename> of HORIZON_CONFIG_PARAM=value.
Kubernetes using Helm Chart
Ensure you have followed the pre-requisite of installing the Helm CLI tool and added the Stellar chart repo to Helm client. The Horizon process requires access to a Postgres 12 database. First use the common Kubernetes CLI toolkubectl from your workstation to create a Kubernetes secret on the intended namespace of the Kubernetes cluster which will hold the Horizon database URL.
- Uses the
global.network=[testnet|pubnet]parameter, this automates generation of all the Horizon configuration parameters specific to the network such as archive urls, captive core config, and other parameters mentioned in Configuring. global.image.horizon.tagshould be set to one of the Docker Hub tags published on stellar/stellar-horizon- Enables all roles on the deployment instance: ingesting and web API (includes transaction submission). If you choose to have a multi-instance deployment with each instance performing a single role of just web API or ingestion, then you will do two Helm installations, one for each role:
my-horizon-ingestion-installationandmy-horizon-api-installation. Each of these Helm installations will setingest.enabled,web.enabled,ingest.replicaCount,web.replicaCountrespectively for the role they are performing. - To customize further, the best approach is to download the Horizon Helm Chart values.yaml, update the settings in your local copy of values.yaml, and pass to Helm install, rather than have many individual
--seton Helm install:
-
Customizing network configuration parameters, If you want to connect to a network other than presets of
testnetorpubnet, then you won’t useglobal.network, instead, use local copy of values.yaml and setingest.coreConfig, and refer to _core-config.tpl for example of all the key/value pairs to include. -
Minimum resource limits, verify whether
LimitRangedefaults are defined on the target namespace in Kubernetes for deployment, if so, ensure that the defaults provide at least minimum resource limits of6Giof memory and1cpu. Otherwise, define the limits explicitly on the helm install via theingest.resources.limits.*shown in example, to ensure the deployed pods have adequate resources.
Once the Horizon process starts, it will emit logging to standard out. When run, you should see output similar to:
curl http://127.0.0.1:8000/ would show you that the root resource loads correctly: