Skip to content

Commit

Permalink
'--enable core --local' only runs core, no ancillary services (#615)
Browse files Browse the repository at this point in the history
* enable=core only starts the core service, no ancillaries

* revert checking enabled rpc for soroban core limit updates

* friendbot tests assumed horizon when local, but needs to be explicit enabled now

* enable all services under --local network when just rpc is enabled

* tweak readme

---------

Co-authored-by: Leigh McCulloch <[email protected]>
  • Loading branch information
sreuland and leighmcculloch authored Jul 11, 2024
1 parent 611afc9 commit 807b2b3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ jobs:
go run test_horizon_ingesting.go
curl http://localhost:8000
- name: Run friendbot test
if: ${{ matrix.network == 'local' }}
if: ${{ matrix.horizon && matrix.network == 'local' }}
run: |
docker logs stellar -f &
echo "supervisorctl tail -f friendbot" | docker exec -i stellar sh &
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ In local network mode, you can optionally pass:
- `testnet` sets limits to match those used on testnet (the default quickstart configuration)
- `unlimited` sets limits to the maximum resources that can be configured

__Note: The `--enable` options behaves differently in local network mode, see [Service Options](#service-otions) for more details.__
The network passphrase of the network defaults to:
```
Standalone Network ; February 2017
Expand Down Expand Up @@ -93,9 +94,7 @@ To run only select services, simply specify only those services. For example, to
```
--enable rpc
```

__Note: All services, and in addition friendbot, always run on a local network.__

__Note: In `--local` mode the `core` service always runs no matter what options are passed, the `friendbot` faucet service runs whenever `horizon` is running, and `horizon` is run when `rpc` is requested so that friendbot is available.__
### Faucet (Friendbot)

Stellar development/test networks use friendbot as a faucet for the native asset.
Expand Down
28 changes: 16 additions & 12 deletions start
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ function process_args() {
NETWORK="testnet"
fi

if [[ ",$ENABLE," = *",core,"* ]]; then
ENABLE_CORE=true
fi
if [[ ",$ENABLE," = *",horizon,"* ]]; then
ENABLE_HORIZON=true
fi
if [[ ",$ENABLE," = *",rpc,"* ]]; then
ENABLE_SOROBAN_RPC=true
fi

case "$NETWORK" in
testnet)
export NETWORK_PASSPHRASE="Test SDF Network ; September 2015"
Expand All @@ -190,7 +200,9 @@ function process_args() {
# h1570ry - we'll start a webserver connected to history directory later on
export HISTORY_ARCHIVE_URLS="http://localhost:1570"
ENABLE_CORE=true
ENABLE_HORIZON=true
if [[ "$ENABLE_SOROBAN_RPC" = "true" ]]; then
ENABLE_HORIZON=true
fi
;;
futurenet)
export NETWORK_PASSPHRASE="Test SDF Future Network ; October 2022"
Expand All @@ -201,16 +213,6 @@ function process_args() {
exit 1
esac

if [[ ",$ENABLE," = *",core,"* ]]; then
ENABLE_CORE=true
fi
if [[ ",$ENABLE," = *",horizon,"* ]]; then
ENABLE_HORIZON=true
fi
if [[ ",$ENABLE," = *",rpc,"* ]]; then
ENABLE_SOROBAN_RPC=true
fi

if [ "$RANDOMIZE_NETWORK_PASSPHRASE" = "true" ]; then
NETWORK_PASSPHRASE="${NETWORK_PASSPHRASE} ; $(openssl rand -hex 32)"
fi
Expand Down Expand Up @@ -597,7 +599,9 @@ function upgrade_local() {
# account to submit txs. while friend it is not dependent on the config
# upgrade txs, it must not be started until the config upgrades are
# complete otherwise the txs sequence numbers will conflict.
supervisorctl start friendbot
if [ "$ENABLE_HORIZON" == "true" ]; then
supervisorctl start friendbot
fi
}

function start_optional_services() {
Expand Down

0 comments on commit 807b2b3

Please sign in to comment.