Skip to content
Snippets Groups Projects
Commit 4cdb0c84 authored by Dan Notestein's avatar Dan Notestein
Browse files

Fix balance tracker so that it can be run standalone in addition to just

as part of hafbe
parent dcaf29a3
No related branches found
No related tags found
2 merge requests!66Merge develop to master for release,!47Fix balance tracker so that it can be run standalone
...@@ -114,8 +114,19 @@ NETWORK_NAME=haf ...@@ -114,8 +114,19 @@ NETWORK_NAME=haf
# REPUTATION_TRACKER_VERSION=${HIVE_API_NODE_VERSION} # REPUTATION_TRACKER_VERSION=${HIVE_API_NODE_VERSION}
# REPTRACKER_SCHEMA="hafbe-rt" # There are two ways of running Balance Tracker: as a standalone app, or
# BTRACKER_SCHEMA="hafbe-bt" # integrated with HAF Block Explorer. While you can technically run both,
# there's no good reason to do so--you'll just waste disk space and processing
# power maintaining two copies of the data.
# Regardless of which way you decide to run Balance Tracker, you will need
# to run a single API server, and it needs to know which schema the data is
# stored in. It will be in "hafbe_bal" if you're running HAF Block Explorer,
# and "btracker_app" if you're running Balance Tracker standalone.
# The default behavior is to serve data from the HAF Block Explorer, but
# if you're only running the standalone Balance Tracker, uncomment the next
# line:
# BTRACKER_SCHEMA="btracker_app"
# The default setup will run the recommended version of HAF block explorer, # The default setup will run the recommended version of HAF block explorer,
# you can run a custom version by un-commenting and modifying the # you can run a custom version by un-commenting and modifying the
# values below # values below
......
# Note, most of the services in this file are only used in the uncommon case where
# the node is running Balance Tracker standalone. Balance Tracker is typically
# run as part of HAF Block Explorer, and the services related to that usage are
# in haf_block_explorer.yaml.
# The exception is the postgrest server & rewriter. Those are shared between the two
services: services:
balance-tracker-install: balance-tracker-install:
image: ${BALANCE_TRACKER_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/balance_tracker}:${BALANCE_TRACKER_VERSION:-${HIVE_API_NODE_VERSION}} image: ${BALANCE_TRACKER_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/balance_tracker}:${BALANCE_TRACKER_VERSION:-${HIVE_API_NODE_VERSION}}
profiles: profiles:
- apps - balance-tracker-standalone
- hafbe
- balance-tracker-setup
environment: environment:
POSTGRES_HOST: haf POSTGRES_HOST: haf
networks: networks:
haf-network: haf-network:
command: command:
- install_app - install_app
- --schema=${BTRACKER_SCHEMA:-hafbe_bal} - --schema=btracker_app
- --swagger-url=${PUBLIC_HOSTNAME} - --swagger-url=${PUBLIC_HOSTNAME}
depends_on: depends_on:
haf: haf:
condition: service_healthy condition: service_healthy
# to uninstall Balance Tracker (standalone), shut down the stack and run a command like:
# docker compose --profile core --profile balance-tracker-standalone-uninstall up -d
balance-tracker-uninstall: balance-tracker-uninstall:
image: ${BALANCE_TRACKER_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/balance_tracker}:${BALANCE_TRACKER_VERSION:-${HIVE_API_NODE_VERSION}} image: ${BALANCE_TRACKER_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/balance_tracker}:${BALANCE_TRACKER_VERSION:-${HIVE_API_NODE_VERSION}}
profiles: profiles:
- balance-tracker-uninstall - balance-tracker-standalone-uninstall
environment: environment:
POSTGRES_HOST: haf POSTGRES_HOST: haf
networks: networks:
haf-network: haf-network:
command: command:
- uninstall_app - uninstall_app
- --schema=${BTRACKER_SCHEMA:-hafbe_bal} - --schema=btracker_app
depends_on: depends_on:
haf: haf:
condition: service_healthy condition: service_healthy
...@@ -41,7 +46,7 @@ services: ...@@ -41,7 +46,7 @@ services:
haf-network: haf-network:
command: command:
- process_blocks - process_blocks
- --schema=${BTRACKER_SCHEMA:-hafbe_bal} - --schema=btracker_app
healthcheck: healthcheck:
test: ["CMD-SHELL","/app/block-processing-healthcheck.sh"] test: ["CMD-SHELL","/app/block-processing-healthcheck.sh"]
interval: 60s interval: 60s
...@@ -80,6 +85,10 @@ services: ...@@ -80,6 +85,10 @@ services:
depends_on: depends_on:
balance-tracker-install: balance-tracker-install:
condition: service_completed_successfully condition: service_completed_successfully
required: false # allow this service to be missing (when only running hafbe)
block-explorer-install-balance-tracker:
condition: service_completed_successfully
required: false # allow this service to be missing (when only running standalone)
haf: haf:
condition: service_healthy condition: service_healthy
balance-tracker-postgrest-rewriter: balance-tracker-postgrest-rewriter:
......
...@@ -43,6 +43,7 @@ services: ...@@ -43,6 +43,7 @@ services:
host haf_block_log haf_admin ${COMPOSE_PROJECT_NAME}-block-explorer-uninstall-1.${NETWORK_NAME} trust\n host haf_block_log haf_admin ${COMPOSE_PROJECT_NAME}-block-explorer-uninstall-1.${NETWORK_NAME} trust\n
host haf_block_log hafbe_owner ${COMPOSE_PROJECT_NAME}-block-explorer-uninstall-1.${NETWORK_NAME} trust\n host haf_block_log hafbe_owner ${COMPOSE_PROJECT_NAME}-block-explorer-uninstall-1.${NETWORK_NAME} trust\n
host haf_block_log haf_admin ${COMPOSE_PROJECT_NAME}-block-explorer-uninstall-balance-tracker-1.${NETWORK_NAME} trust\n host haf_block_log haf_admin ${COMPOSE_PROJECT_NAME}-block-explorer-uninstall-balance-tracker-1.${NETWORK_NAME} trust\n
host haf_block_log haf_admin ${COMPOSE_PROJECT_NAME}-block-explorer-install-balance-tracker-1.${NETWORK_NAME} trust\n
host haf_block_log haf_admin ${COMPOSE_PROJECT_NAME}-block-explorer-uninstall-reputation-tracker-1.${NETWORK_NAME} trust\n host haf_block_log haf_admin ${COMPOSE_PROJECT_NAME}-block-explorer-uninstall-reputation-tracker-1.${NETWORK_NAME} trust\n
......
...@@ -14,12 +14,14 @@ services: ...@@ -14,12 +14,14 @@ services:
depends_on: depends_on:
haf: haf:
condition: service_healthy condition: service_healthy
balance-tracker-install: block-explorer-install-balance-tracker:
condition: service_completed_successfully condition: service_completed_successfully
hafah-install: hafah-install:
condition: service_completed_successfully condition: service_completed_successfully
reputation-tracker-install: reputation-tracker-install:
condition: service_completed_successfully condition: service_completed_successfully
# to uninstall HAF Block Explorer, shut down the stack and run a command like:
# docker compose --profile core --profile block-explorer-uninstall up -d
block-explorer-uninstall: block-explorer-uninstall:
image: ${HAF_BLOCK_EXPLORER_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/haf_block_explorer}:${HAF_BLOCK_EXPLORER_VERSION:-${HIVE_API_NODE_VERSION}} image: ${HAF_BLOCK_EXPLORER_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/haf_block_explorer}:${HAF_BLOCK_EXPLORER_VERSION:-${HIVE_API_NODE_VERSION}}
profiles: profiles:
...@@ -33,6 +35,22 @@ services: ...@@ -33,6 +35,22 @@ services:
depends_on: depends_on:
haf: haf:
condition: service_healthy condition: service_healthy
block-explorer-install-balance-tracker:
image: ${BALANCE_TRACKER_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/balance_tracker}:${BALANCE_TRACKER_VERSION:-${HIVE_API_NODE_VERSION}}
profiles:
- apps
- hafbe
environment:
POSTGRES_HOST: haf
networks:
haf-network:
command:
- install_app
- --schema=hafbe_bal
- --swagger-url=${PUBLIC_HOSTNAME}
depends_on:
haf:
condition: service_healthy
block-explorer-uninstall-balance-tracker: block-explorer-uninstall-balance-tracker:
image: ${BALANCE_TRACKER_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/balance_tracker}:${BALANCE_TRACKER_VERSION:-${HIVE_API_NODE_VERSION}} image: ${BALANCE_TRACKER_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/balance_tracker}:${BALANCE_TRACKER_VERSION:-${HIVE_API_NODE_VERSION}}
profiles: profiles:
...@@ -43,6 +61,7 @@ services: ...@@ -43,6 +61,7 @@ services:
haf-network: haf-network:
command: command:
- uninstall_app - uninstall_app
- --schema=hafbe_bal
depends_on: depends_on:
block-explorer-uninstall: block-explorer-uninstall:
condition: service_completed_successfully condition: service_completed_successfully
...@@ -100,7 +119,7 @@ services: ...@@ -100,7 +119,7 @@ services:
PGRST_DB_POOL: 20 PGRST_DB_POOL: 20
PGRST_DB_POOL_ACQUISITION_TIMEOUT: 10 PGRST_DB_POOL_ACQUISITION_TIMEOUT: 10
PGRST_DB_ROOT_SPEC: root PGRST_DB_ROOT_SPEC: root
PGRST_DB_EXTRA_SEARCH_PATH: ${BTRACKER_SCHEMA:-hafbe_bal}, ${REPTRACKER_SCHEMA:-reptracker_app} PGRST_DB_EXTRA_SEARCH_PATH: hafbe_bal, reptracker_app
# PGRST_OPENAPI_SERVER_PROXY_URI: http://${PUBLIC_HOSTNAME}/hafbe_api/ # PGRST_OPENAPI_SERVER_PROXY_URI: http://${PUBLIC_HOSTNAME}/hafbe_api/
networks: networks:
haf-network: haf-network:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment