Skip to content

Commit

Permalink
#243: review feedback on configuring page
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Jan 18, 2024
1 parent cca1fec commit 0e00bdb
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions docs/run-platform-server/configuring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Alert } from "@site/src/components/Alert";

- You have identified the [installation](./installing.mdx) method for the host system:

- For bare metal, you have two executables: `stellar-horizon` and `stellar-core` both on host OS' `$PATH`.
- For bare-metal, you have two executables installed on the host operation system path: `stellar-horizon` and `stellar-core`.
- For running Horizon image with Docker daemon, you will use the [stellar/stellar-horizon](https://hub.docker.com/r/stellar/stellar-horizon) hosted on Docker Hub. You have already pulled the stellar/stellar-horizon image via `docker pull stellar/stellar-horizon:<tag_version>` onto host. This image contains the `stellar-horizon` and `stellar-core` within.
- For Kubernetes with [Horizon Helm Chart](https://github.com/stellar/helm-charts/tree/main/charts/horizon), you have followed the [Install Horizon with Helm Chart](./installing.mdx#helm-chart-installation).

Expand Down Expand Up @@ -74,30 +74,42 @@ If setting `INGEST=false`, then **must** define the `STELLAR_CORE_URL` variable

## Notes

- If you have configured your deployment to perform the ingestion role, then it is **strongly** recommended to review [Ingestion](./ingestion.mdx) first and [Filtering](./ingestion-filtering) second and factor that into configuration parameters to achieve best performance related to your application requirements before proceeding further.
### Ingestion

- `DISABLE_TX_SUB`: optional, set as FALSE by default. Controls whether Horizon will accept HTTP requests to the `/tx` API endpoint and forward to the network. Refer to [Channel Accounts](../encyclopedia/channel-accounts.mdx) for some recommendations on optional client transaction submission optimizations.
If you have configured your deployment to perform the ingestion role, then it is **strongly** recommended to review [Ingestion](./ingestion.mdx) first and [Filtering](./ingestion-filtering) second and factor that into configuration parameters to achieve best performance related to your application requirements before proceeding further.

- When set to FALSE, it requires **live** ingestion process to be running on the same database because Horizon depends on new ledgers from the network to confirm a transaction submission status, Horizon will report a startup error if it detects no **live** ingestion. Requires `INGEST=true` or `STELLAR_CORE_URL` to be defined for access to a Core instance.
- When transaction submission is disabled by setting it to TRUE, Horizon will return 405 on POSTs to /tx.
- Horizon will create a sub-directory under the current working directory of the o/s process to store captive core runtime data files. Refer to [Prerequisites](./prerequisites.mdx) for the type and amount of storage recommended. You can override this location with the optional `CAPTIVE_CORE_STORAGE_PATH` environment variable, set to a directory on the file system where captive core will store the runtime files.

### `DISABLE_TX_SUB`

This config parameter is optional, set as FALSE by default. Controls whether Horizon will accept HTTP requests to the `/tx` API endpoint and forward to the network. Refer to [Channel Accounts](../encyclopedia/channel-accounts.mdx) for some recommendations on optional client transaction submission optimizations.

- When set to FALSE, it requires **live** ingestion process to be running on the same database because Horizon depends on new ledgers from the network to confirm a transaction submission status, Horizon will report a startup error if it detects no **live** ingestion. Requires `INGEST=true` or `STELLAR_CORE_URL` to be defined for access to a Core instance.
- When transaction submission is disabled by setting it to TRUE, Horizon will return 405 on POSTs to /tx.

- `NETWORK`: optional, can be one of Stellar's public networks, 'pubnet', or 'testnet'. Triggers Horizon to automatically set configurations for remaining Horizon settings and generate the correct core toml/cfg settings. If you only need Horizon to connect to one of those public Stellar networks, this will take care of all related configurations.
### `NETWORK`

This config parameter is optional, can be one of Stellar's public networks, 'pubnet', or 'testnet'. Triggers Horizon to automatically set configurations for remaining Horizon settings and generate the correct core toml/cfg settings. If you only need Horizon to connect to one of those public Stellar networks, this will take care of all related configurations.

- If you want to connect Horizon to a different Stellar network other than pubnet or testnet or override any of the defaults that `NETWORK` usage will initiate, the key environment variables that can be set are: `HISTORY_ARCHIVE_URLS`, `CAPTIVE_CORE_CONFIG_PATH`, `NETWORK_PASSPHRASE`, `CAPTIVE_CORE_STORAGE_PATH`, `STELLAR_CORE_URL`.

- `DB_URL`: required, specifies the Horizon database. It's value follows this format: `dbname=<pg_dbname> user=<pg_user_name> password=<pg_user_pwd> host=<host_address>`
### `DB_URL`

- `LOG_LEVEL`: optional, can be one of 'info', 'error', 'debug'.
This config parameter is required, specifies the Horizon database. It's value follows this format: `dbname=<pg_dbname> user=<pg_user_name> password=<pg_user_pwd> host=<host_address>`

- `HISTORY_RETENTION_COUNT`: optional, this determines the maximum sliding window of historical network data to retain on the database from ingestion. The value is expressed as absolute ledger count, which is an indirect way to define a duration of time, each ledger being approximately 5 seconds. It is defaulted to 0, which means it will not purge any history from the database. To enact the recommended sliding window of one month, set this to 518400, which is the approximate number of ledgers in 30 days. Refer to [Compute Resources](./prerequisites.mdx) for how database storage space is closely related to this setting.
### `LOG_LEVEL`

- Horizon will create a sub-directory under the current working directory of the o/s process to store captive core runtime data files. Refer to [Prerequisites](./prerequisites.mdx) for the type and amount of storage recommended. You can override this location with the optional `CAPTIVE_CORE_STORAGE_PATH` environment variable, set to a directory on the file system where captive core will store the runtime files.
This config parameter is optional, can be one of 'info', 'error', 'debug'.

### `HISTORY_RETENTION_COUNT`

This config parameter is optional, it determines the maximum sliding window of historical network data to retain on the database from ingestion. The value is expressed as absolute ledger count, which is an indirect way to define a duration of time, each ledger being approximately 5 seconds. It is defaulted to 0, which means it will not purge any history from the database. To enact the recommended sliding window of one month, set this to 518400, which is the approximate number of ledgers in 30 days. Refer to [Compute Resources](./prerequisites.mdx) for how database storage space is closely related to this setting.

### Passing Configurations to Horizon
## Passing Configurations to Horizon

The `stellar-horizon` binary searches process environment variables for configuration. Depending on how Horizon was installed, the method you perform to configure the process environment will differ:

- Bare metal
- Bare-metal
- Non-package manager: use O/S environment variables to pass configurations. There are many tools you can use to manage them, such as [direnv](http://direnv.net/) or [dotenv](https://github.com/bkeepers/dotenv).
- [Package manager](./installing.mdx#package-manager): the provided `stellar-horizon-cmd` wrapper will start a new process and create environment variables in the process from `/etc/default/stellar-horizon` and then launch the 'stellar-horizon' in the process, hence, to set configurations, edit the file at `/etc/default/stellar-horizon`.
<Alert>
Expand Down

0 comments on commit 0e00bdb

Please sign in to comment.