Skip to content

Commit

Permalink
Add deploy to main deploy file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey committed Jun 7, 2024
1 parent 7640f96 commit 626423b
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 0 deletions.
67 changes: 67 additions & 0 deletions deploy/deploy.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ SCRIPT_DIR="$(realpath $(dirname $0))"
USER_SYSTEMD_DIR="${USER_SYSTEMD_DIR:-/home/ubuntu/.config/systemd/user}"

# Service files
# Crawler
SEER_CRAWLER_ARBITRUM_ONE_SERVICE_FILE="seer-crawler-arbitrum-one.service"
SEER_CRAWLER_ARBITRUM_SEPOLIA_SERVICE_FILE="seer-crawler-arbitrum-sepolia.service"
SEER_CRAWLER_ETHEREUM_SERVICE_FILE="seer-crawler-ethereum.service"
Expand All @@ -32,8 +33,16 @@ SEER_CRAWLER_POLYGON_SERVICE_FILE="seer-crawler-polygon.service"
SEER_CRAWLER_XAI_SEPOLIA_SERVICE_FILE="seer-crawler-xai-sepolia.service"
SEER_CRAWLER_XAI_SERVICE_FILE="seer-crawler-xai.service"

# Synchronizer
SEER_SYNCHRONIZER_ETHEREUM_SERVICE_FILE="seer-synchronizer-ethereum.service"
SEER_SYNCHRONIZER_POLYGON_SERVICE_FILE="seer-synchronizer-polygon.service"
SEER_SYNCHRONIZER_ARBITRUM_ONE_SERVICE_FILE="seer-synchronizer-arbitrum-one.service"
SEER_SYNCHRONIZER_ARBITRUM_SEPOLIA_SERVICE_FILE="seer-synchronizer-arbitrum-sepolia.service"
SEER_SYNCHRONIZER_GAME7_ORBIT_ARBITRUM_SEPOLIA_SERVICE_FILE="seer-synchronizer-game7-orbit-arbitrum-sepolia.service"
SEER_SYNCHRONIZER_MANTLE_SEPOLIA_SERVICE_FILE="seer-synchronizer-mantle-sepolia.service"
SEER_SYNCHRONIZER_MANTLE_SERVICE_FILE="seer-synchronizer-mantle.service"
SEER_SYNCHRONIZER_XAI_SEPOLIA_SERVICE_FILE="seer-synchronizer-xai-sepolia.service"
SEER_SYNCHRONIZER_XAI_SERVICE_FILE="seer-synchronizer-xai.service"

set -eu

Expand Down Expand Up @@ -198,3 +207,61 @@ chmod 644 "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_POLYGON_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_POLYGON_SERVICE_FILE}" "${USER_SYSTEMD_DIR}/${SEER_SYNCHRONIZER_POLYGON_SERVICE_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_SYNCHRONIZER_POLYGON_SERVICE_FILE}"



echo
echo
echo -e "${PREFIX_INFO} Replacing existing seer synchronizer for Arbitrum One blockchain service definition with ${SEER_SYNCHRONIZER_ARBITRUM_ONE_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_ARBITRUM_ONE_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_ARBITRUM_ONE_SERVICE_FILE}" "${USER_SYSTEMD_DIR}/${SEER_SYNCHRONIZER_ARBITRUM_ONE_SERVICE_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_SYNCHRONIZER_ARBITRUM_ONE_SERVICE_FILE}"

echo
echo
echo -e "${PREFIX_INFO} Replacing existing seer synchronizer for Arbitrum Sepolia blockchain service definition with ${SEER_SYNCHRONIZER_ARBITRUM_SEPOLIA_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_ARBITRUM_SEPOLIA_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_ARBITRUM_SEPOLIA_SERVICE_FILE}" "${USER_SYSTEMD_DIR}/${SEER_SYNCHRONIZER_ARBITRUM_SEPOLIA_SERVICE_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_SYNCHRONIZER_ARBITRUM_SEPOLIA_SERVICE_FILE}"

echo
echo
echo -e "${PREFIX_INFO} Replacing existing seer synchronizer for Game7 Orbit Arbitrum Sepolia blockchain service definition with ${SEER_SYNCHRONIZER_GAME7_ORBIT_ARBITRUM_SEPOLIA_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_GAME7_ORBIT_ARBITRUM_SEPOLIA_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_GAME7_ORBIT_ARBITRUM_SEPOLIA_SERVICE_FILE}" "${USER_SYSTEMD_DIR}/${SEER_SYNCHRONIZER_GAME7_ORBIT_ARBITRUM_SEPOLIA_SERVICE_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_SYNCHRONIZER_GAME7_ORBIT_ARBITRUM_SEPOLIA_SERVICE_FILE}"

echo
echo
echo -e "${PREFIX_INFO} Replacing existing seer synchronizer for Mantle Sepolia blockchain service definition with ${SEER_SYNCHRONIZER_MANTLE_SEPOLIA_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_MANTLE_SEPOLIA_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_MANTLE_SEPOLIA_SERVICE_FILE}" "${USER_SYSTEMD_DIR}/${SEER_SYNCHRONIZER_MANTLE_SEPOLIA_SERVICE_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_SYNCHRONIZER_MANTLE_SEPOLIA_SERVICE_FILE}"

echo
echo
echo -e "${PREFIX_INFO} Replacing existing seer synchronizer for Mantle blockchain service definition with ${SEER_SYNCHRONIZER_MANTLE_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_MANTLE_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_MANTLE_SERVICE_FILE}" "${USER_SYSTEMD_DIR}/${SEER_SYNCHRONIZER_MANTLE_SERVICE_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_SYNCHRONIZER_MANTLE_SERVICE_FILE}"

echo
echo
echo -e "${PREFIX_INFO} Replacing existing seer synchronizer for Xai Sepolia blockchain service definition with ${SEER_SYNCHRONIZER_XAI_SEPOLIA_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_XAI_SEPOLIA_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_XAI_SEPOLIA_SERVICE_FILE}" "${USER_SYSTEMD_DIR}/${SEER_SYNCHRONIZER_XAI_SEPOLIA_SERVICE_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_SYNCHRONIZER_XAI_SEPOLIA_SERVICE_FILE}"

echo
echo
echo -e "${PREFIX_INFO} Replacing existing seer synchronizer for Xai blockchain service definition with ${SEER_SYNCHRONIZER_XAI_SERVICE_FILE}"
chmod 644 "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_XAI_SERVICE_FILE}"
cp "${SCRIPT_DIR}/${SEER_SYNCHRONIZER_XAI_SERVICE_FILE}" "${USER_SYSTEMD_DIR}/${SEER_SYNCHRONIZER_XAI_SERVICE_FILE}"
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart "${SEER_SYNCHRONIZER_XAI_SERVICE_FILE}"
16 changes: 16 additions & 0 deletions deploy/seer-synchronizer-arbitrum-one.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Seer synchronizer service for arbitrum one blockchain
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3

[Service]
WorkingDirectory=/home/ubuntu/seer
EnvironmentFile=/home/ubuntu/seer-secrets/app.env
Restart=on-failure
RestartSec=15s
ExecStart=/home/ubuntu/seer/seer synchronizer --chain arbitrum_one
SyslogIdentifier=seer-synchronizer-arbitrum-one

[Install]
WantedBy=multi-user.target
16 changes: 16 additions & 0 deletions deploy/seer-synchronizer-arbitrum-sepolia.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Seer synchronizer service for arbitrum sepolia blockchain
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3

[Service]
WorkingDirectory=/home/ubuntu/seer
EnvironmentFile=/home/ubuntu/seer-secrets/app.env
Restart=on-failure
RestartSec=15s
ExecStart=/home/ubuntu/seer/seer synchronizer --chain arbitrum_sepolia
SyslogIdentifier=seer-synchronizer-arbitrum-sepolia

[Install]
WantedBy=multi-user.target
16 changes: 16 additions & 0 deletions deploy/seer-synchronizer-game7-orbit-arbitrum-sepolia.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Seer synchronizer service for game7 orbit arbitrum sepolia blockchain
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3

[Service]
WorkingDirectory=/home/ubuntu/seer
EnvironmentFile=/home/ubuntu/seer-secrets/app.env
Restart=on-failure
RestartSec=15s
ExecStart=/home/ubuntu/seer/seer indexer --chain game7_orbit_arbitrum_sepolia
SyslogIdentifier=seer-synchronizer-game7-orbit-arbitrum-sepolia

[Install]
WantedBy=multi-user.target
16 changes: 16 additions & 0 deletions deploy/seer-synchronizer-mantle-sepolia.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Seer synchronizer service for mantle sepolia blockchain
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3

[Service]
WorkingDirectory=/home/ubuntu/seer
EnvironmentFile=/home/ubuntu/seer-secrets/app.env
Restart=on-failure
RestartSec=15s
ExecStart=/home/ubuntu/seer/seer synchronizer --chain mantle_sepolia
SyslogIdentifier=seer-synchronizer-mantle-sepolia

[Install]
WantedBy=multi-user.target
16 changes: 16 additions & 0 deletions deploy/seer-synchronizer-mantle.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Seer synchronizer service for mantle blockchain
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3

[Service]
WorkingDirectory=/home/ubuntu/seer
EnvironmentFile=/home/ubuntu/seer-secrets/app.env
Restart=on-failure
RestartSec=15s
ExecStart=/home/ubuntu/seer/seer synchronizer --chain mantle
SyslogIdentifier=seer-synchronizer-mantle

[Install]
WantedBy=multi-user.target
16 changes: 16 additions & 0 deletions deploy/seer-synchronizer-xai-sepolia.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Seer synchronizer service for xai sepolia blockchain
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3

[Service]
WorkingDirectory=/home/ubuntu/seer
EnvironmentFile=/home/ubuntu/seer-secrets/app.env
Restart=on-failure
RestartSec=15s
ExecStart=/home/ubuntu/seer/seer synchronizer --chain xai_sepolia
SyslogIdentifier=seer-synchronizer-xai-sepolia

[Install]
WantedBy=multi-user.target
16 changes: 16 additions & 0 deletions deploy/seer-synchronizer-xai.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Seer synchronizer service for xai blockchain
After=network.target
StartLimitIntervalSec=300
StartLimitBurst=3

[Service]
WorkingDirectory=/home/ubuntu/seer
EnvironmentFile=/home/ubuntu/seer-secrets/app.env
Restart=on-failure
RestartSec=15s
ExecStart=/home/ubuntu/seer/seer synchronizer --chain xai
SyslogIdentifier=seer-synchronizer-xai

[Install]
WantedBy=multi-user.target

0 comments on commit 626423b

Please sign in to comment.