Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: add profile support and improved endpoint access. #5323

Merged
merged 1 commit into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 9 additions & 8 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ There are a number of special files and environment variables used to control ho

### Default Configuration

By default the following config.json overrides are applied:
The following config.json overrides are applied:

| Setting | Value |
| ------- | ----- |
| EndpointAddress | 0.0.0.0:8080 |
| Setting | Value | Description |
| ------- | ----- | ----------- |
| EndpointAddress | 0.0.0.0:8080 | Ensure the API is accessible from outside of the container. |

### Environment Variables

Expand All @@ -23,14 +23,15 @@ The following environment variables can be supplied. Except when noted, it is po
| Variable | Description |
| -------- | ----------- |
| NETWORK | Leave blank for a private network, otherwise specify one of mainnet, betanet, testnet, or devnet. Only used during a data directory initialization. |
| FAST_CATCHUP | If set to 1 on a public network, attempt to start fast-catchup during initial config. |
| TELEMETRY_NAME | If set on a public network, telemetry is reported with this name. |
| PROFILE | If set, initializes the config.json file according to the given profile. |
algobarb marked this conversation as resolved.
Show resolved Hide resolved
| DEV_MODE | If set to 1 on a private network, enable dev mode. Only used during data directory initialization. |
| NUM_ROUNDS | If set on a private network, override default of 30000 participation keys. |
| START_KMD | When set to 1, start kmd service with no timeout. THIS SHOULD NOT BE USED IN PRODUCTION. |
| FAST_CATCHUP | If set to 1 on a public network, attempt to start fast-catchup during initial config. |
| TOKEN | If set, overrides the REST API token. |
| ADMIN_TOKEN | If set, overrides the REST API admin token. |
| KMD_TOKEN | If set along with `START_KMD`, override the KMD REST API token. |
| START_KMD | When set to 1, start kmd service with no timeout. THIS SHOULD NOT BE USED IN PRODUCTION. |
| TELEMETRY_NAME | If set on a public network, telemetry is reported with this name. |
| NUM_ROUNDS | If set on a private network, override default of 30000 participation keys. |
| PEER_ADDRESS | If set, override phonebook with peer ip:port (or semicolon separated list: ip:port;ip:port;ip:port...) |

### Special Files
Expand Down
9 changes: 8 additions & 1 deletion docker/files/run/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ function start_public_network() {

function configure_data_dir() {
cd "$ALGORAND_DATA"
algocfg -d . set -p EndpointAddress -v "0.0.0.0:${ALGOD_PORT}"

# check for config file overrides.
if [ -f "/etc/algorand/config.json" ]; then
Expand All @@ -70,6 +69,14 @@ function configure_data_dir() {
cp /etc/algorand/logging.config logging.config
fi

# initialize config with profile.
if [ "$PROFILE" != "" ]; then
algocfg profile set --yes -d "$ALGORAND_DATA" "$PROFILE"
fi

# call after copying config.json to make sure the port is exposed.
algocfg -d . set -p EndpointAddress -v "0.0.0.0:${ALGOD_PORT}"

# check for token overrides
if [ "$TOKEN" != "" ]; then
for dir in ${ALGORAND_DATA}/../*/; do
Expand Down