From 852e44b89383f746c78ffd8d610ab72f34e4e622 Mon Sep 17 00:00:00 2001 From: David Whittington Date: Sun, 29 Oct 2023 14:30:40 -0500 Subject: [PATCH] refactor(handlers info): set default CONTRACT_ID in code instead of docker-compose This is more in line with how we handle other defaults and may save users some hassle having to rebuild containers. --- docker-compose.yaml | 4 ++-- src/config.ts | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 6880d1ef..ee84781a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -51,7 +51,7 @@ services: - ARNS_ROOT_HOST=${ARNS_ROOT_HOST:-} - SANDBOX_PROTOCOL=${SANDBOX_PROTOCOL:-} - START_WRITERS=${START_WRITERS:-} - - CONTRACT_ID=${CONTRACT_ID:-bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U} + - CONTRACT_ID=${CONTRACT_ID:-} observer: image: ghcr.io/ar-io/ar-io-observer:${OBSERVER_IMAGE_TAG:-42c909257f9907f2aef9957b70474207f0cfc78d} @@ -64,5 +64,5 @@ services: environment: - PORT=5000 - OBSERVER_WALLET=${OBSERVER_WALLET:-} - - CONTRACT_ID=${CONTRACT_ID:-bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U} + - CONTRACT_ID=${CONTRACT_ID:-} - RUN_OBSERVER=${RUN_OBSERVER:-true} diff --git a/src/config.ts b/src/config.ts index eac8eda2..0af59ce4 100644 --- a/src/config.ts +++ b/src/config.ts @@ -75,4 +75,7 @@ export const ROOT_HOST_SUBDOMAIN_LENGTH = export const SANDBOX_PROTOCOL = env.varOrUndefined('SANDBOX_PROTOCOL'); export const START_WRITERS = env.varOrDefault('START_WRITERS', 'true') === 'true'; -export const CONTRACT_ID = env.varOrUndefined('CONTRACT_ID'); +export const CONTRACT_ID = env.varOrDefault( + 'CONTRACT_ID', + 'bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U', +);