Skip to content

Commit

Permalink
Add missing definition for metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
dostrelith678 committed Nov 28, 2021
1 parent 2c23d40 commit b91d74d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion files/docker/grest/.env
@@ -1,5 +1,5 @@
# set the username and password for postgres
POSTGRES_USER=guild
POSTGRES_USER=postgres
POSTGRES_PASSWORD=02h347fowuipv90

# don't change the 'cexplorer' db name - required by db-sync
Expand Down
12 changes: 6 additions & 6 deletions files/docker/grest/docker-entrypoint.sh
Expand Up @@ -8,19 +8,19 @@ apt-get install -y --no-install-recommends cron > /dev/null 2>&1
# To add a user without a password the command is the foloowing:
# adduser --disabled-password --gecos '' guild#
sed -i 's/%sudo.*/%sudo ALL=(ALL) NOPASSWD:ALL/g' /etc/sudoers > /dev/null 2>&1
adduser guild sudo > /dev/null 2>&1
adduser postgres sudo > /dev/null 2>&1


# Sets the postgres user cronJobs
chown guild:root /etc/cron.d/crontab > /dev/null 2>&1
chown postgres:root /etc/cron.d/crontab > /dev/null 2>&1
chmod 0660 /etc/cron.d/crontab > /dev/null 2>&1
touch /var/log/cron.log > /dev/null 2>&1
chmod 0660 /var/log/cron.log > /dev/null 2>&1
chown guild:root /var/log/cron.log > /dev/null 2>&1
crontab -u guild /etc/cron.d/crontab > /dev/null 2>&1
chown postgres:root /var/log/cron.log > /dev/null 2>&1
crontab -u postgres /etc/cron.d/crontab > /dev/null 2>&1

# Listen for metrics via guild user
sudo -u guild socat TCP-LISTEN:8059,reuseaddr,fork SYSTEM:"echo HTTP/1.1 200 OK;SERVED=true bash /getmetrics.sh " &
# Listen for metrics via postgres user
sudo -u postgres socat TCP-LISTEN:8059,reuseaddr,fork SYSTEM:"echo HTTP/1.1 200 OK;SERVED=true bash /getmetrics.sh " &

###################### Customisations - END ###################################

Expand Down
2 changes: 2 additions & 0 deletions files/docker/grest/scripts/docker-getmetrics.sh
Expand Up @@ -7,6 +7,7 @@
######################################

#BYRON_EPOCH_LENGTH=2160 # 2160 for mainnet | other networks to-do
#BYRON_SLOT_LENGTH=20000 # 20000 for mainnet | other networks to-do
#BYRON_GENESIS_START_SEC=1506203091 # 1506203091 for mainnet | other networks to-do
#SHELLEY_TRANS_EPOCH=208 # 208 for mainnet | other networks to-do

Expand Down Expand Up @@ -64,6 +65,7 @@ exec 2>/dev/null
[[ -z ${SHELLEY_TRANS_EPOCH} ]] && SHELLEY_TRANS_EPOCH=208
[[ -z ${BYRON_EPOCH_LENGTH} ]] && BYRON_EPOCH_LENGTH=2160
[[ -z ${BYRON_GENESIS_START_SEC} ]] && BYRON_GENESIS_START_SEC=1506203091
[[ -z ${BYRON_SLOT_LENGTH} ]] && BYRON_SLOT_LENGTH=20000



Expand Down

0 comments on commit b91d74d

Please sign in to comment.