From 44764abdaa3b1c997b234956b80e6e8e57ef362e Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 17 Apr 2024 02:48:04 +0300 Subject: [PATCH] Added deploy scripts. --- ...fofplay-apex-historical-crawl-events.service | 17 +++++++++++++++++ ...oofofplay-apex-historical-crawl-events.timer | 9 +++++++++ ...y-apex-historical-crawl-transactions.service | 17 +++++++++++++++++ ...lay-apex-historical-crawl-transactions.timer | 9 +++++++++ .../deploy/proofofplay-apex-missing.service | 11 +++++++++++ crawlers/deploy/proofofplay-apex-missing.timer | 9 +++++++++ .../proofofplay-apex-moonworm-crawler.service | 17 +++++++++++++++++ .../deploy/proofofplay-apex-synchronize.service | 17 +++++++++++++++++ 8 files changed, 106 insertions(+) create mode 100644 crawlers/deploy/proofofplay-apex-historical-crawl-events.service create mode 100644 crawlers/deploy/proofofplay-apex-historical-crawl-events.timer create mode 100644 crawlers/deploy/proofofplay-apex-historical-crawl-transactions.service create mode 100644 crawlers/deploy/proofofplay-apex-historical-crawl-transactions.timer create mode 100644 crawlers/deploy/proofofplay-apex-missing.service create mode 100644 crawlers/deploy/proofofplay-apex-missing.timer create mode 100644 crawlers/deploy/proofofplay-apex-moonworm-crawler.service create mode 100644 crawlers/deploy/proofofplay-apex-synchronize.service diff --git a/crawlers/deploy/proofofplay-apex-historical-crawl-events.service b/crawlers/deploy/proofofplay-apex-historical-crawl-events.service new file mode 100644 index 00000000..48309bd8 --- /dev/null +++ b/crawlers/deploy/proofofplay-apex-historical-crawl-events.service @@ -0,0 +1,17 @@ +[Unit] +Description=ProofOfPlay historical crawler events +After=network.target +StartLimitIntervalSec=300 +StartLimitBurst=3 + +[Service] +WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl +EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env +Restart=on-failure +RestartSec=15s +ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli historical-crawl --blockchain-type proofofplay_apex --find-deployed-blocks --end 0 --tasks-journal --only-events +CPUWeight=70 +SyslogIdentifier=proofofplay-apex-historical-crawl-events + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/crawlers/deploy/proofofplay-apex-historical-crawl-events.timer b/crawlers/deploy/proofofplay-apex-historical-crawl-events.timer new file mode 100644 index 00000000..66f179e8 --- /dev/null +++ b/crawlers/deploy/proofofplay-apex-historical-crawl-events.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Runs events historical crawler on proofofplay apex + +[Timer] +OnBootSec=60s +OnUnitActiveSec=10m + +[Install] +WantedBy=timers.target diff --git a/crawlers/deploy/proofofplay-apex-historical-crawl-transactions.service b/crawlers/deploy/proofofplay-apex-historical-crawl-transactions.service new file mode 100644 index 00000000..522a1ecd --- /dev/null +++ b/crawlers/deploy/proofofplay-apex-historical-crawl-transactions.service @@ -0,0 +1,17 @@ +[Unit] +Description=ProofOfPlay historical crawler transactions +After=network.target +StartLimitIntervalSec=300 +StartLimitBurst=3 + +[Service] +WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl +EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env +Restart=on-failure +RestartSec=15s +ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli historical-crawl --blockchain-type proofofplay_apex --find-deployed-blocks --end 0 --tasks-journal --only-functions +CPUWeight=70 +SyslogIdentifier=proofofplay-apex-historical-crawl-transactions + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/crawlers/deploy/proofofplay-apex-historical-crawl-transactions.timer b/crawlers/deploy/proofofplay-apex-historical-crawl-transactions.timer new file mode 100644 index 00000000..025ad1ad --- /dev/null +++ b/crawlers/deploy/proofofplay-apex-historical-crawl-transactions.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Runs transactions historical crawler on proofofplay apex + +[Timer] +OnBootSec=60s +OnUnitActiveSec=10m + +[Install] +WantedBy=timers.target diff --git a/crawlers/deploy/proofofplay-apex-missing.service b/crawlers/deploy/proofofplay-apex-missing.service new file mode 100644 index 00000000..a2724b62 --- /dev/null +++ b/crawlers/deploy/proofofplay-apex-missing.service @@ -0,0 +1,11 @@ +[Unit] +Description=Fill missing blocks at ProofOfPlay database +After=network.target + +[Service] +Type=oneshot +WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl +EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env +ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain proofofplay_apex -n +CPUWeight=50 +SyslogIdentifier=proofofplay-apex-missing \ No newline at end of file diff --git a/crawlers/deploy/proofofplay-apex-missing.timer b/crawlers/deploy/proofofplay-apex-missing.timer new file mode 100644 index 00000000..bfb85ed8 --- /dev/null +++ b/crawlers/deploy/proofofplay-apex-missing.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Fill missing blocks at ProofOfPlay database + +[Timer] +OnBootSec=120s +OnUnitActiveSec=15m + +[Install] +WantedBy=timers.target diff --git a/crawlers/deploy/proofofplay-apex-moonworm-crawler.service b/crawlers/deploy/proofofplay-apex-moonworm-crawler.service new file mode 100644 index 00000000..f2ff4bf8 --- /dev/null +++ b/crawlers/deploy/proofofplay-apex-moonworm-crawler.service @@ -0,0 +1,17 @@ +[Unit] +Description=ProofOfPlay Apex moonworm crawler +After=network.target +StartLimitIntervalSec=300 +StartLimitBurst=3 + +[Service] +WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl +EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env +Restart=on-failure +RestartSec=15s +ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli crawl -b proofofplay_apex --confirmations 50 --min-blocks-batch 20 +CPUWeight=70 +SyslogIdentifier=proofofplay-apex-moonworm-crawler + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/crawlers/deploy/proofofplay-apex-synchronize.service b/crawlers/deploy/proofofplay-apex-synchronize.service new file mode 100644 index 00000000..e6b4c79e --- /dev/null +++ b/crawlers/deploy/proofofplay-apex-synchronize.service @@ -0,0 +1,17 @@ +[Unit] +Description=ProofOfPlay Apex block with transactions synchronizer +StartLimitIntervalSec=300 +StartLimitBurst=3 +After=network.target + +[Service] +Restart=on-failure +RestartSec=15s +WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl +EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env +ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain proofofplay_apex --confirmations 40 --jobs 2 +CPUWeight=90 +SyslogIdentifier=proofofplay-apex-synchronize + +[Install] +WantedBy=multi-user.target \ No newline at end of file