kopia lustrzana https://github.com/bugout-dev/moonstream
Porównaj commity
111 Commity
moonstream
...
main
Autor | SHA1 | Data |
---|---|---|
Andrey Dolgolev | da2da94b55 | |
Andrey | 18e650d233 | |
Sergei Sumarokov | e2fb5b10e5 | |
Andrey Dolgolev | 3e813a21bc | |
Andrey | 2c71082895 | |
kompotkot | daf47028a4 | |
kompotkot | 15567735c9 | |
kompotkot | 516e507123 | |
Andrey | af1ad369a9 | |
Andrey | 819e0b18b2 | |
Andrey | 63383a40e2 | |
kompotkot | 9a31d145e0 | |
kompotkot | f6e541edab | |
kompotkot | e1c62d9932 | |
kompotkot | 12345e42a3 | |
kompotkot | e700efff5b | |
Andrey Dolgolev | 135af1765c | |
Andrey | 6874ff62f4 | |
Andrey | 8506995513 | |
Sergei Sumarokov | 2caaa82953 | |
Sergei Sumarokov | 3299380916 | |
kompotkot | 03a6601ded | |
kompotkot | 1bb23eeda4 | |
Sergei Sumarokov | 262ea4c792 | |
kompotkot | a6ba053f10 | |
Andrey Dolgolev | f3a3601a88 | |
kompotkot | f6bc86f082 | |
Andrey | 3eb0301304 | |
Andrey | a74d5ce76c | |
Andrey | a31ce2c588 | |
Andrey | 0854656a6e | |
Andrey | 3721ec9f6f | |
Andrey | 3bd8a68bd7 | |
Andrey | c42d8ccd10 | |
Andrey | a15b2f94ed | |
Andrey | ce628b6e0b | |
Andrey | 44764abdaa | |
Andrey | c64eec10f6 | |
Andrey | 911f7e7ebe | |
Sergei Sumarokov | 3cab309c42 | |
kompotkot | 8d1f5f4b4c | |
Sergei Sumarokov | f5ff9427fe | |
kompotkot | 9a5bc824c4 | |
Sergei Sumarokov | 41787fafaa | |
kompotkot | e5f324b841 | |
Sergei Sumarokov | 1d0fcda13c | |
kompotkot | bf653b3202 | |
kompotkot | 8a556b0b1f | |
kompotkot | 6a773965b2 | |
kompotkot | 525abb8a5f | |
kompotkot | 3d81cb79fc | |
Sergei Sumarokov | 50d7c826be | |
kompotkot | ece119afdd | |
Sergei Sumarokov | 13054433da | |
kompotkot | 9bb392dc0b | |
kompotkot | df3365167a | |
Sergei Sumarokov | becb5b8843 | |
kompotkot | c4e313e15c | |
kompotkot | 2221b45bc9 | |
Sergei Sumarokov | 163049b9b6 | |
Sergei Sumarokov | 7994da519b | |
kompotkot | f84788a6c1 | |
kompotkot | 784ff2a740 | |
kompotkot | 49b49153ac | |
Sergei Sumarokov | 25fc91569d | |
kompotkot | c06d9df61b | |
Sergei Sumarokov | 7ec2ee5003 | |
kompotkot | 23b20284f9 | |
Sergei Sumarokov | 1f31738b44 | |
Andrey Dolgolev | c139c488c1 | |
Andrey | 1e0ce12634 | |
Andrey | 220e7f1a7d | |
Andrey | aa08db0473 | |
Andrey | c3dc91b0f5 | |
Andrey | 4a41852bea | |
Andrey Dolgolev | d22606508e | |
Andrey | 46c708db4c | |
Andrey Dolgolev | d235d3b9a7 | |
Andrey | 474ee11a2f | |
Andrey | 6f210a2a69 | |
kompotkot | 640a8d12a0 | |
Andrey | 6923754115 | |
Andrey | cc5791578d | |
Andrey | f9258b2eee | |
Andrey | b5f14d5759 | |
Sergei Sumarokov | 19a17f83e2 | |
kompotkot | 5ab43d398e | |
kompotkot | e406fc5b8a | |
kompotkot | 8af25265b3 | |
kompotkot | b8846f49e2 | |
kompotkot | d85870b525 | |
Sergei Sumarokov | cbbac43d05 | |
kompotkot | f60eb178b9 | |
Sergei Sumarokov | e6989aba3d | |
kompotkot | 7f620e997b | |
Sergei Sumarokov | 45acffa709 | |
kompotkot | 0a092e6fac | |
kompotkot | 5030865ef1 | |
kompotkot | 51f6e5d02e | |
kompotkot | 44b656fb9b | |
kompotkot | d0cd24dd5f | |
kompotkot | 650d45a334 | |
kompotkot | f913ec73ae | |
Andrey | 799353b39a | |
Andrey | d4c3ebd84d | |
Andrey | e3072a36ad | |
Andrey | 63347d81f3 | |
Andrey | 07734d1b2b | |
Andrey | 0e5ea6f4cc | |
Andrey | 338418ef72 | |
Andrey | 1b3b2a3cdd |
|
@ -0,0 +1,30 @@
|
|||
name: Release moonstreamdbv3 package
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'moonstreamdbv3/v*'
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: moonstreamdb-v3
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.8'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -e .[distribute]
|
||||
- name: Build and publish
|
||||
env:
|
||||
TWINE_USERNAME: "__token__"
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_MOONSTREAMDBV3 }}
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
twine upload dist/*
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=Mumbai historical crawler events
|
||||
Description=Amoy historical crawler events
|
||||
After=network.target
|
||||
StartLimitIntervalSec=300
|
||||
StartLimitBurst=3
|
||||
|
@ -9,9 +9,9 @@ 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 mumbai --find-deployed-blocks --end 0 --tasks-journal --only-events
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli historical-crawl --blockchain-type amoy --find-deployed-blocks --end 0 --tasks-journal --only-events
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=mumbai-historical-crawl-events
|
||||
SyslogIdentifier=amoy-historical-crawl-events
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=Runs events historical crawler on mumbai
|
||||
Description=Runs events historical crawler on Amoy
|
||||
|
||||
[Timer]
|
||||
OnBootSec=60s
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=Mumbai historical crawler transactions
|
||||
Description=Amoy historical crawler transactions
|
||||
After=network.target
|
||||
StartLimitIntervalSec=300
|
||||
StartLimitBurst=3
|
||||
|
@ -9,9 +9,9 @@ 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 mumbai --find-deployed-blocks --end 0 --tasks-journal --only-functions
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli historical-crawl --blockchain-type amoy --find-deployed-blocks --end 0 --tasks-journal --only-functions
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=mumbai-historical-crawl-transactions
|
||||
SyslogIdentifier=amoy-historical-crawl-transactions
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=Runs transactions historical crawler on mumbai
|
||||
Description=Runs transactions historical crawler on Amoy
|
||||
|
||||
[Timer]
|
||||
OnBootSec=60s
|
|
@ -1,11 +1,11 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at Mumbai database
|
||||
Description=Fill missing blocks at Amoy 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 mumbai -n
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain amoy -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=mumbai-missing
|
||||
SyslogIdentifier=amoy-missing
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at Mumbai database
|
||||
Description=Fill missing blocks at Amoy database
|
||||
|
||||
[Timer]
|
||||
OnBootSec=120s
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=Mumbai moonworm crawler
|
||||
Description=Amoy moonworm crawler
|
||||
After=network.target
|
||||
StartLimitIntervalSec=300
|
||||
StartLimitBurst=3
|
||||
|
@ -9,9 +9,9 @@ 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 mumbai --confirmations 40
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli crawl -b amoy --confirmations 10 --min-blocks-batch 20
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=mumbai-moonworm-crawler
|
||||
SyslogIdentifier=amoy-moonworm-crawler
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=Mumbai block with transactions synchronizer
|
||||
Description=Amoy block with transactions synchronizer
|
||||
StartLimitIntervalSec=300
|
||||
StartLimitBurst=3
|
||||
After=network.target
|
||||
|
@ -9,9 +9,9 @@ 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 mumbai -c 20 -j 2
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain amoy -c 10 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=mumbai-synchronize
|
||||
SyslogIdentifier=amoy-synchronize
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Arbitrum One 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 arbitrum_one --find-deployed-blocks --end 0 --tasks-journal --only-events
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=arbitrum-one-historical-crawl-events
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=Runs transactions historical crawler on ZkSync Era testnet
|
||||
Description=Runs events historical crawler on arbitrum one
|
||||
|
||||
[Timer]
|
||||
OnBootSec=60s
|
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Arbitrum One 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 arbitrum_one --find-deployed-blocks --end 0 --tasks-journal --only-functions
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=arbitrum-one-historical-crawl-transactions
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Runs transactions historical crawler on proofofplay apex
|
||||
|
||||
[Timer]
|
||||
OnBootSec=60s
|
||||
OnUnitActiveSec=10m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -1,11 +1,11 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at ZkSync Era testnet database
|
||||
Description=Fill missing blocks at Arbitrum One 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 zksync_era_testnet -n
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain arbitrum_one -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=zksync-era-testnet-missing
|
||||
SyslogIdentifier=arbitrum-one-missing
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at Arbitrum One database
|
||||
|
||||
[Timer]
|
||||
OnBootSec=120s
|
||||
OnUnitActiveSec=15m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=ZkSync Era testnet moonworm crawler
|
||||
Description=Arbitrum One moonworm crawler
|
||||
After=network.target
|
||||
StartLimitIntervalSec=300
|
||||
StartLimitBurst=3
|
||||
|
@ -9,9 +9,9 @@ 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 zksync_era_testnet --confirmations 20 --min-blocks-batch 20
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli crawl -b arbitrum_one --confirmations 10 --min-blocks-batch 20
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=zksync-era-testnet-moonworm-crawler
|
||||
SyslogIdentifier=arbitrum-one-moonworm-crawler
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=ZkSync Era testnet block with transactions synchronizer
|
||||
Description=Arbitrum One block with transactions synchronizer
|
||||
StartLimitIntervalSec=300
|
||||
StartLimitBurst=3
|
||||
After=network.target
|
||||
|
@ -9,9 +9,9 @@ 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 zksync_era_testnet -c 20 -j 2
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain arbitrum_one -c 10 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=zksync-era-testnet-synchronize
|
||||
SyslogIdentifier=arbitrum-one-synchronize
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at Avalanche Fuji 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 avalanche_fuji -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=avalanche-fuji-missing
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at Avalanche Fuji database
|
||||
|
||||
[Timer]
|
||||
OnBootSec=120s
|
||||
OnUnitActiveSec=15m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Avalanche Fuji 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 avalanche_fuji --confirmations 10 --min-blocks-batch 20
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=avalanche-fuji-moonworm-crawler
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Avalanche Fuji 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 avalanche_fuji -c 10 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=avalanche-fuji-synchronize
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at Avalanche 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 avalanche -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=avalanche-missing
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at Avalanche database
|
||||
|
||||
[Timer]
|
||||
OnBootSec=120s
|
||||
OnUnitActiveSec=15m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Avalanche 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 avalanche --confirmations 10 --min-blocks-batch 20
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=avalanche-moonworm-crawler
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Avalanche 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 avalanche -c 10 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=avalanche-synchronize
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at Blast 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 blast -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=blast-missing
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at Blast database
|
||||
|
||||
[Timer]
|
||||
OnBootSec=120s
|
||||
OnUnitActiveSec=15m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Blast 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 blast --confirmations 10 --min-blocks-batch 20
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=blast-moonworm-crawler
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at Blast Sepolia 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 blast_sepolia -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=blast-sepolia-missing
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at Blast Sepolia database
|
||||
|
||||
[Timer]
|
||||
OnBootSec=120s
|
||||
OnUnitActiveSec=15m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Blast Sepolia 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 blast_sepolia --confirmations 10 --min-blocks-batch 20
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=blast-sepolia-moonworm-crawler
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Blast Sepolia 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 blast_sepolia -c 10 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=blast-sepolia-synchronize
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Blast 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 blast -c 10 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=blast-synchronize
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -43,10 +43,10 @@ POLYGON_MISSING_TIMER_FILE="polygon-missing.timer"
|
|||
POLYGON_CU_NFT_DASHBOARD_SERVICE_FILE="polygon-cu-nft-dashboard.service"
|
||||
POLYGON_CU_NFT_DASHBOARD_TIMER_FILE="polygon-cu-nft-dashboard.timer"
|
||||
|
||||
# Mumbai service files
|
||||
MUMBAI_SYNCHRONIZE_SERVICE="mumbai-synchronize.service"
|
||||
MUMBAI_MISSING_SERVICE_FILE="mumbai-missing.service"
|
||||
MUMBAI_MISSING_TIMER_FILE="mumbai-missing.timer"
|
||||
# Amoy
|
||||
AMOY_MISSING_SERVICE_FILE="amoy-missing.service"
|
||||
AMOY_MISSING_TIMER_FILE="amoy-missing.timer"
|
||||
AMOY_SYNCHRONIZE_SERVICE="amoy-synchronize.service"
|
||||
|
||||
# XDai service files
|
||||
XDAI_SYNCHRONIZE_SERVICE="xdai-synchronize.service"
|
||||
|
@ -63,6 +63,11 @@ ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE="zksync-era-sepolia-synchronize.service"
|
|||
ZKSYNC_ERA_SEPOLIA_MISSING_SERVICE_FILE="zksync-era-sepolia-missing.service"
|
||||
ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE="zksync-era-sepolia-missing.timer"
|
||||
|
||||
# Arbitrum one
|
||||
ARBITRUM_ONE_SYNCHRONIZE_SERVICE="arbitrum-one-synchronize.service"
|
||||
ARBITRUM_ONE_MISSING_SERVICE_FILE="arbitrum-one-missing.service"
|
||||
ARBITRUM_ONE_MISSING_TIMER_FILE="arbitrum-one-missing.timer"
|
||||
|
||||
# Arbitrum Nova
|
||||
ARBITRUM_NOVA_SYNCHRONIZE_SERVICE="arbitrum-nova-synchronize.service"
|
||||
ARBITRUM_NOVA_MISSING_SERVICE_FILE="arbitrum-nova-missing.service"
|
||||
|
@ -93,6 +98,21 @@ AVALANCHE_FUJI_SYNCHRONIZE_SERVICE="avalanche-fuji-synchronize.service"
|
|||
AVALANCHE_FUJI_MISSING_SERVICE_FILE="avalanche-fuji-missing.service"
|
||||
AVALANCHE_FUJI_MISSING_TIMER_FILE="avalanche-fuji-missing.timer"
|
||||
|
||||
# Blast
|
||||
BLAST_MISSING_SERVICE_FILE="blast-missing.service"
|
||||
BLAST_MISSING_TIMER_FILE="blast-missing.timer"
|
||||
BLAST_SYNCHRONIZE_SERVICE="blast-synchronize.service"
|
||||
|
||||
# Blast sepolia
|
||||
BLAST_SEPOLIA_MISSING_SERVICE_FILE="blast-sepolia-missing.service"
|
||||
BLAST_SEPOLIA_MISSING_TIMER_FILE="blast-sepolia-missing.timer"
|
||||
BLAST_SEPOLIA_SYNCHRONIZE_SERVICE="blast-sepolia-synchronize.service"
|
||||
|
||||
# ProofofPlay APEX
|
||||
PROOFOFPLAY_APEX_MISSING_SERVICE_FILE="proofofplay-apex-missing.service"
|
||||
PROOFOFPLAY_APEX_MISSING_TIMER_FILE="proofofplay-apex-missing.timer"
|
||||
PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE="proofofplay-apex-synchronize.service"
|
||||
|
||||
set -eu
|
||||
|
||||
echo
|
||||
|
@ -117,7 +137,7 @@ if [ ! -d "${SECRETS_DIR}" ]; then
|
|||
mkdir -p "${SECRETS_DIR}"
|
||||
echo -e "${PREFIX_WARN} Created new secrets directory"
|
||||
fi
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" CHECKENV_AWS_FETCH_LOOP_LIMIT=20 /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
|
||||
chmod 0640 "${PARAMETERS_ENV_PATH}"
|
||||
|
||||
echo
|
||||
|
@ -140,6 +160,15 @@ cp "${SCRIPT_DIR}/${MOONCRAWL_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MOONCRAWL_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Leaderboards worker service and timer with: ${LEADERBOARDS_WORKER_SERVICE_FILE}, ${LEADERBOARDS_WORKER_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${LEADERBOARDS_WORKER_SERVICE_FILE}" "${SCRIPT_DIR}/${LEADERBOARDS_WORKER_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${LEADERBOARDS_WORKER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${LEADERBOARDS_WORKER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${LEADERBOARDS_WORKER_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${LEADERBOARDS_WORKER_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${LEADERBOARDS_WORKER_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Ethereum block with transactions syncronizer service definition with ${ETHEREUM_SYNCHRONIZE_SERVICE_FILE}"
|
||||
|
@ -157,41 +186,6 @@ cp "${SCRIPT_DIR}/${ETHEREUM_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Ethereum moonworm crawler service definition with ${ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Ethereum state service and timer with: ${ETHEREUM_STATE_SERVICE_FILE}, ${ETHEREUM_STATE_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_STATE_SERVICE_FILE}" "${SCRIPT_DIR}/${ETHEREUM_STATE_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_STATE_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_STATE_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_STATE_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_STATE_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_STATE_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Ethereum state clean service and timer with: ${ETHEREUM_STATE_CLEAN_SERVICE_FILE}, ${ETHEREUM_STATE_CLEAN_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_STATE_CLEAN_SERVICE_FILE}" "${SCRIPT_DIR}/${ETHEREUM_STATE_CLEAN_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_STATE_CLEAN_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_STATE_CLEAN_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_STATE_CLEAN_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_STATE_CLEAN_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_STATE_CLEAN_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Ethereum metadata service and timer with: ${ETHEREUM_METADATA_SERVICE_FILE}, ${ETHEREUM_METADATA_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_METADATA_SERVICE_FILE}" "${SCRIPT_DIR}/${ETHEREUM_METADATA_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_METADATA_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_METADATA_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_METADATA_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_METADATA_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_METADATA_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Ethereum Orange DAO reports tokenonomics service and timer with: ${ETHEREUM_ORANGE_DAO_REPORTS_TOKENONOMICS_SERVICE_FILE}, ${ETHEREUM_ORANGE_DAO_TOKENONOMICS_TIMER_FILE}"
|
||||
|
@ -201,25 +195,6 @@ cp "${SCRIPT_DIR}/${ETHEREUM_ORANGE_DAO_TOKENONOMICS_TIMER_FILE}" "/home/ubuntu/
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_ORANGE_DAO_TOKENONOMICS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Ethereum historical transactions crawler service and timer with: ${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Ethereum historical events crawler service and timer with: ${ETHEREUM_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${ETHEREUM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon block with transactions syncronizer service definition with ${POLYGON_SYNCHRONIZE_SERVICE}"
|
||||
|
@ -237,43 +212,6 @@ cp "${SCRIPT_DIR}/${POLYGON_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/u
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_MISSING_TIMER_FILE}"
|
||||
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon moonworm crawler service definition with ${POLYGON_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${POLYGON_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon state service and timer with: ${POLYGON_STATE_SERVICE_FILE}, ${POLYGON_STATE_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${POLYGON_STATE_SERVICE_FILE}" "${SCRIPT_DIR}/${POLYGON_STATE_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATE_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_STATE_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATE_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_STATE_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_STATE_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon state clean service and timer with: ${POLYGON_STATE_CLEAN_SERVICE_FILE}, ${POLYGON_STATE_CLEAN_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${POLYGON_STATE_CLEAN_SERVICE_FILE}" "${SCRIPT_DIR}/${POLYGON_STATE_CLEAN_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATE_CLEAN_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_STATE_CLEAN_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_STATE_CLEAN_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_STATE_CLEAN_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_STATE_CLEAN_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon metadata service and timer with: ${POLYGON_METADATA_SERVICE_FILE}, ${POLYGON_METADATA_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${POLYGON_METADATA_SERVICE_FILE}" "${SCRIPT_DIR}/${POLYGON_METADATA_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_METADATA_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_METADATA_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_METADATA_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_METADATA_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_METADATA_TIMER_FILE}"
|
||||
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon CU reports tokenonomics service and timer with: ${POLYGON_CU_NFT_DASHBOARD_SERVICE_FILE}, ${POLYGON_CU_NFT_DASHBOARD_TIMER_FILE}"
|
||||
|
@ -283,94 +221,25 @@ cp "${SCRIPT_DIR}/${POLYGON_CU_NFT_DASHBOARD_TIMER_FILE}" "/home/ubuntu/.config/
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_CU_NFT_DASHBOARD_TIMER_FILE}"
|
||||
|
||||
# Amoy
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon historical transactions crawler service and timer with: ${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
echo -e "${PREFIX_INFO} Replacing existing Amoy block with transactions syncronizer service definition with ${AMOY_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${AMOY_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${AMOY_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AMOY_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Polygon historical events crawler service and timer with: ${POLYGON_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
echo -e "${PREFIX_INFO} Replacing existing Amoy missing service and timer with: ${AMOY_MISSING_SERVICE_FILE}, ${AMOY_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${AMOY_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${AMOY_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Mumbai block with transactions syncronizer service definition with ${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Mumbai missing service and timer with: ${MUMBAI_MISSING_SERVICE_FILE}, ${MUMBAI_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Mumbai moonworm crawler service definition with ${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI state service and timer with: ${MUMBAI_STATE_SERVICE_FILE}, ${MUMBAI_STATE_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_STATE_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_STATE_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_STATE_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI state clean service and timer with: ${MUMBAI_STATE_CLEAN_SERVICE_FILE}, ${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_CLEAN_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI metadata service and timer with: ${MUMBAI_METADATA_SERVICE_FILE}, ${MUMBAI_METADATA_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_METADATA_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_METADATA_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_METADATA_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_METADATA_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_METADATA_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_METADATA_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_METADATA_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI historical transactions crawler service and timer with: ${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI historical events crawler service and timer with: ${MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AMOY_MISSING_TIMER_FILE}"
|
||||
|
||||
# Xdai
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing XDai block with transactions syncronizer service definition with ${XDAI_SYNCHRONIZE_SERVICE}"
|
||||
|
@ -388,34 +257,6 @@ cp "${SCRIPT_DIR}/${XDAI_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XDAI_MISSING_TIMER_FILE}"
|
||||
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing XDai moonworm crawler service definition with ${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XDAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing xDai historical transactions crawler service and timer with: ${XDai_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${XDai_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XDai_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XDai_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XDai_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing xDai historical events crawler service and timer with: ${XDai_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${XDai_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XDai_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XDai_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XDai_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
|
||||
# ZkSync Era
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era block with transactions syncronizer service definition with ${ZKSYNC_ERA_SYNCHRONIZE_SERVICE}"
|
||||
|
@ -433,51 +274,6 @@ cp "${SCRIPT_DIR}/${ZKSYNC_ERA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/system
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era moonworm crawler service definition with ${ZKSYNC_ERA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era historical transactions crawler service and timer with: ${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era historical events crawler service and timer with: ${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era state service and timer with: ${ZKSYNC_ERA_STATE_SERVICE_FILE}, ${ZKSYNC_ERA_STATE_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_STATE_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_STATE_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_STATE_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era state clean service and timer with: ${ZKSYNC_ERA_STATE_CLEAN_SERVICE_FILE}, ${ZKSYNC_ERA_STATE_CLEAN_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_CLEAN_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_CLEAN_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_CLEAN_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_STATE_CLEAN_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_STATE_CLEAN_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_STATE_CLEAN_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_STATE_CLEAN_TIMER_FILE}"
|
||||
|
||||
# ZkSync Era Sepolia
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia block with transactions syncronizer service definition with ${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
|
@ -495,69 +291,25 @@ cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}" "/home/ubuntu/.confi
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
|
||||
|
||||
# Arbitrum one
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia moonworm crawler service definition with ${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum one block with transactions syncronizer service definition with ${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia historical transactions crawler service and timer with: ${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum one missing service and timer with: ${ARBITRUM_ONE_MISSING_SERVICE_FILE}, ${ARBITRUM_ONE_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${ARBITRUM_ONE_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_ONE_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia historical events crawler service and timer with: ${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Leaderboards worker service and timer with: ${LEADERBOARDS_WORKER_SERVICE_FILE}, ${LEADERBOARDS_WORKER_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${LEADERBOARDS_WORKER_SERVICE_FILE}" "${SCRIPT_DIR}/${LEADERBOARDS_WORKER_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${LEADERBOARDS_WORKER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${LEADERBOARDS_WORKER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${LEADERBOARDS_WORKER_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${LEADERBOARDS_WORKER_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${LEADERBOARDS_WORKER_TIMER_FILE}"
|
||||
|
||||
# ZkSync Era Sepolia
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia block with transactions syncronizer service definition with ${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia missing service and timer with: ${ZKSYNC_ERA_SEPOLIA_MISSING_SERVICE_FILE}, ${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia moonworm crawler service definition with ${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
# Arbitrum Nova
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum Nova block with transactions syncronizer service definition with ${ARBITRUM_NOVA_SYNCHRONIZE_SERVICE}"
|
||||
|
@ -575,16 +327,6 @@ cp "${SCRIPT_DIR}/${ARBITRUM_NOVA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/sys
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_NOVA_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum Nova moonworm crawler service definition with ${ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
|
||||
# Arbitrum Sepolia
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum Sepolia block with transactions syncronizer service definition with ${ARBITRUM_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
|
@ -602,17 +344,6 @@ cp "${SCRIPT_DIR}/${ARBITRUM_SEPOLIA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum Sepolia moonworm crawler service definition with ${ARBITRUM_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
|
||||
|
||||
# Xai
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Xai block with transactions syncronizer service definition with ${XAI_SYNCHRONIZE_SERVICE}"
|
||||
|
@ -630,16 +361,6 @@ cp "${SCRIPT_DIR}/${XAI_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Xai moonworm crawler service definition with ${XAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${XAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XAI_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
|
||||
# Xai sepolia
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Xai sepolia block with transactions syncronizer service definition with ${XAI_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
|
@ -657,15 +378,6 @@ cp "${SCRIPT_DIR}/${XAI_SEPOLIA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/syste
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Xai sepolia moonworm crawler service definition with ${XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
# Avalanche
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Avalanche block with transactions syncronizer service definition with ${AVALANCHE_SYNCHRONIZE_SERVICE}"
|
||||
|
@ -683,7 +395,6 @@ cp "${SCRIPT_DIR}/${AVALANCHE_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AVALANCHE_MISSING_TIMER_FILE}"
|
||||
|
||||
# Avalanche Fuji
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Avalanche Fuji block with transactions syncronizer service definition with ${AVALANCHE_FUJI_SYNCHRONIZE_SERVICE}"
|
||||
|
@ -700,3 +411,57 @@ cp "${SCRIPT_DIR}/${AVALANCHE_FUJI_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/
|
|||
cp "${SCRIPT_DIR}/${AVALANCHE_FUJI_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${AVALANCHE_FUJI_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AVALANCHE_FUJI_MISSING_TIMER_FILE}"
|
||||
|
||||
# Blast
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Blast block with transactions syncronizer service definition with ${BLAST_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${BLAST_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${BLAST_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Blast missing service and timer with: ${BLAST_MISSING_SERVICE_FILE}, ${BLAST_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${BLAST_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${BLAST_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_MISSING_TIMER_FILE}"
|
||||
|
||||
# Blast sepolia
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Blast sepolia block with transactions syncronizer service definition with ${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Blast sepolia missing service and timer with: ${BLAST_SEPOLIA_MISSING_SERVICE_FILE}, ${BLAST_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${BLAST_SEPOLIA_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${BLAST_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_SEPOLIA_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_SEPOLIA_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_SEPOLIA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
|
||||
# Proofofplay Apex
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex block with transactions syncronizer service definition with ${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex missing service and timer with: ${PROOFOFPLAY_APEX_MISSING_SERVICE_FILE}, ${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}"
|
||||
|
|
|
@ -36,11 +36,11 @@ POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="polygon-historical-crawl-trans
|
|||
POLYGON_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="polygon-historical-crawl-events.service"
|
||||
POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="polygon-historical-crawl-events.timer"
|
||||
|
||||
# Mumbai service files
|
||||
MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="mumbai-historical-crawl-transactions.service"
|
||||
MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="mumbai-historical-crawl-transactions.timer"
|
||||
MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="mumbai-historical-crawl-events.service"
|
||||
MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="mumbai-historical-crawl-events.timer"
|
||||
# Amoy service files
|
||||
AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="amoy-historical-crawl-transactions.service"
|
||||
AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="amoy-historical-crawl-transactions.timer"
|
||||
AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="amoy-historical-crawl-events.service"
|
||||
AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="amoy-historical-crawl-events.timer"
|
||||
|
||||
# XDai service files
|
||||
XDai_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="xdai-historical-crawl-transactions.service"
|
||||
|
@ -60,6 +60,18 @@ ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="zksync-era-sepolia-
|
|||
ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="zksync-era-sepolia-historical-crawl-events.service"
|
||||
ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="zksync-era-sepolia-historical-crawl-events.timer"
|
||||
|
||||
# Arbitrum one
|
||||
ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="arbitrum-one-historical-crawl-transactions.service"
|
||||
ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="arbitrum-one-historical-crawl-transactions.timer"
|
||||
ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="arbitrum-one-historical-crawl-events.service"
|
||||
ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="arbitrum-one-historical-crawl-events.timer"
|
||||
|
||||
# ProofofPlay APEX
|
||||
PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="proofofplay-apex-historical-crawl-transactions.service"
|
||||
PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="proofofplay-apex-historical-crawl-transactions.timer"
|
||||
PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="proofofplay-apex-historical-crawl-events.service"
|
||||
PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="proofofplay-apex-historical-crawl-events.timer"
|
||||
|
||||
set -eu
|
||||
|
||||
echo
|
||||
|
@ -84,7 +96,7 @@ if [ ! -d "${SECRETS_DIR}" ]; then
|
|||
mkdir -p "${SECRETS_DIR}"
|
||||
echo -e "${PREFIX_WARN} Created new secrets directory"
|
||||
fi
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" CHECKENV_AWS_FETCH_LOOP_LIMIT=20 /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
|
||||
chmod 0640 "${PARAMETERS_ENV_PATH}"
|
||||
|
||||
echo
|
||||
|
@ -137,21 +149,21 @@ XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_
|
|||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI historical transactions crawler service and timer with: ${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
echo -e "${PREFIX_INFO} Replacing existing Amoy historical transactions crawler service and timer with: ${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI historical events crawler service and timer with: ${MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
echo -e "${PREFIX_INFO} Replacing existing Amoy historical events crawler service and timer with: ${AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
|
@ -206,3 +218,39 @@ cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/
|
|||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex historical transactions crawler service and timer with: ${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex historical events crawler service and timer with: ${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum one historical transactions crawler service and timer with: ${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum one historical events crawler service and timer with: ${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
|
@ -27,16 +27,20 @@ SCRIPT_DIR="$(realpath $(dirname $0))"
|
|||
# Service files
|
||||
ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE="ethereum-moonworm-crawler.service"
|
||||
POLYGON_MOONWORM_CRAWLER_SERVICE_FILE="polygon-moonworm-crawler.service"
|
||||
MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE="mumbai-moonworm-crawler.service"
|
||||
AMOY_MOONWORM_CRAWLER_SERVICE_FILE="amoy-moonworm-crawler.service"
|
||||
XDAI_MOONWORM_CRAWLER_SERVICE_FILE="xdai-moonworm-crawler.service"
|
||||
ZKSYNC_ERA_MOONWORM_CRAWLER_SERVICE_FILE="zksync-era-moonworm-crawler.service"
|
||||
ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE="zksync-era-sepolia-moonworm-crawler.service"
|
||||
ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE="arbitrum-one-moonworm-crawler.service"
|
||||
ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE="arbitrum-nova-moonworm-crawler.service"
|
||||
ARBITRUM_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE="arbitrum-sepolia-moonworm-crawler.service"
|
||||
XAI_MOONWORM_CRAWLER_SERVICE_FILE="xai-moonworm-crawler.service"
|
||||
XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE="xai-sepolia-moonworm-crawler.service"
|
||||
AVALANCHE_MOONWORM_CRAWLER_SERVICE_FILE="avalanche-moonworm-crawler.service"
|
||||
AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE="avalanche-fuji-moonworm-crawler.service"
|
||||
BLAST_MOONWORM_CRAWLER_SERVICE_FILE="blast-moonworm-crawler.service"
|
||||
BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE="blast-sepolia-moonworm-crawler.service"
|
||||
PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE="proofofplay-apex-moonworm-crawler.service"
|
||||
|
||||
set -eu
|
||||
|
||||
|
@ -62,7 +66,7 @@ if [ ! -d "${SECRETS_DIR}" ]; then
|
|||
mkdir -p "${SECRETS_DIR}"
|
||||
echo -e "${PREFIX_WARN} Created new secrets directory"
|
||||
fi
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" CHECKENV_AWS_FETCH_LOOP_LIMIT=20 /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
|
||||
chmod 0640 "${PARAMETERS_ENV_PATH}"
|
||||
|
||||
echo
|
||||
|
@ -95,11 +99,11 @@ XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_
|
|||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Mumbai moonworm crawler service definition with ${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
echo -e "${PREFIX_INFO} Replacing existing Amoy moonworm crawler service definition with ${AMOY_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${AMOY_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AMOY_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
|
@ -125,6 +129,15 @@ cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ub
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum One moonworm crawler service definition with ${ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum Nova moonworm crawler service definition with ${ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
@ -172,3 +185,27 @@ chmod 644 "${SCRIPT_DIR}/${AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
|||
cp "${SCRIPT_DIR}/${AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Blast moonworm crawler service definition with ${BLAST_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${BLAST_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Blast sepolia moonworm crawler service definition with ${BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex moonworm crawler service definition with ${PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
|
|
@ -40,14 +40,6 @@ POLYGON_STATE_CLEAN_TIMER_FILE="polygon-state-clean.timer"
|
|||
POLYGON_METADATA_SERVICE_FILE="polygon-metadata.service"
|
||||
POLYGON_METADATA_TIMER_FILE="polygon-metadata.timer"
|
||||
|
||||
# Mumbai service files
|
||||
MUMBAI_STATE_SERVICE_FILE="mumbai-state.service"
|
||||
MUMBAI_STATE_TIMER_FILE="mumbai-state.timer"
|
||||
MUMBAI_STATE_CLEAN_SERVICE_FILE="mumbai-state-clean.service"
|
||||
MUMBAI_STATE_CLEAN_TIMER_FILE="mumbai-state-clean.timer"
|
||||
MUMBAI_METADATA_SERVICE_FILE="mumbai-metadata.service"
|
||||
MUMBAI_METADATA_TIMER_FILE="mumbai-metadata.timer"
|
||||
|
||||
# ZkSync Era
|
||||
ZKSYNC_ERA_STATE_SERVICE_FILE="zksync-era-state.service"
|
||||
ZKSYNC_ERA_STATE_TIMER_FILE="zksync-era-state.timer"
|
||||
|
@ -78,7 +70,7 @@ if [ ! -d "${SECRETS_DIR}" ]; then
|
|||
mkdir -p "${SECRETS_DIR}"
|
||||
echo -e "${PREFIX_WARN} Created new secrets directory"
|
||||
fi
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" CHECKENV_AWS_FETCH_LOOP_LIMIT=20 /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
|
||||
chmod 0640 "${PARAMETERS_ENV_PATH}"
|
||||
|
||||
echo
|
||||
|
@ -147,33 +139,6 @@ cp "${SCRIPT_DIR}/${POLYGON_METADATA_TIMER_FILE}" "/home/ubuntu/.config/systemd/
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_METADATA_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI state service and timer with: ${MUMBAI_STATE_SERVICE_FILE}, ${MUMBAI_STATE_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_STATE_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_STATE_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_STATE_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI metadata service and timer with: ${MUMBAI_METADATA_SERVICE_FILE}, ${MUMBAI_METADATA_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_METADATA_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_METADATA_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_METADATA_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_METADATA_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_METADATA_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_METADATA_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_METADATA_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI state clean service and timer with: ${MUMBAI_STATE_CLEAN_SERVICE_FILE}, ${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_CLEAN_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era state service and timer with: ${ZKSYNC_ERA_STATE_SERVICE_FILE}, ${ZKSYNC_ERA_STATE_TIMER_FILE}"
|
||||
|
|
|
@ -65,21 +65,15 @@ POLYGON_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="polygon-historical-crawl-trans
|
|||
POLYGON_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="polygon-historical-crawl-events.service"
|
||||
POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="polygon-historical-crawl-events.timer"
|
||||
|
||||
# Mumbai service files
|
||||
MUMBAI_SYNCHRONIZE_SERVICE="mumbai-synchronize.service"
|
||||
MUMBAI_MISSING_SERVICE_FILE="mumbai-missing.service"
|
||||
MUMBAI_MISSING_TIMER_FILE="mumbai-missing.timer"
|
||||
MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE="mumbai-moonworm-crawler.service"
|
||||
MUMBAI_STATE_SERVICE_FILE="mumbai-state.service"
|
||||
MUMBAI_STATE_TIMER_FILE="mumbai-state.timer"
|
||||
MUMBAI_STATE_CLEAN_SERVICE_FILE="mumbai-state-clean.service"
|
||||
MUMBAI_STATE_CLEAN_TIMER_FILE="mumbai-state-clean.timer"
|
||||
MUMBAI_METADATA_SERVICE_FILE="mumbai-metadata.service"
|
||||
MUMBAI_METADATA_TIMER_FILE="mumbai-metadata.timer"
|
||||
MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="mumbai-historical-crawl-transactions.service"
|
||||
MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="mumbai-historical-crawl-transactions.timer"
|
||||
MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="mumbai-historical-crawl-events.service"
|
||||
MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="mumbai-historical-crawl-events.timer"
|
||||
# Amoy
|
||||
AMOY_MISSING_SERVICE_FILE="amoy-missing.service"
|
||||
AMOY_MISSING_TIMER_FILE="amoy-missing.timer"
|
||||
AMOY_MOONWORM_CRAWLER_SERVICE_FILE="amoy-moonworm-crawler.service"
|
||||
AMOY_SYNCHRONIZE_SERVICE="amoy-synchronize.service"
|
||||
AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="amoy-historical-crawl-transactions.service"
|
||||
AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="amoy-historical-crawl-transactions.timer"
|
||||
AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="amoy-historical-crawl-events.service"
|
||||
AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="amoy-historical-crawl-events.timer"
|
||||
|
||||
# XDai service files
|
||||
XDAI_SYNCHRONIZE_SERVICE="xdai-synchronize.service"
|
||||
|
@ -121,6 +115,16 @@ ARBITRUM_NOVA_MISSING_TIMER_FILE="arbitrum-nova-missing.timer"
|
|||
ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE="arbitrum-nova-moonworm-crawler.service"
|
||||
ARBITRUM_NOVA_SYNCHRONIZE_SERVICE="arbitrum-nova-synchronize.service"
|
||||
|
||||
# Arbitrum one
|
||||
ARBITRUM_ONE_SYNCHRONIZE_SERVICE="arbitrum-one-synchronize.service"
|
||||
ARBITRUM_ONE_MISSING_SERVICE_FILE="arbitrum-one-missing.service"
|
||||
ARBITRUM_ONE_MISSING_TIMER_FILE="arbitrum-one-missing.timer"
|
||||
ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE="arbitrum-one-moonworm-crawler.service"
|
||||
ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="arbitrum-one-historical-crawl-transactions.service"
|
||||
ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="arbitrum-one-historical-crawl-transactions.timer"
|
||||
ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="arbitrum-one-historical-crawl-events.service"
|
||||
ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="arbitrum-one-historical-crawl-events.timer"
|
||||
|
||||
# Arbitrum Sepolia
|
||||
ARBITRUM_SEPOLIA_MISSING_SERVICE_FILE="arbitrum-sepolia-missing.service"
|
||||
ARBITRUM_SEPOLIA_MISSING_TIMER_FILE="arbitrum-sepolia-missing.timer"
|
||||
|
@ -139,18 +143,41 @@ XAI_SEPOLIA_MISSING_TIMER_FILE="xai-sepolia-missing.timer"
|
|||
XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE="xai-sepolia-moonworm-crawler.service"
|
||||
XAI_SEPOLIA_SYNCHRONIZE_SERVICE="xai-sepolia-synchronize.service"
|
||||
|
||||
# Avalanche sepolia
|
||||
# Avalanche
|
||||
AVALANCHE_SYNCHRONIZE_SERVICE="avalanche-synchronize.service"
|
||||
AVALANCHE_MISSING_SERVICE_FILE="avalanche-missing.service"
|
||||
AVALANCHE_MISSING_TIMER_FILE="avalanche-missing.timer"
|
||||
AVALANCHE_MOONWORM_CRAWLER_SERVICE_FILE="avalanche-moonworm-crawler.service"
|
||||
|
||||
# Avalanche Fuji sepolia
|
||||
# Avalanche Fuji
|
||||
AVALANCHE_FUJI_SYNCHRONIZE_SERVICE="avalanche-fuji-synchronize.service"
|
||||
AVALANCHE_FUJI_MISSING_SERVICE_FILE="avalanche-fuji-missing.service"
|
||||
AVALANCHE_FUJI_MISSING_TIMER_FILE="avalanche-fuji-missing.timer"
|
||||
AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE="avalanche-fuji-moonworm-crawler.service"
|
||||
|
||||
# Blast
|
||||
BLAST_MISSING_SERVICE_FILE="blast-missing.service"
|
||||
BLAST_MISSING_TIMER_FILE="blast-missing.timer"
|
||||
BLAST_MOONWORM_CRAWLER_SERVICE_FILE="blast-moonworm-crawler.service"
|
||||
BLAST_SYNCHRONIZE_SERVICE="blast-synchronize.service"
|
||||
|
||||
# Blast sepolia
|
||||
BLAST_SEPOLIA_MISSING_SERVICE_FILE="blast-sepolia-missing.service"
|
||||
BLAST_SEPOLIA_MISSING_TIMER_FILE="blast-sepolia-missing.timer"
|
||||
BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE="blast-sepolia-moonworm-crawler.service"
|
||||
BLAST_SEPOLIA_SYNCHRONIZE_SERVICE="blast-sepolia-synchronize.service"
|
||||
|
||||
# ProofofPlay APEX
|
||||
PROOFOFPLAY_APEX_MISSING_SERVICE_FILE="proofofplay-apex-missing.service"
|
||||
PROOFOFPLAY_APEX_MISSING_TIMER_FILE="proofofplay-apex-missing.timer"
|
||||
PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE="proofofplay-apex-moonworm-crawler.service"
|
||||
PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE="proofofplay-apex-synchronize.service"
|
||||
PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="proofofplay-apex-historical-crawl-transactions.service"
|
||||
PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="proofofplay-apex-historical-crawl-transactions.timer"
|
||||
PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="proofofplay-apex-historical-crawl-events.service"
|
||||
PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="proofofplay-apex-historical-crawl-events.timer"
|
||||
|
||||
|
||||
set -eu
|
||||
|
||||
echo
|
||||
|
@ -175,7 +202,7 @@ if [ ! -d "${SECRETS_DIR}" ]; then
|
|||
mkdir -p "${SECRETS_DIR}"
|
||||
echo -e "${PREFIX_WARN} Created new secrets directory"
|
||||
fi
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" CHECKENV_AWS_FETCH_LOOP_LIMIT=20 /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
|
||||
chmod 0640 "${PARAMETERS_ENV_PATH}"
|
||||
|
||||
echo
|
||||
|
@ -359,76 +386,51 @@ cp "${SCRIPT_DIR}/${POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${POLYGON_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
|
||||
# Amoy
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Mumbai block with transactions syncronizer service definition with ${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
echo -e "${PREFIX_INFO} Replacing existing Amoy block with transactions syncronizer service definition with ${AMOY_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${AMOY_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${AMOY_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AMOY_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Mumbai missing service and timer with: ${MUMBAI_MISSING_SERVICE_FILE}, ${MUMBAI_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_MISSING_TIMER_FILE}"
|
||||
echo -e "${PREFIX_INFO} Replacing existing Amoy missing service and timer with: ${AMOY_MISSING_SERVICE_FILE}, ${AMOY_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${AMOY_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${AMOY_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AMOY_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Mumbai moonworm crawler service definition with ${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
echo -e "${PREFIX_INFO} Replacing existing Amoy moonworm crawler service definition with ${AMOY_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${AMOY_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AMOY_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI state service and timer with: ${MUMBAI_STATE_SERVICE_FILE}, ${MUMBAI_STATE_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_STATE_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_STATE_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_TIMER_FILE}"
|
||||
echo -e "${PREFIX_INFO} Replacing existing Amoy historical transactions crawler service and timer with: ${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_STATE_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AMOY_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI state clean service and timer with: ${MUMBAI_STATE_CLEAN_SERVICE_FILE}, ${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_CLEAN_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_STATE_CLEAN_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
echo -e "${PREFIX_INFO} Replacing existing Amoy historical events crawler service and timer with: ${AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_STATE_CLEAN_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI metadata service and timer with: ${MUMBAI_METADATA_SERVICE_FILE}, ${MUMBAI_METADATA_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_METADATA_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_METADATA_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_METADATA_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_METADATA_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_METADATA_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_METADATA_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_METADATA_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI historical transactions crawler service and timer with: ${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing MUMBAI historical events crawler service and timer with: ${MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AMOY_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
|
||||
# Xdai
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing XDai block with transactions syncronizer service definition with ${XDAI_SYNCHRONIZE_SERVICE}"
|
||||
|
@ -614,6 +616,50 @@ cp "${SCRIPT_DIR}/${ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_NOVA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
# Arbitrum one
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum one block with transactions syncronizer service definition with ${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_ONE_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum one missing service and timer with: ${ARBITRUM_ONE_MISSING_SERVICE_FILE}, ${ARBITRUM_ONE_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${ARBITRUM_ONE_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_ONE_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum One moonworm crawler service definition with ${ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_ONE_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum one historical transactions crawler service and timer with: ${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_ONE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Arbitrum one historical events crawler service and timer with: ${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_ONE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
|
||||
|
||||
# Arbitrum Sepolia
|
||||
echo
|
||||
|
@ -641,8 +687,6 @@ cp "${SCRIPT_DIR}/${ARBITRUM_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubun
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ARBITRUM_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
|
||||
|
||||
# Xai
|
||||
echo
|
||||
echo
|
||||
|
@ -747,3 +791,101 @@ chmod 644 "${SCRIPT_DIR}/${AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
|||
cp "${SCRIPT_DIR}/${AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
# Blast
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Blast block with transactions syncronizer service definition with ${BLAST_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${BLAST_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${BLAST_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Blast missing service and timer with: ${BLAST_MISSING_SERVICE_FILE}, ${BLAST_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${BLAST_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${BLAST_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Blast moonworm crawler service definition with ${BLAST_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${BLAST_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
# Blast sepolia
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Blast sepolia block with transactions syncronizer service definition with ${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Blast sepolia missing service and timer with: ${BLAST_SEPOLIA_MISSING_SERVICE_FILE}, ${BLAST_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${BLAST_SEPOLIA_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${BLAST_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_SEPOLIA_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_SEPOLIA_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_SEPOLIA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Blast sepolia moonworm crawler service definition with ${BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
|
||||
# Proofofplay Apex
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex block with transactions syncronizer service definition with ${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex missing service and timer with: ${PROOFOFPLAY_APEX_MISSING_SERVICE_FILE}, ${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${PROOFOFPLAY_APEX_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex moonworm crawler service definition with ${PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${PROOFOFPLAY_APEX_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex historical transactions crawler service and timer with: ${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex historical events crawler service and timer with: ${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
|
|
|
@ -9,7 +9,7 @@ Restart=on-failure
|
|||
RestartSec=15s
|
||||
WorkingDirectory=/home/ubuntu/
|
||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/monitoring.env
|
||||
ExecStart=/home/ubuntu/monitoring -plugin systemd -host "${AWS_LOCAL_IPV4}" -port 7171 -healthcheck -server -threshold 3 -config /home/ubuntu/.monitoring/monitoring-crawlers-config.json -service ethereum-moonworm-crawler.service -service mumbai-moonworm-crawler.service -service polygon-moonworm-crawler.service -service zksync-era-moonworm-crawler.service -service zksync-era-sepolia-moonworm-crawler.service -service arbitrum-nova-moonworm-crawler.service -service arbitrum-sepolia-moonworm-crawler.service -service xai-moonworm-crawler.service -service xai-sepolia-moonworm-crawler.service
|
||||
ExecStart=/home/ubuntu/monitoring -plugin systemd -host "${AWS_LOCAL_IPV4}" -port 7171 -healthcheck -server -threshold 3 -config /home/ubuntu/.monitoring/monitoring-crawlers-config.json -service ethereum-moonworm-crawler.service -service amoy-moonworm-crawler.service -service polygon-moonworm-crawler.service -service zksync-era-moonworm-crawler.service -service zksync-era-sepolia-moonworm-crawler.service -service arbitrum-nova-moonworm-crawler.service -service arbitrum-sepolia-moonworm-crawler.service -service xai-moonworm-crawler.service -service xai-sepolia-moonworm-crawler.service -service avalanche-moonworm-crawler.service -service avalanche-fuji-moonworm-crawler.service -service blast-moonworm-crawler.service -service blast-sepolia-moonworm-crawler.service -service proofofplay-apex-moonworm-crawler.service -service arbitrum-one-moonworm-crawler.service
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=monitoring-crawlers
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
[Unit]
|
||||
Description=Execute metadata crawler
|
||||
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.metadata_crawler.cli crawl --blockchain mumbai
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=mumbai-metadata
|
|
@ -1,9 +0,0 @@
|
|||
[Unit]
|
||||
Description=Execute Mumbai metadata crawler each 10m
|
||||
|
||||
[Timer]
|
||||
OnBootSec=20s
|
||||
OnUnitActiveSec=60m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -1,11 +0,0 @@
|
|||
[Unit]
|
||||
Description=Execute state clean labels crawler
|
||||
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.state_crawler.cli clean-state-labels --blockchain mumbai -N 10000
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=mumbai-state-clean
|
|
@ -1,9 +0,0 @@
|
|||
[Unit]
|
||||
Description=Execute Mumbai state clean labels crawler each 25m
|
||||
|
||||
[Timer]
|
||||
OnBootSec=50s
|
||||
OnUnitActiveSec=25m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -1,11 +0,0 @@
|
|||
[Unit]
|
||||
Description=Execute state crawler
|
||||
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.state_crawler.cli crawl-jobs --moonstream-token "${MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN}" --blockchain mumbai --infura --jobs-file /home/ubuntu/moonstream/crawlers/mooncrawl/mooncrawl/state_crawler/jobs/mumbai-jobs.json
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=mumbai-state
|
|
@ -1,9 +0,0 @@
|
|||
[Unit]
|
||||
Description=Execute Mumbai state crawler each 10m
|
||||
|
||||
[Timer]
|
||||
OnBootSec=15s
|
||||
OnUnitActiveSec=10m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -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
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Runs events historical crawler on proofofplay apex
|
||||
|
||||
[Timer]
|
||||
OnBootSec=60s
|
||||
OnUnitActiveSec=10m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -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
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Runs transactions historical crawler on proofofplay apex
|
||||
|
||||
[Timer]
|
||||
OnBootSec=60s
|
||||
OnUnitActiveSec=10m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -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
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at ProofOfPlay database
|
||||
|
||||
[Timer]
|
||||
OnBootSec=120s
|
||||
OnUnitActiveSec=15m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -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
|
|
@ -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
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=ZkSync Era testnet historical crawler events
|
||||
Description=ZkSync Era Sepolia historical crawler events
|
||||
After=network.target
|
||||
StartLimitIntervalSec=300
|
||||
StartLimitBurst=3
|
||||
|
@ -9,9 +9,9 @@ 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 zksync_era_testnet --find-deployed-blocks --end 0 --tasks-journal --only-events
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli historical-crawl --blockchain-type zksync_era_sepolia --find-deployed-blocks --end 0 --tasks-journal --only-events
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=zksync-era-testnet-historical-crawl-events
|
||||
SyslogIdentifier=zksync-era-sepolia-historical-crawl-events
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=Runs events historical crawler on ZkSync Era testnet
|
||||
Description=Runs events historical crawler on ZkSync Era Sepolia
|
||||
|
||||
[Timer]
|
||||
OnBootSec=60s
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=ZkSync Era testnet historical crawler transactions
|
||||
Description=ZkSync Era Sepolia historical crawler transactions
|
||||
After=network.target
|
||||
StartLimitIntervalSec=300
|
||||
StartLimitBurst=3
|
||||
|
@ -9,9 +9,9 @@ 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 zksync_era_testnet --find-deployed-blocks --end 0 --tasks-journal --only-functions
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli historical-crawl --blockchain-type zksync_era_sepolia --find-deployed-blocks --end 0 --tasks-journal --only-functions
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=zksync-era-testnet-historical-crawl-transactions
|
||||
SyslogIdentifier=zksync-era-sepolia-historical-crawl-transactions
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Runs transactions historical crawler on ZkSync Era Sepolia
|
||||
|
||||
[Timer]
|
||||
OnBootSec=60s
|
||||
OnUnitActiveSec=10m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -1,9 +0,0 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at ZkSync Era testnet database
|
||||
|
||||
[Timer]
|
||||
OnBootSec=120s
|
||||
OnUnitActiveSec=15m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -22,19 +22,23 @@ from .data import DateRange
|
|||
from .db import yield_db_session, yield_db_session_ctx
|
||||
from .settings import (
|
||||
MOONSTREAM_CRAWL_WORKERS,
|
||||
MOONSTREAM_NODE_AMOY_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_ARBITRUM_ONE_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_ARBITRUM_NOVA_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_AVALANCHE_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_AVALANCHE_FUJI_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_BLAST_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_BLAST_SEPOLIA_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_ETHEREUM_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_MUMBAI_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_POLYGON_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_PROOFOFPLAY_APEX_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_XAI_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_XAI_SEPOLIA_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_XDAI_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_ZKSYNC_ERA_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_ZKSYNC_ERA_SEPOLIA_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_ZKSYNC_ERA_TESTNET_A_EXTERNAL_URI,
|
||||
WEB3_CLIENT_REQUEST_TIMEOUT_SECONDS,
|
||||
)
|
||||
|
||||
|
@ -65,14 +69,16 @@ def connect(
|
|||
web3_uri = MOONSTREAM_NODE_POLYGON_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.MUMBAI:
|
||||
web3_uri = MOONSTREAM_NODE_MUMBAI_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.AMOY:
|
||||
web3_uri = MOONSTREAM_NODE_AMOY_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.XDAI:
|
||||
web3_uri = MOONSTREAM_NODE_XDAI_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_TESTNET:
|
||||
web3_uri = MOONSTREAM_NODE_ZKSYNC_ERA_TESTNET_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA:
|
||||
web3_uri = MOONSTREAM_NODE_ZKSYNC_ERA_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_SEPOLIA:
|
||||
web3_uri = MOONSTREAM_NODE_ZKSYNC_ERA_SEPOLIA_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_ONE:
|
||||
web3_uri = MOONSTREAM_NODE_ARBITRUM_ONE_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
web3_uri = MOONSTREAM_NODE_ARBITRUM_NOVA_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
|
@ -85,6 +91,12 @@ def connect(
|
|||
web3_uri = MOONSTREAM_NODE_AVALANCHE_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE_FUJI:
|
||||
web3_uri = MOONSTREAM_NODE_AVALANCHE_FUJI_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST:
|
||||
web3_uri = MOONSTREAM_NODE_BLAST_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST_SEPOLIA:
|
||||
web3_uri = MOONSTREAM_NODE_BLAST_SEPOLIA_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.PROOFOFPLAY_APEX:
|
||||
web3_uri = MOONSTREAM_NODE_PROOFOFPLAY_APEX_A_EXTERNAL_URI
|
||||
else:
|
||||
raise Exception("Wrong blockchain type provided for web3 URI")
|
||||
|
||||
|
@ -149,8 +161,9 @@ def add_block(db_session, block: Any, blockchain_type: AvailableBlockchainType)
|
|||
)
|
||||
if blockchain_type == AvailableBlockchainType.XDAI:
|
||||
block_obj.author = block.author
|
||||
if (
|
||||
elif (
|
||||
blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_TESTNET
|
||||
or blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_SEPOLIA
|
||||
or blockchain_type == AvailableBlockchainType.ZKSYNC_ERA
|
||||
):
|
||||
block_obj.mix_hash = block.get("mixHash", "")
|
||||
|
@ -165,17 +178,18 @@ def add_block(db_session, block: Any, blockchain_type: AvailableBlockchainType)
|
|||
if block.get("l1BatchTimestamp") is not None
|
||||
else None
|
||||
)
|
||||
if (
|
||||
elif (
|
||||
blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA
|
||||
or blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA
|
||||
or blockchain_type == AvailableBlockchainType.PROOFOFPLAY_APEX
|
||||
or blockchain_type == AvailableBlockchainType.ARBITRUM_ONE
|
||||
):
|
||||
block_obj.sha3_uncles = block.get("sha3Uncles", "")
|
||||
block_obj.l1_block_number = hex_to_int(block.get("l1BlockNumber"))
|
||||
block_obj.send_count = hex_to_int(block.get("sendCount"))
|
||||
block_obj.send_root = block.get("sendRoot", "")
|
||||
block_obj.mix_hash = block.get("mixHash", "")
|
||||
|
||||
if (
|
||||
elif (
|
||||
blockchain_type == AvailableBlockchainType.XAI
|
||||
or blockchain_type == AvailableBlockchainType.XAI_SEPOLIA
|
||||
):
|
||||
|
@ -184,8 +198,7 @@ def add_block(db_session, block: Any, blockchain_type: AvailableBlockchainType)
|
|||
block_obj.send_count = hex_to_int(block.get("sendCount"))
|
||||
block_obj.send_root = block.get("sendRoot", "")
|
||||
block_obj.mix_hash = block.get("mixHash", "")
|
||||
|
||||
if (
|
||||
elif (
|
||||
blockchain_type == AvailableBlockchainType.AVALANCHE
|
||||
or blockchain_type == AvailableBlockchainType.AVALANCHE_FUJI
|
||||
):
|
||||
|
@ -194,6 +207,13 @@ def add_block(db_session, block: Any, blockchain_type: AvailableBlockchainType)
|
|||
block_obj.block_gas_cost = block.get("blockGasCost")
|
||||
block_obj.ext_data_gas_used = block.get("extDataGasUsed", "")
|
||||
block_obj.ext_data_hash = block.get("extDataHash", "")
|
||||
elif (
|
||||
blockchain_type == AvailableBlockchainType.BLAST
|
||||
or blockchain_type == AvailableBlockchainType.BLAST_SEPOLIA
|
||||
):
|
||||
block_obj.sha3_uncles = block.get("sha3Uncles", "")
|
||||
block_obj.mix_hash = block.get("mixHash", "")
|
||||
block_obj.withdrawals_root = block.get("withdrawalsRoot", "")
|
||||
|
||||
db_session.add(block_obj)
|
||||
|
||||
|
@ -225,6 +245,7 @@ def add_block_transactions(
|
|||
)
|
||||
if (
|
||||
blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_TESTNET
|
||||
or blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_SEPOLIA
|
||||
or blockchain_type == AvailableBlockchainType.ZKSYNC_ERA
|
||||
):
|
||||
tx_obj.l1_batch_number = (
|
||||
|
@ -242,6 +263,8 @@ def add_block_transactions(
|
|||
or blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA
|
||||
or blockchain_type == AvailableBlockchainType.XAI
|
||||
or blockchain_type == AvailableBlockchainType.XAI_SEPOLIA
|
||||
or blockchain_type == AvailableBlockchainType.PROOFOFPLAY_APEX
|
||||
or blockchain_type == AvailableBlockchainType.ARBITRUM_ONE
|
||||
):
|
||||
tx_obj.y_parity = hex_to_int(tx.get("yParity"))
|
||||
|
||||
|
|
|
@ -50,6 +50,12 @@ def crawl_uri(metadata_uri: str) -> Any:
|
|||
result = None
|
||||
while retry < 3:
|
||||
try:
|
||||
|
||||
if metadata_uri.startswith("ipfs://"):
|
||||
metadata_uri = metadata_uri.replace(
|
||||
"ipfs://", "https://ipfs.io/ipfs/", 1
|
||||
)
|
||||
|
||||
response = urllib.request.urlopen(metadata_uri, timeout=10)
|
||||
|
||||
if (
|
||||
|
|
|
@ -4,6 +4,7 @@ from typing import Optional
|
|||
from uuid import UUID
|
||||
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType
|
||||
from moonstreamdb.subscriptions import blockchain_type_to_subscription_type
|
||||
from web3 import Web3
|
||||
from web3.middleware import geth_poa_middleware
|
||||
|
||||
|
@ -15,8 +16,6 @@ from ..settings import (
|
|||
)
|
||||
from .continuous_crawler import _retry_connect_web3, continuous_crawler
|
||||
from .crawler import (
|
||||
SubscriptionTypes,
|
||||
blockchain_type_to_subscription_type,
|
||||
find_all_deployed_blocks,
|
||||
get_crawl_job_entries,
|
||||
make_event_crawl_jobs,
|
||||
|
|
|
@ -6,7 +6,8 @@ from typing import Dict, List, Optional, Tuple
|
|||
from uuid import UUID
|
||||
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType
|
||||
from moonstreamdb.networks import Network
|
||||
from moonstreamdb.networks import blockchain_type_to_network_type
|
||||
from moonstreamdb.subscriptions import blockchain_type_to_subscription_type
|
||||
from moonworm.crawler.moonstream_ethereum_state_provider import ( # type: ignore
|
||||
MoonstreamEthereumStateProvider,
|
||||
)
|
||||
|
@ -21,7 +22,6 @@ from .crawler import (
|
|||
EventCrawlJob,
|
||||
FunctionCallCrawlJob,
|
||||
_retry_connect_web3,
|
||||
blockchain_type_to_subscription_type,
|
||||
get_crawl_job_entries,
|
||||
heartbeat,
|
||||
make_event_crawl_jobs,
|
||||
|
@ -50,11 +50,14 @@ def _refetch_new_jobs(
|
|||
"""
|
||||
Refetches new jobs from bugout journal, merges, and returns new jobs.
|
||||
"""
|
||||
|
||||
max_created_at_event_job = max(job.created_at for job in old_event_jobs)
|
||||
max_created_at_function_call_job = max(
|
||||
job.created_at for job in old_function_call_jobs
|
||||
)
|
||||
max_created_at_event_job: Optional[int] = None
|
||||
max_created_at_function_call_job: Optional[int] = None
|
||||
if len(old_event_jobs) != 0:
|
||||
max_created_at_event_job = max(job.created_at for job in old_event_jobs)
|
||||
if len(old_function_call_jobs) != 0:
|
||||
max_created_at_function_call_job = max(
|
||||
job.created_at for job in old_function_call_jobs
|
||||
)
|
||||
|
||||
logger.info("Looking for new event crawl jobs.")
|
||||
old_event_jobs_length = len(old_event_jobs)
|
||||
|
@ -121,36 +124,10 @@ def continuous_crawler(
|
|||
if web3 is None:
|
||||
web3 = _retry_connect_web3(blockchain_type, web3_uri=web3_uri)
|
||||
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
network = Network.ethereum
|
||||
elif blockchain_type == AvailableBlockchainType.POLYGON:
|
||||
network = Network.polygon
|
||||
elif blockchain_type == AvailableBlockchainType.MUMBAI:
|
||||
network = Network.mumbai
|
||||
elif blockchain_type == AvailableBlockchainType.XDAI:
|
||||
network = Network.xdai
|
||||
elif blockchain_type == AvailableBlockchainType.WYRM:
|
||||
network = Network.wyrm
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_TESTNET:
|
||||
network = Network.zksync_era_testnet
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA:
|
||||
network = Network.zksync_era
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_SEPOLIA:
|
||||
network = Network.zksync_era_sepolia
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
network = Network.arbitrum_nova
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
network = Network.arbitrum_sepolia
|
||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||
network = Network.xai
|
||||
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
network = Network.xai_sepolia
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE:
|
||||
network = Network.avalanche
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE_FUJI:
|
||||
network = Network.avalanche_fuji
|
||||
else:
|
||||
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
|
||||
try:
|
||||
network = blockchain_type_to_network_type(blockchain_type=blockchain_type)
|
||||
except Exception as e:
|
||||
raise Exception(e)
|
||||
|
||||
ethereum_state_provider = MoonstreamEthereumStateProvider(
|
||||
web3,
|
||||
|
|
|
@ -11,6 +11,7 @@ from uuid import UUID
|
|||
from bugout.data import BugoutJournalEntries, BugoutSearchResult
|
||||
from eth_typing.evm import ChecksumAddress
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType
|
||||
from moonstreamdb.subscriptions import SubscriptionTypes
|
||||
from moonworm.deployment import find_deployment_block # type: ignore
|
||||
from web3.main import Web3
|
||||
|
||||
|
@ -29,20 +30,6 @@ logging.basicConfig(level=logging.INFO)
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SubscriptionTypes(Enum):
|
||||
POLYGON_BLOCKCHAIN = "polygon_smartcontract"
|
||||
ETHEREUM_BLOCKCHAIN = "ethereum_smartcontract"
|
||||
MUMBAI_BLOCKCHAIN = "mumbai_smartcontract"
|
||||
XDAI_BLOCKCHAIN = "xdai_smartcontract"
|
||||
WYRM_BLOCKCHAIN = "wyrm_smartcontract"
|
||||
ZKSYNC_ERA_TESTNET_BLOCKCHAIN = "zksync_era_testnet_smartcontract"
|
||||
ZKSYNC_ERA_BLOCKCHAIN = "zksync_era_smartcontract"
|
||||
ARBITRUM_NOVA_BLOCKCHAIN = "arbitrum_nova_smartcontract"
|
||||
ARBITRUM_SEPOLIA_BLOCKCHAIN = "arbitrum_sepolia_smartcontract"
|
||||
XAI_BLOCKCHAIN = "xai_smartcontract"
|
||||
XAI_SEPOLIA_BLOCKCHAIN = "xai_sepolia_smartcontract"
|
||||
|
||||
|
||||
def abi_input_signature(input_abi: Dict[str, Any]) -> str:
|
||||
"""
|
||||
Stringifies a function ABI input object according to the ABI specification:
|
||||
|
@ -132,35 +119,6 @@ def _retry_connect_web3(
|
|||
)
|
||||
|
||||
|
||||
def blockchain_type_to_subscription_type(
|
||||
blockchain_type: AvailableBlockchainType,
|
||||
) -> SubscriptionTypes:
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
return SubscriptionTypes.ETHEREUM_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.POLYGON:
|
||||
return SubscriptionTypes.POLYGON_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.MUMBAI:
|
||||
return SubscriptionTypes.MUMBAI_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.XDAI:
|
||||
return SubscriptionTypes.XDAI_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.WYRM:
|
||||
return SubscriptionTypes.WYRM_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_TESTNET:
|
||||
return SubscriptionTypes.ZKSYNC_ERA_TESTNET_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA:
|
||||
return SubscriptionTypes.ZKSYNC_ERA_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
return SubscriptionTypes.ARBITRUM_NOVA_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
return SubscriptionTypes.ARBITRUM_SEPOLIA_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||
return SubscriptionTypes.XAI_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
return SubscriptionTypes.XAI_SEPOLIA_BLOCKCHAIN
|
||||
else:
|
||||
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
|
||||
|
||||
|
||||
@dataclass
|
||||
class EventCrawlJob:
|
||||
event_abi_hash: str
|
||||
|
|
|
@ -2,7 +2,7 @@ import logging
|
|||
from typing import List
|
||||
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType
|
||||
from moonstreamdb.networks import Network # type: ignore
|
||||
from moonstreamdb.networks import blockchain_type_to_network_type # type: ignore
|
||||
from moonworm.crawler.function_call_crawler import ( # type: ignore
|
||||
ContractFunctionCall,
|
||||
FunctionCallCrawler,
|
||||
|
@ -58,30 +58,10 @@ def function_call_crawler(
|
|||
end_block: int,
|
||||
batch_size: int,
|
||||
):
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
network = Network.ethereum
|
||||
elif blockchain_type == AvailableBlockchainType.POLYGON:
|
||||
network = Network.polygon
|
||||
elif blockchain_type == AvailableBlockchainType.MUMBAI:
|
||||
network = Network.mumbai
|
||||
elif blockchain_type == AvailableBlockchainType.XDAI:
|
||||
network = Network.xdai
|
||||
elif blockchain_type == AvailableBlockchainType.WYRM:
|
||||
network = Network.wyrm
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_TESTNET:
|
||||
network = Network.zksync_era_testnet
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA:
|
||||
network = Network.zksync_era
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
network = Network.arbitrum_nova
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
network = Network.arbitrum_sepolia
|
||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||
network = Network.xai
|
||||
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
network = Network.xai_sepolia
|
||||
else:
|
||||
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
|
||||
try:
|
||||
network = blockchain_type_to_network_type(blockchain_type=blockchain_type)
|
||||
except Exception as e:
|
||||
raise Exception(e)
|
||||
|
||||
ethereum_state_provider = MoonstreamEthereumStateProvider(
|
||||
web3,
|
||||
|
|
|
@ -5,7 +5,7 @@ from uuid import UUID
|
|||
|
||||
from eth_typing.evm import ChecksumAddress
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType
|
||||
from moonstreamdb.networks import Network # type: ignore
|
||||
from moonstreamdb.networks import blockchain_type_to_network_type # type: ignore
|
||||
from moonworm.crawler.moonstream_ethereum_state_provider import ( # type: ignore
|
||||
MoonstreamEthereumStateProvider,
|
||||
)
|
||||
|
@ -52,30 +52,10 @@ def historical_crawler(
|
|||
web3.eth.block_number >= start_block
|
||||
), "start_block must be less than current block"
|
||||
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
network = Network.ethereum
|
||||
elif blockchain_type == AvailableBlockchainType.POLYGON:
|
||||
network = Network.polygon
|
||||
elif blockchain_type == AvailableBlockchainType.MUMBAI:
|
||||
network = Network.mumbai
|
||||
elif blockchain_type == AvailableBlockchainType.XDAI:
|
||||
network = Network.xdai
|
||||
elif blockchain_type == AvailableBlockchainType.WYRM:
|
||||
network = Network.wyrm
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_TESTNET:
|
||||
network = Network.zksync_era_testnet
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA:
|
||||
network = Network.zksync_era
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
network = Network.arbitrum_nova
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
network = Network.arbitrum_sepolia
|
||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||
network = Network.xai
|
||||
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
network = Network.xai_sepolia
|
||||
else:
|
||||
raise Exception("Unsupported blockchain type provided")
|
||||
try:
|
||||
network = blockchain_type_to_network_type(blockchain_type=blockchain_type)
|
||||
except Exception as e:
|
||||
raise Exception(e)
|
||||
|
||||
ethereum_state_provider = MoonstreamEthereumStateProvider(
|
||||
web3,
|
||||
|
|
|
@ -96,20 +96,18 @@ MOONSTREAM_NODE_MUMBAI_A_EXTERNAL_URI = os.environ.get(
|
|||
if MOONSTREAM_NODE_MUMBAI_A_EXTERNAL_URI == "":
|
||||
raise Exception("MOONSTREAM_NODE_MUMBAI_A_EXTERNAL_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_NODE_AMOY_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_AMOY_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_NODE_AMOY_A_EXTERNAL_URI == "":
|
||||
raise Exception("MOONSTREAM_NODE_AMOY_A_EXTERNAL_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_NODE_XDAI_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_XDAI_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_NODE_XDAI_A_EXTERNAL_URI == "":
|
||||
raise Exception("MOONSTREAM_NODE_XDAI_A_EXTERNAL_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_NODE_ZKSYNC_ERA_TESTNET_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_ZKSYNC_ERA_TESTNET_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_NODE_ZKSYNC_ERA_TESTNET_A_EXTERNAL_URI == "":
|
||||
raise Exception(
|
||||
"MOONSTREAM_NODE_ZKSYNC_ERA_TESTNET_A_EXTERNAL_URI env variable is not set"
|
||||
)
|
||||
|
||||
MOONSTREAM_NODE_ZKSYNC_ERA_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_ZKSYNC_ERA_A_EXTERNAL_URI", ""
|
||||
)
|
||||
|
@ -168,6 +166,37 @@ if MOONSTREAM_NODE_AVALANCHE_FUJI_A_EXTERNAL_URI == "":
|
|||
"MOONSTREAM_NODE_AVALANCHE_FUJI_A_EXTERNAL_URI env variable is not set"
|
||||
)
|
||||
|
||||
MOONSTREAM_NODE_BLAST_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_BLAST_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_NODE_BLAST_A_EXTERNAL_URI == "":
|
||||
raise Exception("MOONSTREAM_NODE_BLAST_A_EXTERNAL_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_NODE_BLAST_SEPOLIA_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_BLAST_SEPOLIA_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_NODE_BLAST_SEPOLIA_A_EXTERNAL_URI == "":
|
||||
raise Exception(
|
||||
"MOONSTREAM_NODE_BLAST_SEPOLIA_A_EXTERNAL_URI env variable is not set"
|
||||
)
|
||||
|
||||
MOONSTREAM_NODE_PROOFOFPLAY_APEX_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_PROOFOFPLAY_APEX_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_NODE_PROOFOFPLAY_APEX_A_EXTERNAL_URI == "":
|
||||
raise Exception(
|
||||
"MOONSTREAM_NODE_PROOFOFPLAY_APEX_A_EXTERNAL_URI env variable is not set"
|
||||
)
|
||||
|
||||
MOONSTREAM_NODE_ARBITRUM_ONE_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_ARBITRUM_ONE_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_NODE_ARBITRUM_ONE_A_EXTERNAL_URI == "":
|
||||
raise Exception(
|
||||
"MOONSTREAM_NODE_ARBITRUM_ONE_A_EXTERNAL_URI env variable is not set"
|
||||
)
|
||||
|
||||
|
||||
MOONSTREAM_CRAWL_WORKERS = 4
|
||||
MOONSTREAM_CRAWL_WORKERS_RAW = os.environ.get("MOONSTREAM_CRAWL_WORKERS")
|
||||
try:
|
||||
|
@ -258,14 +287,6 @@ NB_DATA_SOURCE_HEADER = os.environ.get(
|
|||
"NB_DATA_SOURCE_HEADER", "x-node-balancer-data-source"
|
||||
)
|
||||
|
||||
NB_CONTROLLER_ACCESS_ID: Optional[UUID] = None
|
||||
NB_CONTROLLER_ACCESS_ID_RAW = os.environ.get("NB_CONTROLLER_ACCESS_ID", "")
|
||||
try:
|
||||
NB_CONTROLLER_ACCESS_ID = UUID(NB_CONTROLLER_ACCESS_ID_RAW)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
# HTTPProvider for web3 client
|
||||
|
||||
WEB3_CLIENT_REQUEST_TIMEOUT_SECONDS = 600
|
||||
|
|
|
@ -62,5 +62,36 @@
|
|||
}
|
||||
],
|
||||
"address": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"stateMutability": "view",
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "tokenId",
|
||||
"type": "uint256",
|
||||
"value": {
|
||||
"type": "queryAPI",
|
||||
"query_url": "template_erc721_minting",
|
||||
"blockchain": "ethereum",
|
||||
"params": {
|
||||
"address": "0xd9F092BdF2b6eaF303fc09cc952e94253AE32fae"
|
||||
},
|
||||
"keys": [
|
||||
"token_id"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": "tokenURI",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"address": "0xd9F092BdF2b6eaF303fc09cc952e94253AE32fae"
|
||||
}
|
||||
]
|
|
@ -24,6 +24,10 @@ from moonstreamdb.blockchain import (
|
|||
get_label_model,
|
||||
get_transaction_model,
|
||||
)
|
||||
from moonstreamdb.subscriptions import (
|
||||
blockchain_by_subscription_id,
|
||||
subscription_id_by_blockchain,
|
||||
)
|
||||
from sqlalchemy import and_
|
||||
from sqlalchemy import cast as sqlalchemy_cast
|
||||
from sqlalchemy import distinct, extract, func, text
|
||||
|
@ -47,55 +51,6 @@ logging.basicConfig(level=logging.INFO)
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
subscription_id_by_blockchain = {
|
||||
"ethereum": "ethereum_smartcontract",
|
||||
"polygon": "polygon_smartcontract",
|
||||
"mumbai": "mumbai_smartcontract",
|
||||
"xdai": "xdai_smartcontract",
|
||||
"wyrm": "wyrm_smartcontract",
|
||||
"zksync_era_testnet": "zksync_era_testnet_smartcontract",
|
||||
"zksync_era": "zksync_era_smartcontract",
|
||||
"zksync_era_sepolia": "zksync_era_sepolia_smartcontract",
|
||||
"arbitrum_nova": "arbitrum_nova_smartcontract",
|
||||
"arbitrum_sepolia": "arbitrum_sepolia_smartcontract",
|
||||
"xai": "xai_smartcontract",
|
||||
"xai_sepolia": "xai_sepolia_smartcontract",
|
||||
"avalanche": "avalanche_smartcontract",
|
||||
"avalanche_fuji": "avalanche_fuji_smartcontract",
|
||||
}
|
||||
|
||||
blockchain_by_subscription_id = {
|
||||
"ethereum_blockchain": "ethereum",
|
||||
"polygon_blockchain": "polygon",
|
||||
"mumbai_blockchain": "mumbai",
|
||||
"xdai_blockchain": "xdai",
|
||||
"wyrm_blockchain": "wyrm",
|
||||
"zksync_era_testnet_blockchain": "zksync_era_testnet",
|
||||
"zksync_era_blockchain": "zksync_era",
|
||||
"zksync_era_sepolia_blockchain": "zksync_era_sepolia",
|
||||
"arbitrum_nova_blockchain": "arbitrum_nova",
|
||||
"arbitrum_sepolia_blockchain": "arbitrum_sepolia",
|
||||
"xai_blockchain": "xai",
|
||||
"xai_sepolia_blockchain": "xai_sepolia",
|
||||
"avalanche_blockchain": "avalanche",
|
||||
"avalanche_fuji_blockchain": "avalanche_fuji",
|
||||
"ethereum_smartcontract": "ethereum",
|
||||
"polygon_smartcontract": "polygon",
|
||||
"mumbai_smartcontract": "mumbai",
|
||||
"xdai_smartcontract": "xdai",
|
||||
"wyrm_smartcontract": "wyrm",
|
||||
"zksync_era_testnet_smartcontract": "zksync_era_testnet",
|
||||
"zksync_era_smartcontract": "zksync_era",
|
||||
"zksync_era_sepolia_smartcontract": "zksync_era_sepolia",
|
||||
"arbitrum_nova_smartcontract": "arbitrum_nova",
|
||||
"arbitrum_sepolia_smartcontract": "arbitrum_sepolia",
|
||||
"xai_smartcontract": "xai",
|
||||
"xai_sepolia_smartcontract": "xai_sepolia",
|
||||
"avalanche_smartcontract": "avalanche",
|
||||
"avalanche_fuji_smartcontract": "avalanche_fuji",
|
||||
}
|
||||
|
||||
|
||||
class TimeScale(Enum):
|
||||
# TODO(Andrey) Unlock when we be sure about perfomanse of agregation on transactions table.
|
||||
# Right now it can be hungs
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
Moonstream crawlers version.
|
||||
"""
|
||||
|
||||
MOONCRAWL_VERSION = "0.4.1"
|
||||
MOONCRAWL_VERSION = "0.4.5"
|
||||
|
|
|
@ -11,3 +11,6 @@ ignore_missing_imports = True
|
|||
|
||||
[mypy-tqdm.*]
|
||||
ignore_missing_imports = True
|
||||
|
||||
[mypy-moonworm.*]
|
||||
ignore_missing_imports = True
|
||||
|
|
|
@ -23,18 +23,21 @@ export NFT_HUMBUG_TOKEN="<Token_for_nft_crawler>"
|
|||
# Blockchain nodes environment variables
|
||||
export MOONSTREAM_NODE_ETHEREUM_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_POLYGON_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_PROOFOFPLAY_APEX_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_MUMBAI_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_AMOY_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_XDAI_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_ZKSYNC_ERA_TESTNET_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_ZKSYNC_ERA_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_ZKSYNC_ERA_SEPOLIA_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_ARBITRUM_ONE_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_ARBITRUM_NOVA_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_XAI_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_XAI_SEPOLIA_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_AVALANCHE_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_AVALANCHE_FUJI_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export NB_CONTROLLER_ACCESS_ID="<access_uuid_for_moonstream_nodebalancer>"
|
||||
export MOONSTREAM_NODE_BLAST_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_BLAST_SEPOLIA_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
|
||||
# AWS environment variables
|
||||
export MOONSTREAM_S3_SMARTCONTRACTS_BUCKET="<AWS_S3_bucket_for_smart_contracts>"
|
||||
|
|
|
@ -37,7 +37,7 @@ setup(
|
|||
"bugout>=0.2.13",
|
||||
"chardet",
|
||||
"fastapi",
|
||||
"moonstreamdb>=0.3.10",
|
||||
"moonstreamdb>=0.4.4",
|
||||
"moonstream>=0.1.1",
|
||||
"moonworm[moonstream]>=0.6.2",
|
||||
"humbug",
|
||||
|
|
|
@ -3,9 +3,9 @@ import json
|
|||
import logging
|
||||
import uuid
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Any, Dict, List, Optional, Tuple
|
||||
from typing import Any, Dict, List, Optional, Set, Tuple
|
||||
|
||||
from sqlalchemy import func, or_, text
|
||||
from sqlalchemy import func, or_, text, tuple_
|
||||
from sqlalchemy.dialects.postgresql import insert
|
||||
from sqlalchemy.engine import Row
|
||||
from sqlalchemy.exc import IntegrityError, NoResultFound
|
||||
|
@ -71,6 +71,12 @@ class CallRequestAlreadyRegistered(Exception):
|
|||
"""
|
||||
|
||||
|
||||
class CallRequestIdDuplicates(Exception):
|
||||
"""
|
||||
Raised when same call request IDs passed in one request.
|
||||
"""
|
||||
|
||||
|
||||
def parse_registered_contract_response(
|
||||
obj: Tuple[RegisteredContract, Blockchain]
|
||||
) -> data.RegisteredContractResponse:
|
||||
|
@ -431,6 +437,38 @@ def create_request_calls(
|
|||
return len(call_specs)
|
||||
|
||||
|
||||
def get_call_request_from_tuple(
|
||||
db_session: Session,
|
||||
metatx_requester_id: uuid.UUID,
|
||||
requests: Set[Tuple[str, str]],
|
||||
contract_id: Optional[uuid.UUID] = None,
|
||||
contract_address: Optional[str] = None,
|
||||
) -> List[CallRequest]:
|
||||
if contract_id is None and contract_address is None:
|
||||
raise ValueError(
|
||||
"At least one of contract_id or contract_address must be specified"
|
||||
)
|
||||
query = (
|
||||
db_session.query(CallRequest)
|
||||
.join(
|
||||
RegisteredContract,
|
||||
CallRequest.registered_contract_id == RegisteredContract.id,
|
||||
)
|
||||
.filter(RegisteredContract.metatx_requester_id == metatx_requester_id)
|
||||
.filter(tuple_(CallRequest.caller, CallRequest.request_id).in_(requests))
|
||||
)
|
||||
if contract_id is not None:
|
||||
query = query.filter(RegisteredContract.id == contract_id)
|
||||
if contract_address is not None:
|
||||
query = query.filter(
|
||||
RegisteredContract.address == Web3.toChecksumAddress(contract_address)
|
||||
)
|
||||
|
||||
existing_requests = query.all()
|
||||
|
||||
return existing_requests
|
||||
|
||||
|
||||
def get_call_request(
|
||||
db_session: Session,
|
||||
request_id: uuid.UUID,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from datetime import datetime
|
||||
from enum import Enum
|
||||
from typing import Any, Dict, List, Optional, Set
|
||||
from typing import Any, Dict, List, Optional, Set, Tuple
|
||||
from uuid import UUID
|
||||
|
||||
from bugout.data import BugoutResource
|
||||
|
@ -329,6 +329,10 @@ class CallRequestResponse(BaseModel):
|
|||
return Web3.toChecksumAddress(v)
|
||||
|
||||
|
||||
class CallRequestsCheck(BaseModel):
|
||||
existing_requests: Set[Tuple[str, str]] = Field(default_factory=set)
|
||||
|
||||
|
||||
class CompleteCallRequestsAPIRequest(BaseModel):
|
||||
tx_hash: str
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ async def leaderboard(
|
|||
leaderboard_id: UUID = Query(..., description="Leaderboard ID"),
|
||||
limit: int = Query(10),
|
||||
offset: int = Query(0),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
db_session: Session = Depends(db.yield_db_read_only_session),
|
||||
version: Optional[str] = Query(None, description="Version of the leaderboard."),
|
||||
points_data: Dict[str, str] = Depends(points_data_dependency),
|
||||
) -> List[data.LeaderboardPosition]:
|
||||
|
@ -348,7 +348,7 @@ async def delete_leaderboard(
|
|||
)
|
||||
async def get_leaderboards(
|
||||
request: Request,
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
db_session: Session = Depends(db.yield_db_read_only_session),
|
||||
Authorization: str = AuthHeader,
|
||||
) -> List[data.Leaderboard]:
|
||||
"""
|
||||
|
@ -394,7 +394,7 @@ async def get_leaderboards(
|
|||
async def count_addresses(
|
||||
leaderboard_id: UUID = Query(..., description="Leaderboard ID"),
|
||||
version: Optional[int] = Query(None, description="Version of the leaderboard."),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
db_session: Session = Depends(db.yield_db_read_only_session),
|
||||
) -> data.CountAddressesResponse:
|
||||
"""
|
||||
Returns the number of addresses in the leaderboard.
|
||||
|
@ -422,7 +422,7 @@ async def count_addresses(
|
|||
)
|
||||
async def leadeboard_info(
|
||||
leaderboard_id: UUID = Query(..., description="Leaderboard ID"),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
db_session: Session = Depends(db.yield_db_read_only_session),
|
||||
version: Optional[int] = Query(None, description="Version of the leaderboard."),
|
||||
) -> data.LeaderboardInfoResponse:
|
||||
"""
|
||||
|
@ -455,7 +455,7 @@ async def leadeboard_info(
|
|||
)
|
||||
async def get_scores_changes(
|
||||
leaderboard_id: UUID = Query(..., description="Leaderboard ID"),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
db_session: Session = Depends(db.yield_db_read_only_session),
|
||||
) -> List[data.LeaderboardScoresChangesResponse]:
|
||||
"""
|
||||
Returns the score history for the given address.
|
||||
|
@ -482,7 +482,7 @@ async def get_scores_changes(
|
|||
@app.get("/quartiles", response_model=data.QuartilesResponse, tags=["Public Endpoints"])
|
||||
async def quartiles(
|
||||
leaderboard_id: UUID = Query(..., description="Leaderboard ID"),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
db_session: Session = Depends(db.yield_db_read_only_session),
|
||||
version: Optional[int] = Query(None, description="Version of the leaderboard."),
|
||||
) -> data.QuartilesResponse:
|
||||
"""
|
||||
|
@ -533,7 +533,7 @@ async def position(
|
|||
True, description="Normalize addresses to checksum."
|
||||
),
|
||||
version: Optional[int] = Query(None, description="Version of the leaderboard."),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
db_session: Session = Depends(db.yield_db_read_only_session),
|
||||
) -> List[data.LeaderboardPosition]:
|
||||
"""
|
||||
Returns the leaderboard posotion for the given address.
|
||||
|
@ -589,7 +589,7 @@ async def rank(
|
|||
limit: Optional[int] = Query(None),
|
||||
offset: Optional[int] = Query(None),
|
||||
version: Optional[int] = Query(None, description="Version of the leaderboard."),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
db_session: Session = Depends(db.yield_db_read_only_session),
|
||||
) -> List[data.LeaderboardPosition]:
|
||||
"""
|
||||
Returns the leaderboard scores for the given rank.
|
||||
|
@ -632,7 +632,7 @@ async def rank(
|
|||
async def ranks(
|
||||
leaderboard_id: UUID = Query(..., description="Leaderboard ID"),
|
||||
version: Optional[int] = Query(None, description="Version of the leaderboard."),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
db_session: Session = Depends(db.yield_db_read_only_session),
|
||||
) -> List[data.RanksResponse]:
|
||||
"""
|
||||
Returns the leaderboard rank buckets overview with score and size of bucket.
|
||||
|
@ -674,7 +674,7 @@ async def leaderboard_score(
|
|||
normalize_addresses: bool = Query(
|
||||
True, description="Normalize addresses to checksum."
|
||||
),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
db_session: Session = Depends(db.yield_db_read_only_session),
|
||||
) -> data.LeaderboardScore:
|
||||
"""
|
||||
Returns the leaderboard posotion for the given address.
|
||||
|
@ -825,7 +825,7 @@ async def leaderboard_push_scores(
|
|||
async def leaderboard_config(
|
||||
request: Request,
|
||||
leaderboard_id: UUID = Path(..., description="Leaderboard ID"),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
db_session: Session = Depends(db.yield_db_read_only_session),
|
||||
Authorization: str = AuthHeader,
|
||||
) -> data.LeaderboardConfig:
|
||||
"""
|
||||
|
@ -1037,7 +1037,7 @@ async def leaderboard_config_deactivate(
|
|||
async def leaderboard_versions_list(
|
||||
request: Request,
|
||||
leaderboard_id: UUID = Path(..., description="Leaderboard ID"),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
db_session: Session = Depends(db.yield_db_read_only_session),
|
||||
Authorization: str = AuthHeader,
|
||||
) -> List[data.LeaderboardVersion]:
|
||||
"""
|
||||
|
@ -1093,7 +1093,7 @@ async def leaderboard_version_handler(
|
|||
request: Request,
|
||||
leaderboard_id: UUID = Path(..., description="Leaderboard ID"),
|
||||
version: int = Path(..., description="Version of the leaderboard."),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
db_session: Session = Depends(db.yield_db_read_only_session),
|
||||
Authorization: str = AuthHeader,
|
||||
) -> data.LeaderboardVersion:
|
||||
"""
|
||||
|
@ -1319,7 +1319,7 @@ async def leaderboard_version_scores_handler(
|
|||
version: int = Path(..., description="Version of the leaderboard."),
|
||||
limit: int = Query(10),
|
||||
offset: int = Query(0),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
db_session: Session = Depends(db.yield_db_read_only_session),
|
||||
Authorization: str = AuthHeader,
|
||||
) -> List[data.LeaderboardPosition]:
|
||||
"""
|
||||
|
|
|
@ -5,14 +5,16 @@ Moonstream users can register contracts on Moonstream Engine. This allows them t
|
|||
as part of their chain-adjacent activities (like performing signature-based token distributions on the
|
||||
Dropper contract).
|
||||
"""
|
||||
|
||||
import logging
|
||||
from typing import Dict, List, Optional
|
||||
from typing import Dict, List, Optional, Set, Tuple
|
||||
from uuid import UUID
|
||||
|
||||
from bugout.data import BugoutUser
|
||||
from fastapi import Body, Depends, FastAPI, Form, Path, Query, Request
|
||||
from sqlalchemy.exc import NoResultFound
|
||||
from sqlalchemy.orm import Session
|
||||
from web3 import Web3
|
||||
|
||||
from .. import contracts_actions, data, db
|
||||
from ..middleware import (
|
||||
|
@ -316,6 +318,57 @@ async def list_requests_route(
|
|||
return [contracts_actions.parse_call_request_response(r) for r in requests]
|
||||
|
||||
|
||||
@app.get(
|
||||
"/requests/check",
|
||||
response_model=data.CallRequestsCheck,
|
||||
)
|
||||
async def check_requests_route(
|
||||
request_data: data.CreateCallRequestsAPIRequest = Body(...),
|
||||
user: BugoutUser = Depends(request_user_auth),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
) -> data.CallRequestsCheck:
|
||||
"""
|
||||
Implemented for pre-check until list of requests to be pushed into database.
|
||||
"""
|
||||
try:
|
||||
incoming_requests: Set[Tuple[str, str]] = set()
|
||||
incoming_request_ids: List[str] = []
|
||||
for r in request_data.specifications:
|
||||
caller_addr = Web3.toChecksumAddress(r.caller)
|
||||
incoming_requests.add((caller_addr, r.request_id))
|
||||
incoming_request_ids.append(r.request_id)
|
||||
|
||||
if len(incoming_requests) != len(incoming_request_ids):
|
||||
raise contracts_actions.CallRequestIdDuplicates(
|
||||
"There are same call_request_id's in one request"
|
||||
)
|
||||
|
||||
existing_requests = contracts_actions.get_call_request_from_tuple(
|
||||
db_session=db_session,
|
||||
metatx_requester_id=user.id,
|
||||
requests=incoming_requests,
|
||||
contract_id=request_data.contract_id,
|
||||
contract_address=request_data.contract_address,
|
||||
)
|
||||
except contracts_actions.CallRequestIdDuplicates:
|
||||
raise EngineHTTPException(
|
||||
status_code=400, detail="There are same call_request_id's in one request"
|
||||
)
|
||||
except Exception as err:
|
||||
logger.error(repr(err))
|
||||
raise EngineHTTPException(status_code=500)
|
||||
|
||||
existing_requests_set: Set[Tuple[str, str]] = set()
|
||||
if len(existing_requests) != 0:
|
||||
existing_requests_set = {
|
||||
(er.caller, str(er.request_id)) for er in existing_requests
|
||||
}
|
||||
|
||||
return data.CallRequestsCheck(
|
||||
existing_requests=existing_requests_set,
|
||||
)
|
||||
|
||||
|
||||
@app.get(
|
||||
"/requests/{request_id}", tags=["requests"], response_model=data.CallRequestResponse
|
||||
)
|
||||
|
@ -348,7 +401,7 @@ async def get_request(
|
|||
|
||||
@app.post("/requests", tags=["requests"], response_model=int)
|
||||
async def create_requests(
|
||||
data: data.CreateCallRequestsAPIRequest = Body(...),
|
||||
request_data: data.CreateCallRequestsAPIRequest = Body(...),
|
||||
user: BugoutUser = Depends(request_user_auth),
|
||||
db_session: Session = Depends(db.yield_db_session),
|
||||
) -> int:
|
||||
|
@ -361,11 +414,11 @@ async def create_requests(
|
|||
num_requests = contracts_actions.create_request_calls(
|
||||
db_session=db_session,
|
||||
metatx_requester_id=user.id,
|
||||
registered_contract_id=data.contract_id,
|
||||
contract_address=data.contract_address,
|
||||
call_specs=data.specifications,
|
||||
ttl_days=data.ttl_days,
|
||||
live_at=data.live_at,
|
||||
registered_contract_id=request_data.contract_id,
|
||||
contract_address=request_data.contract_address,
|
||||
call_specs=request_data.specifications,
|
||||
ttl_days=request_data.ttl_days,
|
||||
live_at=request_data.live_at,
|
||||
)
|
||||
except contracts_actions.InvalidAddressFormat as err:
|
||||
raise EngineHTTPException(
|
||||
|
|
|
@ -87,46 +87,44 @@ MOONSTREAM_AWS_SIGNER_INSTANCE_PORT = 17181
|
|||
|
||||
# Blockchain configuration
|
||||
|
||||
MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI"
|
||||
)
|
||||
MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI"
|
||||
)
|
||||
MOONSTREAM_POLYGON_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_POLYGON_WEB3_PROVIDER_URI"
|
||||
)
|
||||
MOONSTREAM_XDAI_WEB3_PROVIDER_URI = os.environ.get("MOONSTREAM_XDAI_WEB3_PROVIDER_URI")
|
||||
|
||||
# TODO(kompotkot): Leave a comment here explaining templated *_WEB3_PROVIDER_URI when we set
|
||||
# NODEBALANCER_ACCESS_ID
|
||||
ETHEREUM_PROVIDER_URI = MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI
|
||||
MUMBAI_PROVIDER_URI = MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI
|
||||
POLYGON_PROVIDER_URI = MOONSTREAM_POLYGON_WEB3_PROVIDER_URI
|
||||
XDAI_PROVIDER_URI = MOONSTREAM_XDAI_WEB3_PROVIDER_URI
|
||||
|
||||
NODEBALANCER_ACCESS_ID = os.environ.get("ENGINE_NODEBALANCER_ACCESS_ID")
|
||||
if NODEBALANCER_ACCESS_ID is not None:
|
||||
NODEBALANCER_URI_TEMPLATE = "{}?access_id={}&data_source=blockchain"
|
||||
ETHEREUM_PROVIDER_URI = NODEBALANCER_URI_TEMPLATE.format(
|
||||
MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI, NODEBALANCER_ACCESS_ID
|
||||
)
|
||||
MUMBAI_PROVIDER_URI = NODEBALANCER_URI_TEMPLATE.format(
|
||||
MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI, NODEBALANCER_ACCESS_ID
|
||||
)
|
||||
POLYGON_PROVIDER_URI = NODEBALANCER_URI_TEMPLATE.format(
|
||||
MOONSTREAM_POLYGON_WEB3_PROVIDER_URI, NODEBALANCER_ACCESS_ID
|
||||
)
|
||||
XDAI_PROVIDER_URI = NODEBALANCER_URI_TEMPLATE.format(
|
||||
MOONSTREAM_XDAI_WEB3_PROVIDER_URI, NODEBALANCER_ACCESS_ID
|
||||
)
|
||||
|
||||
BLOCKCHAIN_PROVIDER_URIS = {
|
||||
"ethereum": ETHEREUM_PROVIDER_URI,
|
||||
"mumbai": MUMBAI_PROVIDER_URI,
|
||||
"polygon": POLYGON_PROVIDER_URI,
|
||||
"xdai": XDAI_PROVIDER_URI,
|
||||
}
|
||||
BLOCKCHAIN_PROVIDER_URIS = {}
|
||||
|
||||
blockchain_names = [
|
||||
"ethereum",
|
||||
"polygon",
|
||||
"mumbai",
|
||||
"amoy",
|
||||
"xdai",
|
||||
"zksync_era",
|
||||
"zksync_era_sepolia",
|
||||
"arbitrum_one",
|
||||
"arbitrum_nova",
|
||||
"arbitrum_sepolia",
|
||||
"xai",
|
||||
"xai_sepolia",
|
||||
"avalanche",
|
||||
"avalanche_fuji",
|
||||
"blast",
|
||||
"blast_sepolia",
|
||||
"proofofplay_apex",
|
||||
]
|
||||
|
||||
for b in blockchain_names:
|
||||
provider_uri = os.environ.get(f"MOONSTREAM_{b.upper()}_WEB3_PROVIDER_URI")
|
||||
if provider_uri is None:
|
||||
continue
|
||||
|
||||
if NODEBALANCER_ACCESS_ID is not None:
|
||||
NODEBALANCER_URI_TEMPLATE = "{}?access_id={}&data_source=blockchain"
|
||||
provider_uri = NODEBALANCER_URI_TEMPLATE.format(
|
||||
provider_uri, NODEBALANCER_ACCESS_ID
|
||||
)
|
||||
|
||||
BLOCKCHAIN_PROVIDER_URIS[b] = provider_uri
|
||||
|
||||
globals()[f"MOONSTREAM_{b.upper()}_WEB3_PROVIDER_URI"] = provider_uri
|
||||
|
||||
SUPPORTED_BLOCKCHAINS = ", ".join(BLOCKCHAIN_PROVIDER_URIS)
|
||||
UNSUPPORTED_BLOCKCHAIN_ERROR_MESSAGE = f"That blockchain is not supported. The supported blockchains are: {SUPPORTED_BLOCKCHAINS}."
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.0.8
|
||||
0.0.9
|
||||
|
|
|
@ -14,10 +14,21 @@ export ENGINE_REDIS_PASSWORD="<redis_requirepass_password>"
|
|||
export ENGINE_REDIS_URL="localhost:6380"
|
||||
|
||||
# Web3 Provider URIs
|
||||
export MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI="<JSON_RPC_API_URL>"
|
||||
export MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI="<JSON_RPC_API_URL>"
|
||||
export MOONSTREAM_POLYGON_WEB3_PROVIDER_URI="<JSON_RPC_API_URL>"
|
||||
export MOONSTREAM_XDAI_WEB3_PROVIDER_URI="<JSON_RPC_API_URL>"
|
||||
export MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_POLYGON_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_AMOY_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_XDAI_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_ZKSYNC_ERA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_ZKSYNC_ERA_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_ARBITRUM_NOVA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_ARBITRUM_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_XAI_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_AVALANCHE_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_AVALANCHE_FUJI_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_BLAST_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_BLAST_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export ENGINE_NODEBALANCER_ACCESS_ID="<access_id_for_Moonstream_Node_Balancer-if_provided_it_is_interpolated_into_provider_URIs>"
|
||||
|
||||
# leaderboard config
|
||||
|
|
|
@ -15,8 +15,30 @@ export MOONSTREAM_CRAWLERS_SERVER_PORT="<Moonstream_crawlers_server_port>"
|
|||
# Blockchain, txpool, whalewatch data depends variables
|
||||
export MOONSTREAM_DATA_JOURNAL_ID="<bugout_journal_id_to_store_blockchain_data>"
|
||||
export HUMBUG_TXPOOL_CLIENT_ID="<Bugout_Humbug_client_id_for_txpool_transactions_in_journal>"
|
||||
export MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI="https://<connection_path_uri_to_ethereum_node>"
|
||||
export MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_POLYGON_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_PROOFOFPLAY_APEX_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_AMOY_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_XDAI_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_WYRM_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_ZKSYNC_ERA_TESTNET_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_ZKSYNC_ERA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_ZKSYNC_ERA_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_ARBITRUM_ONE_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_ARBITRUM_NOVA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_ARBITRUM_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_XAI_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_AVALANCHE_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_AVALANCHE_FUJI_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_BLAST_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_BLAST_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
|
||||
export MOONSTREAM_QUERIES_JOURNAL_ID="<bugout_journal_id_where_store_queries_for_executing>"
|
||||
export MOONSTREAM_USAGE_REPORTS_JOURNAL_ID="<bugout_journal_id_where_save_generated_reports>"
|
||||
export MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN="<access_token>"
|
||||
export MOONSTREAM_LEADERBOARD_GENERATOR_JOURNAL_ID="<journal_id>"
|
||||
|
||||
# Set following parameters if AWS node instance and S3 smartcontracts configured
|
||||
export MOONSTREAM_S3_SMARTCONTRACTS_BUCKET="<AWS_S3_bucket_to_store_smart_contracts>"
|
||||
|
@ -26,4 +48,4 @@ export MOONSTREAM_S3_QUERIES_BUCKET="<AWS_S3_bucket_to_store_sql_queries>"
|
|||
export MOONSTREAM_S3_QUERIES_BUCKET_PREFIX="dev"
|
||||
|
||||
# Set the following variables in the most reasonable manner for your development environment
|
||||
export HUMBUG_REPORTER_BACKEND_TOKEN="<Bugout_umbug_token_for_crash_reports>"
|
||||
export HUMBUG_REPORTER_BACKEND_TOKEN="<Bugout_umbug_token_for_crash_reports>"
|
|
@ -47,7 +47,7 @@ echo
|
|||
echo
|
||||
echo -e "${PREFIX_INFO} Retrieving addition deployment parameters"
|
||||
mkdir -p "${SECRETS_DIR}"
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" CHECKENV_AWS_FETCH_LOOP_LIMIT=20 /home/ubuntu/go/bin/checkenv show aws_ssm+moonstream:true > "${PARAMETERS_ENV_PATH}"
|
||||
|
||||
echo
|
||||
echo
|
||||
|
|
|
@ -4,12 +4,11 @@ import sys
|
|||
from typing import List, Optional, Type, Union, cast
|
||||
|
||||
import pyevmasm
|
||||
from moonstreamdb.db import yield_db_session
|
||||
from moonstreamdb.models import ESDEventSignature, ESDFunctionSignature
|
||||
from sqlalchemy.orm.session import Session
|
||||
from sqlalchemy.sql.expression import text
|
||||
|
||||
from moonstreamdb.db import yield_db_session
|
||||
|
||||
from .data import ContractABI, EVMEventSignature, EVMFunctionSignature
|
||||
|
||||
|
||||
|
|
|
@ -12,10 +12,10 @@ from bugout.data import (
|
|||
BugoutJournal,
|
||||
BugoutJournals,
|
||||
BugoutResource,
|
||||
BugoutResourceHolder,
|
||||
BugoutResources,
|
||||
BugoutSearchResult,
|
||||
BugoutSearchResults,
|
||||
BugoutResourceHolder,
|
||||
HolderType,
|
||||
ResourcePermissions,
|
||||
)
|
||||
|
@ -25,6 +25,7 @@ from ens.utils import is_valid_ens_name # type: ignore
|
|||
from eth_utils.address import is_address # type: ignore
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType
|
||||
from moonstreamdb.models import EthereumLabel
|
||||
from moonstreamdb.subscriptions import blockchain_by_subscription_id
|
||||
from slugify import slugify # type: ignore
|
||||
from sqlalchemy import text
|
||||
from sqlalchemy.orm import Session
|
||||
|
@ -52,30 +53,6 @@ from .web3_provider import FunctionSignature, connect, multicall
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
blockchain_by_subscription_id = {
|
||||
"ethereum_blockchain": "ethereum",
|
||||
"polygon_blockchain": "polygon",
|
||||
"mumbai_blockchain": "mumbai",
|
||||
"xdai_blockchain": "xdai",
|
||||
"wyrm_blockchain": "wyrm",
|
||||
"arbitrum_nova_blockchain": "arbitrum_nova",
|
||||
"arbitrum_sepolia_blockchain": "arbitrum_sepolia",
|
||||
"xai_blockchain": "xai",
|
||||
"zksync_era_testnet_blockchain": "zksync_era_testnet",
|
||||
"zksync_era_blockchain": "zksync_era",
|
||||
"ethereum_smartcontract": "ethereum",
|
||||
"polygon_smartcontract": "polygon",
|
||||
"mumbai_smartcontract": "mumbai",
|
||||
"xdai_smartcontract": "xdai",
|
||||
"wyrm_smartcontract": "wyrm",
|
||||
"zksync_era_testnet_smartcontract": "zksync_era_testnet",
|
||||
"zksync_era_smartcontract": "zksync_era",
|
||||
"arbitrum_nova_smartcontract": "arbitrum_nova",
|
||||
"arbitrum_sepolia_smartcontract": "arbitrum_sepolia",
|
||||
"xai_smartcontract": "xai",
|
||||
}
|
||||
|
||||
|
||||
class StatusAPIException(Exception):
|
||||
"""
|
||||
Raised during checking Moonstream API statuses.
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
"""
|
||||
Moonstream CLI
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
from posix import listdir
|
||||
from typing import Optional, List, Dict, Any, Union, Callable
|
||||
|
||||
from sqlalchemy.orm import with_expression
|
||||
from typing import Any, Callable, Dict, List, Optional, Union
|
||||
|
||||
from moonstreamdb.db import SessionLocal
|
||||
from sqlalchemy.orm import with_expression
|
||||
|
||||
from ..settings import (
|
||||
BUGOUT_BROOD_URL,
|
||||
BUGOUT_SPIRE_URL,
|
||||
MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
MOONSTREAM_APPLICATION_ID,
|
||||
MOONSTREAM_MOONWORM_TASKS_JOURNAL,
|
||||
MOONSTREAM_USAGE_REPORTS_JOURNAL_ID,
|
||||
)
|
||||
from ..web3_provider import yield_web3_provider
|
||||
|
||||
from . import subscription_types, subscriptions, moonworm_tasks, queries
|
||||
from . import moonworm_tasks, queries, subscription_types, subscriptions, usage
|
||||
from .migrations import (
|
||||
checksum_address,
|
||||
update_dashboard_subscription_key,
|
||||
generate_entity_subscriptions,
|
||||
add_selectors,
|
||||
checksum_address,
|
||||
generate_entity_subscriptions,
|
||||
update_dashboard_subscription_key,
|
||||
)
|
||||
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
@ -257,6 +257,34 @@ def moonworm_tasks_add_subscription_handler(args: argparse.Namespace) -> None:
|
|||
moonworm_tasks.add_subscription(args.id)
|
||||
|
||||
|
||||
def generate_usage_handler(args: argparse.Namespace) -> None:
|
||||
usage_info = usage.collect_usage_information(
|
||||
month=args.month,
|
||||
user_id=args.user_id,
|
||||
contracts=args.contracts,
|
||||
)
|
||||
|
||||
if MOONSTREAM_USAGE_REPORTS_JOURNAL_ID is not None:
|
||||
|
||||
usage.push_report_to_bugout_journal(
|
||||
name=args.name,
|
||||
user_id=args.user_id,
|
||||
month=args.month,
|
||||
journal_id=MOONSTREAM_USAGE_REPORTS_JOURNAL_ID,
|
||||
report=usage_info,
|
||||
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
)
|
||||
|
||||
if args.output is not None:
|
||||
# create path if not exists
|
||||
|
||||
if not os.path.exists(os.path.dirname(args.output)):
|
||||
os.makedirs(os.path.dirname(args.output))
|
||||
|
||||
with open(args.output, "w") as output_file:
|
||||
output_file.write(json.dumps(usage_info, indent=4))
|
||||
|
||||
|
||||
def main() -> None:
|
||||
cli_description = f"""Moonstream Admin CLI
|
||||
|
||||
|
@ -532,6 +560,56 @@ This CLI is configured to work with the following API URLs:
|
|||
"-n", "--name", required=True, help="Name for the new query"
|
||||
)
|
||||
create_query_parser.set_defaults(func=queries.create_query_template)
|
||||
|
||||
usage_parser = subcommands.add_parser(
|
||||
"usage", description="Manage Moonstream usage"
|
||||
)
|
||||
|
||||
usage_parser.set_defaults(func=lambda _: usage_parser.print_help())
|
||||
|
||||
usage_subcommands = usage_parser.add_subparsers(description="Usage commands")
|
||||
|
||||
generate_usage_parser = usage_subcommands.add_parser(
|
||||
"generate", description="Generate usage"
|
||||
)
|
||||
|
||||
generate_usage_parser.add_argument(
|
||||
"--month",
|
||||
required=True,
|
||||
type=str,
|
||||
help="Month for which to generate usage in YYYY-MM format (e.g. 2021-10)",
|
||||
)
|
||||
|
||||
generate_usage_parser.add_argument(
|
||||
"--user-id",
|
||||
required=False,
|
||||
type=str,
|
||||
help="User token for which to generate usage (not implemented yet - use user-token instead)",
|
||||
)
|
||||
|
||||
generate_usage_parser.add_argument(
|
||||
"--name",
|
||||
type=str,
|
||||
help="Name of the user for which to generate usage",
|
||||
default="",
|
||||
)
|
||||
|
||||
generate_usage_parser.add_argument(
|
||||
"--contracts",
|
||||
required=False,
|
||||
type=json.loads,
|
||||
help="Contracts for which to generate usage Json format( { 'blockchain': ['contract_address',...] })",
|
||||
)
|
||||
|
||||
generate_usage_parser.add_argument(
|
||||
"--output",
|
||||
required=False,
|
||||
type=str,
|
||||
help="Output file for usage",
|
||||
)
|
||||
|
||||
generate_usage_parser.set_defaults(func=generate_usage_handler)
|
||||
|
||||
args = parser.parse_args()
|
||||
args.func(args)
|
||||
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
"""
|
||||
Add selectors to all moonworm tasks.
|
||||
"""
|
||||
import logging
|
||||
import json
|
||||
|
||||
import json
|
||||
import logging
|
||||
|
||||
from bugout.exceptions import BugoutResponseException
|
||||
from web3 import Web3
|
||||
|
||||
from ...actions import get_all_entries_from_search
|
||||
from ...settings import (
|
||||
BUGOUT_REQUEST_TIMEOUT_SECONDS,
|
||||
MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
MOONSTREAM_MOONWORM_TASKS_JOURNAL,
|
||||
)
|
||||
from ...settings import bugout_client as bc
|
||||
from ...actions import get_all_entries_from_search
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
Convert all addresses in user subscriptions
|
||||
and ethereum_labels column to checksum address.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from typing import List
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Generate entity subscriptions from existing brood resources subscriptions
|
||||
"""
|
||||
|
||||
import hashlib
|
||||
import json
|
||||
import logging
|
||||
|
@ -691,9 +692,9 @@ def restore_dashboard_state():
|
|||
f"Update dashboard {dashboard.id} with subscription {subscription_id} to old state"
|
||||
)
|
||||
|
||||
dashboard_metadata[index][
|
||||
"subscription_id"
|
||||
] = user_entity_subscriptions[subscription_id]
|
||||
dashboard_metadata[index]["subscription_id"] = (
|
||||
user_entity_subscriptions[subscription_id]
|
||||
)
|
||||
|
||||
bc.update_resource(
|
||||
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
Convert all addresses in user subscriptions
|
||||
and ethereum_labels column to checksum address.
|
||||
"""
|
||||
|
||||
import logging
|
||||
from typing import List
|
||||
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
import logging
|
||||
import json
|
||||
import logging
|
||||
|
||||
import boto3 # type: ignore
|
||||
from bugout.data import BugoutResource, BugoutResources
|
||||
from bugout.exceptions import BugoutResponseException
|
||||
|
||||
|
||||
from ..actions import get_all_entries_from_search, apply_moonworm_tasks
|
||||
from ..actions import apply_moonworm_tasks, get_all_entries_from_search
|
||||
from ..settings import MOONSTREAM_ADMIN_ACCESS_TOKEN, MOONSTREAM_MOONWORM_TASKS_JOURNAL
|
||||
from ..settings import bugout_client as bc
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="ethereum",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Ethereum blockchain",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/ethereum/eth-diamond-purple.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/ethereum/eth-diamond-purple.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
|
@ -35,7 +35,18 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="polygon",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Polygon blockchain",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
),
|
||||
"proofofplay_apex_smartcontract": SubscriptionTypeResourceData(
|
||||
id="proofofplay_apex_smartcontract",
|
||||
name="Proof of Play Apex smartcontracts",
|
||||
blockchain="proofofplay_apex",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Proof of Play Apex blockchain",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/ethereum/eth-diamond-purple.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
|
@ -46,7 +57,18 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="mumbai",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Mumbai blockchain",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
),
|
||||
"amoy_smartcontract": SubscriptionTypeResourceData(
|
||||
id="amoy_smartcontract",
|
||||
name="Amoy smartcontracts",
|
||||
blockchain="amoy",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Amoy blockchain",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
|
@ -57,7 +79,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="xdai",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of XDai blockchain.",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/xdai-token-logo.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/xdai-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
|
@ -68,7 +90,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="wyrm",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Wyrm blockchain.",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/great-wyrm-network-logo.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/great-wyrm-network-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
|
@ -79,7 +101,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="zksync_era",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of zkSync Era blockchain.",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/zksync-era-token-logo.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/zksync-era-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
|
@ -90,7 +112,29 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="zksync_era_testnet",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of zkSync Era testnet blockchain.",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/zksync-era-testnet-token-logo.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/zksync-era-testnet-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
),
|
||||
"zksync_era_sepolia_smartcontract": SubscriptionTypeResourceData(
|
||||
id="zksync_era_sepolia_smartcontract",
|
||||
name="zkSync Era Sepolia smartcontract",
|
||||
blockchain="zksync_era_sepolia",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of zkSync Era Sepolia blockchain.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/zksync-era-testnet-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
),
|
||||
"arbitrum_one_smartcontract": SubscriptionTypeResourceData(
|
||||
id="arbitrum_one_smartcontract",
|
||||
name="Arbitrum One smartcontract",
|
||||
blockchain="arbitrum_one",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Arbitrum One blockchain.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/arbitrum-one-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
|
@ -101,7 +145,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="arbitrum_nova",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Arbitrum Nova blockchain.",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/arbitrum-nova-token-logo.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/arbitrum-nova-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
|
@ -112,7 +156,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="arbitrum_sepolia",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Arbitrum Sepolia blockchain.",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/arbitrum-sepolia-token-logo.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/arbitrum-sepolia-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
|
@ -123,7 +167,62 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="xai",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Xai blockchain.",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/xai-token-logo.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/xai-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
),
|
||||
"xai_sepolia_smartcontract": SubscriptionTypeResourceData(
|
||||
id="xai_sepolia_smartcontract",
|
||||
name="Xai Sepolia smartcontract",
|
||||
blockchain="xai_sepolia",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Xai Sepolia blockchain.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/xai-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
),
|
||||
"avalanche_smartcontract": SubscriptionTypeResourceData(
|
||||
id="avalanche_smartcontract",
|
||||
name="Avalanche smartcontract",
|
||||
blockchain="avalanche",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Avalanche blockchain.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/avalanche-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
),
|
||||
"avalanche_fuji_smartcontract": SubscriptionTypeResourceData(
|
||||
id="avalanche_fuji_smartcontract",
|
||||
name="Avalanche Fuji smartcontract",
|
||||
blockchain="avalanche_fuji",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Avalanche Fuji blockchain.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/avalanche-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
),
|
||||
"blast_smartcontract": SubscriptionTypeResourceData(
|
||||
id="blast_smartcontract",
|
||||
name="Blast smartcontract",
|
||||
blockchain="blast",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Blast blockchain.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/blast-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
),
|
||||
"blast_sepolia_smartcontract": SubscriptionTypeResourceData(
|
||||
id="blast_sepolia_smartcontract",
|
||||
name="Blast Sepolia smartcontract",
|
||||
blockchain="blast_sepolia",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Blast Sepolia blockchain.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/blast-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
|
@ -134,7 +233,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="ethereum",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Transactions that have been mined into the Ethereum blockchain",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/ethereum/eth-diamond-purple.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/ethereum/eth-diamond-purple.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
|
@ -145,7 +244,18 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="polygon",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Transactions that have been mined into the Polygon blockchain",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
),
|
||||
"proofofplay_apex_blockchain": SubscriptionTypeResourceData(
|
||||
id="proofofplay_apex_blockchain",
|
||||
name="Proof of Play Apex transactions",
|
||||
blockchain="proofofplay_apex",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Transactions that have been mined into the Proof of Play Apex blockchain",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/ethereum/eth-diamond-purple.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
|
@ -156,7 +266,18 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="mumbai",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Transactions that have been mined into the Mumbai blockchain",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
),
|
||||
"amoy_blockchain": SubscriptionTypeResourceData(
|
||||
id="amoy_blockchain",
|
||||
name="Amoy transactions",
|
||||
blockchain="amoy",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Transactions that have been mined into the Amoy blockchain",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/matic-token-inverted-icon.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
|
@ -167,7 +288,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="xdai",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Gnosis chain transactions subscription.",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/xdai-token-logo.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/xdai-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
|
@ -178,7 +299,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="wyrm",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Wyrm chain transactions subscription.",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/great-wyrm-network-logo.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/great-wyrm-network-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
|
@ -189,7 +310,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="zksync_era",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="ZkSync Era chain transactions subscription.",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/zksync-era-token-logo.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/zksync-era-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
|
@ -200,7 +321,117 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="zksync_era_testnet",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="ZkSync Era testnet chain transactions subscription.",
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/zksync-era-testnet-token-logo.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/zksync-era-testnet-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
),
|
||||
"zksync_era_sepolia_blockchain": SubscriptionTypeResourceData(
|
||||
id="zksync_era_sepolia_blockchain",
|
||||
name="zkSync Era Sepolia transactions",
|
||||
blockchain="zksync_era_sepolia",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="ZkSync Era Sepolia chain transactions subscription.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/zksync-era-testnet-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
),
|
||||
"arbitrum_one_blockchain": SubscriptionTypeResourceData(
|
||||
id="arbitrum_one_blockchain",
|
||||
name="Arbitrum One transactions",
|
||||
blockchain="arbitrum_one",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Arbitrum One chain transactions subscription.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/arbitrum-one-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
),
|
||||
"arbitrum_nova_blockchain": SubscriptionTypeResourceData(
|
||||
id="arbitrum_nova_blockchain",
|
||||
name="Arbitrum Nova transactions",
|
||||
blockchain="arbitrum_nova",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Arbitrum Nova chain transactions subscription.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/arbitrum-nova-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
),
|
||||
"arbitrum_sepolia_blockchain": SubscriptionTypeResourceData(
|
||||
id="arbitrum_sepolia_blockchain",
|
||||
name="Arbitrum Sepolia transactions",
|
||||
blockchain="arbitrum_sepolia",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Arbitrum Sepolia chain transactions subscription.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/arbitrum-sepolia-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
),
|
||||
"xai_blockchain": SubscriptionTypeResourceData(
|
||||
id="xai_blockchain",
|
||||
name="Xai smartcontract",
|
||||
blockchain="xai",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Xai chain transactions subscription.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/xai-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
),
|
||||
"xai_sepolia_blockchain": SubscriptionTypeResourceData(
|
||||
id="xai_sepolia_blockchain",
|
||||
name="Xai Sepolia transactions",
|
||||
blockchain="xai_sepolia",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Xai Sepolia chain transactions subscription.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/xai-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
),
|
||||
"avalanche_blockchain": SubscriptionTypeResourceData(
|
||||
id="avalanche_blockchain",
|
||||
name="Avalanche transactions",
|
||||
blockchain="avalanche",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Avalanche chain transactions subscription.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/avalanche-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
),
|
||||
"avalanche_fuji_blockchain": SubscriptionTypeResourceData(
|
||||
id="avalanche_fuji_blockchain",
|
||||
name="Avalanche Fuji transactions",
|
||||
blockchain="avalanche_fuji",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Avalanche Fuji chain transactions subscription.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/avalanche-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
),
|
||||
"blast_blockchain": SubscriptionTypeResourceData(
|
||||
id="blast_blockchain",
|
||||
name="Blast transactions",
|
||||
blockchain="blast",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Blast chain transactions subscription.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/blast-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
),
|
||||
"blast_sepolia_blockchain": SubscriptionTypeResourceData(
|
||||
id="blast_sepolia_blockchain",
|
||||
name="Blast Sepolia transactions",
|
||||
blockchain="blast_sepolia",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Blast Sepolia chain transactions subscription.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/blast-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
|
@ -212,7 +443,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
description="Ethereum accounts that have experienced a lot of recent activity",
|
||||
choices=[],
|
||||
# Icon taken from: https://www.maxpixel.net/Whale-Cetacean-Wildlife-Symbol-Ocean-Sea-Black-99310
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/whalewatch.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/whalewatch.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
|
@ -223,7 +454,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="ethereum",
|
||||
description="Transactions that have been submitted into the Ethereum transaction pool but not necessarily mined yet",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/ethereum/eth-diamond-rainbow.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/ethereum/eth-diamond-rainbow.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=False,
|
||||
|
@ -234,7 +465,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
blockchain="Any",
|
||||
description="Externally owned account",
|
||||
choices=[],
|
||||
icon_url="https://s3.amazonaws.com/static.simiotics.com/moonstream/assets/ethereum/eth-diamond-rainbow.png",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/ethereum/eth-diamond-rainbow.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Utilities for managing subscription resources for a Moonstream application.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
from typing import Dict, List, Optional, Union
|
||||
|
|
|
@ -0,0 +1,461 @@
|
|||
import json
|
||||
import logging
|
||||
import textwrap
|
||||
import time
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, List, Optional, Union
|
||||
|
||||
import requests # type: ignore
|
||||
from bugout.data import BugoutResourceHolders, HolderType, ResourcePermissions
|
||||
from moonstream.client import ENDPOINT_QUERIES, Moonstream, MoonstreamQueryResultUrl
|
||||
from web3 import Web3
|
||||
|
||||
from ..actions import get_all_entries_from_search
|
||||
from ..data import BUGOUT_RESOURCE_QUERY_RESOLVER
|
||||
from ..settings import (
|
||||
BUGOUT_REQUEST_TIMEOUT_SECONDS,
|
||||
MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
MOONSTREAM_LEADERBOARD_GENERATOR_JOURNAL_ID,
|
||||
MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN,
|
||||
MOONSTREAM_USAGE_REPORTS_JOURNAL_ID,
|
||||
)
|
||||
from ..settings import bugout_client as bc
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def recive_S3_data_from_query(
|
||||
client: Moonstream,
|
||||
token: Union[str, uuid.UUID],
|
||||
query_name: str,
|
||||
params: Dict[str, Any] = {},
|
||||
time_await: int = 2,
|
||||
max_retries: int = 30,
|
||||
custom_body: Optional[Dict[str, Any]] = None,
|
||||
) -> Any:
|
||||
"""
|
||||
Await the query to be update data on S3 with if_modified_since and return new the data.
|
||||
"""
|
||||
|
||||
keep_going = True
|
||||
|
||||
repeat = 0
|
||||
|
||||
if_modified_since_datetime = datetime.utcnow()
|
||||
if_modified_since = if_modified_since_datetime.strftime("%a, %d %b %Y %H:%M:%S GMT")
|
||||
|
||||
time.sleep(2)
|
||||
if custom_body:
|
||||
headers = {
|
||||
"Authorization": f"Bearer {token}",
|
||||
}
|
||||
json = custom_body
|
||||
|
||||
response = requests.post(
|
||||
url=f"{client.api.endpoints[ENDPOINT_QUERIES]}/{query_name}/update_data",
|
||||
headers=headers,
|
||||
json=json,
|
||||
timeout=5,
|
||||
)
|
||||
data_url = MoonstreamQueryResultUrl(url=response.json()["url"])
|
||||
else:
|
||||
data_url = client.exec_query(
|
||||
token=token,
|
||||
name=query_name,
|
||||
params=params,
|
||||
) # S3 presign_url
|
||||
|
||||
while keep_going:
|
||||
time.sleep(time_await)
|
||||
try:
|
||||
data_response = requests.get(
|
||||
data_url.url,
|
||||
headers={"If-Modified-Since": if_modified_since},
|
||||
timeout=5,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
continue
|
||||
|
||||
if data_response.status_code == 200:
|
||||
break
|
||||
|
||||
repeat += 1
|
||||
|
||||
if repeat > max_retries:
|
||||
logger.info("Too many retries")
|
||||
break
|
||||
return data_response.json()
|
||||
|
||||
|
||||
def generate_leaderboard_owners(
|
||||
leaderboards: List[Dict[str, Any]],
|
||||
) -> List[Dict[str, Any]]:
|
||||
"""
|
||||
Get list of all leaderboard and add owners to it.
|
||||
"""
|
||||
|
||||
leaderboards_cache = {}
|
||||
|
||||
leaderboard_owners = []
|
||||
|
||||
### Get leaderboard owners cache entry
|
||||
entries = []
|
||||
|
||||
if MOONSTREAM_USAGE_REPORTS_JOURNAL_ID is not None:
|
||||
try:
|
||||
entries = get_all_entries_from_search(
|
||||
journal_id=MOONSTREAM_USAGE_REPORTS_JOURNAL_ID,
|
||||
search_query=f"tag:leaderboard_owners tag:cache",
|
||||
limit=100,
|
||||
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
content=True,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Error getting leaderboard_owners_cache entry: {e}")
|
||||
|
||||
if len(entries) > 0:
|
||||
try:
|
||||
leaderboards_cache = json.loads(entries[0].content)
|
||||
except Exception as e:
|
||||
logger.error(f"Error loading leaderboard_owners_cache: {e}")
|
||||
|
||||
for leaderboard in leaderboards:
|
||||
leaderboard_id = leaderboard.resource_data["leaderboard_id"]
|
||||
resource_id = leaderboard.id
|
||||
|
||||
if leaderboard_id in leaderboards_cache:
|
||||
leaderboard_owners.append(leaderboards_cache[leaderboard_id])
|
||||
continue
|
||||
|
||||
holders: BugoutResourceHolders = bc.get_resource_holders(
|
||||
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
resource_id=resource_id,
|
||||
timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS,
|
||||
)
|
||||
|
||||
try:
|
||||
owner = [
|
||||
holder.id
|
||||
for holder in holders.holders
|
||||
if holder.holder_type == HolderType.user
|
||||
and ResourcePermissions.ADMIN in holder.permissions
|
||||
][0]
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
breakpoint()
|
||||
continue
|
||||
|
||||
leaderboard_owners.append(
|
||||
{
|
||||
"leaderboard_id": leaderboard_id,
|
||||
"owner": str(owner),
|
||||
"resource_id": str(resource_id),
|
||||
"created_at": str(leaderboard.created_at),
|
||||
"updated_at": str(leaderboard.updated_at),
|
||||
}
|
||||
)
|
||||
|
||||
leaderboards_cache[leaderboard_id] = {
|
||||
"leaderboard_id": leaderboard_id,
|
||||
"owner": str(owner),
|
||||
"resource_id": str(resource_id),
|
||||
"created_at": str(leaderboard.created_at),
|
||||
"updated_at": str(leaderboard.updated_at),
|
||||
}
|
||||
|
||||
### update cache
|
||||
|
||||
if MOONSTREAM_LEADERBOARD_GENERATOR_JOURNAL_ID is not None:
|
||||
|
||||
if len(entries) > 0:
|
||||
try:
|
||||
bc.update_entry_content(
|
||||
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
journal_id=MOONSTREAM_USAGE_REPORTS_JOURNAL_ID,
|
||||
entry_id=entries[0].entry_url.split("/")[-1],
|
||||
content=textwrap.indent(
|
||||
json.dumps(leaderboards_cache, indent=4), " "
|
||||
),
|
||||
title=entries[0].title,
|
||||
timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
f"Error updating leaderboard_owners_cache entry: {e} continue..."
|
||||
)
|
||||
else:
|
||||
title = "leaderboard_owners_cache"
|
||||
tags = [
|
||||
"leaderboard_owners",
|
||||
"cache",
|
||||
]
|
||||
try:
|
||||
report_entry = bc.create_entry(
|
||||
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
journal_id=MOONSTREAM_USAGE_REPORTS_JOURNAL_ID,
|
||||
title=title,
|
||||
content=textwrap.indent(
|
||||
json.dumps(leaderboards_cache, indent=4), " "
|
||||
),
|
||||
tags=tags,
|
||||
timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
f"Error creating leaderboard_owners_cache entry: {e} continue..."
|
||||
)
|
||||
|
||||
return leaderboard_owners
|
||||
|
||||
|
||||
def collect_usage_information(
|
||||
month: str,
|
||||
user_id: Optional[str] = None,
|
||||
contracts: Optional[Dict[str, List[str]]] = None,
|
||||
) -> Dict[str, Any]:
|
||||
"""
|
||||
Collect billing information for a user.
|
||||
|
||||
By user_id or token.
|
||||
|
||||
Collected info:
|
||||
|
||||
Resources:
|
||||
- queries
|
||||
- subscriptions
|
||||
- leaderboards
|
||||
|
||||
Contracts:
|
||||
- moonstream contracts
|
||||
"""
|
||||
|
||||
subscription_resources = bc.list_resources(
|
||||
token=MOONSTREAM_ADMIN_ACCESS_TOKEN, # type: ignore
|
||||
params={
|
||||
"user_id": user_id,
|
||||
"type": "entity_subscription",
|
||||
},
|
||||
timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS,
|
||||
)
|
||||
|
||||
logger.info(
|
||||
"Found users collection resources: %s", len(subscription_resources.resources)
|
||||
)
|
||||
|
||||
if len(subscription_resources.resources) == 0:
|
||||
subscription_amount = 0
|
||||
else:
|
||||
collection_id = subscription_resources.resources[0].resource_data[
|
||||
"collection_id"
|
||||
]
|
||||
|
||||
### search in subscriptions collection
|
||||
|
||||
subscription_collection = bc.search(
|
||||
token=MOONSTREAM_ADMIN_ACCESS_TOKEN, # type: ignore
|
||||
journal_id=collection_id,
|
||||
content=False,
|
||||
query="",
|
||||
limit=1000,
|
||||
)
|
||||
|
||||
subscription_amount = subscription_collection.total_results
|
||||
|
||||
logger.info("Found users subscriptions: %s", subscription_amount)
|
||||
|
||||
### Get user's queries resources
|
||||
|
||||
query_resources = bc.list_resources(
|
||||
token=MOONSTREAM_ADMIN_ACCESS_TOKEN, # type: ignore
|
||||
params={"user_id": user_id, "type": BUGOUT_RESOURCE_QUERY_RESOLVER},
|
||||
timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS,
|
||||
)
|
||||
|
||||
query_amount = len(query_resources.resources)
|
||||
|
||||
logger.info("Found users queries: %s", query_amount)
|
||||
|
||||
### Get user's leaderboards resources
|
||||
leaderboard_resources = bc.list_resources(
|
||||
token=MOONSTREAM_ADMIN_ACCESS_TOKEN, # type: ignore
|
||||
params={"type": "leaderboard"},
|
||||
timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS,
|
||||
)
|
||||
|
||||
logger.info("Geneating leaderboards owners map")
|
||||
|
||||
leaderboards = generate_leaderboard_owners(
|
||||
leaderboards=leaderboard_resources.resources
|
||||
)
|
||||
|
||||
# Get user leaderboards
|
||||
|
||||
leaderboard_configs = get_all_entries_from_search(
|
||||
token=MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
journal_id=MOONSTREAM_LEADERBOARD_GENERATOR_JOURNAL_ID,
|
||||
search_query="",
|
||||
content=True,
|
||||
limit=1000,
|
||||
)
|
||||
|
||||
leaderboard_configs_mapper = {}
|
||||
|
||||
for leaderboard_entry in leaderboard_configs:
|
||||
tags = leaderboard_entry.tags
|
||||
try:
|
||||
content = json.loads(leaderboard_entry.content)
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
continue
|
||||
|
||||
leaderboard_configs_mapper[content["leaderboard_id"]] = {
|
||||
"query_name": content["query_name"],
|
||||
"update_activated": True if "status:active" in tags else False,
|
||||
}
|
||||
|
||||
logger.info("Found leaderboards: %s", len(leaderboards))
|
||||
logger.info("Fill leaderboards with users data")
|
||||
|
||||
user_leaderboards = []
|
||||
|
||||
for leaderboard in leaderboards:
|
||||
|
||||
if leaderboard["owner"] != user_id:
|
||||
continue
|
||||
|
||||
if leaderboard["leaderboard_id"] in leaderboard_configs_mapper:
|
||||
leaderboard["query_name"] = leaderboard_configs_mapper[
|
||||
leaderboard["leaderboard_id"]
|
||||
]["query_name"]
|
||||
leaderboard["update_activated"] = leaderboard_configs_mapper[
|
||||
leaderboard["leaderboard_id"]
|
||||
]["update_activated"]
|
||||
|
||||
# get leaderboard info
|
||||
|
||||
leaderboard_info = requests.get(
|
||||
f"https://engineapi.moonstream.to/leaderboard/info?leaderboard_id={leaderboard['leaderboard_id']}",
|
||||
).json()
|
||||
try:
|
||||
leaderboard["users_count"] = leaderboard_info["users_count"]
|
||||
leaderboard["last_updated_at"] = leaderboard_info["last_updated_at"]
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
leaderboard["users_count"] = 0
|
||||
leaderboard["last_updated_at"] = None
|
||||
|
||||
user_leaderboards.append(leaderboard)
|
||||
|
||||
logger.info("Found users leaderboards: %s", len(user_leaderboards))
|
||||
|
||||
### contracts events
|
||||
|
||||
contract_data = {}
|
||||
|
||||
if contracts is not None:
|
||||
client = Moonstream()
|
||||
|
||||
### run query
|
||||
|
||||
for blockchain, addresses in contracts.items():
|
||||
logger.info(
|
||||
f"Collecting contracts events for {blockchain} for addresses: {addresses}"
|
||||
)
|
||||
contracts_events = recive_S3_data_from_query(
|
||||
client=client,
|
||||
token=MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN, # type: ignore
|
||||
query_name="template_contract_events_per_month",
|
||||
params={},
|
||||
time_await=2,
|
||||
max_retries=30,
|
||||
custom_body={
|
||||
"blockchain": blockchain,
|
||||
"params": {
|
||||
"block_month": month,
|
||||
"addresses": [
|
||||
Web3.toChecksumAddress(addresses) for addresses in addresses
|
||||
],
|
||||
},
|
||||
},
|
||||
)["data"]
|
||||
|
||||
contract_data[blockchain] = contracts_events
|
||||
|
||||
return {
|
||||
"subscriptions": subscription_amount,
|
||||
"queries": query_amount,
|
||||
"leaderboards": leaderboards,
|
||||
"leaderboards_amount": len(leaderboards),
|
||||
"contracts": contract_data,
|
||||
}
|
||||
|
||||
|
||||
def push_report_to_bugout_journal(
|
||||
name: str,
|
||||
user_id: str,
|
||||
month: str,
|
||||
journal_id: str,
|
||||
report: Dict[str, Any],
|
||||
token: str,
|
||||
) -> None:
|
||||
"""
|
||||
Push report to bugout journal.
|
||||
"""
|
||||
### search by month if entry already exists
|
||||
|
||||
entries = get_all_entries_from_search(
|
||||
journal_id=journal_id,
|
||||
search_query=f"tag:month:{month} tag:report tag:user_id:{user_id}",
|
||||
limit=100,
|
||||
token=token,
|
||||
)
|
||||
|
||||
if len(entries) > 0:
|
||||
entry = entries[0]
|
||||
|
||||
### ensure additional tags
|
||||
|
||||
tags = entry.tags
|
||||
|
||||
if f"customer:{name}" not in tags:
|
||||
tags.append(f"customer:{name}")
|
||||
|
||||
if "moonstream" not in tags:
|
||||
tags.append("moonstream")
|
||||
|
||||
bc.update_entry_content(
|
||||
token=token,
|
||||
journal_id=journal_id,
|
||||
entry_id=entry.entry_url.split("/")[-1],
|
||||
content=textwrap.indent(json.dumps(report, indent=4), " "),
|
||||
title=entry.title,
|
||||
tags=tags,
|
||||
timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS,
|
||||
)
|
||||
|
||||
logger.info("Report entry updated: %s", entry.entry_url)
|
||||
|
||||
else:
|
||||
|
||||
title = f"{name} - {month} - {user_id}"
|
||||
|
||||
tags = [
|
||||
f"month:{month}",
|
||||
"report",
|
||||
f"user_id:{user_id}",
|
||||
"moonstream",
|
||||
f"customer:{name}",
|
||||
]
|
||||
|
||||
report_entry = bc.create_entry(
|
||||
token=token,
|
||||
journal_id=journal_id,
|
||||
title=title,
|
||||
content=textwrap.indent(json.dumps(report, indent=4), " "),
|
||||
tags=tags,
|
||||
timeout=BUGOUT_REQUEST_TIMEOUT_SECONDS,
|
||||
)
|
||||
|
||||
logger.info("Report entry created: %s", report_entry.id)
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
The Moonstream HTTP API
|
||||
"""
|
||||
|
||||
import logging
|
||||
import time
|
||||
from typing import Dict
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Pydantic schemas for the Moonstream HTTP API
|
||||
"""
|
||||
|
||||
import json
|
||||
from datetime import datetime
|
||||
from enum import Enum
|
||||
|
|
|
@ -49,22 +49,40 @@ class ReceivingEventsException(Exception):
|
|||
event_providers: Dict[str, Any] = {
|
||||
moonworm_provider.EthereumMoonwormProvider.event_type: moonworm_provider.EthereumMoonwormProvider,
|
||||
moonworm_provider.PolygonMoonwormProvider.event_type: moonworm_provider.PolygonMoonwormProvider,
|
||||
moonworm_provider.ProofOfPlayApexMoonwormProvider.event_type: moonworm_provider.ProofOfPlayApexMoonwormProvider,
|
||||
moonworm_provider.MumbaiMoonwormProvider.event_type: moonworm_provider.MumbaiMoonwormProvider,
|
||||
moonworm_provider.AmoyMoonwormProvider.event_type: moonworm_provider.AmoyMoonwormProvider,
|
||||
moonworm_provider.XDaiMoonwormProvider.event_type: moonworm_provider.XDaiMoonwormProvider,
|
||||
moonworm_provider.ZkSyncEraTestnetMoonwormProvider.event_type: moonworm_provider.ZkSyncEraTestnetMoonwormProvider,
|
||||
moonworm_provider.ZkSyncEraMoonwormProvider.event_type: moonworm_provider.ZkSyncEraMoonwormProvider,
|
||||
moonworm_provider.ZkSyncEraSepoliaMoonwormProvider.event_type: moonworm_provider.ZkSyncEraSepoliaMoonwormProvider,
|
||||
moonworm_provider.ArbitrumOneMoonwormProvider.event_type: moonworm_provider.ArbitrumOneMoonwormProvider,
|
||||
moonworm_provider.ArbitrumNovaMoonwormProvider.event_type: moonworm_provider.ArbitrumNovaMoonwormProvider,
|
||||
moonworm_provider.ArbitrumSepoliaMoonwormProvider.event_type: moonworm_provider.ArbitrumSepoliaMoonwormProvider,
|
||||
moonworm_provider.XaiMoonwormProvider.event_type: moonworm_provider.XaiMoonwormProvider,
|
||||
moonworm_provider.XaiSepoliaMoonwormProvider.event_type: moonworm_provider.XaiSepoliaMoonwormProvider,
|
||||
moonworm_provider.AvalancheMoonwormProvider.event_type: moonworm_provider.AvalancheMoonwormProvider,
|
||||
moonworm_provider.AvalancheFujiMoonwormProvider.event_type: moonworm_provider.AvalancheFujiMoonwormProvider,
|
||||
moonworm_provider.BlastMoonwormProvider.event_type: moonworm_provider.BlastMoonwormProvider,
|
||||
moonworm_provider.BlastSepoliaMoonwormProvider.event_type: moonworm_provider.BlastSepoliaMoonwormProvider,
|
||||
transactions.EthereumTransactions.event_type: transactions.EthereumTransactions,
|
||||
transactions.PolygonTransactions.event_type: transactions.PolygonTransactions,
|
||||
transactions.ProofOfPlayApexTransactions.event_type: transactions.ProofOfPlayApexTransactions,
|
||||
transactions.MumbaiTransactions.event_type: transactions.MumbaiTransactions,
|
||||
transactions.AmoyTransactions.event_type: transactions.AmoyTransactions,
|
||||
transactions.XDaiTransactions.event_type: transactions.XDaiTransactions,
|
||||
transactions.ZkSyncEraTestnetTransactions.event_type: transactions.ZkSyncEraTestnetTransactions,
|
||||
transactions.ZkSyncEraTransactions.event_type: transactions.ZkSyncEraTransactions,
|
||||
transactions.ZkSyncEraSepoliaTransactions.event_type: transactions.ZkSyncEraSepoliaTransactions,
|
||||
transactions.ArbitrumOneTransactions.event_type: transactions.ArbitrumOneTransactions,
|
||||
transactions.ArbitrumNovaTransactions.event_type: transactions.ArbitrumNovaTransactions,
|
||||
transactions.ArbitrumSepoliaTransactions.event_type: transactions.ArbitrumSepoliaTransactions,
|
||||
transactions.XaiTransactions.event_type: transactions.XaiTransactions,
|
||||
transactions.XaiSepoliaTransactions.event_type: transactions.XaiSepoliaTransactions,
|
||||
transactions.AvalancheTransactions.event_type: transactions.AvalancheTransactions,
|
||||
transactions.AvalancheFujiTransactions.event_type: transactions.AvalancheFujiTransactions,
|
||||
transactions.BlastTransactions.event_type: transactions.BlastTransactions,
|
||||
transactions.BlastSepoliaTransactions.event_type: transactions.BlastSepoliaTransactions,
|
||||
bugout.polygon_whalewatch_provider.event_type: bugout.polygon_whalewatch_provider,
|
||||
bugout.ethereum_txpool_provider.event_type: bugout.ethereum_txpool_provider,
|
||||
bugout.ethereum_whalewatch_provider.event_type: bugout.ethereum_whalewatch_provider,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Event providers powered by Bugout journals.
|
||||
"""
|
||||
|
||||
import json
|
||||
import logging
|
||||
from datetime import datetime
|
||||
|
@ -155,7 +156,7 @@ class BugoutEventProvider:
|
|||
timeout=self.timeout,
|
||||
order=SearchOrder.DESCENDING,
|
||||
)
|
||||
events.extend([self.entry_event(entry) for entry in search_results.results]) # type: ignore
|
||||
events.extend([self.entry_event(entry) for entry in search_results.results]) # type: ignore
|
||||
offset = search_results.next_offset
|
||||
|
||||
return stream_boundary, events
|
||||
|
@ -192,7 +193,7 @@ class BugoutEventProvider:
|
|||
timeout=self.timeout,
|
||||
order=SearchOrder.DESCENDING,
|
||||
)
|
||||
return [self.entry_event(entry) for entry in search_results.results] # type: ignore
|
||||
return [self.entry_event(entry) for entry in search_results.results] # type: ignore
|
||||
|
||||
def next_event(
|
||||
self,
|
||||
|
@ -233,7 +234,7 @@ class BugoutEventProvider:
|
|||
)
|
||||
if not search_results.results:
|
||||
return None
|
||||
return self.entry_event(search_results.results[0]) # type: ignore
|
||||
return self.entry_event(search_results.results[0]) # type: ignore
|
||||
|
||||
def previous_event(
|
||||
self,
|
||||
|
@ -274,7 +275,7 @@ class BugoutEventProvider:
|
|||
)
|
||||
if not search_results.results:
|
||||
return None
|
||||
return self.entry_event(search_results.results[0]) # type: ignore
|
||||
return self.entry_event(search_results.results[0]) # type: ignore
|
||||
|
||||
|
||||
class EthereumTXPoolProvider(BugoutEventProvider):
|
||||
|
|
|
@ -19,13 +19,23 @@ logger.setLevel(logging.WARN)
|
|||
|
||||
ethereum_event_type = "ethereum_blockchain"
|
||||
polygon_event_type = "polygon_blockchain"
|
||||
proofofplay_apex_event_type = "proofofplay_apex_blockchain"
|
||||
mumbai_event_type = "mumbai_blockchain"
|
||||
amoy_event_type = "amoy_blockchain"
|
||||
xdai_event_type = "xdai_blockchain"
|
||||
zksync_era_testnet_event_type = "zksync_era_testnet_blockchain"
|
||||
zksync_era_event_type = "zksync_era_blockchain"
|
||||
zksync_era_sepolia_event_type = "zksync_era_sepolia_blockchain"
|
||||
arbitrum_one_event_type = "arbitrum_one_blockchain"
|
||||
arbitrum_nova_event_type = "arbitrum_nova_blockchain"
|
||||
arbitrum_sepolia_event_type = "arbitrum_sepolia_blockchain"
|
||||
xai_event_type = "xai_blockchain"
|
||||
xai_sepolia_event_type = "xai_sepolia_blockchain"
|
||||
avalanche_event_type = "avalanche_blockchain"
|
||||
avalanche_fuji_sepolia_event_type = "avalanche_fuji_sepolia_blockchain"
|
||||
blast_event_type = "blast_blockchain"
|
||||
blast_sepolia_event_type = "blast_sepolia_blockchain"
|
||||
|
||||
allowed_tags = ["tag:erc721"]
|
||||
|
||||
description = f"""Event provider for transactions from the Ethereum blockchain.
|
||||
|
@ -412,6 +422,13 @@ MumbaiMoonwormProvider = MoonwormProvider(
|
|||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
AmoyMoonwormProvider = MoonwormProvider(
|
||||
event_type="amoy_smartcontract",
|
||||
blockchain=AvailableBlockchainType("amoy"),
|
||||
description="Provider for reviving transactions from Amoy tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
XDaiMoonwormProvider = MoonwormProvider(
|
||||
event_type="xdai_smartcontract",
|
||||
blockchain=AvailableBlockchainType("xdai"),
|
||||
|
@ -433,6 +450,20 @@ ZkSyncEraMoonwormProvider = MoonwormProvider(
|
|||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
ZkSyncEraSepoliaMoonwormProvider = MoonwormProvider(
|
||||
event_type="zksync_era_sepolia_smartcontract",
|
||||
blockchain=AvailableBlockchainType("zksync_era_sepolia"),
|
||||
description="Provider for reviving transactions from zkSync Era Sepolia tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
ArbitrumOneMoonwormProvider = MoonwormProvider(
|
||||
event_type="arbitrum_one_smartcontract",
|
||||
blockchain=AvailableBlockchainType("arbitrum_one"),
|
||||
description="Provider for reviving transactions from Arbitrum One tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
ArbitrumNovaMoonwormProvider = MoonwormProvider(
|
||||
event_type="arbitrum_nova_smartcontract",
|
||||
blockchain=AvailableBlockchainType("arbitrum_nova"),
|
||||
|
@ -453,3 +484,45 @@ XaiMoonwormProvider = MoonwormProvider(
|
|||
description="Provider for reviving transactions from Xai tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
XaiSepoliaMoonwormProvider = MoonwormProvider(
|
||||
event_type="xai_sepolia_smartcontract",
|
||||
blockchain=AvailableBlockchainType("xai_sepolia"),
|
||||
description="Provider for reviving transactions from Xai Sepolia tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
AvalancheMoonwormProvider = MoonwormProvider(
|
||||
event_type="avalanche_smartcontract",
|
||||
blockchain=AvailableBlockchainType("avalanche"),
|
||||
description="Provider for reviving transactions from Avalanche tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
AvalancheFujiMoonwormProvider = MoonwormProvider(
|
||||
event_type="avalanche_fuji_smartcontract",
|
||||
blockchain=AvailableBlockchainType("avalanche_fuji"),
|
||||
description="Provider for reviving transactions from Avalanche Fuji tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
BlastMoonwormProvider = MoonwormProvider(
|
||||
event_type="blast_smartcontract",
|
||||
blockchain=AvailableBlockchainType("blast"),
|
||||
description="Provider for reviving transactions from Blast tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
BlastSepoliaMoonwormProvider = MoonwormProvider(
|
||||
event_type="blast_sepolia_smartcontract",
|
||||
blockchain=AvailableBlockchainType("blast_sepolia"),
|
||||
description="Provider for reviving transactions from Blast Sepolia tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
ProofOfPlayApexMoonwormProvider = MoonwormProvider(
|
||||
event_type="proofofplay_apex_smartcontract",
|
||||
blockchain=AvailableBlockchainType("proofofplay_apex"),
|
||||
description="Provider for reviving transactions from Proof of Play Apex tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
|
|
@ -469,6 +469,13 @@ MumbaiTransactions = TransactionsProvider(
|
|||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
AmoyTransactions = TransactionsProvider(
|
||||
event_type="amoy_blockchain",
|
||||
blockchain=AvailableBlockchainType("amoy"),
|
||||
description="Provider for resiving transactions from Amoy tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
XDaiTransactions = TransactionsProvider(
|
||||
event_type="xdai_blockchain",
|
||||
blockchain=AvailableBlockchainType("xdai"),
|
||||
|
@ -490,6 +497,19 @@ ZkSyncEraTransactions = TransactionsProvider(
|
|||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
ZkSyncEraSepoliaTransactions = TransactionsProvider(
|
||||
event_type="zksync_era_sepolia_blockchain",
|
||||
blockchain=AvailableBlockchainType("zksync_era_sepolia"),
|
||||
description="Provider for resiving transactions from ZkSync Era Sepolia tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
ArbitrumOneTransactions = TransactionsProvider(
|
||||
event_type="arbitrum_one_blockchain",
|
||||
blockchain=AvailableBlockchainType("arbitrum_one"),
|
||||
description="Provider for resiving transactions from Arbitrum One tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
ArbitrumNovaTransactions = TransactionsProvider(
|
||||
event_type="arbitrum_nova_blockchain",
|
||||
|
@ -511,3 +531,45 @@ XaiTransactions = TransactionsProvider(
|
|||
description="Provider for resiving transactions from Xai tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
XaiSepoliaTransactions = TransactionsProvider(
|
||||
event_type="xai_sepolia_blockchain",
|
||||
blockchain=AvailableBlockchainType("xai_sepolia"),
|
||||
description="Provider for resiving transactions from Xai Sepolia tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
AvalancheTransactions = TransactionsProvider(
|
||||
event_type="avalanche_blockchain",
|
||||
blockchain=AvailableBlockchainType("avalanche"),
|
||||
description="Provider for resiving transactions from Avalanche tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
AvalancheFujiTransactions = TransactionsProvider(
|
||||
event_type="avalanche_fuji_blockchain",
|
||||
blockchain=AvailableBlockchainType("avalanche_fuji"),
|
||||
description="Provider for resiving transactions from Avalanche Fuji tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
BlastTransactions = TransactionsProvider(
|
||||
event_type="blast_blockchain",
|
||||
blockchain=AvailableBlockchainType("blast"),
|
||||
description="Provider for resiving transactions from Blast tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
BlastSepoliaTransactions = TransactionsProvider(
|
||||
event_type="blast_sepolia_blockchain",
|
||||
blockchain=AvailableBlockchainType("blast_sepolia"),
|
||||
description="Provider for resiving transactions from Blast Sepolia tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
||||
ProofOfPlayApexTransactions = TransactionsProvider(
|
||||
event_type="proofofplay_apex_blockchain",
|
||||
blockchain=AvailableBlockchainType("proofofplay_apex"),
|
||||
description="Provider for resiving transactions from Proof of Play Apex tables.",
|
||||
streamboaundary_range_limit=2 * 60 * 60,
|
||||
)
|
||||
|
|
|
@ -2,11 +2,10 @@ import logging
|
|||
from typing import Optional
|
||||
|
||||
from fastapi import APIRouter, Depends, Query
|
||||
from moonstreamdb.db import yield_db_session
|
||||
from sqlalchemy.orm import Session
|
||||
from web3 import Web3
|
||||
|
||||
from moonstreamdb.db import yield_db_session
|
||||
|
||||
from .. import actions, data
|
||||
from ..middleware import MoonstreamHTTPException
|
||||
from ..web3_provider import yield_web3_provider
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
The Moonstream queries HTTP API
|
||||
"""
|
||||
|
||||
import logging
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union, cast
|
||||
|
@ -14,21 +15,22 @@ from bugout.data import (
|
|||
BugoutSearchResult,
|
||||
)
|
||||
from bugout.exceptions import BugoutResponseException
|
||||
from fastapi import APIRouter, Body, Path, Request, Query
|
||||
from fastapi import APIRouter, Body, Path, Query, Request
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType
|
||||
from sqlalchemy import text
|
||||
|
||||
from .. import data
|
||||
from ..actions import (
|
||||
NameNormalizationException,
|
||||
create_resource_for_user,
|
||||
generate_s3_access_links,
|
||||
get_query_by_name,
|
||||
name_normalization,
|
||||
query_parameter_hash,
|
||||
create_resource_for_user,
|
||||
)
|
||||
from ..middleware import MoonstreamHTTPException
|
||||
from ..settings import (
|
||||
BUGOUT_REQUEST_TIMEOUT_SECONDS,
|
||||
MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
MOONSTREAM_CRAWLERS_SERVER_PORT,
|
||||
MOONSTREAM_CRAWLERS_SERVER_URL,
|
||||
|
@ -37,7 +39,6 @@ from ..settings import (
|
|||
MOONSTREAM_QUERY_TEMPLATE_CONTEXT_TYPE,
|
||||
MOONSTREAM_S3_QUERIES_BUCKET,
|
||||
MOONSTREAM_S3_QUERIES_BUCKET_PREFIX,
|
||||
BUGOUT_REQUEST_TIMEOUT_SECONDS,
|
||||
)
|
||||
from ..settings import bugout_client as bc
|
||||
|
||||
|
@ -462,9 +463,9 @@ async def update_query_data_handler(
|
|||
"query": content,
|
||||
"params": request_update.params,
|
||||
"file_type": file_type,
|
||||
"blockchain": request_update.blockchain
|
||||
if request_update.blockchain
|
||||
else None,
|
||||
"blockchain": (
|
||||
request_update.blockchain if request_update.blockchain else None
|
||||
),
|
||||
},
|
||||
timeout=MOONSTREAM_INTERNAL_REQUEST_TIMEOUT_SECONDS,
|
||||
)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Ładowanie…
Reference in New Issue