├── Dockerfile ├── LICENSE ├── Readme.md ├── bin └── docker-push.sh ├── common ├── bridge │ └── bin │ │ └── start ├── core │ └── bin │ │ └── start ├── friendbot │ ├── bin │ │ └── start │ └── friendbot.cfg ├── horizon │ ├── bin │ │ ├── horizon │ │ └── start │ └── etc │ │ └── horizon.env ├── postgresql │ ├── .pgpass │ └── etc │ │ ├── pg_hba.conf │ │ ├── pg_ident.conf │ │ └── postgresql.conf └── supervisor │ └── etc │ └── supervisord.conf ├── integrationnet ├── bridge │ └── etc │ │ └── bridge.cfg ├── core │ └── etc │ │ └── stellar-core.cfg ├── home │ └── fixtures │ │ └── load.sh └── supervisor.d │ └── fixtures.conf ├── pubnet └── core │ └── etc │ └── stellar-core.cfg ├── start └── testnet └── core └── etc └── stellar-core.cfg /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM stellar/base:latest 2 | 3 | # 5432 - postgres 4 | # 8000 - horizon https://github.com/stellar/go/tree/master/services/horizon 5 | # 8004 - friendbot https://github.com/stellar/go/tree/master/services/friendbot 6 | # 8006 - bridge server https://github.com/stellar/go/tree/master/services/bridge 7 | # 11625 - stellar core peer port 8 | # 11626 - stellar core command port 9 | EXPOSE 5432 8000 8004 8006 11625 11626 10 | 11 | RUN echo "[start: dependencies]" \ 12 | && apt-get update \ 13 | && apt-get install -y \ 14 | curl git libpq-dev libsqlite3-dev libsasl2-dev postgresql-client postgresql postgresql-contrib sudo vim zlib1g-dev supervisor \ 15 | && apt-get clean \ 16 | && rm -rf /var/lib/apt/lists/* \ 17 | && echo "[end: dependencies]" 18 | 19 | 20 | ENV STELLAR_CORE_VERSION 10.0.0-685-1fc018b4 21 | ENV HORIZON_VERSION 0.15.1 22 | 23 | # Install core and horizon 24 | RUN echo "[start: stellar install]" \ 25 | && wget -O stellar-core.deb https://s3.amazonaws.com/stellar.org/releases/stellar-core/stellar-core-${STELLAR_CORE_VERSION}_amd64.deb \ 26 | && dpkg -i stellar-core.deb \ 27 | && rm stellar-core.deb \ 28 | && wget -O horizon.tar.gz https://github.com/stellar/go/releases/download/horizon-v${HORIZON_VERSION}/horizon-v${HORIZON_VERSION}-linux-amd64.tar.gz \ 29 | && tar -zxvf horizon.tar.gz \ 30 | && mv /horizon-v${HORIZON_VERSION}-linux-amd64/horizon /usr/local/bin \ 31 | && chmod +x /usr/local/bin/horizon \ 32 | && rm -rf horizon.tar.gz /horizon-v${HORIZON_VERSION}-linux-amd64 \ 33 | && echo "[end: stellar install]" 34 | 35 | # Install stellar bridge server 36 | ENV BRIDGE_VERSION 0.0.31 37 | RUN echo "[start: installing stellar bridge]" \ 38 | && mkdir -p /opt/stellar/bridge \ 39 | && curl -L https://github.com/stellar/bridge-server/releases/download/v${BRIDGE_VERSION}/bridge-v${BRIDGE_VERSION}-linux-amd64.tar.gz \ 40 | | tar -xz -C /opt/stellar/bridge --strip-components=1 \ 41 | && echo "[end: installing stellar bridge" 42 | 43 | ADD common /opt/stellar-default/common 44 | # Public network 45 | ADD pubnet /opt/stellar-default/pubnet 46 | # Test network 47 | ADD testnet /opt/stellar-default/testnet 48 | # Private integration testing network with a single node and fixtures 49 | ADD integrationnet /opt/stellar-default/integrationnet 50 | 51 | ADD start / 52 | 53 | RUN echo "[start: configuring paths and users]" \ 54 | && useradd --uid 10011001 --home-dir /home/stellar --no-log-init stellar \ 55 | && mkdir -p /home/stellar \ 56 | && chown -R stellar:stellar /home/stellar \ 57 | && mkdir -p /opt/stellar \ 58 | && touch /opt/stellar/.docker-ephemeral \ 59 | && ln -s /opt/stellar /stellar \ 60 | && ln -s /opt/stellar/core/etc/stellar-core.cfg /stellar-core.cfg \ 61 | && ln -s /opt/stellar/horizon/etc/horizon.env /horizon.env \ 62 | && chmod +x /start \ 63 | && echo "[end: configuring paths and users]" 64 | 65 | # Install friendbot 66 | ENV FRIENDBOT_VERSION 0.0.1 67 | RUN echo "[start: friendbot install]" \ 68 | && wget -O friendbot.tar.gz https://github.com/stellar/go/releases/download/friendbot-v${FRIENDBOT_VERSION}/friendbot-v${FRIENDBOT_VERSION}-linux-amd64.tar.gz \ 69 | && tar xf friendbot.tar.gz --to-stdout friendbot-v${FRIENDBOT_VERSION}-linux-amd64/friendbot > /opt/stellar-default/common/friendbot/friendbot \ 70 | && chmod a+x /opt/stellar-default/common/friendbot/friendbot \ 71 | && echo "[end: friendbot install]" 72 | 73 | ENTRYPOINT ["/init", "--", "/start" ] 74 | CMD ["--integrationnet"] 75 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 ZuluCrypto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | Standalone single-node Stellar network with fixtures for integration testing with 4 | Horizon. 5 | 6 | ## Quickstart 7 | 8 | Start a docker container with Horizon (port 8000) and Friendbot (port 8004) available: 9 | 10 | ```$bash 11 | $ docker run -it \ 12 | --rm \ 13 | --name horizon-integrationnet \ 14 | -p 8000:8000 \ 15 | -p 8004:8004 \ 16 | zulucrypto/stellar-integration-test-network 17 | ``` 18 | 19 | The container will begin starting and creating a new private Stellar network. 20 | 21 | Eventually, you will see output like this: 22 | 23 | ```$bash 24 | ... lines omitted ... 25 | 2017-10-28 22:40:47,205 INFO success: postgresql entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 26 | 2017-10-28 22:40:47,205 INFO success: stellar-core entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 27 | 2017-10-28 22:40:47,205 INFO success: horizon entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 28 | 2017-10-28 22:40:47,205 INFO success: bridge entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 29 | 2017-10-28 22:40:47,206 INFO success: fixtures entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 30 | 2017-10-28 22:41:08,321 INFO exited: fixtures (exit status 0; expected) 31 | ``` 32 | 33 | `fixtures (exit status 0; expected)` indicates that fixtures have finished loading 34 | and the private network is ready for use. 35 | 36 | ### Connecting to Horizon 37 | 38 | Since this network uses a custom passphrase you will need to use it when signing transactions. 39 | 40 | **Java SDK Example** 41 | ``` 42 | sdk.Network.use(new sdk.Network('Integration Test Network ; zulucrypto')) 43 | ``` 44 | 45 | ## Initial network state 46 | 47 | ### Friendbot 48 | 49 | Friendbot is funded with XLM and can be used to fund additional accounts: 50 | 51 | ```bash 52 | curl http://localhost:8004?addr=GAJCCCRIRXAYEU2ATNQAFYH4E2HKLN2LCKM2VPXCTJKIBVTRSOLEGCJZ 53 | ``` 54 | 55 | The network is setup with several initial accounts: 56 | 57 | ```text 58 | Address: GAJCCCRIRXAYEU2ATNQAFYH4E2HKLN2LCKM2VPXCTJKIBVTRSOLEGCJZ 59 | Seed : SDJCZISO5M5XAUV6Y7MZJNN3JZ5BWPXDHV4GXP3MYNACVDNQRQSERXBC 60 | 61 | Address: GCP6IHMHWRCF5TQ4ZP6TVIRNDZD56W42F42VHYWMVDGDAND75YGAHHBQ 62 | Seed : SCEDMZ7DUEOUGRQWEXHXEXISQ2NAWI5IDXRHYWT2FHTYLIQOSUK5FX2E 63 | 64 | Address: GAPSWEVEZVAOTW6AJM26NIVBITCKXNOMGBZAOPFTFDTJGKYCIIPVI4RJ 65 | Seed : SBY7ZNSKQ3CDHH34RUWVIUCMM7UEWWFTCM6ORFT5QTE77JGDFCBGXSU5 66 | ``` 67 | 68 | You can use Horizon as normal: 69 | 70 | ```text 71 | $ curl http://localhost:8000/accounts/GAPSWEVEZVAOTW6AJM26NIVBITCKXNOMGBZAOPFTFDTJGKYCIIPVI4RJ 72 | ... 73 | "balances": [ 74 | { 75 | "balance": "10000.0000000", 76 | "asset_type": "native" 77 | } 78 | ], 79 | ... 80 | ``` 81 | 82 | ## Upgrades / Network Changes 83 | 84 | Since this is a one-node network, you can change any properties by using the `upgrades` command. 85 | 86 | By default, the network is configured to match the stellar production network: 87 | * Protocol version 9 88 | * Base reserve 0.5 XLM 89 | 90 | If you wanted to change the fee to 0.00002 XLM and the base reserve to 0.25 XLM 91 | 92 | ```bash 93 | # Enter the container 94 | $ docker exec -it your-container-name bash 95 | 96 | # Run the stellar core upgrade command 97 | $ stellar-core --c "upgrades?mode=set&upgradetime=2000-01-01T00:00:00Z&basereserve=2500000&basefee=200" 98 | ``` 99 | 100 | Changes will be applied in the next ledger. 101 | 102 | For more information on what upgrades you can set, see "upgrades" here: https://www.stellar.org/developers/stellar-core/software/commands.html#http-commands 103 | 104 | ## Included Software Versions 105 | 106 | * Stellar Core 10.0.0-685-1fc018b4 107 | * Horizon 0.15.1 108 | * Bridge 0.0.31 109 | * Friendbot 0.0.1 110 | 111 | ## References 112 | 113 | * Heavily based on https://github.com/stellar/docker-stellar-core-horizon 114 | * This PR was very helpful for the private network portion: https://github.com/stellar/docker-stellar-core-horizon/pull/7 115 | -------------------------------------------------------------------------------- /bin/docker-push.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Builds and publishes a the docker container to hub.docker.com 4 | # 5 | # Example usage: 6 | # $ git tag -a v0.2.1 -m "Tagging 0.2.1" 7 | # $ bin/docker-push.sh 8 | # 9 | # NOTE: Versions must start with "v" 10 | # 11 | set -e 12 | 13 | # Will return the current tag, such as "v0.1.0" 14 | CONTAINER_NAME="zulucrypto/stellar-integration-test-network" 15 | VERSION=$(git describe --exact-match --tags $(git log -n1 --pretty='%h')) 16 | 17 | # Verify version looks reasonable 18 | if ! [[ "$VERSION" =~ ^v\d* ]]; then 19 | echo "Invalid version $VERSION" 20 | exit 1 21 | fi 22 | 23 | # Remove first character ("v") 24 | VERSION="${VERSION:1}" 25 | 26 | echo "Building version: ${VERSION}" 27 | 28 | docker build --tag "${CONTAINER_NAME}:${VERSION}" . 29 | 30 | 31 | echo "Pushing version: ${VERSION}" 32 | 33 | docker login --username zulucrypto 34 | 35 | docker push "${CONTAINER_NAME}:${VERSION}" 36 | 37 | docker tag "${CONTAINER_NAME}:${VERSION}" "${CONTAINER_NAME}:latest" 38 | docker push "${CONTAINER_NAME}:latest" 39 | -------------------------------------------------------------------------------- /common/bridge/bin/start: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Verify that horizon is answering requests and there's been at least 1 ledger 4 | while ! curl --silent --fail http://localhost:8000 | grep "core_latest_ledger" |grep -v "0," ; do 5 | echo "Waiting for horizon to be available..." 6 | sleep 1 7 | done 8 | 9 | set -e 10 | 11 | echo "[bridge] Setting up database..." 12 | /opt/stellar/bridge/bridge -c "/opt/stellar/bridge/etc/bridge.cfg" --migrate-db 13 | 14 | echo "[bridge] starting..." 15 | exec /opt/stellar/bridge/bridge -c "/opt/stellar/bridge/etc/bridge.cfg" 16 | -------------------------------------------------------------------------------- /common/core/bin/start: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | while ! psql -U stellar -c 'select 1' core &> /dev/null ; do 4 | echo "Waiting for postgres to be available..." 5 | sleep 1 6 | done 7 | 8 | echo "starting core..." 9 | set -e 10 | exec /usr/local/bin/stellar-core --conf "/opt/stellar/core/etc/stellar-core.cfg" 11 | -------------------------------------------------------------------------------- /common/friendbot/bin/start: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | exec /opt/stellar/friendbot/friendbot -------------------------------------------------------------------------------- /common/friendbot/friendbot.cfg: -------------------------------------------------------------------------------- 1 | port = 8004 2 | friendbot_secret = "SDXHNTECJ63VVROJJT3A2NVZZ4XSQY77UM76TWJL536KO34UVHFAOQZZ" 3 | network_passphrase = "Integration Test Network ; zulucrypto" 4 | horizon_url = "http://localhost:8000" 5 | starting_balance = "10000.00" 6 | -------------------------------------------------------------------------------- /common/horizon/bin/horizon: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # This file is a simple wrapper around horizon that establishes the proper 4 | # environment variables before executing the actual binary. 5 | 6 | source /opt/stellar/horizon/etc/horizon.env 7 | exec /usr/local/bin/horizon --friendbot-url="http://localhost:8004" $@ 8 | -------------------------------------------------------------------------------- /common/horizon/bin/start: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | 5 | while ! psql -U stellar -c 'select 1' horizon &> /dev/null ; do 6 | echo "Waiting for postgres to be available..." 7 | sleep 1 8 | done 9 | 10 | while ! stellar-core --conf /opt/stellar/core/etc/stellar-core.cfg -c info |grep "Synced!" &> /dev/null ; do 11 | echo "Waiting for stellar-core to be available..." 12 | sleep 1 13 | done 14 | 15 | echo "starting horizon..." 16 | set -e 17 | exec $DIR/horizon 18 | -------------------------------------------------------------------------------- /common/horizon/etc/horizon.env: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export DATABASE_URL="postgres://stellar:__PGPASS__@localhost/horizon" 4 | export STELLAR_CORE_DATABASE_URL="postgres://stellar:__PGPASS__@localhost/core" 5 | export STELLAR_CORE_URL="http://localhost:11626" 6 | export LOG_LEVEL="info" 7 | export INGEST="true" 8 | export PER_HOUR_RATE_LIMIT="72000" 9 | export NETWORK_PASSPHRASE="__NETWORK__" 10 | 11 | # Enable friendbot 12 | export FRIENDBOT_SECRET="SATW6OUWKCEPVVQIZ3Q7PD2B6G76IMCGAU2BD2FKDLZ23HIUPAW7UNSI" -------------------------------------------------------------------------------- /common/postgresql/.pgpass: -------------------------------------------------------------------------------- 1 | *:*:*:stellar:__PGPASS__ 2 | -------------------------------------------------------------------------------- /common/postgresql/etc/pg_hba.conf: -------------------------------------------------------------------------------- 1 | # PostgreSQL Client Authentication Configuration File 2 | # =================================================== 3 | # 4 | # Refer to the "Client Authentication" section in the PostgreSQL 5 | # documentation for a complete description of this file. A short 6 | # synopsis follows. 7 | # 8 | # This file controls: which hosts are allowed to connect, how clients 9 | # are authenticated, which PostgreSQL user names they can use, which 10 | # databases they can access. Records take one of these forms: 11 | # 12 | # local DATABASE USER METHOD [OPTIONS] 13 | # host DATABASE USER ADDRESS METHOD [OPTIONS] 14 | # hostssl DATABASE USER ADDRESS METHOD [OPTIONS] 15 | # hostnossl DATABASE USER ADDRESS METHOD [OPTIONS] 16 | # 17 | # (The uppercase items must be replaced by actual values.) 18 | # 19 | # The first field is the connection type: "local" is a Unix-domain 20 | # socket, "host" is either a plain or SSL-encrypted TCP/IP socket, 21 | # "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a 22 | # plain TCP/IP socket. 23 | # 24 | # DATABASE can be "all", "sameuser", "samerole", "replication", a 25 | # database name, or a comma-separated list thereof. The "all" 26 | # keyword does not match "replication". Access to replication 27 | # must be enabled in a separate record (see example below). 28 | # 29 | # USER can be "all", a user name, a group name prefixed with "+", or a 30 | # comma-separated list thereof. In both the DATABASE and USER fields 31 | # you can also write a file name prefixed with "@" to include names 32 | # from a separate file. 33 | # 34 | # ADDRESS specifies the set of hosts the record matches. It can be a 35 | # host name, or it is made up of an IP address and a CIDR mask that is 36 | # an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that 37 | # specifies the number of significant bits in the mask. A host name 38 | # that starts with a dot (.) matches a suffix of the actual host name. 39 | # Alternatively, you can write an IP address and netmask in separate 40 | # columns to specify the set of hosts. Instead of a CIDR-address, you 41 | # can write "samehost" to match any of the server's own IP addresses, 42 | # or "samenet" to match any address in any subnet that the server is 43 | # directly connected to. 44 | # 45 | # METHOD can be "trust", "reject", "md5", "password", "gss", "sspi", 46 | # "ident", "peer", "pam", "ldap", "radius" or "cert". Note that 47 | # "password" sends passwords in clear text; "md5" is preferred since 48 | # it sends encrypted passwords. 49 | # 50 | # OPTIONS are a set of options for the authentication in the format 51 | # NAME=VALUE. The available options depend on the different 52 | # authentication methods -- refer to the "Client Authentication" 53 | # section in the documentation for a list of which options are 54 | # available for which authentication methods. 55 | # 56 | # Database and user names containing spaces, commas, quotes and other 57 | # special characters must be quoted. Quoting one of the keywords 58 | # "all", "sameuser", "samerole" or "replication" makes the name lose 59 | # its special character, and just match a database or username with 60 | # that name. 61 | # 62 | # This file is read on server startup and when the postmaster receives 63 | # a SIGHUP signal. If you edit the file on a running system, you have 64 | # to SIGHUP the postmaster for the changes to take effect. You can 65 | # use "pg_ctl reload" to do that. 66 | 67 | # Put your actual configuration here 68 | # ---------------------------------- 69 | # 70 | # If you want to allow non-local connections, you need to add more 71 | # "host" records. In that case you will also need to make PostgreSQL 72 | # listen on a non-local interface via the listen_addresses 73 | # configuration parameter, or via the -i or -h command line switches. 74 | 75 | 76 | 77 | 78 | # DO NOT DISABLE! 79 | # If you change this first entry you will need to make sure that the 80 | # database superuser can access the database using some other method. 81 | # Noninteractive access to all databases is required during automatic 82 | # maintenance (custom daily cronjobs, replication, and similar tasks). 83 | # 84 | # Database administrative login by Unix domain socket 85 | local all postgres peer 86 | 87 | # TYPE DATABASE USER ADDRESS METHOD 88 | 89 | # "local" is for Unix domain socket connections only 90 | local all all md5 91 | # IPv4 local connections: 92 | host all all 127.0.0.1/32 md5 93 | host all all 0.0.0.0/0 md5 94 | # IPv6 local connections: 95 | host all all ::1/128 md5 96 | # Allow replication connections from localhost, by a user with the 97 | # replication privilege. 98 | #local replication postgres peer 99 | #host replication postgres 127.0.0.1/32 md5 100 | #host replication postgres ::1/128 md5 101 | -------------------------------------------------------------------------------- /common/postgresql/etc/pg_ident.conf: -------------------------------------------------------------------------------- 1 | # PostgreSQL User Name Maps 2 | # ========================= 3 | # 4 | # Refer to the PostgreSQL documentation, chapter "Client 5 | # Authentication" for a complete description. A short synopsis 6 | # follows. 7 | # 8 | # This file controls PostgreSQL user name mapping. It maps external 9 | # user names to their corresponding PostgreSQL user names. Records 10 | # are of the form: 11 | # 12 | # MAPNAME SYSTEM-USERNAME PG-USERNAME 13 | # 14 | # (The uppercase quantities must be replaced by actual values.) 15 | # 16 | # MAPNAME is the (otherwise freely chosen) map name that was used in 17 | # pg_hba.conf. SYSTEM-USERNAME is the detected user name of the 18 | # client. PG-USERNAME is the requested PostgreSQL user name. The 19 | # existence of a record specifies that SYSTEM-USERNAME may connect as 20 | # PG-USERNAME. 21 | # 22 | # If SYSTEM-USERNAME starts with a slash (/), it will be treated as a 23 | # regular expression. Optionally this can contain a capture (a 24 | # parenthesized subexpression). The substring matching the capture 25 | # will be substituted for \1 (backslash-one) if present in 26 | # PG-USERNAME. 27 | # 28 | # Multiple maps may be specified in this file and used by pg_hba.conf. 29 | # 30 | # No map names are defined in the default configuration. If all 31 | # system user names and PostgreSQL user names are the same, you don't 32 | # need anything in this file. 33 | # 34 | # This file is read on server startup and when the postmaster receives 35 | # a SIGHUP signal. If you edit the file on a running system, you have 36 | # to SIGHUP the postmaster for the changes to take effect. You can 37 | # use "pg_ctl reload" to do that. 38 | 39 | # Put your actual configuration here 40 | # ---------------------------------- 41 | 42 | # MAPNAME SYSTEM-USERNAME PG-USERNAME 43 | -------------------------------------------------------------------------------- /common/postgresql/etc/postgresql.conf: -------------------------------------------------------------------------------- 1 | # ----------------------------- 2 | # PostgreSQL configuration file 3 | # ----------------------------- 4 | # 5 | # This file consists of lines of the form: 6 | # 7 | # name = value 8 | # 9 | # (The "=" is optional.) Whitespace may be used. Comments are introduced with 10 | # "#" anywhere on a line. The complete list of parameter names and allowed 11 | # values can be found in the PostgreSQL documentation. 12 | # 13 | # The commented-out settings shown in this file represent the default values. 14 | # Re-commenting a setting is NOT sufficient to revert it to the default value; 15 | # you need to reload the server. 16 | # 17 | # This file is read on server startup and when the server receives a SIGHUP 18 | # signal. If you edit the file on a running system, you have to SIGHUP the 19 | # server for the changes to take effect, or use "pg_ctl reload". Some 20 | # parameters, which are marked below, require a server shutdown and restart to 21 | # take effect. 22 | # 23 | # Any parameter can also be given as a command-line option to the server, e.g., 24 | # "postgres -c log_connections=on". Some parameters can be changed at run time 25 | # with the "SET" SQL command. 26 | # 27 | # Memory units: kB = kilobytes Time units: ms = milliseconds 28 | # MB = megabytes s = seconds 29 | # GB = gigabytes min = minutes 30 | # TB = terabytes h = hours 31 | # d = days 32 | 33 | 34 | #------------------------------------------------------------------------------ 35 | # FILE LOCATIONS 36 | #------------------------------------------------------------------------------ 37 | 38 | # The default values of these variables are driven from the -D command-line 39 | # option or PGDATA environment variable, represented here as ConfigDir. 40 | 41 | data_directory = '/opt/stellar/postgresql/data' 42 | hba_file = '/opt/stellar/postgresql/etc/pg_hba.conf' 43 | ident_file = '/opt/stellar/postgresql/etc/pg_ident.conf' 44 | 45 | #------------------------------------------------------------------------------ 46 | # CONNECTIONS AND AUTHENTICATION 47 | #------------------------------------------------------------------------------ 48 | 49 | # - Connection Settings - 50 | 51 | listen_addresses = '*' 52 | port = 5432 # (change requires restart) 53 | max_connections = 100 # (change requires restart) 54 | # Note: Increasing max_connections costs ~400 bytes of shared memory per 55 | # connection slot, plus lock space (see max_locks_per_transaction). 56 | #superuser_reserved_connections = 3 # (change requires restart) 57 | #unix_socket_directories = '/opt/stellar/postgresql/run' 58 | #unix_socket_group = '' # (change requires restart) 59 | #unix_socket_permissions = 0777 # begin with 0 to use octal notation 60 | # (change requires restart) 61 | #bonjour = off # advertise server via Bonjour 62 | # (change requires restart) 63 | #bonjour_name = '' # defaults to the computer name 64 | # (change requires restart) 65 | 66 | # - Security and Authentication - 67 | 68 | #authentication_timeout = 1min # 1s-600s 69 | ssl = true # (change requires restart) 70 | #ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL' # allowed SSL ciphers 71 | # (change requires restart) 72 | #ssl_prefer_server_ciphers = on # (change requires restart) 73 | #ssl_ecdh_curve = 'prime256v1' # (change requires restart) 74 | #ssl_renegotiation_limit = 0 # amount of data between renegotiations 75 | ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem' # (change requires restart) 76 | ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' # (change requires restart) 77 | #ssl_ca_file = '' # (change requires restart) 78 | #ssl_crl_file = '' # (change requires restart) 79 | #password_encryption = on 80 | #db_user_namespace = off 81 | 82 | # GSSAPI using Kerberos 83 | #krb_server_keyfile = '' 84 | #krb_caseins_users = off 85 | 86 | # - TCP Keepalives - 87 | # see "man 7 tcp" for details 88 | 89 | #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; 90 | # 0 selects the system default 91 | #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; 92 | # 0 selects the system default 93 | #tcp_keepalives_count = 0 # TCP_KEEPCNT; 94 | # 0 selects the system default 95 | 96 | 97 | #------------------------------------------------------------------------------ 98 | # RESOURCE USAGE (except WAL) 99 | #------------------------------------------------------------------------------ 100 | 101 | # - Memory - 102 | 103 | shared_buffers = 128MB # min 128kB 104 | # (change requires restart) 105 | #huge_pages = try # on, off, or try 106 | # (change requires restart) 107 | #temp_buffers = 8MB # min 800kB 108 | #max_prepared_transactions = 0 # zero disables the feature 109 | # (change requires restart) 110 | # Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory 111 | # per transaction slot, plus lock space (see max_locks_per_transaction). 112 | # It is not advisable to set max_prepared_transactions nonzero unless you 113 | # actively intend to use prepared transactions. 114 | #work_mem = 4MB # min 64kB 115 | #maintenance_work_mem = 64MB # min 1MB 116 | #autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem 117 | #max_stack_depth = 2MB # min 100kB 118 | dynamic_shared_memory_type = posix # the default is the first option 119 | # supported by the operating system: 120 | # posix 121 | # sysv 122 | # windows 123 | # mmap 124 | # use none to disable dynamic shared memory 125 | 126 | # - Disk - 127 | 128 | #temp_file_limit = -1 # limits per-session temp file space 129 | # in kB, or -1 for no limit 130 | 131 | # - Kernel Resource Usage - 132 | 133 | #max_files_per_process = 1000 # min 25 134 | # (change requires restart) 135 | #shared_preload_libraries = '' # (change requires restart) 136 | 137 | # - Cost-Based Vacuum Delay - 138 | 139 | #vacuum_cost_delay = 0 # 0-100 milliseconds 140 | #vacuum_cost_page_hit = 1 # 0-10000 credits 141 | #vacuum_cost_page_miss = 10 # 0-10000 credits 142 | #vacuum_cost_page_dirty = 20 # 0-10000 credits 143 | #vacuum_cost_limit = 200 # 1-10000 credits 144 | 145 | # - Background Writer - 146 | 147 | #bgwriter_delay = 200ms # 10-10000ms between rounds 148 | #bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round 149 | #bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round 150 | 151 | # - Asynchronous Behavior - 152 | 153 | #effective_io_concurrency = 1 # 1-1000; 0 disables prefetching 154 | #max_worker_processes = 8 155 | 156 | 157 | #------------------------------------------------------------------------------ 158 | # WRITE AHEAD LOG 159 | #------------------------------------------------------------------------------ 160 | 161 | # - Settings - 162 | 163 | #wal_level = minimal # minimal, archive, hot_standby, or logical 164 | # (change requires restart) 165 | #fsync = on # turns forced synchronization on or off 166 | #synchronous_commit = on # synchronization level; 167 | # off, local, remote_write, or on 168 | #wal_sync_method = fsync # the default is the first option 169 | # supported by the operating system: 170 | # open_datasync 171 | # fdatasync (default on Linux) 172 | # fsync 173 | # fsync_writethrough 174 | # open_sync 175 | #full_page_writes = on # recover from partial page writes 176 | #wal_log_hints = off # also do full page writes of non-critical updates 177 | # (change requires restart) 178 | #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers 179 | # (change requires restart) 180 | #wal_writer_delay = 200ms # 1-10000 milliseconds 181 | 182 | #commit_delay = 0 # range 0-100000, in microseconds 183 | #commit_siblings = 5 # range 1-1000 184 | 185 | # - Checkpoints - 186 | 187 | #checkpoint_segments = 3 # in logfile segments, min 1, 16MB each 188 | #checkpoint_timeout = 5min # range 30s-1h 189 | #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0 190 | #checkpoint_warning = 30s # 0 disables 191 | 192 | # - Archiving - 193 | 194 | #archive_mode = off # allows archiving to be done 195 | # (change requires restart) 196 | #archive_command = '' # command to use to archive a logfile segment 197 | # placeholders: %p = path of file to archive 198 | # %f = file name only 199 | # e.g. 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f' 200 | #archive_timeout = 0 # force a logfile segment switch after this 201 | # number of seconds; 0 disables 202 | 203 | 204 | #------------------------------------------------------------------------------ 205 | # REPLICATION 206 | #------------------------------------------------------------------------------ 207 | 208 | # - Sending Server(s) - 209 | 210 | # Set these on the master and on any standby that will send replication data. 211 | 212 | #max_wal_senders = 0 # max number of walsender processes 213 | # (change requires restart) 214 | #wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables 215 | #wal_sender_timeout = 60s # in milliseconds; 0 disables 216 | 217 | #max_replication_slots = 0 # max number of replication slots 218 | # (change requires restart) 219 | 220 | # - Master Server - 221 | 222 | # These settings are ignored on a standby server. 223 | 224 | #synchronous_standby_names = '' # standby servers that provide sync rep 225 | # comma-separated list of application_name 226 | # from standby(s); '*' = all 227 | #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed 228 | 229 | # - Standby Servers - 230 | 231 | # These settings are ignored on a master server. 232 | 233 | #hot_standby = off # "on" allows queries during recovery 234 | # (change requires restart) 235 | #max_standby_archive_delay = 30s # max delay before canceling queries 236 | # when reading WAL from archive; 237 | # -1 allows indefinite delay 238 | #max_standby_streaming_delay = 30s # max delay before canceling queries 239 | # when reading streaming WAL; 240 | # -1 allows indefinite delay 241 | #wal_receiver_status_interval = 10s # send replies at least this often 242 | # 0 disables 243 | #hot_standby_feedback = off # send info from standby to prevent 244 | # query conflicts 245 | #wal_receiver_timeout = 60s # time that receiver waits for 246 | # communication from master 247 | # in milliseconds; 0 disables 248 | 249 | 250 | #------------------------------------------------------------------------------ 251 | # QUERY TUNING 252 | #------------------------------------------------------------------------------ 253 | 254 | # - Planner Method Configuration - 255 | 256 | #enable_bitmapscan = on 257 | #enable_hashagg = on 258 | #enable_hashjoin = on 259 | #enable_indexscan = on 260 | #enable_indexonlyscan = on 261 | #enable_material = on 262 | #enable_mergejoin = on 263 | #enable_nestloop = on 264 | #enable_seqscan = on 265 | #enable_sort = on 266 | #enable_tidscan = on 267 | 268 | # - Planner Cost Constants - 269 | 270 | #seq_page_cost = 1.0 # measured on an arbitrary scale 271 | #random_page_cost = 4.0 # same scale as above 272 | #cpu_tuple_cost = 0.01 # same scale as above 273 | #cpu_index_tuple_cost = 0.005 # same scale as above 274 | #cpu_operator_cost = 0.0025 # same scale as above 275 | #effective_cache_size = 4GB 276 | 277 | # - Genetic Query Optimizer - 278 | 279 | #geqo = on 280 | #geqo_threshold = 12 281 | #geqo_effort = 5 # range 1-10 282 | #geqo_pool_size = 0 # selects default based on effort 283 | #geqo_generations = 0 # selects default based on effort 284 | #geqo_selection_bias = 2.0 # range 1.5-2.0 285 | #geqo_seed = 0.0 # range 0.0-1.0 286 | 287 | # - Other Planner Options - 288 | 289 | #default_statistics_target = 100 # range 1-10000 290 | #constraint_exclusion = partition # on, off, or partition 291 | #cursor_tuple_fraction = 0.1 # range 0.0-1.0 292 | #from_collapse_limit = 8 293 | #join_collapse_limit = 8 # 1 disables collapsing of explicit 294 | # JOIN clauses 295 | 296 | 297 | #------------------------------------------------------------------------------ 298 | # ERROR REPORTING AND LOGGING 299 | #------------------------------------------------------------------------------ 300 | 301 | # - Where to Log - 302 | 303 | #log_destination = 'stderr' # Valid values are combinations of 304 | # stderr, csvlog, syslog, and eventlog, 305 | # depending on platform. csvlog 306 | # requires logging_collector to be on. 307 | 308 | # This is used when logging to stderr: 309 | #logging_collector = off # Enable capturing of stderr and csvlog 310 | # into log files. Required to be on for 311 | # csvlogs. 312 | # (change requires restart) 313 | 314 | # These are only used if logging_collector is on: 315 | #log_directory = 'pg_log' # directory where log files are written, 316 | # can be absolute or relative to PGDATA 317 | #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern, 318 | # can include strftime() escapes 319 | #log_file_mode = 0600 # creation mode for log files, 320 | # begin with 0 to use octal notation 321 | #log_truncate_on_rotation = off # If on, an existing log file with the 322 | # same name as the new log file will be 323 | # truncated rather than appended to. 324 | # But such truncation only occurs on 325 | # time-driven rotation, not on restarts 326 | # or size-driven rotation. Default is 327 | # off, meaning append to existing files 328 | # in all cases. 329 | #log_rotation_age = 1d # Automatic rotation of logfiles will 330 | # happen after that time. 0 disables. 331 | #log_rotation_size = 10MB # Automatic rotation of logfiles will 332 | # happen after that much log output. 333 | # 0 disables. 334 | 335 | # These are relevant when logging to syslog: 336 | #syslog_facility = 'LOCAL0' 337 | #syslog_ident = 'postgres' 338 | 339 | # This is only relevant when logging to eventlog (win32): 340 | #event_source = 'PostgreSQL' 341 | 342 | # - When to Log - 343 | 344 | #client_min_messages = notice # values in order of decreasing detail: 345 | # debug5 346 | # debug4 347 | # debug3 348 | # debug2 349 | # debug1 350 | # log 351 | # notice 352 | # warning 353 | # error 354 | 355 | #log_min_messages = warning # values in order of decreasing detail: 356 | # debug5 357 | # debug4 358 | # debug3 359 | # debug2 360 | # debug1 361 | # info 362 | # notice 363 | # warning 364 | # error 365 | # log 366 | # fatal 367 | # panic 368 | 369 | #log_min_error_statement = error # values in order of decreasing detail: 370 | # debug5 371 | # debug4 372 | # debug3 373 | # debug2 374 | # debug1 375 | # info 376 | # notice 377 | # warning 378 | # error 379 | # log 380 | # fatal 381 | # panic (effectively off) 382 | 383 | #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements 384 | # and their durations, > 0 logs only 385 | # statements running at least this number 386 | # of milliseconds 387 | 388 | 389 | # - What to Log - 390 | 391 | #debug_print_parse = off 392 | #debug_print_rewritten = off 393 | #debug_print_plan = off 394 | #debug_pretty_print = on 395 | #log_checkpoints = off 396 | #log_connections = off 397 | #log_disconnections = off 398 | #log_duration = off 399 | #log_error_verbosity = default # terse, default, or verbose messages 400 | #log_hostname = off 401 | log_line_prefix = '%t [%p-%l] %q%u@%d ' # special values: 402 | # %a = application name 403 | # %u = user name 404 | # %d = database name 405 | # %r = remote host and port 406 | # %h = remote host 407 | # %p = process ID 408 | # %t = timestamp without milliseconds 409 | # %m = timestamp with milliseconds 410 | # %i = command tag 411 | # %e = SQL state 412 | # %c = session ID 413 | # %l = session line number 414 | # %s = session start timestamp 415 | # %v = virtual transaction ID 416 | # %x = transaction ID (0 if none) 417 | # %q = stop here in non-session 418 | # processes 419 | # %% = '%' 420 | # e.g. '<%u%%%d> ' 421 | #log_lock_waits = off # log lock waits >= deadlock_timeout 422 | #log_statement = 'none' # none, ddl, mod, all 423 | #log_temp_files = -1 # log temporary files equal or larger 424 | # than the specified size in kilobytes; 425 | # -1 disables, 0 logs all temp files 426 | log_timezone = 'UTC' 427 | 428 | 429 | #------------------------------------------------------------------------------ 430 | # RUNTIME STATISTICS 431 | #------------------------------------------------------------------------------ 432 | 433 | # - Query/Index Statistics Collector - 434 | 435 | #track_activities = on 436 | #track_counts = on 437 | #track_io_timing = off 438 | #track_functions = none # none, pl, all 439 | #track_activity_query_size = 1024 # (change requires restart) 440 | #update_process_title = on 441 | # stats_temp_directory = '' 442 | 443 | 444 | # - Statistics Monitoring - 445 | 446 | #log_parser_stats = off 447 | #log_planner_stats = off 448 | #log_executor_stats = off 449 | #log_statement_stats = off 450 | 451 | 452 | #------------------------------------------------------------------------------ 453 | # AUTOVACUUM PARAMETERS 454 | #------------------------------------------------------------------------------ 455 | 456 | #autovacuum = on # Enable autovacuum subprocess? 'on' 457 | # requires track_counts to also be on. 458 | #log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and 459 | # their durations, > 0 logs only 460 | # actions running at least this number 461 | # of milliseconds. 462 | #autovacuum_max_workers = 3 # max number of autovacuum subprocesses 463 | # (change requires restart) 464 | #autovacuum_naptime = 1min # time between autovacuum runs 465 | #autovacuum_vacuum_threshold = 50 # min number of row updates before 466 | # vacuum 467 | #autovacuum_analyze_threshold = 50 # min number of row updates before 468 | # analyze 469 | #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum 470 | #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze 471 | #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum 472 | # (change requires restart) 473 | #autovacuum_multixact_freeze_max_age = 400000000 # maximum multixact age 474 | # before forced vacuum 475 | # (change requires restart) 476 | #autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for 477 | # autovacuum, in milliseconds; 478 | # -1 means use vacuum_cost_delay 479 | #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for 480 | # autovacuum, -1 means use 481 | # vacuum_cost_limit 482 | 483 | 484 | #------------------------------------------------------------------------------ 485 | # CLIENT CONNECTION DEFAULTS 486 | #------------------------------------------------------------------------------ 487 | 488 | # - Statement Behavior - 489 | 490 | #search_path = '"$user",public' # schema names 491 | #default_tablespace = '' # a tablespace name, '' uses the default 492 | #temp_tablespaces = '' # a list of tablespace names, '' uses 493 | # only default tablespace 494 | #check_function_bodies = on 495 | #default_transaction_isolation = 'read committed' 496 | #default_transaction_read_only = off 497 | #default_transaction_deferrable = off 498 | #session_replication_role = 'origin' 499 | #statement_timeout = 0 # in milliseconds, 0 is disabled 500 | #lock_timeout = 0 # in milliseconds, 0 is disabled 501 | #vacuum_freeze_min_age = 50000000 502 | #vacuum_freeze_table_age = 150000000 503 | #vacuum_multixact_freeze_min_age = 5000000 504 | #vacuum_multixact_freeze_table_age = 150000000 505 | #bytea_output = 'hex' # hex, escape 506 | #xmlbinary = 'base64' 507 | #xmloption = 'content' 508 | #gin_fuzzy_search_limit = 0 509 | 510 | # - Locale and Formatting - 511 | 512 | datestyle = 'iso, mdy' 513 | #intervalstyle = 'postgres' 514 | timezone = 'UTC' 515 | #timezone_abbreviations = 'Default' # Select the set of available time zone 516 | # abbreviations. Currently, there are 517 | # Default 518 | # Australia (historical usage) 519 | # India 520 | # You can create your own file in 521 | # share/timezonesets/. 522 | #extra_float_digits = 0 # min -15, max 3 523 | #client_encoding = sql_ascii # actually, defaults to database 524 | # encoding 525 | 526 | # These settings are initialized by initdb, but they can be changed. 527 | lc_messages = 'C' # locale for system error message 528 | # strings 529 | lc_monetary = 'C' # locale for monetary formatting 530 | lc_numeric = 'C' # locale for number formatting 531 | lc_time = 'C' # locale for time formatting 532 | 533 | # default configuration for text search 534 | default_text_search_config = 'pg_catalog.english' 535 | 536 | # - Other Defaults - 537 | 538 | #dynamic_library_path = '$libdir' 539 | #local_preload_libraries = '' 540 | #session_preload_libraries = '' 541 | 542 | 543 | #------------------------------------------------------------------------------ 544 | # LOCK MANAGEMENT 545 | #------------------------------------------------------------------------------ 546 | 547 | #deadlock_timeout = 1s 548 | #max_locks_per_transaction = 64 # min 10 549 | # (change requires restart) 550 | # Note: Each lock table slot uses ~270 bytes of shared memory, and there are 551 | # max_locks_per_transaction * (max_connections + max_prepared_transactions) 552 | # lock table slots. 553 | #max_pred_locks_per_transaction = 64 # min 10 554 | # (change requires restart) 555 | 556 | 557 | #------------------------------------------------------------------------------ 558 | # VERSION/PLATFORM COMPATIBILITY 559 | #------------------------------------------------------------------------------ 560 | 561 | # - Previous PostgreSQL Versions - 562 | 563 | #array_nulls = on 564 | #backslash_quote = safe_encoding # on, off, or safe_encoding 565 | #default_with_oids = off 566 | #escape_string_warning = on 567 | #lo_compat_privileges = off 568 | #quote_all_identifiers = off 569 | #sql_inheritance = on 570 | #standard_conforming_strings = on 571 | #synchronize_seqscans = on 572 | 573 | # - Other Platforms and Clients - 574 | 575 | #transform_null_equals = off 576 | 577 | 578 | #------------------------------------------------------------------------------ 579 | # ERROR HANDLING 580 | #------------------------------------------------------------------------------ 581 | 582 | #exit_on_error = off # terminate session on any error? 583 | #restart_after_crash = on # reinitialize after backend crash? 584 | 585 | 586 | #------------------------------------------------------------------------------ 587 | # CONFIG FILE INCLUDES 588 | #------------------------------------------------------------------------------ 589 | 590 | # These options allow settings to be loaded from files other than the 591 | # default postgresql.conf. 592 | 593 | #include_dir = 'conf.d' # include files ending in '.conf' from 594 | # directory 'conf.d' 595 | #include_if_exists = 'exists.conf' # include file only if it exists 596 | #include = 'special.conf' # include file 597 | 598 | 599 | #------------------------------------------------------------------------------ 600 | # CUSTOMIZED OPTIONS 601 | #------------------------------------------------------------------------------ 602 | 603 | # Add settings for extensions here 604 | -------------------------------------------------------------------------------- /common/supervisor/etc/supervisord.conf: -------------------------------------------------------------------------------- 1 | [unix_http_server] 2 | file=/var/run/supervisor.sock 3 | chmod=0700 4 | 5 | [supervisord] 6 | logfile=/var/log/supervisor/supervisord.log 7 | pidfile=/var/run/supervisord.pid 8 | childlogdir=/var/log/supervisor 9 | 10 | [include] 11 | files=/etc/supervisor.d/*.conf 12 | 13 | [rpcinterface:supervisor] 14 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 15 | 16 | [supervisorctl] 17 | serverurl=unix:///var/run/supervisor.sock 18 | 19 | [program:postgresql] 20 | user=postgres 21 | command=/usr/lib/postgresql/9.6/bin/postgres -D "/opt/stellar/postgresql/data" -c config_file=/opt/stellar/postgresql/etc/postgresql.conf 22 | stopsignal=INT 23 | autostart=true 24 | autorestart=true 25 | priority=10 26 | 27 | [program:stellar-core] 28 | user=stellar 29 | directory=/opt/stellar/core 30 | command=/opt/stellar/core/bin/start 31 | autostart=true 32 | autorestart=true 33 | priority=20 34 | 35 | [program:horizon] 36 | user=stellar 37 | directory=/opt/stellar/horizon 38 | command=/opt/stellar/horizon/bin/start 39 | autostart=true 40 | autorestart=true 41 | priority=30 42 | 43 | [program:bridge] 44 | user=stellar 45 | directory=/opt/stellar/bridge 46 | command=/opt/stellar/bridge/bin/start 47 | autostart=true 48 | autorestart=true 49 | priority=40 50 | 51 | [program:friendbot] 52 | user=stellar 53 | directory=/opt/stellar/friendbot 54 | command=/opt/stellar/friendbot/bin/start 55 | autostart=true 56 | autorestart=true 57 | priority=50 -------------------------------------------------------------------------------- /integrationnet/bridge/etc/bridge.cfg: -------------------------------------------------------------------------------- 1 | # Bridge server for managing operations on the integration test network 2 | 3 | port = 8006 4 | horizon = "http://localhost:8000" 5 | network_passphrase = "__NETWORK__" 6 | api_key = "" 7 | mac_key = "" 8 | 9 | [database] 10 | type = "postgres" 11 | url = "postgres://stellar:__PGPASS__@localhost/bridge" 12 | 13 | [accounts] 14 | # master seed for the test network 15 | base_seed = "__ROOT_ACCOUNT_SEED__" 16 | -------------------------------------------------------------------------------- /integrationnet/core/etc/stellar-core.cfg: -------------------------------------------------------------------------------- 1 | HTTP_PORT=11626 2 | PUBLIC_HTTP_PORT=true 3 | RUN_STANDALONE=true 4 | 5 | NETWORK_PASSPHRASE="Integration Test Network ; zulucrypto" 6 | NODE_SEED="SAN5UBIW3RMVT5FIJZUB2F7JVGXE4AEJLENVSQ7TO42I7UU2TZTBKXGX self" 7 | NODE_IS_VALIDATOR=true 8 | 9 | DATABASE="postgresql://dbname=core host=localhost user=stellar password=__PGPASS__" 10 | 11 | UNSAFE_QUORUM=true 12 | FAILURE_SAFETY=0 13 | 14 | # This node is the only one in the quorum set 15 | [QUORUM_SET] 16 | THRESHOLD_PERCENT=100 # rounded up -> 2 nodes out of 3 17 | VALIDATORS=["$self"] 18 | 19 | [HISTORY.vs] 20 | get="cp /tmp/stellar-core/history/vs/{0} {1}" 21 | put="cp {0} /tmp/stellar-core/history/vs/{1}" 22 | mkdir="mkdir -p /tmp/stellar-core/history/vs/{0}" -------------------------------------------------------------------------------- /integrationnet/home/fixtures/load.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # Bridge server must be started 5 | while ! curl --fail -X POST http://localhost:8006/create-keypair &> /dev/null ; do 6 | echo "Waiting for bridge server to be available..." 7 | sleep 1 8 | done 9 | 10 | # Horizon must be started and responding to requests 11 | while ! curl --fail http://localhost:8000 |grep protocol_version &> /dev/null ; do 12 | echo "Waiting for Horizon to be available..." 13 | sleep 1 14 | done 15 | 16 | # Friendbot must be started and giving the error message about an invalid request 17 | # This is normal behavior when a parameter is missing but everything else is working 18 | # as expected. 19 | while ! curl http://localhost:8004 |grep reason &> /dev/null ; do 20 | echo "Waiting for Friendbot to be available..." 21 | sleep 1 22 | done 23 | 24 | # Only run fixtures once 25 | if [ -f /opt/stellar/.fixtures-initialized ]; then 26 | echo "Fixtures already initialized" 27 | exit 0 28 | fi 29 | 30 | # Apply protocol upgrades and match current production network 31 | # Protocol version 9 32 | # Base reserve 0.5 XLM (5000000 stroops) 33 | stellar-core --c "upgrades?mode=set&upgradetime=2000-01-01T00:00:00Z&protocolversion=9&basereserve=5000000" 34 | 35 | # 36 | # Friendbot account (used to fund other accounts) 37 | # This is funded from the root account via stellar bridge 38 | # SDXHNTECJ63VVROJJT3A2NVZZ4XSQY77UM76TWJL536KO34UVHFAOQZZ 39 | # 40 | curl --fail -X POST http://localhost:8006/payment \ 41 | -d "amount=10000000&destination=GBH2M7PZBC6GK4Q4AQLMK3MZ4WKUJ73NYHBCW5VCYOSZTAJFB2QLRCKZ" 42 | echo "Friendbot funded" 43 | 44 | 45 | # 46 | # Simple accounts funded by friendbot 47 | # 48 | 49 | # Purpose: basic testing account #1 50 | # Address: GAJCCCRIRXAYEU2ATNQAFYH4E2HKLN2LCKM2VPXCTJKIBVTRSOLEGCJZ 51 | # Seed : SDJCZISO5M5XAUV6Y7MZJNN3JZ5BWPXDHV4GXP3MYNACVDNQRQSERXBC 52 | curl --fail http://localhost:8004?addr=GAJCCCRIRXAYEU2ATNQAFYH4E2HKLN2LCKM2VPXCTJKIBVTRSOLEGCJZ 53 | 54 | 55 | # Purpose: basic testing account #2 56 | # Address: GCP6IHMHWRCF5TQ4ZP6TVIRNDZD56W42F42VHYWMVDGDAND75YGAHHBQ 57 | # Seed : SCEDMZ7DUEOUGRQWEXHXEXISQ2NAWI5IDXRHYWT2FHTYLIQOSUK5FX2E 58 | curl --fail http://localhost:8004?addr=GCP6IHMHWRCF5TQ4ZP6TVIRNDZD56W42F42VHYWMVDGDAND75YGAHHBQ 59 | 60 | # Purpose: basic testing account #3 61 | # Address: GAPSWEVEZVAOTW6AJM26NIVBITCKXNOMGBZAOPFTFDTJGKYCIIPVI4RJ 62 | # Seed : SBY7ZNSKQ3CDHH34RUWVIUCMM7UEWWFTCM6ORFT5QTE77JGDFCBGXSU5 63 | curl --fail http://localhost:8004?addr=GAPSWEVEZVAOTW6AJM26NIVBITCKXNOMGBZAOPFTFDTJGKYCIIPVI4RJ -------------------------------------------------------------------------------- /integrationnet/supervisor.d/fixtures.conf: -------------------------------------------------------------------------------- 1 | [program:fixtures] 2 | user=stellar 3 | command=/home/stellar/fixtures/load.sh 4 | autostart=true 5 | autorestart=false 6 | priority=1000 -------------------------------------------------------------------------------- /pubnet/core/etc/stellar-core.cfg: -------------------------------------------------------------------------------- 1 | HTTP_PORT=11626 2 | PUBLIC_HTTP_PORT=true 3 | LOG_FILE_PATH="" 4 | 5 | DATABASE="postgresql://dbname=core host=localhost user=stellar password=__PGPASS__" 6 | NETWORK_PASSPHRASE="Public Global Stellar Network ; September 2015" 7 | CATCHUP_RECENT=8640 8 | 9 | 10 | NODE_NAMES=[ 11 | "GAOO3LWBC4XF6VWRP5ESJ6IBHAISVJMSBTALHOQM2EZG7Q477UWA6L7U eno", 12 | "GAXP5DW4CVCW2BJNPFGTWCEGZTJKTNWFQQBE5SCWNJIJ54BOHR3WQC3W moni", 13 | "GBFZFQRGOPQC5OEAWO76NOY6LBRLUNH4I5QYPUYAK53QSQWVTQ2D4FT5 dzham", 14 | "GDXWQCSKVYAJSUGR2HBYVFVR7NA7YWYSYK3XYKKFO553OQGOHAUP2PX2 jianing", 15 | "GCJCSMSPIWKKPR7WEPIQG63PDF7JGGEENRC33OKVBSPUDIRL6ZZ5M7OO tempo.eu.com", 16 | "GCCW4H2DKAC7YYW62H3ZBDRRE5KXRLYLI4T5QOSO6EAMUOE37ICSKKRJ sparrow_tw", 17 | "GD5DJQDDBKGAYNEAXU562HYGOOSYAEOO6AS53PZXBOZGCP5M2OPGMZV3 fuxi.lab", 18 | "GBGGNBZVYNMVLCWNQRO7ASU6XX2MRPITAGLASRWOWLB4ZIIPHMGNMC4I huang.lab", 19 | "GDPJ4DPPFEIP2YTSQNOKT7NMLPKU2FFVOEIJMG36RCMBWBUR4GTXLL57 nezha.lab", 20 | "GCDLFPQ76D6YUSCUECLKI3AFEVXFWVRY2RZH2YQNYII35FDECWUGV24T SnT.Lux", 21 | "GBAR4OY6T6M4P344IF5II5DNWHVUJU7OLQPSMG2FWVJAFF642BX5E3GB telindus", 22 | # non validating 23 | "GCGB2S2KGYARPVIA37HYZXVRM2YZUEXA6S33ZU5BUDC6THSB62LZSTYH sdf_watcher1", 24 | "GCM6QMP3DLRPTAZW2UZPCPX2LF3SXWXKPMP3GKFZBDSF3QZGV2G5QSTK sdf_watcher2", 25 | "GABMKJM6I25XI4K7U6XWMULOUQIQ27BCTMLS6BYYSOWKTBUXVRJSXHYQ sdf_watcher3", 26 | # seem down 27 | "GB6REF5GOGGSEHZ3L2YK6K4T4KX3YDMWHDCPMV7MZJDLHBDNZXEPRBGM donovan", 28 | "GBGR22MRCIVW2UZHFXMY5UIBJGPYABPQXQ5GGMNCSUM2KHE3N6CNH6G5 nelisky1", 29 | "GA2DE5AQF32LU5OZ5OKAFGPA2DLW4H6JHPGYJUVTNS3W7N2YZCTQFFV6 nelisky2", 30 | "GDJ73EX25GGUVMUBCK6DPSTJLYP3IC7I3H2URLXJQ5YP56BW756OUHIG w00kie", 31 | "GAM7A32QZF5PJASRSGVFPAB36WWTHCBHO5CHG3WUFTUQPT7NZX3ONJU4 ptarasov" 32 | ] 33 | 34 | KNOWN_PEERS=[ 35 | "core-live-a.stellar.org:11625", 36 | "core-live-b.stellar.org:11625", 37 | "core-live-c.stellar.org:11625", 38 | "confucius.strllar.org", 39 | "stellar1.bitventure.co", 40 | "stellar.256kw.com"] 41 | 42 | [QUORUM_SET] 43 | VALIDATORS=[ 44 | "$sdf_watcher1","$eno","$tempo.eu.com","$sdf_watcher2","$sdf_watcher3" 45 | ] 46 | 47 | [HISTORY.cache] 48 | get="cp /opt/stellar/history-cache/{0} {1}" 49 | 50 | # Stellar.org history store 51 | [HISTORY.sdf1] 52 | get="curl -sf http://history.stellar.org/prd/core-live/core_live_001/{0} -o {1}" 53 | 54 | [HISTORY.sdf2] 55 | get="curl -sf http://history.stellar.org/prd/core-live/core_live_002/{0} -o {1}" 56 | 57 | [HISTORY.sdf3] 58 | get="curl -sf http://history.stellar.org/prd/core-live/core_live_003/{0} -o {1}" 59 | -------------------------------------------------------------------------------- /start: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | set -e 3 | 4 | export STELLAR_HOME="/opt/stellar" 5 | export PGHOME="$STELLAR_HOME/postgresql" 6 | export SUPHOME="$STELLAR_HOME/supervisor" 7 | export COREHOME="$STELLAR_HOME/core" 8 | export HZHOME="$STELLAR_HOME/horizon" 9 | export BRIDGEHOME="$STELLAR_HOME/bridge" 10 | export FRIENDBOTHOME="$STELLAR_HOME/friendbot" 11 | 12 | export PGBIN="/usr/lib/postgresql/9.6/bin" 13 | export PGDATA="$PGHOME/data" 14 | export PGUSER="stellar" 15 | export PGPORT=5432 16 | 17 | QUICKSTART_INITIALIZED=false 18 | CURRENT_POSTGRES_PID="" 19 | 20 | 21 | # NOTE: not configurable, generated by network and updated in init_stellar_core 22 | ROOT_ACCOUNT_SEED="" 23 | 24 | function main() { 25 | echo "" 26 | echo "Starting Stellar Quickstart" 27 | echo "" 28 | 29 | process_args $* 30 | 31 | echo "mode: $STELLAR_MODE" 32 | echo "network: $NETWORK ($NETWORK_PASSPHRASE)" 33 | 34 | # custom supervisord scripts 35 | init_supervisor_custom 36 | 37 | copy_defaults 38 | init_db 39 | init_stellar_core 40 | init_bridge_server # must come after init_stellar_core! 41 | init_horizon 42 | init_friendbot 43 | copy_pgpass 44 | 45 | stop_postgres # this gets started in init_db 46 | 47 | echo "**************************************************************" 48 | echo "Starting Stellar services..." 49 | echo "" 50 | echo "Stellar Core v10.0.0-685-1fc018b4" 51 | echo "Horizon v0.15.1" 52 | echo "Bridge v0.0.31" 53 | echo "Friendbot v0.0.1" 54 | echo "**************************************************************" 55 | 56 | # launch services 57 | exec_supervisor 58 | } 59 | 60 | function process_args() { 61 | while [[ -n "$1" ]]; do 62 | ARG="$1" 63 | shift 64 | 65 | case "${ARG}" in 66 | --testnet) 67 | NETWORK="testnet" 68 | ;; 69 | --pubnet) 70 | NETWORK="pubnet" 71 | ;; 72 | --integrationnet) 73 | NETWORK="integrationnet" 74 | ;; 75 | *) 76 | echo "Unknown container arg $ARG" >&2 77 | exit 1 78 | esac 79 | done 80 | 81 | # TODO: ask for what network to use 82 | if [ -z "$NETWORK" ]; then 83 | NETWORK="testnet" 84 | fi 85 | 86 | case "$NETWORK" in 87 | testnet) 88 | export NETWORK_PASSPHRASE="Test SDF Network ; September 2015" 89 | ;; 90 | pubnet) 91 | export NETWORK_PASSPHRASE="Public Global Stellar Network ; September 2015" 92 | ;; 93 | integrationnet) 94 | export NETWORK_PASSPHRASE="Integration Test Network ; zulucrypto" 95 | ;; 96 | *) 97 | echo "Unknown network: '$NETWORK'" >&2 98 | exit 1 99 | esac 100 | 101 | # Are we ephemeral or persistent? 102 | if [ -z "$STELLAR_MODE" ]; then 103 | if [ -f "/opt/stellar/.docker-ephemeral" ]; then 104 | STELLAR_MODE="ephemeral" 105 | else 106 | STELLAR_MODE="persistent" 107 | fi 108 | fi 109 | } 110 | 111 | function set_pg_password() { 112 | # use a random password when ephemeral (or some other unknown mode) 113 | if [ "$STELLAR_MODE" != "persistent" ]; then 114 | PGPASS=$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 16) 115 | echo "postgres password: $PGPASS" 116 | return 0 117 | fi 118 | 119 | if [ -n "$PGPASS" ]; then 120 | echo "postgres password: $PGPASS" 121 | return 0 122 | fi 123 | 124 | # ask for a password when persistent 125 | read -s -p "Enter New Postgresql Password: " PGPASS 126 | echo "" 127 | read -s -p "Confirm: " PGPASS_CONFIRMATION 128 | echo "" 129 | 130 | if [ -z "$PGPASS" ]; then 131 | echo "Password empty" >&2 132 | exit 1 133 | fi 134 | 135 | if [ "$PGPASS" != "$PGPASS_CONFIRMATION" ]; then 136 | echo "Password mistmach" >&2 137 | exit 1 138 | fi 139 | 140 | } 141 | 142 | function copy_defaults() { 143 | local CP="rsync -a" 144 | 145 | if [ -d $PGHOME/etc ]; then 146 | echo "postgres: config directory exists, skipping copy" 147 | else 148 | $CP /opt/stellar-default/common/postgresql/ $PGHOME 149 | fi 150 | 151 | if [ -d $SUPHOME/etc ]; then 152 | echo "supervisor: config directory exists, skipping copy" 153 | else 154 | $CP /opt/stellar-default/common/supervisor/ $SUPHOME 155 | fi 156 | 157 | if [ -d $COREHOME/etc ]; then 158 | echo "stellar-core: config directory exists, skipping copy" 159 | else 160 | $CP /opt/stellar-default/common/core/ $COREHOME 161 | $CP /opt/stellar-default/$NETWORK/core/ $COREHOME 162 | fi 163 | 164 | if [ -d $HZHOME/etc ]; then 165 | echo "horizon: config directory exists, skipping copy" 166 | else 167 | $CP /opt/stellar-default/common/horizon/ $HZHOME 168 | fi 169 | 170 | if [ -d $BRIDGEHOME/etc ]; then 171 | echo "bridge: config directory exists, skipping copy" 172 | else 173 | $CP /opt/stellar-default/common/bridge/ $BRIDGEHOME 174 | $CP /opt/stellar-default/$NETWORK/bridge/ $BRIDGEHOME 175 | fi 176 | } 177 | 178 | function copy_pgpass() { 179 | local CP="rsync -a" 180 | 181 | $CP /opt/stellar/postgresql/.pgpass /root/ 182 | chmod 0600 /root/.pgpass 183 | 184 | $CP /opt/stellar/postgresql/.pgpass /home/stellar 185 | chmod 0600 /home/stellar/.pgpass 186 | chown stellar:stellar /home/stellar/.pgpass 187 | } 188 | 189 | function init_supervisor_custom() { 190 | local CP="rsync -a" 191 | 192 | if [ "$NETWORK" == "integrationnet" ]; then 193 | echo "init-supervisor-custom: copying integrationnet scripts" 194 | $CP /opt/stellar-default/$NETWORK/supervisor.d/ /etc/supervisor.d/ 195 | $CP /opt/stellar-default/$NETWORK/home/fixtures/ /home/stellar/fixtures/ 196 | fi 197 | } 198 | 199 | function init_db() { 200 | if [ -f $PGHOME/.quickstart-initialized ]; then 201 | echo "postgres: already initialized" 202 | return 0 203 | fi 204 | pushd $PGHOME 205 | 206 | # workaround!!!! from: https://github.com/nimiq/docker-postgresql93/issues/2 207 | mkdir /etc/ssl/private-copy; mv /etc/ssl/private/* /etc/ssl/private-copy/; rm -r /etc/ssl/private; mv /etc/ssl/private-copy /etc/ssl/private; chmod -R 0700 /etc/ssl/private; chown -R postgres /etc/ssl/private 208 | # end workaround 209 | 210 | echo "postgres user: $PGUSER" 211 | 212 | set_pg_password 213 | 214 | run_silent "finalize-pgpass" sed -ri "s/__PGPASS__/$PGPASS/g" /opt/stellar/postgresql/.pgpass 215 | 216 | mkdir -p $PGDATA 217 | chown postgres:postgres $PGDATA 218 | chmod 0700 $PGDATA 219 | 220 | run_silent "init-postgres" sudo -u postgres $PGBIN/initdb -D $PGDATA 221 | 222 | start_postgres 223 | run_silent "create-horizon-db" sudo -u postgres createdb horizon 224 | run_silent "create-core-db" sudo -u postgres createdb core 225 | run_silent "create-bridge-db" sudo -u postgres createdb bridge 226 | 227 | run_silent "stellar-postgres-user" sudo -u postgres psql <<-SQL 228 | CREATE USER $PGUSER WITH PASSWORD '$PGPASS'; 229 | GRANT ALL PRIVILEGES ON DATABASE horizon to $PGUSER; 230 | GRANT ALL PRIVILEGES ON DATABASE core to $PGUSER; 231 | GRANT ALL PRIVILEGES ON DATABASE bridge to $PGUSER; 232 | SQL 233 | 234 | touch .quickstart-initialized 235 | popd 236 | } 237 | 238 | function init_stellar_core() { 239 | if [ -f $COREHOME/.quickstart-initialized ]; then 240 | echo "core: already initialized" 241 | return 0 242 | fi 243 | pushd $COREHOME 244 | 245 | run_silent "chown-core" chown stellar:stellar . 246 | run_silent "finalize-core-config" sed -ri "s/__PGPASS__/$PGPASS/g" etc/stellar-core.cfg 247 | 248 | start_postgres 249 | run_silent "init-core-db" sudo -u stellar stellar-core --newdb --conf etc/stellar-core.cfg 250 | 251 | # get master seed from the file that run_silent generates 252 | ROOT_ACCOUNT_SEED=$(grep "Root account seed" /tmp/run_silent.out | cut -d' ' -f 8) 253 | echo "Root Seed: ${ROOT_ACCOUNT_SEED}" 254 | 255 | # integration test network is standalone and needs additional setup 256 | if [ "$NETWORK" == "integrationnet" ]; then 257 | run_silent "init-core-scp" sudo -u stellar stellar-core --forcescp --conf etc/stellar-core.cfg 258 | fi 259 | 260 | touch .quickstart-initialized 261 | popd 262 | } 263 | 264 | # NOTE: must be run after init_stellar_core since it requires $ROOT_ACCOUNT_SEED 265 | function init_bridge_server() { 266 | if [ -f $BRIDGEHOME/.quickstart-initialized ]; then 267 | echo "bridge: already initialized" 268 | return 0 269 | fi 270 | pushd $BRIDGEHOME 271 | 272 | run_silent "chown-bridge" chown stellar:stellar . 273 | 274 | sed -ri \ 275 | -e "s/__PGPASS__/$PGPASS/g" \ 276 | -e "s/__NETWORK__/$NETWORK_PASSPHRASE/g" \ 277 | -e "s/__ROOT_ACCOUNT_SEED__/$ROOT_ACCOUNT_SEED/g" \ 278 | etc/bridge.cfg 279 | 280 | touch .quickstart-initialized 281 | popd 282 | } 283 | 284 | function init_horizon() { 285 | if [ -f $HZHOME/.quickstart-initialized ]; then 286 | echo "horizon: already initialized" 287 | return 0 288 | fi 289 | pushd $HZHOME 290 | 291 | run_silent "chown-horizon" chown stellar:stellar . 292 | 293 | sed -ri \ 294 | -e "s/__PGPASS__/$PGPASS/g" \ 295 | -e "s/__NETWORK__/$NETWORK_PASSPHRASE/g" \ 296 | etc/horizon.env 297 | 298 | start_postgres 299 | run_silent "init-horizon-db" sudo -u stellar ./bin/horizon db init 300 | 301 | touch .quickstart-initialized 302 | popd 303 | } 304 | 305 | function init_friendbot() { 306 | if [ -f $FRIENDBOTHOME/.quickstart-initialized ]; then 307 | echo "friendbot: already initialized" 308 | return 0 309 | fi 310 | 311 | cp -R /opt/stellar-default/common/friendbot/ $FRIENDBOTHOME 312 | 313 | pushd $FRIENDBOTHOME 314 | 315 | run_silent "chown-friendbot" chown stellar:stellar . 316 | 317 | touch .quickstart-initialized 318 | popd 319 | } 320 | 321 | function exec_supervisor() { 322 | echo "starting suervisor" 323 | exec supervisord -n -c $SUPHOME/etc/supervisord.conf 324 | } 325 | 326 | # run_silent is a utility function that runs a command with an abbreviated 327 | # output provided it succeeds. 328 | function run_silent() { 329 | local LABEL=$1 330 | shift 331 | local COMMAND=$1 332 | shift 333 | local ARGS=$@ 334 | local OUTFILE="/tmp/run_silent.out" 335 | 336 | echo -n "$LABEL: " 337 | set +e 338 | 339 | $COMMAND $ARGS &> $OUTFILE 340 | 341 | if [ $? -eq 0 ]; then 342 | echo "ok" 343 | else 344 | echo "failed!" 345 | echo "" 346 | cat $OUTFILE 347 | exit 1 348 | fi 349 | 350 | set -e 351 | } 352 | 353 | function start_postgres() { 354 | if [ ! -z "$CURRENT_POSTGRES_PID" ]; then 355 | return 0 356 | fi 357 | 358 | sudo -u postgres $PGBIN/postgres -D $PGDATA -c config_file=$PGHOME/etc/postgresql.conf &> /dev/null & 359 | CURRENT_POSTGRES_PID=$! 360 | 361 | while ! sudo -u postgres psql -c 'select 1' &> /dev/null ; do 362 | echo "Waiting for postgres to be available..." 363 | sleep 1 364 | done 365 | 366 | echo "postgres: up" 367 | } 368 | 369 | function stop_postgres() { 370 | echo "Stopping: '$CURRENT_POSTGRES_PID'" 371 | if [ -z "$CURRENT_POSTGRES_PID" ]; then 372 | return 0 373 | fi 374 | 375 | # wait for postgres to die 376 | while kill -0 "$CURRENT_POSTGRES_PID" &> /dev/null; do 377 | # If kill doesn't work, use "killall" on subsequent runs since the PID may be invalid 378 | killall postgres 379 | sleep 5 380 | done 381 | echo "postgres: down" 382 | } 383 | 384 | pushd () { 385 | command pushd "$@" > /dev/null 386 | } 387 | 388 | popd () { 389 | command popd "$@" > /dev/null 390 | } 391 | 392 | main $@ 393 | -------------------------------------------------------------------------------- /testnet/core/etc/stellar-core.cfg: -------------------------------------------------------------------------------- 1 | HTTP_PORT=11626 2 | PUBLIC_HTTP_PORT=true 3 | LOG_FILE_PATH="" 4 | 5 | NETWORK_PASSPHRASE="Test SDF Network ; September 2015" 6 | 7 | KNOWN_PEERS=[ 8 | "core-testnet1.stellar.org", 9 | "core-testnet2.stellar.org", 10 | "core-testnet3.stellar.org"] 11 | 12 | DATABASE="postgresql://dbname=core host=localhost user=stellar password=__PGPASS__" 13 | UNSAFE_QUORUM=true 14 | FAILURE_SAFETY=1 15 | CATCHUP_RECENT=8640 16 | 17 | #The public keys of the Stellar testnet servers 18 | [QUORUM_SET] 19 | THRESHOLD_PERCENT=51 # rounded up -> 2 nodes out of 3 20 | VALIDATORS=[ 21 | "GDKXE2OZMJIPOSLNA6N6F2BVCI3O777I2OOC4BV7VOYUEHYX7RTRYA7Y sdf1", 22 | "GCUCJTIYXSOXKBSNFGNFWW5MUQ54HKRPGJUTQFJ5RQXZXNOLNXYDHRAP sdf2", 23 | "GC2V2EFSXN6SQTWVYA5EPJPBWWIMSD2XQNKUOHGEKB535AQE2I6IXV2Z sdf3"] 24 | 25 | [HISTORY.cache] 26 | get="cp /opt/stellar/history-cache/{0} {1}" 27 | 28 | #The history store of the Stellar testnet 29 | [HISTORY.h1] 30 | get="curl -sf http://history.stellar.org/prd/core-testnet/core_testnet_001/{0} -o {1}" 31 | 32 | [HISTORY.h2] 33 | get="curl -sf http://history.stellar.org/prd/core-testnet/core_testnet_002/{0} -o {1}" 34 | 35 | [HISTORY.h3] 36 | get="curl -sf http://history.stellar.org/prd/core-testnet/core_testnet_003/{0} -o {1}" --------------------------------------------------------------------------------