diff --git a/pubnet/core/etc/stellar-core.cfg b/pubnet/core/etc/stellar-core.cfg index ee08248a..52df3aed 100644 --- a/pubnet/core/etc/stellar-core.cfg +++ b/pubnet/core/etc/stellar-core.cfg @@ -1,6 +1,7 @@ HTTP_PORT=11626 PUBLIC_HTTP_PORT=true LOG_FILE_PATH="" +MANUAL_CLOSE=__MANUAL_CLOSE__ DATABASE="postgresql://dbname=core host=localhost user=stellar password=__PGPASS__" NETWORK_PASSPHRASE="Public Global Stellar Network ; September 2015" diff --git a/standalone/core/etc/stellar-captive-core.cfg b/standalone/core/etc/stellar-captive-core.cfg new file mode 100644 index 00000000..8c95f1ca --- /dev/null +++ b/standalone/core/etc/stellar-captive-core.cfg @@ -0,0 +1,23 @@ +# simple captive core configuration for a standalone test "network" +NETWORK_PASSPHRASE="Standalone Network ; February 2017" +# for debugging purposes +HTTP_PORT=21626 +# To avoid conflicts with the core instance +PEER_PORT=21625 + +NODE_IS_VALIDATOR=false +UNSAFE_QUORUM=true +FAILURE_SAFETY=0 + +DATABASE="sqlite3://stellar-captive-core.db" + +COMMANDS=["ll?level=info"] + +[[VALIDATORS]] +NAME="local_core" +HOME_DOMAIN="core.local" +# From "SDQVDISRYN2JXBS7ICL7QJAEKB3HWBJFP2QECXG7GZICAHBK4UNJCWK2" +PUBLIC_KEY="GCTI6HMWRH2QGMFKWVU5M5ZSOTKL7P7JAHZDMJJBKDHGWTEC4CJ7O3DU" +ADDRESS="localhost" +QUALITY="MEDIUM" +HISTORY="curl http://localhost:1570/{0} -o {1}" diff --git a/standalone/core/etc/stellar-core.cfg b/standalone/core/etc/stellar-core.cfg index 8f863a1b..54ae285a 100644 --- a/standalone/core/etc/stellar-core.cfg +++ b/standalone/core/etc/stellar-core.cfg @@ -3,7 +3,8 @@ HTTP_PORT=11626 PUBLIC_HTTP_PORT=true -RUN_STANDALONE=true +RUN_STANDALONE=__RUN_STANDALONE__ +MANUAL_CLOSE=__MANUAL_CLOSE__ NETWORK_PASSPHRASE="Standalone Network ; February 2017" KNOWN_CURSORS=["HORIZON"] @@ -26,4 +27,4 @@ VALIDATORS=["$self"] [HISTORY.vs] get="cp /tmp/stellar-core/history/vs/{0} {1}" put="cp {0} /tmp/stellar-core/history/vs/{1}" -mkdir="mkdir -p /tmp/stellar-core/history/vs/{0}" \ No newline at end of file +mkdir="mkdir -p /tmp/stellar-core/history/vs/{0}" diff --git a/start b/start index 3dfe6732..0efa8944 100644 --- a/start +++ b/start @@ -12,6 +12,9 @@ export PGDATA="$PGHOME/data" export PGUSER="stellar" export PGPORT=5432 +ENABLE_HORIZON_CAPTIVE_CORE=false +ENABLE_CORE_MANUAL_CLOSE=false + QUICKSTART_INITIALIZED=false CURRENT_POSTGRES_PID="" @@ -21,6 +24,10 @@ function main() { echo "" 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 + fi echo "mode: $STELLAR_MODE" echo "network: $NETWORK ($NETWORK_PASSPHRASE)" @@ -60,6 +67,12 @@ function process_args() { --enable-asset-stats) export ENABLE_ASSET_STATS="$1" shift + ;; + --enable-horizon-captive-core) + ENABLE_HORIZON_CAPTIVE_CORE=true + ;; + --enable-core-manual-close) + ENABLE_CORE_MANUAL_CLOSE=true ;; *) echo "Unknown container arg $ARG" >&2 @@ -230,7 +243,13 @@ function init_stellar_core() { return 0 fi - run_silent "finalize-core-config" sed -ri "s/__PGPASS__/$PGPASS/g" etc/stellar-core.cfg + run_silent "finalize-core-config-pgpass" sed -ri "s/__PGPASS__/$PGPASS/g" etc/stellar-core.cfg + local RUN_STANDALONE=false + if [ "$NETWORK" = "standalone" ] && [ "$HORIZON_ENABLE_CAPTIVE_CORE" = "false" ]; then + RUN_STANDALONE=true + fi + run_silent "finalize-core-config-run-standalone" sed -ri "s/__RUN_STANDALONE__/$RUN_STANDALONE/g" etc/stellar-core.cfg + run_silent "finalize-core-config-manual-close" sed -ri "s/__MANUAL_CLOSE__/$ENABLE_CORE_MANUAL_CLOSE/g" etc/stellar-core.cfg start_postgres @@ -265,6 +284,14 @@ function init_horizon() { -e "s=__ARCHIVE__=$HISTORY_ARCHIVE_URLS=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 diff --git a/testnet/core/etc/stellar-core.cfg b/testnet/core/etc/stellar-core.cfg index 3caedaab..f6664b45 100644 --- a/testnet/core/etc/stellar-core.cfg +++ b/testnet/core/etc/stellar-core.cfg @@ -1,6 +1,7 @@ HTTP_PORT=11626 PUBLIC_HTTP_PORT=true LOG_FILE_PATH="" +MANUAL_CLOSE=__MANUAL_CLOSE__ NETWORK_PASSPHRASE="Test SDF Network ; September 2015" KNOWN_CURSORS=["HORIZON"]