Skip to content

Commit

Permalink
Merge branch 'master' into tsachi/add-high-limit-override
Browse files Browse the repository at this point in the history
  • Loading branch information
tsachiherman committed Sep 18, 2023
2 parents 143c13a + f19b628 commit 8774ce4
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 59 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build-soroban-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
with:
arch: amd64
tag: soroban-dev-amd64
core_ref: soroban-preview-10-July20
core_configure_flags: --disable-tests --enable-next-protocol-version-unsafe-for-production
go_ref: soroban-v0.0.9.1
soroban_tools_ref: v0.9.2
core_ref: v20.0.0rc1
core_configure_flags: --disable-tests
go_ref: soroban-v1.0.0-rc
soroban_tools_ref: v20.0.0-rc1
test_matrix: |
{
"network": ["standalone"],
Expand All @@ -52,11 +52,11 @@ jobs:
with:
arch: arm64
tag: soroban-dev-arm64
core_ref: soroban-preview-10-July20
core_configure_flags: --disable-tests --enable-next-protocol-version-unsafe-for-production
core_ref: v20.0.0rc1
core_configure_flags: --disable-tests
core_build_runner_type: ubuntu-latest-16-cores
go_ref: soroban-v0.0.9.1
soroban_tools_ref: v0.9.2
go_ref: soroban-v1.0.0-rc
soroban_tools_ref: v20.0.0-rc1
soroban_rpc_build_runner_type: ubuntu-latest-16-cores
test_matrix: |
{
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ EXPOSE 11625
EXPOSE 11626

ADD dependencies /
RUN ["chmod", "+x", "dependencies"]
RUN /dependencies

RUN apt-get -y install libunwind8 postgresql curl sqlite libc++abi1-12 libc++1-12
COPY --from=stellar-core /usr/local/bin/stellar-core /usr/bin/stellar-core

COPY --from=horizon /go/bin/horizon /usr/bin/stellar-horizon
Expand Down
54 changes: 39 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,51 @@
__PHONY__: build build-deps
__PHONY__: run logs build build-deps build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc

TAG?=dev
CORE_REF?=master
CORE_CONFIGURE_FLAGS?=--disable-tests
SOROBAN_TOOLS_REF?=main
GO_REF?=$(shell ./scripts/soroban_repo_to_horizon_repo.sh $(SOROBAN_TOOLS_REF))
SOROBAN_RPC_REF?=main
HORIZON_REF?=$(shell ./scripts/soroban_repo_to_horizon_repo.sh $(SOROBAN_RPC_REF))
FRIENDBOT_REF?=$(HORIZON_REF)

run:
docker run --rm --name stellar -p 8000:8000 stellar/quickstart:$(TAG) --standalone --enable-soroban-rpc

logs:
docker exec stellar /bin/sh -c 'tail -F /var/log/supervisor/*'

build-latest:
$(MAKE) build TAG=latest \
CORE_REF=v19.13.0 \
HORIZON_REF=horizon-v2.26.1 \
SOROBAN_RPC_REF=v0.4.0

build-testing:
$(MAKE) build TAG=testing \
CORE_REF=v19.13.0 \
HORIZON_REF=horizon-v2.26.1 \
SOROBAN_RPC_REF=v0.4.0

build-soroban-dev:
$(MAKE) build TAG=soroban-dev \
CORE_REF=v20.0.0rc1 \
CORE_CONFIGURE_FLAGS='--disable-tests' \
HORIZON_REF=soroban-v1.0.0-rc \
SOROBAN_RPC_REF=v20.0.0-rc1

build:
$(MAKE) -j 4 build-deps
docker build -t stellar/quickstart:$(TAG) -f Dockerfile . --build-arg STELLAR_CORE_IMAGE_REF=stellar-core:$(CORE_REF) --build-arg HORIZON_IMAGE_REF=stellar-horizon:$(HORIZON_REF) --build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:$(FRIENDBOT_REF) --build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:$(SOROBAN_RPC_REF)

build-deps: build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc

build-deps-core:
docker build -t stellar-core:$(TAG) -f docker/Dockerfile.testing https://github.com/stellar/stellar-core.git#$(CORE_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true --build-arg CONFIGURE_FLAGS="$(CORE_CONFIGURE_FLAGS)"
docker build -t stellar-core:$(CORE_REF) -f docker/Dockerfile.testing https://github.com/stellar/stellar-core.git#$(CORE_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true --build-arg CONFIGURE_FLAGS="$(CORE_CONFIGURE_FLAGS)"

build-deps-horizon:
docker build -t stellar-horizon:$(TAG) -f Dockerfile.horizon --target builder . --build-arg REF="$(GO_REF)"
docker build -t stellar-horizon:$(HORIZON_REF) -f Dockerfile.horizon --target builder . --build-arg REF="$(HORIZON_REF)"

build-deps-friendbot:
docker build -t stellar-friendbot:$(TAG) -f services/friendbot/docker/Dockerfile https://github.com/stellar/go.git#$(GO_REF)
docker build -t stellar-friendbot:$(FRIENDBOT_REF) -f services/friendbot/docker/Dockerfile https://github.com/stellar/go.git#$(FRIENDBOT_REF)

build-deps-soroban-rpc:
docker build -t stellar-soroban-rpc:$(TAG) -f cmd/soroban-rpc/docker/Dockerfile --target build https://github.com/stellar/soroban-tools.git#$(SOROBAN_TOOLS_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true

# the build-deps have the four dependencies for the building of the
# dockers for core, horizon, friendbot and soroban-rpc. Specifying these as dependencies
# allow the make to run these in parallel when sufficient paralalism is specified using the -j option.
build-deps: build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc

build: build-deps
docker build -t stellar/quickstart:$(TAG) -f Dockerfile . --build-arg STELLAR_CORE_IMAGE_REF=stellar-core:$(TAG) --build-arg HORIZON_IMAGE_REF=stellar-horizon:$(TAG) --build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:$(TAG) --build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:$(TAG)
docker build -t stellar-soroban-rpc:$(SOROBAN_RPC_REF) -f cmd/soroban-rpc/docker/Dockerfile --target build https://github.com/stellar/soroban-tools.git#$(SOROBAN_RPC_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true
34 changes: 5 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ As part of launching, an ephemeral mode container will generate a random passwor

### Persistent mode

In comparison to ephemeral mode, persistent mode is more complicated to operate, but also more powerful. Persistent mode uses a mounted host volume, a directory on the host machine that is exposed to the running docker container, to store all database data as well as the configuration files used for running services. This allows you to manage and modify these files from the host system.
In comparison to ephemeral mode, persistent mode is more complicated to operate, but also more powerful. Persistent mode uses a mounted host volume, a directory on the host machine that is exposed to the running docker container, to store all database data as well as the configuration files used for running services. This allows you to manage and modify these files from the host system.

Note that there is no guarantee that the organization of the files of the volume will remain consistent between releases of the image, that occur on every commit to the stellar/quickstart repository. At anytime new files may be added, old files removed, or dependencies and references between them changed. For this reason persistent mode is primarily intended for running short lived test instances for development. If consistency is required over any period of time use [image digest references] to pin to a specific build.

[image digest references]: https://docs.docker.com/engine/reference/run/#imagedigest

Starting a persistent mode container is the same as the ephemeral mode with one exception:

Expand All @@ -187,34 +191,6 @@ Upon launching a persistent mode container for the first time, the launch script
2. Shut down the interactive container (using Ctrl-C).
3. Start a new container using the same host directory in the background.


### Customizing configurations

To customize the configurations that both stellar-core and horizon use, you must use persistent mode. The default configurations will be copied into the data directory upon launching a persistent mode container for the first time. Use the diagram below to learn about the various configuration files that can be customized.

```
/opt/stellar
|-- core
| `-- etc
| `-- stellar-core.cfg # Stellar core config
|-- horizon
| `-- etc
| `-- horizon.env # A shell script that exports horizon's config
|-- postgresql
| `-- etc
| |-- postgresql.conf # Postgresql root configuration file
| |-- pg_hba.conf # Postgresql client configuration file
| `-- pg_ident.conf # Postgresql user mapping file
`-- supervisor
`-- etc
| `-- supervisord.conf # Supervisord root configuration
```

It is recommended that you stop the container before editing any of these files, then restart the container after completing your customization.

*NOTE:* Be wary of editing these files. It is possible to break the services started within this container with a bad edit. It's recommended that you learn about managing the operations of each of the services before customizing them, as you are taking responsibility for maintaining those services going forward.


## Regarding user accounts

Managing UIDs between a docker container and a host volume can be complicated. At present, this image simply tries to create a UID that does not conflict with the host system by using a preset UID: 10011001. Currently there is no way to customize this value. All data produced in the host volume be owned by 10011001. If this UID value is inappropriate for your infrastructure we recommend you fork this project and do a find/replace operation to change UIDs. We may improve this story in the future if enough users request it.
Expand Down
9 changes: 5 additions & 4 deletions dependencies
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ set -e
# dependencies
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y curl wget git apt-transport-https \
libpq-dev libsqlite3-dev libsasl2-dev \
apt-get install -y curl apt-transport-https \
postgresql-client postgresql postgresql-contrib \
sudo vim zlib1g-dev supervisor psmisc \
nginx rsync jq netcat # Parsing stellar-core JSON for standalone network and checking core HTTP server
sudo supervisor psmisc \
nginx rsync jq netcat \
libunwind8 sqlite libc++abi1-12 libc++1-12
apt-get clean
rm -rf /var/lib/apt/lists/*

chown -R www-data:www-data /var/lib/nginx

Expand Down
1 change: 0 additions & 1 deletion futurenet/core/etc/stellar-core.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ NETWORK_PASSPHRASE="__NETWORK__"
KNOWN_CURSORS=["HORIZON"]
DATABASE="postgresql://dbname=core host=localhost user=stellar password=__PGPASS__"
UNSAFE_QUORUM=true
LIMIT_TX_QUEUE_SOURCE_ACCOUNT=true
FAILURE_SAFETY=0
CATCHUP_RECENT=100

Expand Down

0 comments on commit 8774ce4

Please sign in to comment.