diff --git a/.do/deploy.template.yaml b/.do/deploy.template.yaml index 507b2f54..0c319632 100644 --- a/.do/deploy.template.yaml +++ b/.do/deploy.template.yaml @@ -17,7 +17,7 @@ spec: value: stellar/quickstart:latest scope: BUILD_TIME - key: NETWORK - value: 'standalone' + value: 'local' scope: RUN_TIME - key: ENABLE_SOROBAN_RPC value: 'false' diff --git a/.github/workflows/build-latest.yml b/.github/workflows/build-latest.yml index 46d23f27..04d1b494 100644 --- a/.github/workflows/build-latest.yml +++ b/.github/workflows/build-latest.yml @@ -41,7 +41,7 @@ jobs: soroban_tools_ref: v0.4.0 test_matrix: | { - "network": ["testnet", "pubnet", "standalone"], + "network": ["testnet", "pubnet", "local"], "options": ["", "--enable-horizon-captive-core"], "exclude": [ { "network": "testnet", "options": "--enable-horizon-captive-core" }, @@ -62,7 +62,7 @@ jobs: soroban_tools_ref: v0.4.0 test_matrix: | { - "network": ["testnet", "pubnet", "standalone"], + "network": ["testnet", "pubnet", "local"], "options": ["", "--enable-horizon-captive-core"], "exclude": [ { "network": "testnet", "options": "--enable-horizon-captive-core" }, diff --git a/.github/workflows/build-soroban-dev.yml b/.github/workflows/build-soroban-dev.yml index 98b7f3d7..12670cc6 100644 --- a/.github/workflows/build-soroban-dev.yml +++ b/.github/workflows/build-soroban-dev.yml @@ -40,7 +40,7 @@ jobs: soroban_tools_ref: v20.0.0-rc1 test_matrix: | { - "network": ["standalone"], + "network": ["local"], "options": ["", "--enable-horizon-captive-core", "--enable-soroban-rpc"], } @@ -60,7 +60,7 @@ jobs: soroban_rpc_build_runner_type: ubuntu-latest-16-cores test_matrix: | { - "network": ["standalone"], + "network": ["local"], "options": ["", "--enable-horizon-captive-core", "--enable-soroban-rpc"], } diff --git a/.github/workflows/build-testing.yml b/.github/workflows/build-testing.yml index 56ade80a..0e6ebd50 100644 --- a/.github/workflows/build-testing.yml +++ b/.github/workflows/build-testing.yml @@ -42,7 +42,7 @@ jobs: soroban_tools_ref: v0.4.0 test_matrix: | { - "network": ["testnet", "pubnet", "standalone"], + "network": ["testnet", "pubnet", "local"], "options": ["", "--enable-horizon-captive-core"], "exclude": [ { "network": "testnet", "options": "--enable-horizon-captive-core" }, @@ -63,7 +63,7 @@ jobs: soroban_tools_ref: v0.4.0 test_matrix: | { - "network": ["testnet", "pubnet", "standalone"], + "network": ["testnet", "pubnet", "local"], "options": ["", "--enable-horizon-captive-core"], "exclude": [ { "network": "testnet", "options": "--enable-horizon-captive-core" }, diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22ea53cb..af3edca2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -273,7 +273,7 @@ jobs: go run test_horizon_ingesting.go curl http://localhost:8000 - name: Run friendbot test - if: ${{ matrix.network == 'standalone' }} + if: ${{ matrix.network == 'local' }} run: | echo "supervisorctl tail -f friendbot" | docker exec -i stellar sh & echo "supervisorctl tail -f horizon" | docker exec -i stellar sh & diff --git a/Dockerfile b/Dockerfile index 9d5a0e16..f868c9ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,9 +37,9 @@ RUN ["ln", "-s", "/opt/stellar", "/stellar"] RUN ["ln", "-s", "/opt/stellar/core/etc/stellar-core.cfg", "/stellar-core.cfg"] RUN ["ln", "-s", "/opt/stellar/horizon/etc/horizon.env", "/horizon.env"] ADD common /opt/stellar-default/common +ADD local /opt/stellar-default/local ADD pubnet /opt/stellar-default/pubnet ADD testnet /opt/stellar-default/testnet -ADD standalone /opt/stellar-default/standalone ADD futurenet /opt/stellar-default/futurenet diff --git a/README.md b/README.md index bf35a534..a54f3631 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The image uses the following software: To use this project successfully, you should first decide a few things: -First, decide whether you want your container to be part of the public, production Stellar network (referred to as the _pubnet_) or the test network (called testnet) that we recommend you use while developing software because you need not worry about losing money on the testnet. Additionally, we have added a standalone network (called standalone) which allows you to run your own private Stellar network. +First, decide whether you want your container to be part of the public, production Stellar network (referred to as the _pubnet_) or the test network (called testnet) that we recommend you use while developing software because you need not worry about losing money on the testnet. Alternatively, choose to run a local network (called local) which allows you to run your own private Stellar network. Next, you must decide whether you will use a docker volume or not. When not using a volume, we say that the container is in _ephemeral mode_, that is, nothing will be persisted between runs of the container. _Persistent mode_ is the alternative, which should be used in the case that you need to either customize your configuration (such as to add a validation seed) or would like avoid a slow catchup to the Stellar network in the case of a crash or server restart. We recommend persistent mode for anything besides a development or test environment. @@ -29,7 +29,7 @@ After deciding on the questions above, you can setup your container. Please ref ### Network Options -Provide either `--pubnet`, `--testnet` or `--standalone` as a command line flag when starting the container to determine which network (and base configuration file) to use. +Provide either `--pubnet`, `--testnet` or `--local` as a command line flag when starting the container to determine which network (and base configuration file) to use. #### `--pubnet` @@ -45,9 +45,9 @@ In futurenet network mode, the node will join the [Soroban] test network that de [Soroban]: https://soroban.stellar.org -#### `--standalone` +#### `--local` -In standalone network mode, you can optionally pass `--protocol-version {version}` parameter to run a specific protocol version (defaults to latest version). +In local network mode, you can optionally pass `--protocol-version {version}` parameter to run a specific protocol version (defaults to latest version). The network passphrase of the network defaults to: ``` @@ -64,21 +64,21 @@ Secret Key: SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L The root account is derived from the network passphrase and if the network passphrase is changed the root account will change. To find out the root account when changing the network passphrase view the logs for stellar-core on its first start. See [Viewing logs](#viewing-logs) for more details. -In standalone network mode a ledger occurs every one second and so transactions +In local network mode a ledger occurs every one second and so transactions are finalized faster than on deployed networks. -*Note*: The standalone network in this container is not suitable for any production use as it has a fixed root account. Any private network intended for production use would also required a unique network passphrase. +*Note*: The local network in this container is not suitable for any production use as it has a fixed root account. Any private network intended for production use would also required a unique network passphrase. ### Soroban Development -For local development of smart contracts on Stellar using [Soroban], run a `standalone` network and the Soroban stack locally via the `stellar/quickstart:soroban-dev` image: +For local development of smart contracts on Stellar using [Soroban], run a `local` network and the Soroban stack locally via the `stellar/quickstart:soroban-dev` image: ``` $ docker run --rm -it \ -p "8000:8000" \ --name stellar \ stellar/quickstart:soroban-dev \ - --standalone \ + --local \ --enable-soroban-rpc ``` @@ -86,7 +86,7 @@ This will run development versions of stellar-core, horizon, friendbot, and soro **Warning: The Soroban RPC Server is in early development and the version included in any quickstart image is a development release with no production capabilities and no API compatibility guarantee. Not recommended for use in production or any environment requiring stability or safety.** -The Soroban RPC server is supported only with the `--standalone` and `--futurenet` network options. +The Soroban RPC server is supported only with the `--local` and `--futurenet` network options. To enable the Soroban RPC server provide the following command line flags when starting the container: `--enable-soroban-rpc` @@ -102,22 +102,22 @@ http://:6061/debug/pprof/ ### Deploy to Digital Ocean -You can deploy the quickstart image to DigitalOcean by clicking the button below. It will by default create a container that can be used for development and testing, running the `latest` tag, in ephemeral mode, and on the `standalone` network. +You can deploy the quickstart image to DigitalOcean by clicking the button below. It will by default create a container that can be used for development and testing, running the `latest` tag, in ephemeral mode, and on the `local` network. [![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/stellar/quickstart/tree/master) After clicking the button above, the deployment can be configured to deploy a different variant of the image, or join a different network such as `testnet` or `futurenet` by changing environment variables. Some example configurations that can be used are: -- Standalone network matching pubnet: +- Local network matching pubnet: `IMAGE`: `stellar/quickstart:latest` - `NETWORK`: `standalone` -- Standalone network matching testnet: + `NETWORK`: `local` +- Local network matching testnet: `IMAGE`: `stellar/quickstart:testing` - `NETWORK`: `standalone` -- Standalone network matching futurenet: + `NETWORK`: `local` +- Local network matching futurenet: `IMAGE`: `stellar/quickstart:soroban-dev` - `NETWORK`: `standalone` + `NETWORK`: `local` `ENABLE_SOROBAN_RPC`: `true` - Futurenet node: `IMAGE`: `stellar/quickstart:soroban-dev` diff --git a/standalone/core/etc/stellar-core.cfg b/local/core/etc/stellar-core.cfg similarity index 94% rename from standalone/core/etc/stellar-core.cfg rename to local/core/etc/stellar-core.cfg index 85034ec9..05a60aa7 100644 --- a/standalone/core/etc/stellar-core.cfg +++ b/local/core/etc/stellar-core.cfg @@ -1,4 +1,4 @@ -# simple configuration for a standalone test "network" +# simple configuration for a local test "network" # see stellar-core_example.cfg for a description of the configuration parameters HTTP_PORT=11626 diff --git a/standalone/horizon/etc/horizon.env b/local/horizon/etc/horizon.env similarity index 100% rename from standalone/horizon/etc/horizon.env rename to local/horizon/etc/horizon.env diff --git a/standalone/horizon/etc/stellar-captive-core.cfg b/local/horizon/etc/stellar-captive-core.cfg similarity index 89% rename from standalone/horizon/etc/stellar-captive-core.cfg rename to local/horizon/etc/stellar-captive-core.cfg index 85d7c5aa..14bfe3fa 100644 --- a/standalone/horizon/etc/stellar-captive-core.cfg +++ b/local/horizon/etc/stellar-captive-core.cfg @@ -1,4 +1,4 @@ -# simple captive core configuration for a standalone test "network" +# simple captive core configuration for a local test "network" NETWORK_PASSPHRASE="__NETWORK__" # disable the web service port, not used HTTP_PORT=0 diff --git a/standalone/soroban-rpc/etc/soroban-rpc.cfg b/local/soroban-rpc/etc/soroban-rpc.cfg similarity index 100% rename from standalone/soroban-rpc/etc/soroban-rpc.cfg rename to local/soroban-rpc/etc/soroban-rpc.cfg diff --git a/standalone/soroban-rpc/etc/stellar-captive-core.cfg b/local/soroban-rpc/etc/stellar-captive-core.cfg similarity index 91% rename from standalone/soroban-rpc/etc/stellar-captive-core.cfg rename to local/soroban-rpc/etc/stellar-captive-core.cfg index 95245571..24cfe337 100644 --- a/standalone/soroban-rpc/etc/stellar-captive-core.cfg +++ b/local/soroban-rpc/etc/stellar-captive-core.cfg @@ -1,4 +1,4 @@ -# simple captive core configuration for a standalone test "network" +# simple captive core configuration for a local test "network" NETWORK_PASSPHRASE="__NETWORK__" # disable the web service port, not used HTTP_PORT=0 diff --git a/standalone/supervisor/etc/supervisord.conf.d/friendbot.conf b/local/supervisor/etc/supervisord.conf.d/friendbot.conf similarity index 100% rename from standalone/supervisor/etc/supervisord.conf.d/friendbot.conf rename to local/supervisor/etc/supervisord.conf.d/friendbot.conf diff --git a/standalone/supervisor/etc/supervisord.conf.d/soroban-rpc.conf b/local/supervisor/etc/supervisord.conf.d/soroban-rpc.conf similarity index 100% rename from standalone/supervisor/etc/supervisord.conf.d/soroban-rpc.conf rename to local/supervisor/etc/supervisord.conf.d/soroban-rpc.conf diff --git a/start b/start index 1469f498..90bb310e 100644 --- a/start +++ b/start @@ -33,12 +33,12 @@ CURRENT_POSTGRES_PID="" function main() { process_args $* - if [ "$NETWORK" != "standalone" ] && [ "$NETWORK" != "futurenet" ] &&[ "$ENABLE_HORIZON_CAPTIVE_CORE" = "true" ]; then - echo "--enable-horizon-captive-core usage only supported on standalone/futurenet networks" >&2 + if [ "$NETWORK" != "local" ] && [ "$NETWORK" != "futurenet" ] &&[ "$ENABLE_HORIZON_CAPTIVE_CORE" = "true" ]; then + echo "--enable-horizon-captive-core usage only supported on local/futurenet networks" >&2 exit 1 fi - if [ "$NETWORK" != "standalone" ] && [ "$NETWORK" != "futurenet" ] && [ "$ENABLE_SOROBAN_RPC" = "true" ]; then - echo "--enable-soroban-rpc usage only supported on standalone/futurenet networks" >&2 + if [ "$NETWORK" != "local" ] && [ "$NETWORK" != "futurenet" ] && [ "$ENABLE_SOROBAN_RPC" = "true" ]; then + echo "--enable-soroban-rpc usage only supported on local/futurenet networks" >&2 exit 1 fi if [ "$ENABLE_SOROBAN_RPC" != "true" ] && [ "$ENABLE_SOROBAN_DIAGNOSTIC_EVENTS" = "true" ]; then @@ -49,8 +49,8 @@ function main() { echo "--enable-soroban-rpc-admin-endpoint usage only supported with --enable-soroban-rpc" >&2 exit 1 fi - if [ "$NETWORK" != "standalone" ] && [ "$RANDOMIZE_NETWORK_PASSPHRASE" = "true" ]; then - echo "--randomize-network-passphrase is only supported in the standalone network" >&2 + if [ "$NETWORK" != "local" ] && [ "$RANDOMIZE_NETWORK_PASSPHRASE" = "true" ]; then + echo "--randomize-network-passphrase is only supported in the local network" >&2 exit 1 fi if [ "$ENABLE_LOGS" = "true" ]; then @@ -67,7 +67,8 @@ function start() { echo "Starting Stellar Quickstart" echo "mode: $STELLAR_MODE" - echo "network: $NETWORK ($NETWORK_PASSPHRASE)" + echo "network: $NETWORK" + echo "network passphrase: $NETWORK_PASSPHRASE" copy_defaults init_db @@ -96,8 +97,12 @@ function process_args() { --pubnet) NETWORK="pubnet" ;; + --local) + NETWORK="local" + ;; --standalone) - NETWORK="standalone" + echo "deprecated: option --standalone has been replaced by --local" + NETWORK="local" ;; --futurenet) NETWORK="futurenet" @@ -148,7 +153,7 @@ function process_args() { export NETWORK_PASSPHRASE="Public Global Stellar Network ; September 2015" export HISTORY_ARCHIVE_URLS="https://history.stellar.org/prd/core-live/core_live_001" ;; - standalone) + local) export NETWORK_PASSPHRASE="Standalone Network ; February 2017" # h1570ry - we'll start a webserver connected to history directory later on export HISTORY_ARCHIVE_URLS="http://localhost:1570" @@ -336,7 +341,7 @@ function init_stellar_core() { if [ -f $COREHOME/.quickstart-initialized ]; then echo "core: already initialized" - if [ "$NETWORK" = "standalone" ]; then + if [ "$NETWORK" = "local" ]; then start_postgres run_silent "init-core-scp" sudo -u stellar stellar-core force-scp --conf $COREHOME/etc/stellar-core.cfg @@ -347,20 +352,20 @@ function init_stellar_core() { run_silent "finalize-core-config-pgpass" perl -pi -e "s/__PGPASS__/$PGPASS/g" etc/stellar-core.cfg local RUN_STANDALONE=false - if [ "$NETWORK" = "standalone" ] && [ "$ENABLE_HORIZON_CAPTIVE_CORE" = "false" ] && [ "$ENABLE_SOROBAN_RPC" = "false" ]; then + 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-standalone" perl -pi -e "s/__RUN_STANDALONE__/$RUN_STANDALONE/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 start_postgres run_silent "init-core-db" sudo -u stellar stellar-core new-db --conf etc/stellar-core.cfg - if [ "$NETWORK" = "standalone" ]; then + if [ "$NETWORK" = "local" ]; then run_silent "init-core-scp" sudo -u stellar stellar-core force-scp --conf etc/stellar-core.cfg run_silent "init-history" sudo -u stellar stellar-core new-hist vs --conf $COREHOME/etc/stellar-core.cfg @@ -404,7 +409,7 @@ EOF run_silent "chown-horizon" chown -R stellar:stellar . - if [[ "$NETWORK" = "standalone" || (".$PROTOCOL_VERSION" != ".none" && $PROTOCOL_VERSION -gt 19) ]] ; then + if [[ "$NETWORK" = "local" || (".$PROTOCOL_VERSION" != ".none" && $PROTOCOL_VERSION -gt 19) ]] ; then cat << EOF >> etc/horizon.env export INGEST_DISABLE_STATE_VERIFICATION=True EOF @@ -449,9 +454,9 @@ function init_soroban_rpc() { popd } -function upgrade_standalone() { - # Upgrade standalone network's protocol version and base reserve to match pubnet/testnet - if [ "$NETWORK" = "standalone" ]; then +function upgrade_local() { + # Upgrade local network's protocol version and base reserve to match pubnet/testnet + if [ "$NETWORK" = "local" ]; then # Wait for server while ! echo "Stellar-core http server listening!" | nc localhost 11626 &> /dev/null; do sleep 1; done if [ -z "$PROTOCOL_VERSION" ]; then @@ -468,7 +473,7 @@ function upgrade_standalone() { function exec_supervisor() { echo "supervisor: starting" - upgrade_standalone & + upgrade_local & service_status & exec supervisord -n -c $SUPHOME/etc/supervisord.conf \ > >(sed -u 's/^/supervisor: /') \