Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the config supporting running horizon without a captive stellar-core #498

Merged
4 changes: 2 additions & 2 deletions .github/workflows/build-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
test_matrix: |
{
"network": ["pubnet", "local"],
"options": ["", "--enable-horizon-captive-core"]
"options": [""]
}

arm64:
Expand All @@ -61,7 +61,7 @@ jobs:
test_matrix: |
{
"network": ["pubnet", "local"],
"options": ["", "--enable-horizon-captive-core"]
"options": [""]
}

manifest:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-soroban-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
test_matrix: |
{
"network": ["local"],
"options": ["", "--enable-horizon-captive-core --enable-soroban-rpc"],
"options": ["", "--enable-soroban-rpc"],
}

arm64:
Expand All @@ -62,7 +62,7 @@ jobs:
test_matrix: |
{
"network": ["local"],
"options": ["", "--enable-horizon-captive-core --enable-soroban-rpc"],
"options": ["", "--enable-soroban-rpc"],
}

manifest:
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/build-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,9 @@ jobs:
test_matrix: |
{
"network": ["testnet", "pubnet", "local"],
"options": ["", "--enable-horizon-captive-core --enable-soroban-rpc"],
"options": ["", "--enable-soroban-rpc"],
"exclude": [
{ "network": "pubnet", "options": "--enable-horizon-captive-core --enable-soroban-rpc" },
],
"include": [
{ "network": "pubnet", "options": "--enable-horizon-captive-core" },
{ "network": "pubnet", "options": "--enable-soroban-rpc" },
]
}

Expand All @@ -70,12 +67,9 @@ jobs:
test_matrix: |
{
"network": ["testnet", "pubnet", "local"],
"options": ["", "--enable-horizon-captive-core --enable-soroban-rpc"],
"options": ["", "--enable-soroban-rpc"],
"exclude": [
{ "network": "pubnet", "options": "--enable-horizon-captive-core --enable-soroban-rpc" },
],
"include": [
{ "network": "pubnet", "options": "--enable-horizon-captive-core" },
{ "network": "pubnet", "options": "--enable-soroban-rpc" },
]
}

Expand Down
6 changes: 4 additions & 2 deletions common/horizon/etc/horizon.env
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash

export DATABASE_URL="postgres://stellar:__PGPASS__@localhost/horizon"
export STELLAR_CORE_DATABASE_URL="postgres://stellar:__PGPASS__@localhost/core"
export STELLAR_CORE_URL="http://localhost:11626"
export STELLAR_CORE_BINARY_PATH=/usr/bin/stellar-core
export LOG_LEVEL="info"
export ENABLE_CAPTIVE_CORE_INGESTION="false"
export ENABLE_CAPTIVE_CORE_INGESTION="true"
export CAPTIVE_CORE_USE_DB=true
export STELLAR_CAPTIVE_CORE_HTTP_PORT=0
export INGEST="true"
export PER_HOUR_RATE_LIMIT="72000"
export NETWORK_PASSPHRASE="__NETWORK__"
Expand Down
1 change: 0 additions & 1 deletion local/core/etc/stellar-core.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

HTTP_PORT=11626
PUBLIC_HTTP_PORT=true
RUN_STANDALONE=__RUN_STANDALONE__
MANUAL_CLOSE=__MANUAL_CLOSE__
ARTIFICIALLY_ACCELERATE_TIME_FOR_TESTING=true
__TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE__
Expand Down
6 changes: 4 additions & 2 deletions local/horizon/etc/horizon.env
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash

export DATABASE_URL="postgres://stellar:__PGPASS__@localhost/horizon"
export STELLAR_CORE_DATABASE_URL="postgres://stellar:__PGPASS__@localhost/core"
export STELLAR_CORE_URL="http://localhost:11626"
export STELLAR_CORE_BINARY_PATH=/usr/bin/stellar-core
export LOG_LEVEL="info"
export ENABLE_CAPTIVE_CORE_INGESTION="false"
export ENABLE_CAPTIVE_CORE_INGESTION="true"
export CAPTIVE_CORE_USE_DB=true
export STELLAR_CAPTIVE_CORE_HTTP_PORT=0
export INGEST="true"
export PER_HOUR_RATE_LIMIT="72000"
export NETWORK_PASSPHRASE="__NETWORK__"
Expand Down
34 changes: 9 additions & 25 deletions start
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export PGUSER="stellar"
export PGPORT=5432

: "${ENABLE_LOGS:=false}"
: "${ENABLE_HORIZON_CAPTIVE_CORE:=false}"
: "${ENABLE_SOROBAN_RPC:=false}"
: "${ENABLE_SOROBAN_DIAGNOSTIC_EVENTS:=false}"
: "${ENABLE_SOROBAN_RPC_ADMIN_ENDPOINT:=false}"
Expand Down Expand Up @@ -112,9 +111,6 @@ function process_args() {
export ENABLE_ASSET_STATS="$1"
shift
;;
--enable-horizon-captive-core)
ENABLE_HORIZON_CAPTIVE_CORE=true
;;
--enable-soroban-rpc)
ENABLE_SOROBAN_RPC=true
;;
Expand Down Expand Up @@ -352,14 +348,9 @@ function init_stellar_core() {
fi

run_silent "finalize-core-config-pgpass" perl -pi -e "s/__PGPASS__/$PGPASS/g" etc/stellar-core.cfg
local RUN_STANDALONE=false
if [ "$NETWORK" = "local" ] && [ "$ENABLE_HORIZON_CAPTIVE_CORE" = "false" ] && [ "$ENABLE_SOROBAN_RPC" = "false" ]; then
RUN_STANDALONE=true
fi

perl -pi -e "s/__NETWORK__/$NETWORK_PASSPHRASE/g" etc/stellar-core.cfg

run_silent "finalize-core-config-run-local" perl -pi -e "s/__RUN_STANDALONE__/$RUN_STANDALONE/g" etc/stellar-core.cfg
run_silent "finalize-core-config-manual-close" perl -pi -e "s/__MANUAL_CLOSE__/$ENABLE_CORE_MANUAL_CLOSE/g" etc/stellar-core.cfg

if [ "$NETWORK" = "local" ] && [ "${CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE}" = "true" ]; then
Expand Down Expand Up @@ -398,27 +389,20 @@ function init_horizon() {
perl -pi -e "s/__NETWORK__/$NETWORK_PASSPHRASE/g" etc/horizon.env
perl -pi -e "s=__ARCHIVE__=$HISTORY_ARCHIVE_URLS=g" etc/horizon.env

if [ "$ENABLE_HORIZON_CAPTIVE_CORE" = "true" ]; then

HORIZON_CAPTIVE_CORE_CFG=$HZHOME/etc/stellar-captive-core.cfg
run_silent "finalize-horizon-captivecore-db" perl -pi -e "s*__DATABASE__*sqlite3://$HZHOME/captive-core/stellar.db*g" $HORIZON_CAPTIVE_CORE_CFG
perl -pi -e "s/__NETWORK__/$NETWORK_PASSPHRASE/g" $HORIZON_CAPTIVE_CORE_CFG
HORIZON_CAPTIVE_CORE_CFG=$HZHOME/etc/stellar-captive-core.cfg
run_silent "finalize-horizon-captivecore-db" perl -pi -e "s*__DATABASE__*sqlite3://$HZHOME/captive-core/stellar.db*g" $HORIZON_CAPTIVE_CORE_CFG
perl -pi -e "s/__NETWORK__/$NETWORK_PASSPHRASE/g" $HORIZON_CAPTIVE_CORE_CFG

if [ "$NETWORK" = "local" ] && [ "${CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE}" = "true" ]; then
run_silent "finalize-horizon-captivecore-config-testing-soroban-high-limit-override-set-true" perl -pi -e "s/__TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE__/TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE=true/g" $HORIZON_CAPTIVE_CORE_CFG
else
run_silent "finalize-horizon-captivecore-config-testing-soroban-high-limit-override-unset" perl -pi -e "s/__TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE__//g" $HORIZON_CAPTIVE_CORE_CFG
fi
if [ "$NETWORK" = "local" ] && [ "${CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE}" = "true" ]; then
run_silent "finalize-horizon-captivecore-config-testing-soroban-high-limit-override-set-true" perl -pi -e "s/__TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE__/TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE=true/g" $HORIZON_CAPTIVE_CORE_CFG
else
run_silent "finalize-horizon-captivecore-config-testing-soroban-high-limit-override-unset" perl -pi -e "s/__TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE__//g" $HORIZON_CAPTIVE_CORE_CFG
fi

cat << EOF >> etc/horizon.env
export ENABLE_CAPTIVE_CORE_INGESTION=true
export STELLAR_CORE_BINARY_PATH=/usr/bin/stellar-core
cat << EOF >> etc/horizon.env
export CAPTIVE_CORE_CONFIG_PATH=$HORIZON_CAPTIVE_CORE_CFG
export CAPTIVE_CORE_STORAGE_PATH=$HZHOME/captive-core
export CAPTIVE_CORE_USE_DB=true
export STELLAR_CAPTIVE_CORE_HTTP_PORT=0
EOF
fi

run_silent "chown-horizon" chown -R stellar:stellar .

Expand Down