From 40d43b4cf0a904b1027605f4a415678f7e356f87 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Tue, 27 Oct 2020 15:20:20 +0100 Subject: [PATCH] Make --enable-horizon-captive-core backwards compatible --- common/horizon/etc/horizon.env | 4 +--- start | 11 +++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/common/horizon/etc/horizon.env b/common/horizon/etc/horizon.env index a8795f772..b53f618cd 100644 --- a/common/horizon/etc/horizon.env +++ b/common/horizon/etc/horizon.env @@ -12,6 +12,4 @@ export NETWORK_PASSPHRASE="__NETWORK__" export DISABLE_ASSET_STATS="true" export HISTORY_ARCHIVE_URLS="__ARCHIVE__" export ADMIN_PORT=6060 -export ENABLE_CAPTIVE_CORE_INGESTION=__ENABLE_CAPTIVE_CORE__ -export STELLAR_CORE_BINARY_PATH=/usr/bin/stellar-core -export STELLAR_CORE_CONFIG_PATH=/opt/stellar/core/etc/stellar-captive-core.cfg + diff --git a/start b/start index 62b7288dd..65eb601e1 100644 --- a/start +++ b/start @@ -26,7 +26,7 @@ function main() { process_args $* if [ "$NETWORK" != "standalone" ] && [ "$ENABLE_HORIZON_CAPTIVE_CORE" = "true" ]; then echo "--enable-horizon-captive-core is only supported in the standalone network" >&2 - exit 1 + exit 1 fi echo "mode: $STELLAR_MODE" @@ -282,9 +282,16 @@ function init_horizon() { -e "s/__PGPASS__/$PGPASS/g" \ -e "s/__NETWORK__/$NETWORK_PASSPHRASE/g" \ -e "s=__ARCHIVE__=$HISTORY_ARCHIVE_URLS=g" \ - -e "s=__ENABLE_CAPTIVE_CORE__=$ENABLE_HORIZON_CAPTIVE_CORE=g" \ etc/horizon.env + if [ "$ENABLE_HORIZON_CAPTIVE_CORE" = "true" ]; then + cat << EOF etc/horizon.env +export ENABLE_CAPTIVE_CORE_INGESTION=true +export STELLAR_CORE_BINARY_PATH=/usr/bin/stellar-core +export STELLAR_CORE_CONFIG_PATH=/opt/stellar/core/etc/stellar-captive-core.cfg +EOF + fi + start_postgres run_silent "init-horizon-db" sudo -u stellar ./bin/horizon db init if [ "$NETWORK" == "standalone" ]; then