From 74a4505b8eb5bc7b2cf0a795510899ae7ca49801 Mon Sep 17 00:00:00 2001 From: Lucky Baar Date: Sun, 8 Jan 2023 11:26:35 -0600 Subject: [PATCH 1/9] container: update docs and remove unused build artifacts --- Dockerfile | 2 ++ docker/README.md | 30 +++++++++++++++++++++++++++++- docker/files/build/install.sh | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 89296cf6ec..ef564935b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -61,4 +61,6 @@ COPY --chown=algorand:algorand --from=builder "/node/files/run/" "/node/run/" # Expose Algod REST API, Algod Gossip, and Prometheus Metrics ports EXPOSE $ALGOD_PORT 4160 9100 +WORKDIR /node/bin + CMD ["/node/run/run.sh"] diff --git a/docker/README.md b/docker/README.md index b3027655e6..1ca36a7dd3 100644 --- a/docker/README.md +++ b/docker/README.md @@ -42,6 +42,7 @@ Configuration can be modified by specifying certain files. These can be changed | /etc/config.json | Override default configurations by providing your own file. | | /etc/algod.token | Override default randomized REST API token. | | /etc/algod.admin.token | Override default randomized REST API admin token. | +| /etc/logging.config | Use a custom [logging.config](https://developer.algorand.org/docs/run-a-node/reference/telemetry-config/?from_query=logging.config#configuration) file for configuring telemetry. | TODO: `/etc/template.json` for overriding the private network topology. @@ -66,7 +67,7 @@ Explanation of parts: * `-p 4190:8080` maps the internal algod REST API to local port 4190 * `-e NETWORK=` can be set to any of the supported public networks. * `-e FAST_CATCHUP=` causes fast catchup to start shortly after launching the network. -* `-e TELEMETRY_NAME=` enables telemetry reporting to Algorand for network health analysis. +* `-e TELEMETRY_NAME=` enables telemetry reporting to Algorand for network health analysis. The value of this variable takes precedence over the GUID in `/etc/logging.config`. * `-e TOKEN=` sets the REST API token to use. * `-v ${PWD}/data:/algod/data/` mounts a local volume to the data directory, which can be used to restart and upgrade the deployment. @@ -74,6 +75,33 @@ Explanation of parts: The data directory located at `/algod/data`. Mounting a volume at that location will allow you to shutdown and resume the node. +### Dealing with Permission Errors + +The container executes in the context of the `algorand` user with it's own UID and GID. If experiencing permission errors when mounting a volume, try one of the following: + +1. Using a named volume + + ```bash + docker run -it --rm -d -v algod-data:/algod/data algorand/algod + ``` + +2. Specifying UID/GID of the container + + ```bash + docker run -it --rm -d -v /srv/data:/algod/data -u $UID:$GID algorand/algod + ``` + +3. Relabeling the contents of the volume + + ```bash + docker run -it --rm -d -v /srv/data:/algod/data:Z algorand/algod + ``` + +For more information on volumes or why this may be happening refer to the following: + +- https://docs.docker.com/storage/volumes/ +- https://web.archive.org/web/20190728100417/https://www.projectatomic.io/blog/2015/06/using-volumes-with-docker-can-cause-problems-with-selinux/ + ### Private Network Private networks work a little bit differently. They are configured with, potentially, several data directories. The default topology supplied with this container is installed to `/algod/`, and has a single node named `data`. This means the private network has a data directory at `/algod/data`, matching the production configuration. diff --git a/docker/files/build/install.sh b/docker/files/build/install.sh index 9cfef5e858..abc57cc5ec 100755 --- a/docker/files/build/install.sh +++ b/docker/files/build/install.sh @@ -87,6 +87,6 @@ BUILD_NUMBER="" BRANCH="$BRANCH" make build shopt -s extglob -cd "$BINDIR" && rm -vrf !(algocfg|algod|algoh|algokey|carpenter|catchupsrv|ddconfig.sh|diagcfg|find-nodes.sh|goal|kmd|msgpacktool|node_exporter|tealcut|tealdbg|update.sh|updater|COPYING) +cd "$BINDIR" && rm -vrf !(algocfg|algod|algokey|diagcfg|goal|kmd|msgpacktool|node_exporter|tealdbg|update.sh|updater|COPYING) "$BINDIR"/algod -v From f72169c309441829f2adf4d994eb9e9b6eb07367 Mon Sep 17 00:00:00 2001 From: Lucky Baar Date: Mon, 9 Jan 2023 10:29:16 -0600 Subject: [PATCH 2/9] add badge to DockerHub --- docker/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/README.md b/docker/README.md index 1ca36a7dd3..1b2c50e2ec 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,5 +1,7 @@ # Algod Container +[![DockerHub](https://img.shields.io/badge/DockerHub-blue)](https://hub.docker.com/r/algorand/algod) + General purpose algod container image. ## Image Configuration @@ -42,7 +44,7 @@ Configuration can be modified by specifying certain files. These can be changed | /etc/config.json | Override default configurations by providing your own file. | | /etc/algod.token | Override default randomized REST API token. | | /etc/algod.admin.token | Override default randomized REST API admin token. | -| /etc/logging.config | Use a custom [logging.config](https://developer.algorand.org/docs/run-a-node/reference/telemetry-config/?from_query=logging.config#configuration) file for configuring telemetry. | +| /etc/logging.config | Use a custom [logging.config](https://developer.algorand.org/docs/run-a-node/reference/telemetry-config/#configuration) file for configuring telemetry. | TODO: `/etc/template.json` for overriding the private network topology. @@ -75,7 +77,7 @@ Explanation of parts: The data directory located at `/algod/data`. Mounting a volume at that location will allow you to shutdown and resume the node. -### Dealing with Permission Errors +### Handling Permission Errors The container executes in the context of the `algorand` user with it's own UID and GID. If experiencing permission errors when mounting a volume, try one of the following: From e6973345cf538952897af4bd97966ad674b1aed1 Mon Sep 17 00:00:00 2001 From: algolucky <105239720+algolucky@users.noreply.github.com> Date: Wed, 11 Jan 2023 08:53:38 -0600 Subject: [PATCH 3/9] Update docker/README.md Co-authored-by: Will Winder --- docker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index 1b2c50e2ec..636682328b 100644 --- a/docker/README.md +++ b/docker/README.md @@ -77,7 +77,7 @@ Explanation of parts: The data directory located at `/algod/data`. Mounting a volume at that location will allow you to shutdown and resume the node. -### Handling Permission Errors +### Volume Permissions The container executes in the context of the `algorand` user with it's own UID and GID. If experiencing permission errors when mounting a volume, try one of the following: From 5394a83432d27bffec1ae7ec74ecc0a12602519f Mon Sep 17 00:00:00 2001 From: algolucky <105239720+algolucky@users.noreply.github.com> Date: Wed, 11 Jan 2023 09:10:21 -0600 Subject: [PATCH 4/9] Update docker/README.md Co-authored-by: Will Winder --- docker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index 636682328b..8beb096e15 100644 --- a/docker/README.md +++ b/docker/README.md @@ -79,7 +79,7 @@ The data directory located at `/algod/data`. Mounting a volume at that location ### Volume Permissions -The container executes in the context of the `algorand` user with it's own UID and GID. If experiencing permission errors when mounting a volume, try one of the following: +The container executes in the context of the `algorand` user with it's own UID and GID which is handled differently depending on your operating system. Here are a few options for how to work with this environment: 1. Using a named volume From 5478fed8416fd4b874efc08c2da879b29717b2aa Mon Sep 17 00:00:00 2001 From: Lucky Baar Date: Wed, 11 Jan 2023 09:22:02 -0600 Subject: [PATCH 5/9] container: flesh out volume permission examples --- docker/README.md | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/docker/README.md b/docker/README.md index 8beb096e15..0a5829863a 100644 --- a/docker/README.md +++ b/docker/README.md @@ -81,28 +81,32 @@ The data directory located at `/algod/data`. Mounting a volume at that location The container executes in the context of the `algorand` user with it's own UID and GID which is handled differently depending on your operating system. Here are a few options for how to work with this environment: -1. Using a named volume +#### Named Volume - ```bash - docker run -it --rm -d -v algod-data:/algod/data algorand/algod - ``` +Using a named volume will work without any specific configuration in most cases: -2. Specifying UID/GID of the container +```bash +docker volume create algod-data +docker run -it --rm -d -v algod-data:/algod/data algorand/algod +``` + +#### Local Directory without SELinux + +Explicitly set the UID and GID of the container: - ```bash - docker run -it --rm -d -v /srv/data:/algod/data -u $UID:$GID algorand/algod - ``` +```bash +docker run -it --rm -d -v /srv/data:/algod/data -u $UID:$GID algorand/algod +``` -3. Relabeling the contents of the volume +#### Local Directory with SELinux - ```bash - docker run -it --rm -d -v /srv/data:/algod/data:Z algorand/algod - ``` +Set the UID and GID of the container while add the `Z` option to the volume definition: -For more information on volumes or why this may be happening refer to the following: +```bash +docker run -it --rm -d -v /srv/data:/algod/data:Z -u $UID:$GID algorand/algod +``` -- https://docs.docker.com/storage/volumes/ -- https://web.archive.org/web/20190728100417/https://www.projectatomic.io/blog/2015/06/using-volumes-with-docker-can-cause-problems-with-selinux/ +> See the documentation on [configuring the selinux label](https://docs.docker.com/storage/bind-mounts/#configure-the-selinux-label). ### Private Network From bc9c610e2f1beae13ebd4629a77e55bbb7b1e232 Mon Sep 17 00:00:00 2001 From: Lucky Baar Date: Thu, 12 Jan 2023 15:30:07 -0600 Subject: [PATCH 6/9] container: consolidate on /algod --- Dockerfile | 24 ++++++++++++------------ docker/README.md | 10 +++++----- docker/files/run/run.sh | 24 ++++++++++++------------ 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Dockerfile b/Dockerfile index ef564935b0..fc923a7631 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ ARG TARGETARCH ADD https://go.dev/dl/go${GO_VERSION}.linux-${TARGETARCH}.tar.gz /go.tar.gz # Basic dependencies. -ENV HOME="/node" DEBIAN_FRONTEND="noninteractive" GOPATH="/node" +ENV HOME="/node" DEBIAN_FRONTEND="noninteractive" GOPATH="/dist" RUN apt-get update && \ apt-get install -y --no-install-recommends \ @@ -27,15 +27,15 @@ RUN apt-get update && \ ENV PATH="/usr/local/go/bin:${PATH}" -COPY ./docker/files/ /node/files -COPY ./installer/genesis /node/files/run/genesis -COPY ./cmd/updater/update.sh /node/files/build/update.sh -COPY ./installer/config.json.example /node/files/run/config.json.example +COPY ./docker/files/ /dist/files +COPY ./installer/genesis /dist/files/run/genesis +COPY ./cmd/updater/update.sh /dist/files/build/update.sh +COPY ./installer/config.json.example /dist/files/run/config.json.example # Install algod binaries. -RUN /node/files/build/install.sh \ +RUN /dist/files/build/install.sh \ -p "${GOPATH}/bin" \ - -d "/node/data" \ + -d "/algod/data" \ -c "${CHANNEL}" \ -u "${URL}" \ -b "${BRANCH}" \ @@ -43,7 +43,7 @@ RUN /node/files/build/install.sh \ FROM debian:bullseye-slim as final -ENV PATH="/node/bin:${PATH}" ALGOD_PORT="8080" ALGORAND_DATA="/algod/data" +ENV PATH="/algod/bin:${PATH}" ALGOD_PORT="8080" ALGORAND_DATA="/algod/data" # curl is needed to lookup the fast catchup url RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && \ @@ -55,12 +55,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates USER algorand -COPY --chown=algorand:algorand --from=builder "/node/bin/" "/node/bin/" -COPY --chown=algorand:algorand --from=builder "/node/files/run/" "/node/run/" +COPY --chown=algorand:algorand --from=builder "/dist/bin/" "/algod/bin/" +COPY --chown=algorand:algorand --from=builder "/dist/files/run/" "/algod/run/" # Expose Algod REST API, Algod Gossip, and Prometheus Metrics ports EXPOSE $ALGOD_PORT 4160 9100 -WORKDIR /node/bin +WORKDIR /algod -CMD ["/node/run/run.sh"] +CMD ["/algod/run/run.sh"] diff --git a/docker/README.md b/docker/README.md index 0a5829863a..33b4a9814b 100644 --- a/docker/README.md +++ b/docker/README.md @@ -41,12 +41,12 @@ Configuration can be modified by specifying certain files. These can be changed | File | Description | | ---- | ----------- | -| /etc/config.json | Override default configurations by providing your own file. | -| /etc/algod.token | Override default randomized REST API token. | -| /etc/algod.admin.token | Override default randomized REST API admin token. | -| /etc/logging.config | Use a custom [logging.config](https://developer.algorand.org/docs/run-a-node/reference/telemetry-config/#configuration) file for configuring telemetry. | +| /algod/config/config.json | Override default configurations by providing your own file. | +| /algod/config/algod.token | Override default randomized REST API token. | +| /algod/config/algod.admin.token | Override default randomized REST API admin token. | +| /algod/config/logging.config | Use a custom [logging.config](https://developer.algorand.org/docs/run-a-node/reference/telemetry-config/#configuration) file for configuring telemetry. | -TODO: `/etc/template.json` for overriding the private network topology. +TODO: `/algod/config/template.json` for overriding the private network topology. ## Example Configuration diff --git a/docker/files/run/run.sh b/docker/files/run/run.sh index 24e59ae145..90c704d02d 100755 --- a/docker/files/run/run.sh +++ b/docker/files/run/run.sh @@ -13,17 +13,17 @@ function apply_configuration() { cd "$ALGORAND_DATA" # check for config file overrides. - if [ -f "/etc/config.json" ]; then - cp /etc/config.json config.json + if [ -f "/algod/config/config.json" ]; then + cp /algod/config/config.json config.json fi - if [ -f "/etc/algod.token" ]; then - cp /etc/algod.token algod.token + if [ -f "/algod/config/algod.token" ]; then + cp /algod/config/algod.token algod.token fi - if [ -f "/etc/algod.admin.token" ]; then - cp /etc/algod.admin.token algod.admin.token + if [ -f "/algod/config/algod.admin.token" ]; then + cp /algod/config/algod.admin.token algod.admin.token fi - if [ -f "/etc/logging.config" ]; then - cp /etc/logging.config logging.config + if [ -f "/algod/config/logging.config" ]; then + cp /algod/config/logging.config logging.config fi # check for environment variable overrides. @@ -78,7 +78,7 @@ function configure_data_dir() { } function start_new_public_network() { - cd /node + cd /algod if [ ! -d "run/genesis/$NETWORK" ]; then echo "No genesis file for '$NETWORK' is available." exit 1 @@ -88,8 +88,8 @@ function start_new_public_network() { cd "$ALGORAND_DATA" - cp "/node/run/genesis/$NETWORK/genesis.json" genesis.json - cp /node/run/config.json.example config.json + cp "/algod/run/genesis/$NETWORK/genesis.json" genesis.json + cp /algod/run/config.json.example config.json configure_data_dir @@ -116,7 +116,7 @@ function start_private_network() { } function start_new_private_network() { - cd /node + cd /algod local TEMPLATE="template.json" if [ "$DEV_MODE" ]; then TEMPLATE="devmode_template.json" From 08fda1b2f3f0c2e06ff6d02fbd5bfd6227b439cd Mon Sep 17 00:00:00 2001 From: Lucky Baar Date: Thu, 12 Jan 2023 15:38:09 -0600 Subject: [PATCH 7/9] container: TELEMETRY_NAME changes the name attribute --- docker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index 33b4a9814b..f1ff1ecc12 100644 --- a/docker/README.md +++ b/docker/README.md @@ -69,7 +69,7 @@ Explanation of parts: * `-p 4190:8080` maps the internal algod REST API to local port 4190 * `-e NETWORK=` can be set to any of the supported public networks. * `-e FAST_CATCHUP=` causes fast catchup to start shortly after launching the network. -* `-e TELEMETRY_NAME=` enables telemetry reporting to Algorand for network health analysis. The value of this variable takes precedence over the GUID in `/etc/logging.config`. +* `-e TELEMETRY_NAME=` enables telemetry reporting to Algorand for network health analysis. The value of this variable takes precedence over the `name` attribute set in `/algod/config/logging.config`. * `-e TOKEN=` sets the REST API token to use. * `-v ${PWD}/data:/algod/data/` mounts a local volume to the data directory, which can be used to restart and upgrade the deployment. From e3499f497d7a71cce5f981a475b7e97ce3af6c0f Mon Sep 17 00:00:00 2001 From: Lucky Baar Date: Thu, 12 Jan 2023 17:38:40 -0600 Subject: [PATCH 8/9] container: fix goal network create --- docker/files/run/run.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docker/files/run/run.sh b/docker/files/run/run.sh index 90c704d02d..37b4d9ff91 100755 --- a/docker/files/run/run.sh +++ b/docker/files/run/run.sh @@ -111,8 +111,8 @@ function start_private_network() { apply_configuration # TODO: Is there a way to properly exec a private network? - goal network start -r "$ALGORAND_DATA/.." - tail -f "$ALGORAND_DATA/node.log" + goal network start -r "${ALGORAND_DATA}/.." + tail -f "${ALGORAND_DATA}/node.log" } function start_new_private_network() { @@ -122,7 +122,8 @@ function start_new_private_network() { TEMPLATE="devmode_template.json" fi sed -i "s/NUM_ROUNDS/${NUM_ROUNDS:-30000}/" "run/$TEMPLATE" - goal network create -n dockernet -r "$ALGORAND_DATA/.." -t "run/$TEMPLATE" + goal network create --noclean -n dockernet -r "/tmp/dockernet" -t "run/$TEMPLATE" + mv -v /tmp/dockernet/* "${ALGORAND_DATA}/.." configure_data_dir start_private_network } From 4ed761408e140e7997851564e1e25b3a62387ca0 Mon Sep 17 00:00:00 2001 From: Lucky Baar Date: Tue, 17 Jan 2023 14:03:42 -0600 Subject: [PATCH 9/9] container: use /etc/algorand for config --- Dockerfile | 8 ++++---- docker/README.md | 12 ++++++------ docker/files/run/run.sh | 32 +++++++++++++++----------------- 3 files changed, 25 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index fc923a7631..ab55a90940 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,7 @@ RUN /dist/files/build/install.sh \ FROM debian:bullseye-slim as final -ENV PATH="/algod/bin:${PATH}" ALGOD_PORT="8080" ALGORAND_DATA="/algod/data" +ENV PATH="/node/bin:${PATH}" ALGOD_PORT="8080" ALGORAND_DATA="/algod/data" # curl is needed to lookup the fast catchup url RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && \ @@ -55,12 +55,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates USER algorand -COPY --chown=algorand:algorand --from=builder "/dist/bin/" "/algod/bin/" -COPY --chown=algorand:algorand --from=builder "/dist/files/run/" "/algod/run/" +COPY --chown=algorand:algorand --from=builder "/dist/bin/" "/node/bin/" +COPY --chown=algorand:algorand --from=builder "/dist/files/run/" "/node/run/" # Expose Algod REST API, Algod Gossip, and Prometheus Metrics ports EXPOSE $ALGOD_PORT 4160 9100 WORKDIR /algod -CMD ["/algod/run/run.sh"] +CMD ["/node/run/run.sh"] diff --git a/docker/README.md b/docker/README.md index f1ff1ecc12..78099e6027 100644 --- a/docker/README.md +++ b/docker/README.md @@ -41,12 +41,12 @@ Configuration can be modified by specifying certain files. These can be changed | File | Description | | ---- | ----------- | -| /algod/config/config.json | Override default configurations by providing your own file. | -| /algod/config/algod.token | Override default randomized REST API token. | -| /algod/config/algod.admin.token | Override default randomized REST API admin token. | -| /algod/config/logging.config | Use a custom [logging.config](https://developer.algorand.org/docs/run-a-node/reference/telemetry-config/#configuration) file for configuring telemetry. | +| /etc/algorand/config.json | Override default configurations by providing your own file. | +| /etc/algorand/algod.token | Override default randomized REST API token. | +| /etc/algorand/algod.admin.token | Override default randomized REST API admin token. | +| /etc/algorand/logging.config | Use a custom [logging.config](https://developer.algorand.org/docs/run-a-node/reference/telemetry-config/#configuration) file for configuring telemetry. | -TODO: `/algod/config/template.json` for overriding the private network topology. +TODO: `/etc/algorand/template.json` for overriding the private network topology. ## Example Configuration @@ -69,7 +69,7 @@ Explanation of parts: * `-p 4190:8080` maps the internal algod REST API to local port 4190 * `-e NETWORK=` can be set to any of the supported public networks. * `-e FAST_CATCHUP=` causes fast catchup to start shortly after launching the network. -* `-e TELEMETRY_NAME=` enables telemetry reporting to Algorand for network health analysis. The value of this variable takes precedence over the `name` attribute set in `/algod/config/logging.config`. +* `-e TELEMETRY_NAME=` enables telemetry reporting to Algorand for network health analysis. The value of this variable takes precedence over the `name` attribute set in `/etc/algorand/logging.config`. * `-e TOKEN=` sets the REST API token to use. * `-v ${PWD}/data:/algod/data/` mounts a local volume to the data directory, which can be used to restart and upgrade the deployment. diff --git a/docker/files/run/run.sh b/docker/files/run/run.sh index 37b4d9ff91..627665dd6f 100755 --- a/docker/files/run/run.sh +++ b/docker/files/run/run.sh @@ -13,25 +13,25 @@ function apply_configuration() { cd "$ALGORAND_DATA" # check for config file overrides. - if [ -f "/algod/config/config.json" ]; then - cp /algod/config/config.json config.json + if [ -f "/etc/algorand/config.json" ]; then + cp /etc/algorand/config.json config.json fi - if [ -f "/algod/config/algod.token" ]; then - cp /algod/config/algod.token algod.token + if [ -f "/etc/algorand/algod.token" ]; then + cp /etc/algorand/algod.token algod.token fi - if [ -f "/algod/config/algod.admin.token" ]; then - cp /algod/config/algod.admin.token algod.admin.token + if [ -f "/etc/algorand/algod.admin.token" ]; then + cp /etc/algorand/algod.admin.token algod.admin.token fi - if [ -f "/algod/config/logging.config" ]; then - cp /algod/config/logging.config logging.config + if [ -f "/etc/algorand/logging.config" ]; then + cp /etc/algorand/logging.config logging.config fi # check for environment variable overrides. if [ "$TOKEN" != "" ]; then - echo "$TOKEN" > algod.token + echo "$TOKEN" >algod.token fi if [ "$ADMIN_TOKEN" != "" ]; then - echo "$ADMIN_TOKEN" > algod.admin.token + echo "$ADMIN_TOKEN" >algod.admin.token fi # configure telemetry @@ -79,7 +79,7 @@ function configure_data_dir() { function start_new_public_network() { cd /algod - if [ ! -d "run/genesis/$NETWORK" ]; then + if [ ! -d "/node/run/genesis/${NETWORK}" ]; then echo "No genesis file for '$NETWORK' is available." exit 1 fi @@ -88,8 +88,8 @@ function start_new_public_network() { cd "$ALGORAND_DATA" - cp "/algod/run/genesis/$NETWORK/genesis.json" genesis.json - cp /algod/run/config.json.example config.json + cp "/node/run/genesis/${NETWORK}/genesis.json" genesis.json + cp /node/run/config.json.example config.json configure_data_dir @@ -116,14 +116,12 @@ function start_private_network() { } function start_new_private_network() { - cd /algod local TEMPLATE="template.json" if [ "$DEV_MODE" ]; then TEMPLATE="devmode_template.json" fi - sed -i "s/NUM_ROUNDS/${NUM_ROUNDS:-30000}/" "run/$TEMPLATE" - goal network create --noclean -n dockernet -r "/tmp/dockernet" -t "run/$TEMPLATE" - mv -v /tmp/dockernet/* "${ALGORAND_DATA}/.." + sed -i "s/NUM_ROUNDS/${NUM_ROUNDS:-30000}/" "/node/run/$TEMPLATE" + goal network create --noclean -n dockernet -r "${ALGORAND_DATA}/.." -t "/node/run/$TEMPLATE" configure_data_dir start_private_network }