-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1609 from IntersectMBO/fix/1464-add-enable-future…
…-genesis-to-dbsync-configuration [#1464] Enable future genesis in DBSync config
- Loading branch information
Showing
9 changed files
with
95 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ on: | |
description: "Enable proposal discussion forum" | ||
required: true | ||
type: choice | ||
default: "disabled" | ||
default: "enabled" | ||
options: | ||
- "enabled" | ||
- "disabled" | ||
|
@@ -65,9 +65,10 @@ jobs: | |
TRAEFIK_LE_EMAIL: "[email protected]" | ||
USERSNAP_SPACE_API_KEY: ${{ secrets.USERSNAP_SPACE_API_KEY }} | ||
IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: ${{ inputs.isProposalDiscussionForumEnabled == 'enabled' }} | ||
PDF_API_URL: ${{ secrets.PDF_API_URL }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM ghcr.io/intersectmbo/cardano-db-sync:sancho-5.1.0 | ||
|
||
COPY custom-cardano-db-sync.entrypoint.sh /usr/local/bin/custom-cardano-db-sync.entrypoint.sh | ||
RUN chmod +x /usr/local/bin/custom-cardano-db-sync.entrypoint.sh | ||
|
||
ENTRYPOINT [ "/usr/local/bin/custom-cardano-db-sync.entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
echo "Custom Cardano DB Sync entrypoint" | ||
set -euo pipefail | ||
mkdir -p -m 1777 /tmp | ||
mkdir -p /configuration | ||
CARDANO_NODE_SOCKET_PATH=/node-ipc/node.socket | ||
CARDANO_DB_SYNC_CONFIG_PATH=/configuration/db-sync-config.json | ||
|
||
# set pgpass file | ||
echo "-> Generating PGPASS file" | ||
SECRET_DIR=/run/secrets | ||
POSTGRES_DB=${POSTGRES_DB:-$(< ${SECRET_DIR}/postgres_db)} | ||
POSTGRES_USER=${POSTGRES_USER:-$(< ${SECRET_DIR}/postgres_user)} | ||
POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-$(< ${SECRET_DIR}/postgres_password)} | ||
echo "${POSTGRES_HOST}:${POSTGRES_PORT}:${POSTGRES_DB}:${POSTGRES_USER}:${POSTGRES_PASSWORD}" > /configuration/pgpass | ||
chmod 0600 /configuration/pgpass | ||
export PGPASSFILE=/configuration/pgpass | ||
|
||
# wait for cardano node to start | ||
echo -n "-> Waiting for $CARDANO_NODE_SOCKET_PATH" | ||
until [ -S "$CARDANO_NODE_SOCKET_PATH" ]; do | ||
echo -n "." | ||
sleep 10 | ||
done | ||
echo | ||
|
||
# find schema directory | ||
echo "-> Finding schema directory" | ||
SCHEMA_DIR=$(find /nix/store -type d -name '*-schema') | ||
|
||
echo "-> Running Cardano DB Sync" | ||
exec cardano-db-sync \ | ||
--config "$CARDANO_DB_SYNC_CONFIG_PATH" \ | ||
--socket-path "$CARDANO_NODE_SOCKET_PATH" \ | ||
--schema-dir "$SCHEMA_DIR" \ | ||
--state-dir /state \ | ||
$@ | ||
|
||
echo "-> Cleaning up" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
common_mk := common.mk | ||
ifeq ($(origin $(common_mk)), undefined) | ||
$(eval $(common_mk) := included) | ||
include $(common_mk) | ||
endif | ||
|
||
.DEFAULT_GOAL := push-custom-cardano-db-sync | ||
|
||
# image tags | ||
custom-cardano-db-sync_image_tag := latest | ||
|
||
.PHONY: build-custom-cardano-db-sync | ||
build-custom-cardano-db-sync: docker-login | ||
@:$(call check_defined, cardano_network) | ||
$(call check_image_on_ecr,custom-cardano-db-sync,$(custom-cardano-db-sync_image_tag)) || \ | ||
$(docker) build --tag "$(repo_url)/custom-cardano-db-sync:$(custom-cardano-db-sync_image_tag)" --file "$(root_dir)/scripts/govtool/custom-cardano-db-sync.Dockerfile"\ | ||
$(root_dir)/scripts/govtool | ||
|
||
.PHONY: push-custom-cardano-db-sync | ||
push-custom-cardano-db-sync: build-custom-cardano-db-sync | ||
$(call check_image_on_ecr,custom-cardano-db-sync,$(custom-cardano-db-sync_image_tag)) || \ | ||
$(docker) push $(repo_url)/custom-cardano-db-sync:$(custom-cardano-db-sync_image_tag) |