Skip to content

Commit

Permalink
Make --enable-horizon-captive-core backwards compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio committed Oct 27, 2020
1 parent 9b9f179 commit 40d43b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 1 addition & 3 deletions common/horizon/etc/horizon.env
Original file line number Diff line number Diff line change
Expand Up @@ -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

11 changes: 9 additions & 2 deletions start
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 40d43b4

Please sign in to comment.