kopia lustrzana https://github.com/bugout-dev/moonstream
Porównaj commity
55 Commity
moonstream
...
main
Autor | SHA1 | Data |
---|---|---|
Andrey Dolgolev | 1d4ef733c8 | |
Andrey | 348d115819 | |
Sergei Sumarokov | 7db8b88a2f | |
Andrey Dolgolev | da2da94b55 | |
Andrey | 18e650d233 | |
kompotkot | 27e9a2242f | |
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 |
|
@ -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
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Runs events historical crawler on arbitrum one
|
||||
|
||||
[Timer]
|
||||
OnBootSec=60s
|
||||
OnUnitActiveSec=10m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -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
|
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
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 arbitrum_one -n
|
||||
CPUWeight=50
|
||||
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
|
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Arbitrum One 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 arbitrum_one --confirmations 10 --min-blocks-batch 20
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=arbitrum-one-moonworm-crawler
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,17 @@
|
|||
[Unit]
|
||||
Description=Arbitrum One 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 arbitrum_one -c 10 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=arbitrum-one-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"
|
||||
|
@ -103,6 +108,11 @@ 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
|
||||
|
@ -127,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
|
||||
|
@ -211,23 +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 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}"
|
||||
|
||||
# Xdai
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing XDai block with transactions syncronizer service definition with ${XDAI_SYNCHRONIZE_SERVICE}"
|
||||
|
@ -279,6 +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 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 Nova block with transactions syncronizer service definition with ${ARBITRUM_NOVA_SYNCHRONIZE_SERVICE}"
|
||||
|
@ -416,3 +447,21 @@ cp "${SCRIPT_DIR}/${BLAST_SEPOLIA_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/s
|
|||
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,10 +27,11 @@ 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"
|
||||
|
@ -39,6 +40,7 @@ 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
|
||||
|
||||
|
@ -64,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
|
||||
|
@ -97,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
|
||||
|
@ -127,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}"
|
||||
|
@ -190,3 +201,11 @@ 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"
|
||||
|
@ -163,6 +167,17 @@ 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
|
||||
|
@ -187,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
|
||||
|
@ -371,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}"
|
||||
|
@ -626,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
|
||||
|
@ -809,3 +843,49 @@ 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
|
|
@ -22,6 +22,8 @@ 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,
|
||||
|
@ -31,6 +33,7 @@ from .settings import (
|
|||
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,
|
||||
|
@ -66,12 +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:
|
||||
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:
|
||||
|
@ -88,6 +95,8 @@ def connect(
|
|||
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")
|
||||
|
||||
|
@ -172,6 +181,8 @@ def add_block(db_session, block: Any, blockchain_type: AvailableBlockchainType)
|
|||
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"))
|
||||
|
@ -252,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"))
|
||||
|
||||
|
|
|
@ -55,8 +55,11 @@ def crawl_uri(metadata_uri: str) -> Any:
|
|||
metadata_uri = metadata_uri.replace(
|
||||
"ipfs://", "https://ipfs.io/ipfs/", 1
|
||||
)
|
||||
req = urllib.request.Request(
|
||||
metadata_uri, headers={"User-Agent": "Mozilla/5.0"}
|
||||
)
|
||||
|
||||
response = urllib.request.urlopen(metadata_uri, timeout=10)
|
||||
response = urllib.request.urlopen(req, timeout=10)
|
||||
|
||||
if (
|
||||
metadata_uri.startswith("data:application/json")
|
||||
|
|
|
@ -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,
|
||||
|
@ -124,40 +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
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST:
|
||||
network = Network.blast
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST_SEPOLIA:
|
||||
network = Network.blast_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,
|
||||
|
|
|
@ -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,25 +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"
|
||||
ZKSYNC_ERA_SEPOLIA_BLOCKCHAIN = "zksync_era_sepolia_smartcontract"
|
||||
ARBITRUM_NOVA_BLOCKCHAIN = "arbitrum_nova_smartcontract"
|
||||
ARBITRUM_SEPOLIA_BLOCKCHAIN = "arbitrum_sepolia_smartcontract"
|
||||
XAI_BLOCKCHAIN = "xai_smartcontract"
|
||||
XAI_SEPOLIA_BLOCKCHAIN = "xai_sepolia_smartcontract"
|
||||
AVALANCHE_BLOCKCHAIN = "avalanche_smartcontract"
|
||||
AVALANCHE_FUJI_BLOCKCHAIN = "avalanche_fuji_smartcontract"
|
||||
BLAST_BLOCKCHAIN = "blast_smartcontract"
|
||||
BLAST_SEPOLIA_BLOCKCHAIN = "blast_sepolia_smartcontract"
|
||||
|
||||
|
||||
def abi_input_signature(input_abi: Dict[str, Any]) -> str:
|
||||
"""
|
||||
Stringifies a function ABI input object according to the ABI specification:
|
||||
|
@ -137,45 +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.ZKSYNC_ERA_SEPOLIA:
|
||||
return SubscriptionTypes.ZKSYNC_ERA_SEPOLIA_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
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE:
|
||||
return SubscriptionTypes.AVALANCHE_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE_FUJI:
|
||||
return SubscriptionTypes.AVALANCHE_FUJI_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST:
|
||||
return SubscriptionTypes.BLAST_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST_SEPOLIA:
|
||||
return SubscriptionTypes.BLAST_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,40 +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.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
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST:
|
||||
network = Network.blast
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST_SEPOLIA:
|
||||
network = Network.blast_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,40 +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.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
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST:
|
||||
network = Network.blast
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST_SEPOLIA:
|
||||
network = Network.blast_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,6 +96,12 @@ 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", ""
|
||||
)
|
||||
|
@ -174,6 +180,23 @@ if MOONSTREAM_NODE_BLAST_SEPOLIA_A_EXTERNAL_URI == "":
|
|||
"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:
|
||||
|
|
|
@ -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,61 +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",
|
||||
"blast": "blast_smartcontract",
|
||||
"blast_sepolia": "blast_sepolia_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",
|
||||
"blast_blockchain": "blast",
|
||||
"blast_sepolia_blockchain": "blast_sepolia",
|
||||
"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",
|
||||
"blast_smartcontract": "blast",
|
||||
"blast_sepolia_smartcontract": "blast_sepolia",
|
||||
}
|
||||
|
||||
|
||||
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.2"
|
||||
MOONCRAWL_VERSION = "0.4.5"
|
||||
|
|
|
@ -23,10 +23,13 @@ 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_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>"
|
||||
|
|
|
@ -37,7 +37,7 @@ setup(
|
|||
"bugout>=0.2.13",
|
||||
"chardet",
|
||||
"fastapi",
|
||||
"moonstreamdb>=0.3.12",
|
||||
"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
|
||||
|
|
|
@ -17,12 +17,15 @@ 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_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>"
|
||||
|
|
|
@ -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,42 +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",
|
||||
"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",
|
||||
"blast_blockchain": "blast",
|
||||
"blast_sepolia_blockchain": "blast_sepolia",
|
||||
"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",
|
||||
"blast_smartcontract": "blast",
|
||||
"blast_sepolia_smartcontract": "blast_sepolia",
|
||||
}
|
||||
|
||||
|
||||
class StatusAPIException(Exception):
|
||||
"""
|
||||
Raised during checking Moonstream API statuses.
|
||||
|
|
|
@ -40,6 +40,17 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
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,
|
||||
),
|
||||
"mumbai_smartcontract": SubscriptionTypeResourceData(
|
||||
id="mumbai_smartcontract",
|
||||
name="Mumbai smartcontracts",
|
||||
|
@ -51,6 +62,17 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
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,
|
||||
),
|
||||
"xdai_smartcontract": SubscriptionTypeResourceData(
|
||||
id="xdai_smartcontract",
|
||||
name="XDai smartcontract",
|
||||
|
@ -106,6 +128,17 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
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,
|
||||
),
|
||||
"arbitrum_nova_smartcontract": SubscriptionTypeResourceData(
|
||||
id="arbitrum_nova_smartcontract",
|
||||
name="Arbitrum Nova smartcontract",
|
||||
|
@ -216,6 +249,17 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
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,
|
||||
),
|
||||
"mumbai_blockchain": SubscriptionTypeResourceData(
|
||||
id="mumbai_blockchain",
|
||||
name="Mumbai transactions",
|
||||
|
@ -227,6 +271,17 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
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,
|
||||
),
|
||||
"xdai_blockchain": SubscriptionTypeResourceData(
|
||||
id="xdai_blockchain",
|
||||
name="XDai transactions",
|
||||
|
@ -282,12 +337,23 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
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="Wyrm chain transactions subscription.",
|
||||
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,
|
||||
|
@ -298,7 +364,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
name="Arbitrum Sepolia transactions",
|
||||
blockchain="arbitrum_sepolia",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Wyrm chain transactions subscription.",
|
||||
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,
|
||||
|
@ -309,7 +375,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
name="Xai smartcontract",
|
||||
blockchain="xai",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Wyrm chain transactions subscription.",
|
||||
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,
|
||||
|
@ -320,7 +386,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
name="Xai Sepolia transactions",
|
||||
blockchain="xai_sepolia",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Wyrm chain transactions subscription.",
|
||||
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,
|
||||
|
@ -331,7 +397,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
name="Avalanche transactions",
|
||||
blockchain="avalanche",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Wyrm chain transactions subscription.",
|
||||
description="Avalanche chain transactions subscription.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/avalanche-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
|
@ -342,7 +408,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
name="Avalanche Fuji transactions",
|
||||
blockchain="avalanche_fuji",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Wyrm chain transactions subscription.",
|
||||
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,
|
||||
|
@ -353,7 +419,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
name="Blast transactions",
|
||||
blockchain="blast",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Wyrm chain transactions subscription.",
|
||||
description="Blast chain transactions subscription.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/blast-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
|
@ -364,7 +430,7 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
name="Blast Sepolia transactions",
|
||||
blockchain="blast_sepolia",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Wyrm chain transactions subscription.",
|
||||
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,
|
||||
|
|
|
@ -49,11 +49,14 @@ 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,
|
||||
|
@ -64,11 +67,14 @@ event_providers: Dict[str, Any] = {
|
|||
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,
|
||||
|
|
|
@ -19,11 +19,14 @@ 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"
|
||||
|
@ -419,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"),
|
||||
|
@ -447,6 +457,13 @@ ZkSyncEraSepoliaMoonwormProvider = MoonwormProvider(
|
|||
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"),
|
||||
|
@ -502,3 +519,10 @@ BlastSepoliaMoonwormProvider = MoonwormProvider(
|
|||
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"),
|
||||
|
@ -497,6 +504,13 @@ ZkSyncEraSepoliaTransactions = TransactionsProvider(
|
|||
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",
|
||||
blockchain=AvailableBlockchainType("arbitrum_nova"),
|
||||
|
@ -552,3 +566,10 @@ BlastSepoliaTransactions = TransactionsProvider(
|
|||
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,
|
||||
)
|
||||
|
|
|
@ -118,6 +118,12 @@ MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI = os.environ.get(
|
|||
if MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI == "":
|
||||
raise Exception("MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_AMOY_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_AMOY_WEB3_PROVIDER_URI", ""
|
||||
)
|
||||
if MOONSTREAM_AMOY_WEB3_PROVIDER_URI == "":
|
||||
raise Exception("MOONSTREAM_AMOY_WEB3_PROVIDER_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_XDAI_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_XDAI_WEB3_PROVIDER_URI", ""
|
||||
)
|
||||
|
@ -152,6 +158,13 @@ if MOONSTREAM_ZKSYNC_ERA_SEPOLIA_WEB3_PROVIDER_URI == "":
|
|||
"MOONSTREAM_ZKSYNC_ERA_SEPOLIA_WEB3_PROVIDER_URI env variable is not set"
|
||||
)
|
||||
|
||||
|
||||
MOONSTREAM_ARBITRUM_ONE_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_ARBITRUM_ONE_WEB3_PROVIDER_URI", ""
|
||||
)
|
||||
if MOONSTREAM_ARBITRUM_ONE_WEB3_PROVIDER_URI == "":
|
||||
raise Exception("MOONSTREAM_ARBITRUM_ONE_WEB3_PROVIDER_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_ARBITRUM_NOVA_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_ARBITRUM_NOVA_WEB3_PROVIDER_URI", ""
|
||||
)
|
||||
|
@ -208,6 +221,14 @@ if MOONSTREAM_BLAST_SEPOLIA_WEB3_PROVIDER_URI == "":
|
|||
"MOONSTREAM_BLAST_SEPOLIA_WEB3_PROVIDER_URI env variable is not set"
|
||||
)
|
||||
|
||||
MOONSTREAM_PROOFOFPLAY_APEX_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_PROOFOFPLAY_APEX_WEB3_PROVIDER_URI", ""
|
||||
)
|
||||
if MOONSTREAM_PROOFOFPLAY_APEX_WEB3_PROVIDER_URI == "":
|
||||
raise Exception(
|
||||
"MOONSTREAM_PROOFOFPLAY_APEX_WEB3_PROVIDER_URI env variable is not set"
|
||||
)
|
||||
|
||||
## QueryAPI
|
||||
|
||||
MOONSTREAM_S3_QUERIES_BUCKET = os.environ.get("MOONSTREAM_S3_QUERIES_BUCKET", "")
|
||||
|
@ -258,7 +279,9 @@ THREAD_TIMEOUT_SECONDS = 10
|
|||
multicall_contracts: Dict[AvailableBlockchainType, str] = {
|
||||
AvailableBlockchainType.POLYGON: "0xc8E51042792d7405184DfCa245F2d27B94D013b6",
|
||||
AvailableBlockchainType.MUMBAI: "0xe9939e7Ea7D7fb619Ac57f648Da7B1D425832631",
|
||||
AvailableBlockchainType.AMOY: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
||||
AvailableBlockchainType.ETHEREUM: "0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696",
|
||||
AvailableBlockchainType.ARBITRUM_ONE: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
||||
AvailableBlockchainType.ARBITRUM_NOVA: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
||||
AvailableBlockchainType.ARBITRUM_SEPOLIA: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
||||
AvailableBlockchainType.XAI: "0xcA11bde05977b3631167028862bE2a173976CA11",
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
Moonstream library and API version.
|
||||
"""
|
||||
|
||||
MOONSTREAMAPI_VERSION = "0.3.6"
|
||||
MOONSTREAMAPI_VERSION = "0.4.2"
|
||||
|
|
|
@ -12,6 +12,8 @@ from web3.middleware import geth_poa_middleware
|
|||
from web3.providers.rpc import HTTPProvider
|
||||
|
||||
from .settings import (
|
||||
MOONSTREAM_AMOY_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_ARBITRUM_ONE_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_ARBITRUM_NOVA_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_ARBITRUM_SEPOLIA_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_AVALANCHE_FUJI_WEB3_PROVIDER_URI,
|
||||
|
@ -21,6 +23,7 @@ from .settings import (
|
|||
MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_POLYGON_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_PROOFOFPLAY_APEX_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_WYRM_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_XAI_WEB3_PROVIDER_URI,
|
||||
|
@ -74,6 +77,8 @@ def connect(
|
|||
web3_uri = MOONSTREAM_POLYGON_WEB3_PROVIDER_URI
|
||||
elif blockchain_type == AvailableBlockchainType.MUMBAI:
|
||||
web3_uri = MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI
|
||||
elif blockchain_type == AvailableBlockchainType.AMOY:
|
||||
web3_uri = MOONSTREAM_AMOY_WEB3_PROVIDER_URI
|
||||
elif blockchain_type == AvailableBlockchainType.XDAI:
|
||||
web3_uri = MOONSTREAM_XDAI_WEB3_PROVIDER_URI
|
||||
elif blockchain_type == AvailableBlockchainType.WYRM:
|
||||
|
@ -84,6 +89,8 @@ def connect(
|
|||
web3_uri = MOONSTREAM_ZKSYNC_ERA_WEB3_PROVIDER_URI
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_SEPOLIA:
|
||||
web3_uri = MOONSTREAM_ZKSYNC_ERA_SEPOLIA_WEB3_PROVIDER_URI
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_ONE:
|
||||
web3_uri = MOONSTREAM_ARBITRUM_ONE_WEB3_PROVIDER_URI
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
web3_uri = MOONSTREAM_ARBITRUM_NOVA_WEB3_PROVIDER_URI
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
|
@ -100,6 +107,8 @@ def connect(
|
|||
web3_uri = MOONSTREAM_BLAST_WEB3_PROVIDER_URI
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST_SEPOLIA:
|
||||
web3_uri = MOONSTREAM_BLAST_SEPOLIA_WEB3_PROVIDER_URI
|
||||
elif blockchain_type == AvailableBlockchainType.PROOFOFPLAY_APEX:
|
||||
web3_uri = MOONSTREAM_PROOFOFPLAY_APEX_WEB3_PROVIDER_URI
|
||||
else:
|
||||
raise Exception("Wrong blockchain type provided for web3 URI")
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ lru-dict==1.1.8
|
|||
Mako==1.2.3
|
||||
MarkupSafe==2.1.1
|
||||
moonstream==0.1.1
|
||||
moonstreamdb==0.3.12
|
||||
moonstreamdb==0.4.4
|
||||
multiaddr==0.0.9
|
||||
multidict==6.0.2
|
||||
netaddr==0.8.0
|
||||
|
|
|
@ -16,7 +16,7 @@ setup(
|
|||
"bugout>=0.2.15",
|
||||
"fastapi",
|
||||
"moonstream",
|
||||
"moonstreamdb>=0.3.12",
|
||||
"moonstreamdb>=0.4.4",
|
||||
"humbug",
|
||||
"pydantic==1.10.2",
|
||||
"pyevmasm",
|
||||
|
|
|
@ -31,16 +31,21 @@ from moonstreamdbv3.models import (
|
|||
SepoliaLabel,
|
||||
PolygonLabel,
|
||||
MumbaiLabel,
|
||||
AmoyLabel,
|
||||
XDaiLabel,
|
||||
ZkSyncEraLabel,
|
||||
ZkSyncEraSepoliaLabel,
|
||||
BaseLabel,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumOneLabel,
|
||||
ArbitrumSepoliaLabel,
|
||||
XaiLabel,
|
||||
XaiSepoliaLabel,
|
||||
AvalancheLabel,
|
||||
AvalancheFujiLabel,
|
||||
BlastLabel,
|
||||
BlastSepoliaLabel,
|
||||
ProofOfPlayApexLabel,
|
||||
StarknetLabel,
|
||||
StarknetSepoliaLabel,
|
||||
)
|
||||
|
@ -52,6 +57,7 @@ def include_symbol(tablename, schema):
|
|||
SepoliaLabel.__tablename__,
|
||||
PolygonLabel.__tablename__,
|
||||
MumbaiLabel.__tablename__,
|
||||
AmoyLabel.__tablename__,
|
||||
XDaiLabel.__tablename__,
|
||||
ZkSyncEraLabel.__tablename__,
|
||||
ZkSyncEraSepoliaLabel.__tablename__,
|
||||
|
@ -62,6 +68,9 @@ def include_symbol(tablename, schema):
|
|||
XaiSepoliaLabel.__tablename__,
|
||||
AvalancheLabel.__tablename__,
|
||||
AvalancheFujiLabel.__tablename__,
|
||||
BlastLabel.__tablename__,
|
||||
BlastSepoliaLabel.__tablename__,
|
||||
ProofOfPlayApexLabel.__tablename__,
|
||||
StarknetLabel.__tablename__,
|
||||
StarknetSepoliaLabel.__tablename__,
|
||||
}
|
||||
|
|
|
@ -0,0 +1,185 @@
|
|||
"""Amoy, Blast and Apex blockchains
|
||||
|
||||
Revision ID: e9e1b43f49e1
|
||||
Revises: 994e614b5500
|
||||
Create Date: 2024-04-22 09:35:56.509834
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'e9e1b43f49e1'
|
||||
down_revision: Union[str, None] = '994e614b5500'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('amoy_labels',
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('label', sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column('transaction_hash', sa.VARCHAR(length=128), nullable=False),
|
||||
sa.Column('log_index', sa.Integer(), nullable=True),
|
||||
sa.Column('block_number', sa.BigInteger(), nullable=False),
|
||||
sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column('block_timestamp', sa.BigInteger(), nullable=False),
|
||||
sa.Column('caller_address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('origin_address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('label_name', sa.Text(), nullable=True),
|
||||
sa.Column('label_type', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('label_data', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_amoy_labels')),
|
||||
sa.UniqueConstraint('id', name=op.f('uq_amoy_labels_id'))
|
||||
)
|
||||
op.create_index('ix_amoy_labels_addr_block_num', 'amoy_labels', ['address', 'block_number'], unique=False)
|
||||
op.create_index('ix_amoy_labels_addr_block_ts', 'amoy_labels', ['address', 'block_timestamp'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_labels_address'), 'amoy_labels', ['address'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_labels_block_number'), 'amoy_labels', ['block_number'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_labels_caller_address'), 'amoy_labels', ['caller_address'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_labels_label'), 'amoy_labels', ['label'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_labels_label_name'), 'amoy_labels', ['label_name'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_labels_label_type'), 'amoy_labels', ['label_type'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_labels_origin_address'), 'amoy_labels', ['origin_address'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_labels_transaction_hash'), 'amoy_labels', ['transaction_hash'], unique=False)
|
||||
op.create_table('blast_labels',
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('label', sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column('transaction_hash', sa.VARCHAR(length=128), nullable=False),
|
||||
sa.Column('log_index', sa.Integer(), nullable=True),
|
||||
sa.Column('block_number', sa.BigInteger(), nullable=False),
|
||||
sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column('block_timestamp', sa.BigInteger(), nullable=False),
|
||||
sa.Column('caller_address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('origin_address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('label_name', sa.Text(), nullable=True),
|
||||
sa.Column('label_type', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('label_data', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_blast_labels')),
|
||||
sa.UniqueConstraint('id', name=op.f('uq_blast_labels_id'))
|
||||
)
|
||||
op.create_index('ix_blast_labels_addr_block_num', 'blast_labels', ['address', 'block_number'], unique=False)
|
||||
op.create_index('ix_blast_labels_addr_block_ts', 'blast_labels', ['address', 'block_timestamp'], unique=False)
|
||||
op.create_index(op.f('ix_blast_labels_address'), 'blast_labels', ['address'], unique=False)
|
||||
op.create_index(op.f('ix_blast_labels_block_number'), 'blast_labels', ['block_number'], unique=False)
|
||||
op.create_index(op.f('ix_blast_labels_caller_address'), 'blast_labels', ['caller_address'], unique=False)
|
||||
op.create_index(op.f('ix_blast_labels_label'), 'blast_labels', ['label'], unique=False)
|
||||
op.create_index(op.f('ix_blast_labels_label_name'), 'blast_labels', ['label_name'], unique=False)
|
||||
op.create_index(op.f('ix_blast_labels_label_type'), 'blast_labels', ['label_type'], unique=False)
|
||||
op.create_index(op.f('ix_blast_labels_origin_address'), 'blast_labels', ['origin_address'], unique=False)
|
||||
op.create_index(op.f('ix_blast_labels_transaction_hash'), 'blast_labels', ['transaction_hash'], unique=False)
|
||||
op.create_table('blast_sepolia_labels',
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('label', sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column('transaction_hash', sa.VARCHAR(length=128), nullable=False),
|
||||
sa.Column('log_index', sa.Integer(), nullable=True),
|
||||
sa.Column('block_number', sa.BigInteger(), nullable=False),
|
||||
sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column('block_timestamp', sa.BigInteger(), nullable=False),
|
||||
sa.Column('caller_address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('origin_address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('label_name', sa.Text(), nullable=True),
|
||||
sa.Column('label_type', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('label_data', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_blast_sepolia_labels')),
|
||||
sa.UniqueConstraint('id', name=op.f('uq_blast_sepolia_labels_id'))
|
||||
)
|
||||
op.create_index('ix_blast_sepolia_labels_addr_block_num', 'blast_sepolia_labels', ['address', 'block_number'], unique=False)
|
||||
op.create_index('ix_blast_sepolia_labels_addr_block_ts', 'blast_sepolia_labels', ['address', 'block_timestamp'], unique=False)
|
||||
op.create_index(op.f('ix_blast_sepolia_labels_address'), 'blast_sepolia_labels', ['address'], unique=False)
|
||||
op.create_index(op.f('ix_blast_sepolia_labels_block_number'), 'blast_sepolia_labels', ['block_number'], unique=False)
|
||||
op.create_index(op.f('ix_blast_sepolia_labels_caller_address'), 'blast_sepolia_labels', ['caller_address'], unique=False)
|
||||
op.create_index(op.f('ix_blast_sepolia_labels_label'), 'blast_sepolia_labels', ['label'], unique=False)
|
||||
op.create_index(op.f('ix_blast_sepolia_labels_label_name'), 'blast_sepolia_labels', ['label_name'], unique=False)
|
||||
op.create_index(op.f('ix_blast_sepolia_labels_label_type'), 'blast_sepolia_labels', ['label_type'], unique=False)
|
||||
op.create_index(op.f('ix_blast_sepolia_labels_origin_address'), 'blast_sepolia_labels', ['origin_address'], unique=False)
|
||||
op.create_index(op.f('ix_blast_sepolia_labels_transaction_hash'), 'blast_sepolia_labels', ['transaction_hash'], unique=False)
|
||||
op.create_table('proofofplay_apex_labels',
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('label', sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column('transaction_hash', sa.VARCHAR(length=128), nullable=False),
|
||||
sa.Column('log_index', sa.Integer(), nullable=True),
|
||||
sa.Column('block_number', sa.BigInteger(), nullable=False),
|
||||
sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column('block_timestamp', sa.BigInteger(), nullable=False),
|
||||
sa.Column('caller_address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('origin_address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('label_name', sa.Text(), nullable=True),
|
||||
sa.Column('label_type', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('label_data', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_proofofplay_apex_labels')),
|
||||
sa.UniqueConstraint('id', name=op.f('uq_proofofplay_apex_labels_id'))
|
||||
)
|
||||
op.create_index('ix_proofofplay_apex_labels_addr_block_num', 'proofofplay_apex_labels', ['address', 'block_number'], unique=False)
|
||||
op.create_index('ix_proofofplay_apex_labels_addr_block_ts', 'proofofplay_apex_labels', ['address', 'block_timestamp'], unique=False)
|
||||
op.create_index(op.f('ix_proofofplay_apex_labels_address'), 'proofofplay_apex_labels', ['address'], unique=False)
|
||||
op.create_index(op.f('ix_proofofplay_apex_labels_block_number'), 'proofofplay_apex_labels', ['block_number'], unique=False)
|
||||
op.create_index(op.f('ix_proofofplay_apex_labels_caller_address'), 'proofofplay_apex_labels', ['caller_address'], unique=False)
|
||||
op.create_index(op.f('ix_proofofplay_apex_labels_label'), 'proofofplay_apex_labels', ['label'], unique=False)
|
||||
op.create_index(op.f('ix_proofofplay_apex_labels_label_name'), 'proofofplay_apex_labels', ['label_name'], unique=False)
|
||||
op.create_index(op.f('ix_proofofplay_apex_labels_label_type'), 'proofofplay_apex_labels', ['label_type'], unique=False)
|
||||
op.create_index(op.f('ix_proofofplay_apex_labels_origin_address'), 'proofofplay_apex_labels', ['origin_address'], unique=False)
|
||||
op.create_index(op.f('ix_proofofplay_apex_labels_transaction_hash'), 'proofofplay_apex_labels', ['transaction_hash'], unique=False)
|
||||
op.create_index('ix_arbitrum_nova_labels_addr_block_ts', 'arbitrum_nova_labels', ['address', 'block_timestamp'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_proofofplay_apex_labels_transaction_hash'), table_name='proofofplay_apex_labels')
|
||||
op.drop_index(op.f('ix_proofofplay_apex_labels_origin_address'), table_name='proofofplay_apex_labels')
|
||||
op.drop_index(op.f('ix_proofofplay_apex_labels_label_type'), table_name='proofofplay_apex_labels')
|
||||
op.drop_index(op.f('ix_proofofplay_apex_labels_label_name'), table_name='proofofplay_apex_labels')
|
||||
op.drop_index(op.f('ix_proofofplay_apex_labels_label'), table_name='proofofplay_apex_labels')
|
||||
op.drop_index(op.f('ix_proofofplay_apex_labels_caller_address'), table_name='proofofplay_apex_labels')
|
||||
op.drop_index(op.f('ix_proofofplay_apex_labels_block_number'), table_name='proofofplay_apex_labels')
|
||||
op.drop_index(op.f('ix_proofofplay_apex_labels_address'), table_name='proofofplay_apex_labels')
|
||||
op.drop_index('ix_proofofplay_apex_labels_addr_block_ts', table_name='proofofplay_apex_labels')
|
||||
op.drop_index('ix_proofofplay_apex_labels_addr_block_num', table_name='proofofplay_apex_labels')
|
||||
op.drop_table('proofofplay_apex_labels')
|
||||
op.drop_index(op.f('ix_blast_sepolia_labels_transaction_hash'), table_name='blast_sepolia_labels')
|
||||
op.drop_index(op.f('ix_blast_sepolia_labels_origin_address'), table_name='blast_sepolia_labels')
|
||||
op.drop_index(op.f('ix_blast_sepolia_labels_label_type'), table_name='blast_sepolia_labels')
|
||||
op.drop_index(op.f('ix_blast_sepolia_labels_label_name'), table_name='blast_sepolia_labels')
|
||||
op.drop_index(op.f('ix_blast_sepolia_labels_label'), table_name='blast_sepolia_labels')
|
||||
op.drop_index(op.f('ix_blast_sepolia_labels_caller_address'), table_name='blast_sepolia_labels')
|
||||
op.drop_index(op.f('ix_blast_sepolia_labels_block_number'), table_name='blast_sepolia_labels')
|
||||
op.drop_index(op.f('ix_blast_sepolia_labels_address'), table_name='blast_sepolia_labels')
|
||||
op.drop_index('ix_blast_sepolia_labels_addr_block_ts', table_name='blast_sepolia_labels')
|
||||
op.drop_index('ix_blast_sepolia_labels_addr_block_num', table_name='blast_sepolia_labels')
|
||||
op.drop_table('blast_sepolia_labels')
|
||||
op.drop_index(op.f('ix_blast_labels_transaction_hash'), table_name='blast_labels')
|
||||
op.drop_index(op.f('ix_blast_labels_origin_address'), table_name='blast_labels')
|
||||
op.drop_index(op.f('ix_blast_labels_label_type'), table_name='blast_labels')
|
||||
op.drop_index(op.f('ix_blast_labels_label_name'), table_name='blast_labels')
|
||||
op.drop_index(op.f('ix_blast_labels_label'), table_name='blast_labels')
|
||||
op.drop_index(op.f('ix_blast_labels_caller_address'), table_name='blast_labels')
|
||||
op.drop_index(op.f('ix_blast_labels_block_number'), table_name='blast_labels')
|
||||
op.drop_index(op.f('ix_blast_labels_address'), table_name='blast_labels')
|
||||
op.drop_index('ix_blast_labels_addr_block_ts', table_name='blast_labels')
|
||||
op.drop_index('ix_blast_labels_addr_block_num', table_name='blast_labels')
|
||||
op.drop_table('blast_labels')
|
||||
op.drop_index(op.f('ix_amoy_labels_transaction_hash'), table_name='amoy_labels')
|
||||
op.drop_index(op.f('ix_amoy_labels_origin_address'), table_name='amoy_labels')
|
||||
op.drop_index(op.f('ix_amoy_labels_label_type'), table_name='amoy_labels')
|
||||
op.drop_index(op.f('ix_amoy_labels_label_name'), table_name='amoy_labels')
|
||||
op.drop_index(op.f('ix_amoy_labels_label'), table_name='amoy_labels')
|
||||
op.drop_index(op.f('ix_amoy_labels_caller_address'), table_name='amoy_labels')
|
||||
op.drop_index(op.f('ix_amoy_labels_block_number'), table_name='amoy_labels')
|
||||
op.drop_index(op.f('ix_amoy_labels_address'), table_name='amoy_labels')
|
||||
op.drop_index('ix_amoy_labels_addr_block_ts', table_name='amoy_labels')
|
||||
op.drop_index('ix_amoy_labels_addr_block_num', table_name='amoy_labels')
|
||||
op.drop_table('amoy_labels')
|
||||
# ### end Alembic commands ###
|
|
@ -0,0 +1,67 @@
|
|||
"""Arbitrum One blockchain
|
||||
|
||||
Revision ID: e9f640a2b45b
|
||||
Revises: e9e1b43f49e1
|
||||
Create Date: 2024-05-10 10:39:21.257483
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = 'e9f640a2b45b'
|
||||
down_revision: Union[str, None] = 'e9e1b43f49e1'
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('arbitrum_one_labels',
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('label', sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column('transaction_hash', sa.VARCHAR(length=128), nullable=False),
|
||||
sa.Column('log_index', sa.Integer(), nullable=True),
|
||||
sa.Column('block_number', sa.BigInteger(), nullable=False),
|
||||
sa.Column('block_hash', sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column('block_timestamp', sa.BigInteger(), nullable=False),
|
||||
sa.Column('caller_address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('origin_address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('address', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('label_name', sa.Text(), nullable=True),
|
||||
sa.Column('label_type', sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column('label_data', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_arbitrum_one_labels')),
|
||||
sa.UniqueConstraint('id', name=op.f('uq_arbitrum_one_labels_id'))
|
||||
)
|
||||
op.create_index('ix_arbitrum_one_labels_addr_block_num', 'arbitrum_one_labels', ['address', 'block_number'], unique=False)
|
||||
op.create_index('ix_arbitrum_one_labels_addr_block_ts', 'arbitrum_one_labels', ['address', 'block_timestamp'], unique=False)
|
||||
op.create_index(op.f('ix_arbitrum_one_labels_address'), 'arbitrum_one_labels', ['address'], unique=False)
|
||||
op.create_index(op.f('ix_arbitrum_one_labels_block_number'), 'arbitrum_one_labels', ['block_number'], unique=False)
|
||||
op.create_index(op.f('ix_arbitrum_one_labels_caller_address'), 'arbitrum_one_labels', ['caller_address'], unique=False)
|
||||
op.create_index(op.f('ix_arbitrum_one_labels_label'), 'arbitrum_one_labels', ['label'], unique=False)
|
||||
op.create_index(op.f('ix_arbitrum_one_labels_label_name'), 'arbitrum_one_labels', ['label_name'], unique=False)
|
||||
op.create_index(op.f('ix_arbitrum_one_labels_label_type'), 'arbitrum_one_labels', ['label_type'], unique=False)
|
||||
op.create_index(op.f('ix_arbitrum_one_labels_origin_address'), 'arbitrum_one_labels', ['origin_address'], unique=False)
|
||||
op.create_index(op.f('ix_arbitrum_one_labels_transaction_hash'), 'arbitrum_one_labels', ['transaction_hash'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_arbitrum_one_labels_transaction_hash'), table_name='arbitrum_one_labels')
|
||||
op.drop_index(op.f('ix_arbitrum_one_labels_origin_address'), table_name='arbitrum_one_labels')
|
||||
op.drop_index(op.f('ix_arbitrum_one_labels_label_type'), table_name='arbitrum_one_labels')
|
||||
op.drop_index(op.f('ix_arbitrum_one_labels_label_name'), table_name='arbitrum_one_labels')
|
||||
op.drop_index(op.f('ix_arbitrum_one_labels_label'), table_name='arbitrum_one_labels')
|
||||
op.drop_index(op.f('ix_arbitrum_one_labels_caller_address'), table_name='arbitrum_one_labels')
|
||||
op.drop_index(op.f('ix_arbitrum_one_labels_block_number'), table_name='arbitrum_one_labels')
|
||||
op.drop_index(op.f('ix_arbitrum_one_labels_address'), table_name='arbitrum_one_labels')
|
||||
op.drop_index('ix_arbitrum_one_labels_addr_block_ts', table_name='arbitrum_one_labels')
|
||||
op.drop_index('ix_arbitrum_one_labels_addr_block_num', table_name='arbitrum_one_labels')
|
||||
op.drop_table('arbitrum_one_labels')
|
||||
# ### end Alembic commands ###
|
|
@ -7,7 +7,7 @@ import os
|
|||
from contextlib import contextmanager
|
||||
from typing import Generator, Optional
|
||||
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy import create_engine, Engine
|
||||
from sqlalchemy.orm import Session, sessionmaker
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
@ -21,35 +21,35 @@ try:
|
|||
MOONSTREAM_DB_URI_READ_ONLY = os.environ.get("MOONSTREAM_DB_URI_READ_ONLY")
|
||||
if MOONSTREAM_DB_URI_READ_ONLY is None:
|
||||
raise Warning("MOONSTREAM_DB_URI_READ_ONLY environment variable must be set")
|
||||
|
||||
MOONSTREAM_POOL_SIZE_RAW = os.environ.get("MOONSTREAM_POOL_SIZE")
|
||||
MOONSTREAM_POOL_SIZE = 1
|
||||
try:
|
||||
if MOONSTREAM_POOL_SIZE_RAW is not None:
|
||||
MOONSTREAM_POOL_SIZE = int(MOONSTREAM_POOL_SIZE_RAW)
|
||||
except:
|
||||
raise ValueError(
|
||||
f"Could not parse MOONSTREAM_POOL_SIZE as int: {MOONSTREAM_POOL_SIZE_RAW}"
|
||||
)
|
||||
|
||||
MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS_RAW = os.environ.get(
|
||||
"MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS"
|
||||
)
|
||||
MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS = 30000
|
||||
try:
|
||||
if MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS_RAW is not None:
|
||||
MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS = int(
|
||||
MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS_RAW
|
||||
)
|
||||
except:
|
||||
raise ValueError(
|
||||
f"MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS must be an integer: {MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS_RAW}"
|
||||
)
|
||||
except ValueError as e:
|
||||
raise ValueError(e)
|
||||
except Warning:
|
||||
logger.warning("Database variables not set")
|
||||
|
||||
MOONSTREAM_POOL_SIZE_RAW = os.environ.get("MOONSTREAM_POOL_SIZE")
|
||||
MOONSTREAM_POOL_SIZE = 1
|
||||
try:
|
||||
if MOONSTREAM_POOL_SIZE_RAW is not None:
|
||||
MOONSTREAM_POOL_SIZE = int(MOONSTREAM_POOL_SIZE_RAW)
|
||||
except:
|
||||
raise ValueError(
|
||||
f"Could not parse MOONSTREAM_POOL_SIZE as int: {MOONSTREAM_POOL_SIZE_RAW}"
|
||||
)
|
||||
|
||||
MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS_RAW = os.environ.get(
|
||||
"MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS"
|
||||
)
|
||||
MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS = 30000
|
||||
try:
|
||||
if MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS_RAW is not None:
|
||||
MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS = int(
|
||||
MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS_RAW
|
||||
)
|
||||
except:
|
||||
raise ValueError(
|
||||
f"MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS must be an integer: {MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS_RAW}"
|
||||
)
|
||||
|
||||
|
||||
def create_moonstream_engine(
|
||||
url: str,
|
||||
|
@ -57,7 +57,7 @@ def create_moonstream_engine(
|
|||
statement_timeout: int,
|
||||
pool_pre_ping: bool = False,
|
||||
schema: Optional[str] = None,
|
||||
):
|
||||
) -> Engine:
|
||||
# Pooling: https://docs.sqlalchemy.org/en/14/core/pooling.html#sqlalchemy.pool.QueuePool
|
||||
# Statement timeout: https://stackoverflow.com/a/44936982
|
||||
options = f"-c statement_timeout={statement_timeout}"
|
||||
|
@ -71,22 +71,28 @@ def create_moonstream_engine(
|
|||
)
|
||||
|
||||
|
||||
class MoonstreamDBEngine:
|
||||
def __init__(self, schema: Optional[str] = None) -> None:
|
||||
class DBEngine:
|
||||
def __init__(self, url: str, schema: Optional[str] = None) -> None:
|
||||
self._engine = create_moonstream_engine(
|
||||
url=MOONSTREAM_DB_URI, # type: ignore
|
||||
url=url, # type: ignore
|
||||
pool_size=MOONSTREAM_POOL_SIZE,
|
||||
statement_timeout=MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS,
|
||||
schema=schema,
|
||||
)
|
||||
|
||||
@property
|
||||
def engine(self) -> Engine:
|
||||
return self._engine
|
||||
|
||||
|
||||
class MoonstreamDBEngine(DBEngine):
|
||||
def __init__(self, schema: Optional[str] = None) -> None:
|
||||
super().__init__(url=MOONSTREAM_DB_URI, schema=schema)
|
||||
|
||||
self._session_local = sessionmaker(bind=self.engine)
|
||||
|
||||
self._yield_db_session_ctx = contextmanager(self.yield_db_session)
|
||||
|
||||
@property
|
||||
def engine(self):
|
||||
return self._engine
|
||||
|
||||
@property
|
||||
def session_local(self):
|
||||
return self._session_local
|
||||
|
@ -110,29 +116,27 @@ class MoonstreamDBEngine:
|
|||
session.close()
|
||||
|
||||
|
||||
class MoonstreamDBEngineRO:
|
||||
class MoonstreamDBEngineRO(DBEngine):
|
||||
def __init__(self, schema: Optional[str] = None) -> None:
|
||||
self._RO_engine = create_moonstream_engine(
|
||||
url=MOONSTREAM_DB_URI_READ_ONLY, # type: ignore
|
||||
pool_size=MOONSTREAM_POOL_SIZE,
|
||||
statement_timeout=MOONSTREAM_DB_STATEMENT_TIMEOUT_MILLIS,
|
||||
schema=schema,
|
||||
)
|
||||
self._RO_session_local = sessionmaker(bind=self.RO_engine)
|
||||
|
||||
self._RO_yield_db_session_ctx = contextmanager(self.yield_db_read_only_session)
|
||||
super().__init__(url=MOONSTREAM_DB_URI_READ_ONLY, schema=schema)
|
||||
|
||||
@property
|
||||
def RO_engine(self):
|
||||
return self._RO_engine
|
||||
def engine(self):
|
||||
raise AttributeError(
|
||||
"RO_engine should be used instead of engine for read-only access."
|
||||
)
|
||||
|
||||
@property
|
||||
def RO_engine(self) -> Engine:
|
||||
return self._engine
|
||||
|
||||
@property
|
||||
def RO_session_local(self):
|
||||
return self._RO_session_local
|
||||
return self._session_local
|
||||
|
||||
@property
|
||||
def RO_yield_db_session_ctx(self):
|
||||
return self._RO_yield_db_session_ctx
|
||||
return self._yield_db_session_ctx
|
||||
|
||||
def yield_db_read_only_session(self) -> Generator[Session, None, None]:
|
||||
"""
|
||||
|
@ -140,7 +144,7 @@ class MoonstreamDBEngineRO:
|
|||
As per FastAPI docs:
|
||||
https://fastapi.tiangolo.com/tutorial/sql-databases/#create-a-dependency
|
||||
"""
|
||||
session = self._RO_session_local()
|
||||
session = self._session_local()
|
||||
try:
|
||||
yield session
|
||||
finally:
|
||||
|
|
|
@ -193,6 +193,25 @@ class MumbaiLabel(EvmBasedLabel): # type: ignore
|
|||
)
|
||||
|
||||
|
||||
class AmoyLabel(EvmBasedLabel): # type: ignore
|
||||
__tablename__ = "amoy_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_amoy_labels_addr_block_num",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_amoy_labels_addr_block_ts",
|
||||
"address",
|
||||
"block_timestamp",
|
||||
unique=False,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class XDaiLabel(EvmBasedLabel): # type: ignore
|
||||
__tablename__ = "xdai_labels"
|
||||
|
||||
|
@ -288,6 +307,25 @@ class ArbitrumNovaLabel(EvmBasedLabel): # type: ignore
|
|||
)
|
||||
|
||||
|
||||
class ArbitrumOneLabel(EvmBasedLabel): # type: ignore
|
||||
__tablename__ = "arbitrum_one_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_arbitrum_one_labels_addr_block_num",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_arbitrum_one_labels_addr_block_ts",
|
||||
"address",
|
||||
"block_timestamp",
|
||||
unique=False,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class ArbitrumSepoliaLabel(EvmBasedLabel): # type: ignore
|
||||
__tablename__ = "arbitrum_sepolia_labels"
|
||||
|
||||
|
@ -383,6 +421,63 @@ class AvalancheFujiLabel(EvmBasedLabel): # type: ignore
|
|||
)
|
||||
|
||||
|
||||
class BlastLabel(EvmBasedLabel): # type: ignore
|
||||
__tablename__ = "blast_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_blast_labels_addr_block_num",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_blast_labels_addr_block_ts",
|
||||
"address",
|
||||
"block_timestamp",
|
||||
unique=False,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class BlastSepoliaLabel(EvmBasedLabel): # type: ignore
|
||||
__tablename__ = "blast_sepolia_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_blast_sepolia_labels_addr_block_num",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_blast_sepolia_labels_addr_block_ts",
|
||||
"address",
|
||||
"block_timestamp",
|
||||
unique=False,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class ProofOfPlayApexLabel(EvmBasedLabel): # type: ignore
|
||||
__tablename__ = "proofofplay_apex_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_proofofplay_apex_labels_addr_block_num",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_proofofplay_apex_labels_addr_block_ts",
|
||||
"address",
|
||||
"block_timestamp",
|
||||
unique=False,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class StarknetLabel(EvmBasedLabel): # type: ignore
|
||||
__tablename__ = "starknet_labels"
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.0.2
|
||||
0.0.4
|
|
@ -25,9 +25,15 @@ target_metadata = MoonstreamBase.metadata
|
|||
# my_important_option = config.get_main_option("my_important_option")
|
||||
# ... etc.
|
||||
from moonstreamdb.models import (
|
||||
AmoyBlock,
|
||||
AmoyTransaction,
|
||||
AmoyLabel,
|
||||
ArbitrumNovaBlock,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumNovaTransaction,
|
||||
ArbitrumOneBlock,
|
||||
ArbitrumOneLabel,
|
||||
ArbitrumOneTransaction,
|
||||
ArbitrumSepoliaBlock,
|
||||
ArbitrumSepoliaLabel,
|
||||
ArbitrumSepoliaTransaction,
|
||||
|
@ -76,6 +82,9 @@ from moonstreamdb.models import (
|
|||
BlastSepoliaBlock,
|
||||
BlastSepoliaLabel,
|
||||
BlastSepoliaTransaction,
|
||||
ProofOfPlayApexBlock,
|
||||
ProofOfPlayApexLabel,
|
||||
ProofOfPlayApexTransaction,
|
||||
)
|
||||
|
||||
|
||||
|
@ -90,6 +99,9 @@ def include_symbol(tablename, schema):
|
|||
MumbaiBlock.__tablename__,
|
||||
MumbaiTransaction.__tablename__,
|
||||
MumbaiLabel.__tablename__,
|
||||
AmoyBlock.__tablename__,
|
||||
AmoyTransaction.__tablename__,
|
||||
AmoyLabel.__tablename__,
|
||||
ESDFunctionSignature.__tablename__,
|
||||
ESDEventSignature.__tablename__,
|
||||
OpenSeaCrawlingState.__tablename__,
|
||||
|
@ -111,6 +123,9 @@ def include_symbol(tablename, schema):
|
|||
ArbitrumNovaBlock.__tablename__,
|
||||
ArbitrumNovaTransaction.__tablename__,
|
||||
ArbitrumNovaLabel.__tablename__,
|
||||
ArbitrumOneBlock.__tablename__,
|
||||
ArbitrumOneLabel.__tablename__,
|
||||
ArbitrumOneTransaction.__tablename__,
|
||||
ArbitrumSepoliaBlock.__tablename__,
|
||||
ArbitrumSepoliaTransaction.__tablename__,
|
||||
ArbitrumSepoliaLabel.__tablename__,
|
||||
|
@ -132,6 +147,9 @@ def include_symbol(tablename, schema):
|
|||
BlastSepoliaBlock.__tablename__,
|
||||
BlastSepoliaLabel.__tablename__,
|
||||
BlastSepoliaTransaction.__tablename__,
|
||||
ProofOfPlayApexBlock.__tablename__,
|
||||
ProofOfPlayApexLabel.__tablename__,
|
||||
ProofOfPlayApexTransaction.__tablename__,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,273 @@
|
|||
"""Add Arbitrum One tables
|
||||
|
||||
Revision ID: 0071b7b26b7b
|
||||
Revises: 6f7c8d64d49a
|
||||
Create Date: 2024-05-05 20:50:14.144861
|
||||
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "0071b7b26b7b"
|
||||
down_revision = "6f7c8d64d49a"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
"arbitrum_one_blocks",
|
||||
sa.Column("block_number", sa.BigInteger(), nullable=False),
|
||||
sa.Column("difficulty", sa.BigInteger(), nullable=True),
|
||||
sa.Column("extra_data", sa.VARCHAR(length=128), nullable=True),
|
||||
sa.Column("gas_limit", sa.BigInteger(), nullable=True),
|
||||
sa.Column("gas_used", sa.BigInteger(), nullable=True),
|
||||
sa.Column("base_fee_per_gas", sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column("hash", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("logs_bloom", sa.VARCHAR(length=1024), nullable=True),
|
||||
sa.Column("miner", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("nonce", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("parent_hash", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("receipt_root", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("uncles", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("size", sa.Integer(), nullable=True),
|
||||
sa.Column("state_root", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("timestamp", sa.BigInteger(), nullable=True),
|
||||
sa.Column("total_difficulty", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("transactions_root", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column(
|
||||
"indexed_at",
|
||||
sa.DateTime(timezone=True),
|
||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
||||
nullable=False,
|
||||
),
|
||||
sa.Column("sha3_uncles", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("l1_block_number", sa.BigInteger(), nullable=True),
|
||||
sa.Column("send_count", sa.BigInteger(), nullable=True),
|
||||
sa.Column("send_root", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("mix_hash", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.PrimaryKeyConstraint("block_number", name=op.f("pk_arbitrum_one_blocks")),
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_blocks_block_number"),
|
||||
"arbitrum_one_blocks",
|
||||
["block_number"],
|
||||
unique=True,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_blocks_hash"),
|
||||
"arbitrum_one_blocks",
|
||||
["hash"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_blocks_timestamp"),
|
||||
"arbitrum_one_blocks",
|
||||
["timestamp"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_table(
|
||||
"arbitrum_one_labels",
|
||||
sa.Column("id", sa.UUID(), nullable=False),
|
||||
sa.Column("label", sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column("block_number", sa.BigInteger(), nullable=True),
|
||||
sa.Column("address", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("label_data", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column("block_timestamp", sa.BigInteger(), nullable=True),
|
||||
sa.Column("log_index", sa.Integer(), nullable=True),
|
||||
sa.Column(
|
||||
"created_at",
|
||||
sa.DateTime(timezone=True),
|
||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
||||
nullable=False,
|
||||
),
|
||||
sa.PrimaryKeyConstraint("id", name=op.f("pk_arbitrum_one_labels")),
|
||||
sa.UniqueConstraint("id", name=op.f("uq_arbitrum_one_labels_id")),
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_labels_address"),
|
||||
"arbitrum_one_labels",
|
||||
["address"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
"ix_arbitrum_one_labels_address_block_number",
|
||||
"arbitrum_one_labels",
|
||||
["address", "block_number"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
"ix_arbitrum_one_labels_address_block_timestamp",
|
||||
"arbitrum_one_labels",
|
||||
["address", "block_timestamp"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_labels_block_number"),
|
||||
"arbitrum_one_labels",
|
||||
["block_number"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_labels_block_timestamp"),
|
||||
"arbitrum_one_labels",
|
||||
["block_timestamp"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_labels_label"),
|
||||
"arbitrum_one_labels",
|
||||
["label"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_labels_transaction_hash"),
|
||||
"arbitrum_one_labels",
|
||||
["transaction_hash"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_table(
|
||||
"arbitrum_one_transactions",
|
||||
sa.Column("hash", sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column("block_number", sa.BigInteger(), nullable=False),
|
||||
sa.Column("from_address", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("to_address", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("gas", sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column("gas_price", sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column("max_fee_per_gas", sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column(
|
||||
"max_priority_fee_per_gas", sa.Numeric(precision=78, scale=0), nullable=True
|
||||
),
|
||||
sa.Column("input", sa.Text(), nullable=True),
|
||||
sa.Column("nonce", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("transaction_index", sa.BigInteger(), nullable=True),
|
||||
sa.Column("transaction_type", sa.Integer(), nullable=True),
|
||||
sa.Column("value", sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column(
|
||||
"indexed_at",
|
||||
sa.DateTime(timezone=True),
|
||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
||||
nullable=False,
|
||||
),
|
||||
sa.Column("y_parity", sa.BigInteger(), nullable=True),
|
||||
sa.ForeignKeyConstraint(
|
||||
["block_number"],
|
||||
["arbitrum_one_blocks.block_number"],
|
||||
name=op.f("fk_arbitrum_one_transactions_block_number_arbitrum_one_blocks"),
|
||||
ondelete="CASCADE",
|
||||
),
|
||||
sa.PrimaryKeyConstraint("hash", name=op.f("pk_arbitrum_one_transactions")),
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_transactions_block_number"),
|
||||
"arbitrum_one_transactions",
|
||||
["block_number"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_transactions_from_address"),
|
||||
"arbitrum_one_transactions",
|
||||
["from_address"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_transactions_gas"),
|
||||
"arbitrum_one_transactions",
|
||||
["gas"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_transactions_gas_price"),
|
||||
"arbitrum_one_transactions",
|
||||
["gas_price"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_transactions_hash"),
|
||||
"arbitrum_one_transactions",
|
||||
["hash"],
|
||||
unique=True,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_transactions_to_address"),
|
||||
"arbitrum_one_transactions",
|
||||
["to_address"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_arbitrum_one_transactions_value"),
|
||||
"arbitrum_one_transactions",
|
||||
["value"],
|
||||
unique=False,
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(
|
||||
op.f("ix_arbitrum_one_transactions_value"),
|
||||
table_name="arbitrum_one_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_arbitrum_one_transactions_to_address"),
|
||||
table_name="arbitrum_one_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_arbitrum_one_transactions_hash"),
|
||||
table_name="arbitrum_one_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_arbitrum_one_transactions_gas_price"),
|
||||
table_name="arbitrum_one_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_arbitrum_one_transactions_gas"), table_name="arbitrum_one_transactions"
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_arbitrum_one_transactions_from_address"),
|
||||
table_name="arbitrum_one_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_arbitrum_one_transactions_block_number"),
|
||||
table_name="arbitrum_one_transactions",
|
||||
)
|
||||
op.drop_table("arbitrum_one_transactions")
|
||||
op.drop_index(
|
||||
op.f("ix_arbitrum_one_labels_transaction_hash"),
|
||||
table_name="arbitrum_one_labels",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_arbitrum_one_labels_label"), table_name="arbitrum_one_labels"
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_arbitrum_one_labels_block_timestamp"), table_name="arbitrum_one_labels"
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_arbitrum_one_labels_block_number"), table_name="arbitrum_one_labels"
|
||||
)
|
||||
op.drop_index(
|
||||
"ix_arbitrum_one_labels_address_block_timestamp",
|
||||
table_name="arbitrum_one_labels",
|
||||
)
|
||||
op.drop_index(
|
||||
"ix_arbitrum_one_labels_address_block_number", table_name="arbitrum_one_labels"
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_arbitrum_one_labels_address"), table_name="arbitrum_one_labels"
|
||||
)
|
||||
op.drop_table("arbitrum_one_labels")
|
||||
op.drop_index(
|
||||
op.f("ix_arbitrum_one_blocks_timestamp"), table_name="arbitrum_one_blocks"
|
||||
)
|
||||
op.drop_index(op.f("ix_arbitrum_one_blocks_hash"), table_name="arbitrum_one_blocks")
|
||||
op.drop_index(
|
||||
op.f("ix_arbitrum_one_blocks_block_number"), table_name="arbitrum_one_blocks"
|
||||
)
|
||||
op.drop_table("arbitrum_one_blocks")
|
||||
# ### end Alembic commands ###
|
|
@ -0,0 +1,39 @@
|
|||
"""zksync address label_data name index
|
||||
|
||||
Revision ID: 6f7c8d64d49a
|
||||
Revises: a1d9fab5f904
|
||||
Create Date: 2024-04-29 15:26:43.880238
|
||||
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "6f7c8d64d49a"
|
||||
down_revision = "a1d9fab5f904"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_index(
|
||||
"ix_zksync_era_labels_address_label_data_name",
|
||||
"zksync_era_labels",
|
||||
["address", sa.text("(label_data ->> 'name')")],
|
||||
unique=False,
|
||||
postgresql_using="btree",
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(
|
||||
"ix_zksync_era_labels_address_label_data_name",
|
||||
table_name="zksync_era_labels",
|
||||
postgresql_using="btree",
|
||||
)
|
||||
# ### end Alembic commands ###
|
|
@ -0,0 +1,285 @@
|
|||
"""ProofOfPlay Apex blockchain
|
||||
|
||||
Revision ID: a1d9fab5f904
|
||||
Revises: c8eaa4ff9d76
|
||||
Create Date: 2024-04-17 02:35:52.418934
|
||||
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "a1d9fab5f904"
|
||||
down_revision = "c8eaa4ff9d76"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
"proofofplay_apex_blocks",
|
||||
sa.Column("block_number", sa.BigInteger(), nullable=False),
|
||||
sa.Column("difficulty", sa.BigInteger(), nullable=True),
|
||||
sa.Column("extra_data", sa.VARCHAR(length=128), nullable=True),
|
||||
sa.Column("gas_limit", sa.BigInteger(), nullable=True),
|
||||
sa.Column("gas_used", sa.BigInteger(), nullable=True),
|
||||
sa.Column("base_fee_per_gas", sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column("hash", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("logs_bloom", sa.VARCHAR(length=1024), nullable=True),
|
||||
sa.Column("miner", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("nonce", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("parent_hash", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("receipt_root", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("uncles", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("size", sa.Integer(), nullable=True),
|
||||
sa.Column("state_root", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("timestamp", sa.BigInteger(), nullable=True),
|
||||
sa.Column("total_difficulty", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("transactions_root", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column(
|
||||
"indexed_at",
|
||||
sa.DateTime(timezone=True),
|
||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
||||
nullable=False,
|
||||
),
|
||||
sa.Column("sha3_uncles", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("l1_block_number", sa.BigInteger(), nullable=True),
|
||||
sa.Column("send_count", sa.BigInteger(), nullable=True),
|
||||
sa.Column("send_root", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("mix_hash", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.PrimaryKeyConstraint(
|
||||
"block_number", name=op.f("pk_proofofplay_apex_blocks")
|
||||
),
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_blocks_block_number"),
|
||||
"proofofplay_apex_blocks",
|
||||
["block_number"],
|
||||
unique=True,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_blocks_hash"),
|
||||
"proofofplay_apex_blocks",
|
||||
["hash"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_blocks_timestamp"),
|
||||
"proofofplay_apex_blocks",
|
||||
["timestamp"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_table(
|
||||
"proofofplay_apex_labels",
|
||||
sa.Column("id", sa.UUID(), nullable=False),
|
||||
sa.Column("label", sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column("block_number", sa.BigInteger(), nullable=True),
|
||||
sa.Column("address", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("label_data", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column("block_timestamp", sa.BigInteger(), nullable=True),
|
||||
sa.Column("log_index", sa.Integer(), nullable=True),
|
||||
sa.Column(
|
||||
"created_at",
|
||||
sa.DateTime(timezone=True),
|
||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
||||
nullable=False,
|
||||
),
|
||||
sa.PrimaryKeyConstraint("id", name=op.f("pk_proofofplay_apex_labels")),
|
||||
sa.UniqueConstraint("id", name=op.f("uq_proofofplay_apex_labels_id")),
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_labels_address"),
|
||||
"proofofplay_apex_labels",
|
||||
["address"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
"ix_proofofplay_apex_labels_address_block_number",
|
||||
"proofofplay_apex_labels",
|
||||
["address", "block_number"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
"ix_proofofplay_apex_labels_address_block_timestamp",
|
||||
"proofofplay_apex_labels",
|
||||
["address", "block_timestamp"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_labels_block_number"),
|
||||
"proofofplay_apex_labels",
|
||||
["block_number"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_labels_block_timestamp"),
|
||||
"proofofplay_apex_labels",
|
||||
["block_timestamp"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_labels_label"),
|
||||
"proofofplay_apex_labels",
|
||||
["label"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_labels_transaction_hash"),
|
||||
"proofofplay_apex_labels",
|
||||
["transaction_hash"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_table(
|
||||
"proofofplay_apex_transactions",
|
||||
sa.Column("hash", sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column("block_number", sa.BigInteger(), nullable=False),
|
||||
sa.Column("from_address", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("to_address", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("gas", sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column("gas_price", sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column("max_fee_per_gas", sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column(
|
||||
"max_priority_fee_per_gas", sa.Numeric(precision=78, scale=0), nullable=True
|
||||
),
|
||||
sa.Column("input", sa.Text(), nullable=True),
|
||||
sa.Column("nonce", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("transaction_index", sa.BigInteger(), nullable=True),
|
||||
sa.Column("transaction_type", sa.Integer(), nullable=True),
|
||||
sa.Column("value", sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column(
|
||||
"indexed_at",
|
||||
sa.DateTime(timezone=True),
|
||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
||||
nullable=False,
|
||||
),
|
||||
sa.Column("y_parity", sa.BigInteger(), nullable=True),
|
||||
sa.ForeignKeyConstraint(
|
||||
["block_number"],
|
||||
["proofofplay_apex_blocks.block_number"],
|
||||
name=op.f(
|
||||
"fk_proofofplay_apex_transactions_block_number_proofofplay_apex_blocks"
|
||||
),
|
||||
ondelete="CASCADE",
|
||||
),
|
||||
sa.PrimaryKeyConstraint("hash", name=op.f("pk_proofofplay_apex_transactions")),
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_transactions_block_number"),
|
||||
"proofofplay_apex_transactions",
|
||||
["block_number"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_transactions_from_address"),
|
||||
"proofofplay_apex_transactions",
|
||||
["from_address"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_transactions_gas"),
|
||||
"proofofplay_apex_transactions",
|
||||
["gas"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_transactions_gas_price"),
|
||||
"proofofplay_apex_transactions",
|
||||
["gas_price"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_transactions_hash"),
|
||||
"proofofplay_apex_transactions",
|
||||
["hash"],
|
||||
unique=True,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_transactions_to_address"),
|
||||
"proofofplay_apex_transactions",
|
||||
["to_address"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_proofofplay_apex_transactions_value"),
|
||||
"proofofplay_apex_transactions",
|
||||
["value"],
|
||||
unique=False,
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_transactions_value"),
|
||||
table_name="proofofplay_apex_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_transactions_to_address"),
|
||||
table_name="proofofplay_apex_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_transactions_hash"),
|
||||
table_name="proofofplay_apex_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_transactions_gas_price"),
|
||||
table_name="proofofplay_apex_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_transactions_gas"),
|
||||
table_name="proofofplay_apex_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_transactions_from_address"),
|
||||
table_name="proofofplay_apex_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_transactions_block_number"),
|
||||
table_name="proofofplay_apex_transactions",
|
||||
)
|
||||
op.drop_table("proofofplay_apex_transactions")
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_labels_transaction_hash"),
|
||||
table_name="proofofplay_apex_labels",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_labels_label"), table_name="proofofplay_apex_labels"
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_labels_block_timestamp"),
|
||||
table_name="proofofplay_apex_labels",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_labels_block_number"),
|
||||
table_name="proofofplay_apex_labels",
|
||||
)
|
||||
op.drop_index(
|
||||
"ix_proofofplay_apex_labels_address_block_timestamp",
|
||||
table_name="proofofplay_apex_labels",
|
||||
)
|
||||
op.drop_index(
|
||||
"ix_proofofplay_apex_labels_address_block_number",
|
||||
table_name="proofofplay_apex_labels",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_labels_address"), table_name="proofofplay_apex_labels"
|
||||
)
|
||||
op.drop_table("proofofplay_apex_labels")
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_blocks_timestamp"),
|
||||
table_name="proofofplay_apex_blocks",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_blocks_hash"), table_name="proofofplay_apex_blocks"
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_proofofplay_apex_blocks_block_number"),
|
||||
table_name="proofofplay_apex_blocks",
|
||||
)
|
||||
op.drop_table("proofofplay_apex_blocks")
|
||||
# ### end Alembic commands ###
|
Plik diff jest za duży
Load Diff
|
@ -0,0 +1,120 @@
|
|||
"""Amoy blockchain
|
||||
|
||||
Revision ID: c8eaa4ff9d76
|
||||
Revises: 181c5800cb1b
|
||||
Create Date: 2024-04-15 08:06:30.569765
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'c8eaa4ff9d76'
|
||||
down_revision = '181c5800cb1b'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('amoy_blocks',
|
||||
sa.Column('block_number', sa.BigInteger(), nullable=False),
|
||||
sa.Column('difficulty', sa.BigInteger(), nullable=True),
|
||||
sa.Column('extra_data', sa.VARCHAR(length=128), nullable=True),
|
||||
sa.Column('gas_limit', sa.BigInteger(), nullable=True),
|
||||
sa.Column('gas_used', sa.BigInteger(), nullable=True),
|
||||
sa.Column('base_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column('hash', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('logs_bloom', sa.VARCHAR(length=1024), nullable=True),
|
||||
sa.Column('miner', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('nonce', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('parent_hash', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('receipt_root', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('uncles', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('size', sa.Integer(), nullable=True),
|
||||
sa.Column('state_root', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('timestamp', sa.BigInteger(), nullable=True),
|
||||
sa.Column('total_difficulty', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('transactions_root', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False),
|
||||
sa.PrimaryKeyConstraint('block_number', name=op.f('pk_amoy_blocks'))
|
||||
)
|
||||
op.create_index(op.f('ix_amoy_blocks_block_number'), 'amoy_blocks', ['block_number'], unique=True)
|
||||
op.create_index(op.f('ix_amoy_blocks_hash'), 'amoy_blocks', ['hash'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_blocks_timestamp'), 'amoy_blocks', ['timestamp'], unique=False)
|
||||
op.create_table('amoy_labels',
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('label', sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column('block_number', sa.BigInteger(), nullable=True),
|
||||
sa.Column('address', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('transaction_hash', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('label_data', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column('block_timestamp', sa.BigInteger(), nullable=True),
|
||||
sa.Column('log_index', sa.Integer(), nullable=True),
|
||||
sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_amoy_labels')),
|
||||
sa.UniqueConstraint('id', name=op.f('uq_amoy_labels_id'))
|
||||
)
|
||||
op.create_index(op.f('ix_amoy_labels_address'), 'amoy_labels', ['address'], unique=False)
|
||||
op.create_index('ix_amoy_labels_address_block_number', 'amoy_labels', ['address', 'block_number'], unique=False)
|
||||
op.create_index('ix_amoy_labels_address_block_timestamp', 'amoy_labels', ['address', 'block_timestamp'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_labels_block_number'), 'amoy_labels', ['block_number'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_labels_block_timestamp'), 'amoy_labels', ['block_timestamp'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_labels_label'), 'amoy_labels', ['label'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_labels_transaction_hash'), 'amoy_labels', ['transaction_hash'], unique=False)
|
||||
op.create_table('amoy_transactions',
|
||||
sa.Column('hash', sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column('block_number', sa.BigInteger(), nullable=False),
|
||||
sa.Column('from_address', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('to_address', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('gas', sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column('gas_price', sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column('max_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column('max_priority_fee_per_gas', sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column('input', sa.Text(), nullable=True),
|
||||
sa.Column('nonce', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('transaction_index', sa.BigInteger(), nullable=True),
|
||||
sa.Column('transaction_type', sa.Integer(), nullable=True),
|
||||
sa.Column('value', sa.Numeric(precision=78, scale=0), nullable=True),
|
||||
sa.Column('indexed_at', sa.DateTime(timezone=True), server_default=sa.text("TIMEZONE('utc', statement_timestamp())"), nullable=False),
|
||||
sa.ForeignKeyConstraint(['block_number'], ['amoy_blocks.block_number'], name=op.f('fk_amoy_transactions_block_number_amoy_blocks'), ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('hash', name=op.f('pk_amoy_transactions'))
|
||||
)
|
||||
op.create_index(op.f('ix_amoy_transactions_block_number'), 'amoy_transactions', ['block_number'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_transactions_from_address'), 'amoy_transactions', ['from_address'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_transactions_gas'), 'amoy_transactions', ['gas'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_transactions_gas_price'), 'amoy_transactions', ['gas_price'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_transactions_hash'), 'amoy_transactions', ['hash'], unique=True)
|
||||
op.create_index(op.f('ix_amoy_transactions_to_address'), 'amoy_transactions', ['to_address'], unique=False)
|
||||
op.create_index(op.f('ix_amoy_transactions_value'), 'amoy_transactions', ['value'], unique=False)
|
||||
op.create_unique_constraint(op.f('uq_blast_labels_id'), 'blast_labels', ['id'])
|
||||
op.create_unique_constraint(op.f('uq_blast_sepolia_labels_id'), 'blast_sepolia_labels', ['id'])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint(op.f('uq_blast_sepolia_labels_id'), 'blast_sepolia_labels', type_='unique')
|
||||
op.drop_constraint(op.f('uq_blast_labels_id'), 'blast_labels', type_='unique')
|
||||
op.drop_index(op.f('ix_amoy_transactions_value'), table_name='amoy_transactions')
|
||||
op.drop_index(op.f('ix_amoy_transactions_to_address'), table_name='amoy_transactions')
|
||||
op.drop_index(op.f('ix_amoy_transactions_hash'), table_name='amoy_transactions')
|
||||
op.drop_index(op.f('ix_amoy_transactions_gas_price'), table_name='amoy_transactions')
|
||||
op.drop_index(op.f('ix_amoy_transactions_gas'), table_name='amoy_transactions')
|
||||
op.drop_index(op.f('ix_amoy_transactions_from_address'), table_name='amoy_transactions')
|
||||
op.drop_index(op.f('ix_amoy_transactions_block_number'), table_name='amoy_transactions')
|
||||
op.drop_table('amoy_transactions')
|
||||
op.drop_index(op.f('ix_amoy_labels_transaction_hash'), table_name='amoy_labels')
|
||||
op.drop_index(op.f('ix_amoy_labels_label'), table_name='amoy_labels')
|
||||
op.drop_index(op.f('ix_amoy_labels_block_timestamp'), table_name='amoy_labels')
|
||||
op.drop_index(op.f('ix_amoy_labels_block_number'), table_name='amoy_labels')
|
||||
op.drop_index('ix_amoy_labels_address_block_timestamp', table_name='amoy_labels')
|
||||
op.drop_index('ix_amoy_labels_address_block_number', table_name='amoy_labels')
|
||||
op.drop_index(op.f('ix_amoy_labels_address'), table_name='amoy_labels')
|
||||
op.drop_table('amoy_labels')
|
||||
op.drop_index(op.f('ix_amoy_blocks_timestamp'), table_name='amoy_blocks')
|
||||
op.drop_index(op.f('ix_amoy_blocks_hash'), table_name='amoy_blocks')
|
||||
op.drop_index(op.f('ix_amoy_blocks_block_number'), table_name='amoy_blocks')
|
||||
op.drop_table('amoy_blocks')
|
||||
# ### end Alembic commands ###
|
|
@ -2,6 +2,12 @@ from enum import Enum
|
|||
from typing import Type, Union
|
||||
|
||||
from .models import (
|
||||
AmoyBlock,
|
||||
AmoyLabel,
|
||||
AmoyTransaction,
|
||||
ArbitrumOneBlock,
|
||||
ArbitrumOneLabel,
|
||||
ArbitrumOneTransaction,
|
||||
ArbitrumNovaBlock,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumNovaTransaction,
|
||||
|
@ -29,6 +35,9 @@ from .models import (
|
|||
PolygonBlock,
|
||||
PolygonLabel,
|
||||
PolygonTransaction,
|
||||
ProofOfPlayApexBlock,
|
||||
ProofOfPlayApexLabel,
|
||||
ProofOfPlayApexTransaction,
|
||||
WyrmBlock,
|
||||
WyrmLabel,
|
||||
WyrmTransaction,
|
||||
|
@ -57,11 +66,13 @@ class AvailableBlockchainType(Enum):
|
|||
ETHEREUM = "ethereum"
|
||||
POLYGON = "polygon"
|
||||
MUMBAI = "mumbai"
|
||||
AMOY = "amoy"
|
||||
XDAI = "xdai"
|
||||
WYRM = "wyrm"
|
||||
ZKSYNC_ERA = "zksync_era"
|
||||
ZKSYNC_ERA_TESTNET = "zksync_era_testnet"
|
||||
ZKSYNC_ERA_SEPOLIA = "zksync_era_sepolia"
|
||||
ARBITRUM_ONE = "arbitrum_one"
|
||||
ARBITRUM_NOVA = "arbitrum_nova"
|
||||
ARBITRUM_SEPOLIA = "arbitrum_sepolia"
|
||||
XAI = "xai"
|
||||
|
@ -70,6 +81,7 @@ class AvailableBlockchainType(Enum):
|
|||
AVALANCHE_FUJI = "avalanche_fuji"
|
||||
BLAST = "blast"
|
||||
BLAST_SEPOLIA = "blast_sepolia"
|
||||
PROOFOFPLAY_APEX = "proofofplay_apex"
|
||||
|
||||
|
||||
def get_block_model(
|
||||
|
@ -79,11 +91,13 @@ def get_block_model(
|
|||
EthereumBlock,
|
||||
PolygonBlock,
|
||||
MumbaiBlock,
|
||||
AmoyBlock,
|
||||
XDaiBlock,
|
||||
WyrmBlock,
|
||||
ZkSyncEraTestnetBlock,
|
||||
ZkSyncEraBlock,
|
||||
ZkSyncEraSepoliaBlock,
|
||||
ArbitrumOneBlock,
|
||||
ArbitrumNovaBlock,
|
||||
ArbitrumSepoliaBlock,
|
||||
XaiBlock,
|
||||
|
@ -92,22 +106,24 @@ def get_block_model(
|
|||
AvalancheFujiBlock,
|
||||
BlastBlock,
|
||||
BlastSepoliaBlock,
|
||||
ProofOfPlayApexBlock,
|
||||
]
|
||||
]:
|
||||
"""
|
||||
Depends on provided blockchain type: Ethereum, Polygon, Mumbai, XDai, Wyrm, ZkSyncEra, ZkSyncEraTestnet, ArbitrumNova, ArbitrumSepolia, Xai, XaiSepolia
|
||||
set proper blocks model.
|
||||
Depends on provided blockchain type set proper blocks model.
|
||||
"""
|
||||
block_model: Type[
|
||||
Union[
|
||||
EthereumBlock,
|
||||
PolygonBlock,
|
||||
MumbaiBlock,
|
||||
AmoyBlock,
|
||||
XDaiBlock,
|
||||
WyrmBlock,
|
||||
ZkSyncEraTestnetBlock,
|
||||
ZkSyncEraBlock,
|
||||
ZkSyncEraSepoliaBlock,
|
||||
ArbitrumOneBlock,
|
||||
ArbitrumNovaBlock,
|
||||
ArbitrumSepoliaBlock,
|
||||
XaiBlock,
|
||||
|
@ -116,6 +132,7 @@ def get_block_model(
|
|||
AvalancheFujiBlock,
|
||||
BlastBlock,
|
||||
BlastSepoliaBlock,
|
||||
ProofOfPlayApexBlock,
|
||||
]
|
||||
]
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
|
@ -124,6 +141,8 @@ def get_block_model(
|
|||
block_model = PolygonBlock
|
||||
elif blockchain_type == AvailableBlockchainType.MUMBAI:
|
||||
block_model = MumbaiBlock
|
||||
elif blockchain_type == AvailableBlockchainType.AMOY:
|
||||
block_model = AmoyBlock
|
||||
elif blockchain_type == AvailableBlockchainType.XDAI:
|
||||
block_model = XDaiBlock
|
||||
elif blockchain_type == AvailableBlockchainType.WYRM:
|
||||
|
@ -134,6 +153,8 @@ def get_block_model(
|
|||
block_model = ZkSyncEraBlock
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_SEPOLIA:
|
||||
block_model = ZkSyncEraSepoliaBlock
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_ONE:
|
||||
block_model = ArbitrumOneBlock
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
block_model = ArbitrumNovaBlock
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
|
@ -150,6 +171,8 @@ def get_block_model(
|
|||
block_model = BlastBlock
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST_SEPOLIA:
|
||||
block_model = BlastSepoliaBlock
|
||||
elif blockchain_type == AvailableBlockchainType.PROOFOFPLAY_APEX:
|
||||
block_model = ProofOfPlayApexBlock
|
||||
else:
|
||||
raise Exception("Unsupported blockchain type provided")
|
||||
|
||||
|
@ -163,11 +186,13 @@ def get_label_model(
|
|||
EthereumLabel,
|
||||
PolygonLabel,
|
||||
MumbaiLabel,
|
||||
AmoyLabel,
|
||||
XDaiLabel,
|
||||
WyrmLabel,
|
||||
ZkSyncEraTestnetLabel,
|
||||
ZkSyncEraLabel,
|
||||
ZkSyncEraSepoliaLabel,
|
||||
ArbitrumOneLabel,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumSepoliaLabel,
|
||||
XaiLabel,
|
||||
|
@ -176,22 +201,24 @@ def get_label_model(
|
|||
AvalancheFujiLabel,
|
||||
BlastLabel,
|
||||
BlastSepoliaLabel,
|
||||
ProofOfPlayApexLabel,
|
||||
]
|
||||
]:
|
||||
"""
|
||||
Depends on provided blockchain type: Ethereum, Polygon, Mumbai, XDai, Wyrm, ZkSyncEra, ZkSyncEraTestnet, ArbitrumNova, ArbitrumSepolia, Xai, XaiSepolia
|
||||
set proper block label model.
|
||||
Depends on provided blockchain type set proper block label model.
|
||||
"""
|
||||
label_model: Type[
|
||||
Union[
|
||||
EthereumLabel,
|
||||
PolygonLabel,
|
||||
MumbaiLabel,
|
||||
AmoyLabel,
|
||||
XDaiLabel,
|
||||
WyrmLabel,
|
||||
ZkSyncEraTestnetLabel,
|
||||
ZkSyncEraLabel,
|
||||
ZkSyncEraSepoliaLabel,
|
||||
ArbitrumOneLabel,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumSepoliaLabel,
|
||||
XaiLabel,
|
||||
|
@ -200,6 +227,7 @@ def get_label_model(
|
|||
AvalancheFujiLabel,
|
||||
BlastLabel,
|
||||
BlastSepoliaLabel,
|
||||
ProofOfPlayApexLabel,
|
||||
]
|
||||
]
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
|
@ -208,6 +236,8 @@ def get_label_model(
|
|||
label_model = PolygonLabel
|
||||
elif blockchain_type == AvailableBlockchainType.MUMBAI:
|
||||
label_model = MumbaiLabel
|
||||
elif blockchain_type == AvailableBlockchainType.AMOY:
|
||||
label_model = AmoyLabel
|
||||
elif blockchain_type == AvailableBlockchainType.XDAI:
|
||||
label_model = XDaiLabel
|
||||
elif blockchain_type == AvailableBlockchainType.WYRM:
|
||||
|
@ -218,6 +248,8 @@ def get_label_model(
|
|||
label_model = ZkSyncEraLabel
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_SEPOLIA:
|
||||
label_model = ZkSyncEraSepoliaLabel
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_ONE:
|
||||
label_model = ArbitrumOneLabel
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
label_model = ArbitrumNovaLabel
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
|
@ -234,6 +266,8 @@ def get_label_model(
|
|||
label_model = BlastLabel
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST_SEPOLIA:
|
||||
label_model = BlastSepoliaLabel
|
||||
elif blockchain_type == AvailableBlockchainType.PROOFOFPLAY_APEX:
|
||||
label_model = ProofOfPlayApexLabel
|
||||
else:
|
||||
raise Exception("Unsupported blockchain type provided")
|
||||
|
||||
|
@ -247,11 +281,13 @@ def get_transaction_model(
|
|||
EthereumTransaction,
|
||||
PolygonTransaction,
|
||||
MumbaiTransaction,
|
||||
AmoyTransaction,
|
||||
XDaiTransaction,
|
||||
WyrmTransaction,
|
||||
ZkSyncEraTestnetTransaction,
|
||||
ZkSyncEraTransaction,
|
||||
ZkSyncEraSepoliaTransaction,
|
||||
ArbitrumOneTransaction,
|
||||
ArbitrumNovaTransaction,
|
||||
ArbitrumSepoliaTransaction,
|
||||
XaiTransaction,
|
||||
|
@ -260,22 +296,24 @@ def get_transaction_model(
|
|||
AvalancheFujiTransaction,
|
||||
BlastTransaction,
|
||||
BlastSepoliaTransaction,
|
||||
ProofOfPlayApexTransaction,
|
||||
]
|
||||
]:
|
||||
"""
|
||||
Depends on provided blockchain type: Ethereum, Polygon, Mumbai, XDai, Wyrm, ZkSyncEra, ZkSyncEraTestnet, ArbitrumNova, ArbitrumSepolia, Xai, XaiSepolia
|
||||
set proper block transactions model.
|
||||
Depends on provided blockchain type set proper block transactions model.
|
||||
"""
|
||||
transaction_model: Type[
|
||||
Union[
|
||||
EthereumTransaction,
|
||||
PolygonTransaction,
|
||||
MumbaiTransaction,
|
||||
AmoyTransaction,
|
||||
XDaiTransaction,
|
||||
WyrmTransaction,
|
||||
ZkSyncEraTestnetTransaction,
|
||||
ZkSyncEraTransaction,
|
||||
ZkSyncEraSepoliaTransaction,
|
||||
ArbitrumOneTransaction,
|
||||
ArbitrumNovaTransaction,
|
||||
ArbitrumSepoliaTransaction,
|
||||
XaiTransaction,
|
||||
|
@ -284,6 +322,7 @@ def get_transaction_model(
|
|||
AvalancheFujiTransaction,
|
||||
BlastTransaction,
|
||||
BlastSepoliaTransaction,
|
||||
ProofOfPlayApexTransaction,
|
||||
]
|
||||
]
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
|
@ -292,6 +331,8 @@ def get_transaction_model(
|
|||
transaction_model = PolygonTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.MUMBAI:
|
||||
transaction_model = MumbaiTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.AMOY:
|
||||
transaction_model = AmoyTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.XDAI:
|
||||
transaction_model = XDaiTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.WYRM:
|
||||
|
@ -302,6 +343,8 @@ def get_transaction_model(
|
|||
transaction_model = ZkSyncEraTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_SEPOLIA:
|
||||
transaction_model = ZkSyncEraSepoliaTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_ONE:
|
||||
transaction_model = ArbitrumOneTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
transaction_model = ArbitrumNovaTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
|
@ -318,6 +361,8 @@ def get_transaction_model(
|
|||
transaction_model = BlastTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST_SEPOLIA:
|
||||
transaction_model = BlastSepoliaTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.PROOFOFPLAY_APEX:
|
||||
transaction_model = ProofOfPlayApexTransaction
|
||||
else:
|
||||
raise Exception("Unsupported blockchain type provided")
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ from sqlalchemy import (
|
|||
from sqlalchemy.dialects.postgresql import JSONB, UUID
|
||||
from sqlalchemy.ext.compiler import compiles
|
||||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy.sql import expression
|
||||
from sqlalchemy.sql import expression, text
|
||||
|
||||
"""
|
||||
Naming conventions doc
|
||||
|
@ -368,6 +368,113 @@ class MumbaiLabel(Base): # type: ignore
|
|||
)
|
||||
|
||||
|
||||
class AmoyBlock(Base): # type: ignore
|
||||
__tablename__ = "amoy_blocks"
|
||||
|
||||
block_number = Column(
|
||||
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
||||
)
|
||||
difficulty = Column(BigInteger)
|
||||
extra_data = Column(VARCHAR(128))
|
||||
gas_limit = Column(BigInteger)
|
||||
gas_used = Column(BigInteger)
|
||||
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
||||
hash = Column(VARCHAR(256), index=True)
|
||||
logs_bloom = Column(VARCHAR(1024))
|
||||
miner = Column(VARCHAR(256))
|
||||
nonce = Column(VARCHAR(256))
|
||||
parent_hash = Column(VARCHAR(256))
|
||||
receipt_root = Column(VARCHAR(256))
|
||||
uncles = Column(VARCHAR(256))
|
||||
size = Column(Integer)
|
||||
state_root = Column(VARCHAR(256))
|
||||
timestamp = Column(BigInteger, index=True)
|
||||
total_difficulty = Column(VARCHAR(256))
|
||||
transactions_root = Column(VARCHAR(256))
|
||||
|
||||
indexed_at = Column(
|
||||
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
||||
)
|
||||
|
||||
|
||||
class AmoyTransaction(Base): # type: ignore
|
||||
__tablename__ = "amoy_transactions"
|
||||
|
||||
hash = Column(
|
||||
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
||||
)
|
||||
block_number = Column(
|
||||
BigInteger,
|
||||
ForeignKey("amoy_blocks.block_number", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
from_address = Column(VARCHAR(256), index=True)
|
||||
to_address = Column(VARCHAR(256), index=True)
|
||||
gas = Column(Numeric(precision=78, scale=0), index=True)
|
||||
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
||||
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
||||
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
||||
input = Column(Text)
|
||||
nonce = Column(VARCHAR(256))
|
||||
transaction_index = Column(BigInteger)
|
||||
transaction_type = Column(Integer, nullable=True)
|
||||
value = Column(Numeric(precision=78, scale=0), index=True)
|
||||
|
||||
indexed_at = Column(
|
||||
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
||||
)
|
||||
|
||||
|
||||
class AmoyLabel(Base): # type: ignore
|
||||
__tablename__ = "amoy_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_amoy_labels_address_block_number",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_amoy_labels_address_block_timestamp",
|
||||
"address",
|
||||
"block_timestamp",
|
||||
unique=False,
|
||||
),
|
||||
)
|
||||
|
||||
id = Column(
|
||||
UUID(as_uuid=True),
|
||||
primary_key=True,
|
||||
default=uuid.uuid4,
|
||||
unique=True,
|
||||
nullable=False,
|
||||
)
|
||||
label = Column(VARCHAR(256), nullable=False, index=True)
|
||||
block_number = Column(
|
||||
BigInteger,
|
||||
nullable=True,
|
||||
index=True,
|
||||
)
|
||||
address = Column(
|
||||
VARCHAR(256),
|
||||
nullable=True,
|
||||
index=True,
|
||||
)
|
||||
transaction_hash = Column(
|
||||
VARCHAR(256),
|
||||
nullable=True,
|
||||
index=True,
|
||||
)
|
||||
label_data = Column(JSONB, nullable=True)
|
||||
block_timestamp = Column(BigInteger, index=True)
|
||||
log_index = Column(Integer, nullable=True)
|
||||
created_at = Column(
|
||||
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
||||
)
|
||||
|
||||
|
||||
class XDaiBlock(Base): # type: ignore
|
||||
__tablename__ = "xdai_blocks"
|
||||
|
||||
|
@ -652,6 +759,12 @@ class ZkSyncEraLabel(Base): # type: ignore
|
|||
"block_timestamp",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_zksync_era_labels_address_label_data_name",
|
||||
"address",
|
||||
text("(label_data ->> 'name')"),
|
||||
postgresql_using="btree",
|
||||
),
|
||||
)
|
||||
|
||||
id = Column(
|
||||
|
@ -1829,6 +1942,235 @@ class BlastSepoliaLabel(Base): # type: ignore
|
|||
)
|
||||
|
||||
|
||||
class ProofOfPlayApexBlock(Base): # type: ignore
|
||||
__tablename__ = "proofofplay_apex_blocks"
|
||||
|
||||
block_number = Column(
|
||||
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
||||
)
|
||||
difficulty = Column(BigInteger)
|
||||
extra_data = Column(VARCHAR(128))
|
||||
gas_limit = Column(BigInteger)
|
||||
gas_used = Column(BigInteger)
|
||||
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
||||
hash = Column(VARCHAR(256), index=True)
|
||||
logs_bloom = Column(VARCHAR(1024))
|
||||
miner = Column(VARCHAR(256))
|
||||
nonce = Column(VARCHAR(256))
|
||||
parent_hash = Column(VARCHAR(256))
|
||||
receipt_root = Column(VARCHAR(256))
|
||||
uncles = Column(VARCHAR(256))
|
||||
size = Column(Integer)
|
||||
state_root = Column(VARCHAR(256))
|
||||
timestamp = Column(BigInteger, index=True)
|
||||
total_difficulty = Column(VARCHAR(256))
|
||||
transactions_root = Column(VARCHAR(256))
|
||||
indexed_at = Column(
|
||||
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
||||
)
|
||||
|
||||
sha3_uncles = Column(VARCHAR(256), nullable=True)
|
||||
l1_block_number = Column(BigInteger, nullable=True)
|
||||
send_count = Column(BigInteger, nullable=True)
|
||||
send_root = Column(VARCHAR(256), nullable=True)
|
||||
mix_hash = Column(VARCHAR(256), nullable=True)
|
||||
|
||||
|
||||
class ProofOfPlayApexTransaction(Base): # type: ignore
|
||||
__tablename__ = "proofofplay_apex_transactions"
|
||||
|
||||
hash = Column(
|
||||
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
||||
)
|
||||
block_number = Column(
|
||||
BigInteger,
|
||||
ForeignKey("proofofplay_apex_blocks.block_number", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
from_address = Column(VARCHAR(256), index=True)
|
||||
to_address = Column(VARCHAR(256), index=True)
|
||||
gas = Column(Numeric(precision=78, scale=0), index=True)
|
||||
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
||||
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
||||
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
||||
input = Column(Text)
|
||||
nonce = Column(VARCHAR(256))
|
||||
transaction_index = Column(BigInteger)
|
||||
transaction_type = Column(Integer, nullable=True)
|
||||
value = Column(Numeric(precision=78, scale=0), index=True)
|
||||
|
||||
indexed_at = Column(
|
||||
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
||||
)
|
||||
|
||||
y_parity = Column(BigInteger, nullable=True)
|
||||
|
||||
|
||||
class ProofOfPlayApexLabel(Base): # type: ignore
|
||||
__tablename__ = "proofofplay_apex_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_proofofplay_apex_labels_address_block_number",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_proofofplay_apex_labels_address_block_timestamp",
|
||||
"address",
|
||||
"block_timestamp",
|
||||
unique=False,
|
||||
),
|
||||
)
|
||||
|
||||
id = Column(
|
||||
UUID(as_uuid=True),
|
||||
primary_key=True,
|
||||
default=uuid.uuid4,
|
||||
unique=True,
|
||||
nullable=False,
|
||||
)
|
||||
label = Column(VARCHAR(256), nullable=False, index=True)
|
||||
block_number = Column(
|
||||
BigInteger,
|
||||
nullable=True,
|
||||
index=True,
|
||||
)
|
||||
address = Column(
|
||||
VARCHAR(256),
|
||||
nullable=True,
|
||||
index=True,
|
||||
)
|
||||
transaction_hash = Column(
|
||||
VARCHAR(256),
|
||||
nullable=True,
|
||||
index=True,
|
||||
)
|
||||
label_data = Column(JSONB, nullable=True)
|
||||
block_timestamp = Column(BigInteger, index=True)
|
||||
log_index = Column(Integer, nullable=True)
|
||||
created_at = Column(
|
||||
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
||||
)
|
||||
|
||||
|
||||
class ArbitrumOneBlock(Base): # type: ignore
|
||||
__tablename__ = "arbitrum_one_blocks"
|
||||
|
||||
block_number = Column(
|
||||
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
||||
)
|
||||
difficulty = Column(BigInteger)
|
||||
extra_data = Column(VARCHAR(128))
|
||||
gas_limit = Column(BigInteger)
|
||||
gas_used = Column(BigInteger)
|
||||
base_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
||||
hash = Column(VARCHAR(256), index=True)
|
||||
logs_bloom = Column(VARCHAR(1024))
|
||||
miner = Column(VARCHAR(256))
|
||||
nonce = Column(VARCHAR(256))
|
||||
parent_hash = Column(VARCHAR(256))
|
||||
receipt_root = Column(VARCHAR(256))
|
||||
uncles = Column(VARCHAR(256))
|
||||
size = Column(Integer)
|
||||
state_root = Column(VARCHAR(256))
|
||||
timestamp = Column(BigInteger, index=True)
|
||||
total_difficulty = Column(VARCHAR(256))
|
||||
transactions_root = Column(VARCHAR(256))
|
||||
|
||||
indexed_at = Column(
|
||||
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
||||
)
|
||||
|
||||
sha3_uncles = Column(VARCHAR(256), nullable=True)
|
||||
l1_block_number = Column(BigInteger, nullable=True)
|
||||
send_count = Column(BigInteger, nullable=True)
|
||||
send_root = Column(VARCHAR(256), nullable=True)
|
||||
mix_hash = Column(VARCHAR(256), nullable=True)
|
||||
|
||||
|
||||
class ArbitrumOneTransaction(Base): # type: ignore
|
||||
__tablename__ = "arbitrum_one_transactions"
|
||||
|
||||
hash = Column(
|
||||
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
||||
)
|
||||
block_number = Column(
|
||||
BigInteger,
|
||||
ForeignKey("arbitrum_one_blocks.block_number", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
from_address = Column(VARCHAR(256), index=True)
|
||||
to_address = Column(VARCHAR(256), index=True)
|
||||
gas = Column(Numeric(precision=78, scale=0), index=True)
|
||||
gas_price = Column(Numeric(precision=78, scale=0), index=True)
|
||||
max_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
||||
max_priority_fee_per_gas = Column(Numeric(precision=78, scale=0), nullable=True)
|
||||
input = Column(Text)
|
||||
nonce = Column(VARCHAR(256))
|
||||
transaction_index = Column(BigInteger)
|
||||
transaction_type = Column(Integer, nullable=True)
|
||||
value = Column(Numeric(precision=78, scale=0), index=True)
|
||||
|
||||
indexed_at = Column(
|
||||
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
||||
)
|
||||
|
||||
y_parity = Column(BigInteger, nullable=True)
|
||||
|
||||
|
||||
class ArbitrumOneLabel(Base): # type: ignore
|
||||
__tablename__ = "arbitrum_one_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_arbitrum_one_labels_address_block_number",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_arbitrum_one_labels_address_block_timestamp",
|
||||
"address",
|
||||
"block_timestamp",
|
||||
unique=False,
|
||||
),
|
||||
)
|
||||
|
||||
id = Column(
|
||||
UUID(as_uuid=True),
|
||||
primary_key=True,
|
||||
default=uuid.uuid4,
|
||||
unique=True,
|
||||
nullable=False,
|
||||
)
|
||||
label = Column(VARCHAR(256), nullable=False, index=True)
|
||||
block_number = Column(
|
||||
BigInteger,
|
||||
nullable=True,
|
||||
index=True,
|
||||
)
|
||||
address = Column(
|
||||
VARCHAR(256),
|
||||
nullable=True,
|
||||
index=True,
|
||||
)
|
||||
transaction_hash = Column(
|
||||
VARCHAR(256),
|
||||
nullable=True,
|
||||
index=True,
|
||||
)
|
||||
label_data = Column(JSONB, nullable=True)
|
||||
block_timestamp = Column(BigInteger, index=True)
|
||||
log_index = Column(Integer, nullable=True)
|
||||
created_at = Column(
|
||||
DateTime(timezone=True), server_default=utcnow(), nullable=False
|
||||
)
|
||||
|
||||
|
||||
class ESDFunctionSignature(Base): # type: ignore
|
||||
"""
|
||||
Function signature from blockchain (Ethereum/Polygon) Signature Database.
|
||||
|
|
|
@ -1,7 +1,14 @@
|
|||
from enum import Enum
|
||||
from typing import Dict, Union
|
||||
|
||||
from .blockchain import AvailableBlockchainType
|
||||
from .models import (
|
||||
AmoyBlock,
|
||||
AmoyLabel,
|
||||
AmoyTransaction,
|
||||
ArbitrumOneBlock,
|
||||
ArbitrumOneLabel,
|
||||
ArbitrumOneTransaction,
|
||||
ArbitrumNovaBlock,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumNovaTransaction,
|
||||
|
@ -30,6 +37,9 @@ from .models import (
|
|||
PolygonBlock,
|
||||
PolygonLabel,
|
||||
PolygonTransaction,
|
||||
ProofOfPlayApexBlock,
|
||||
ProofOfPlayApexLabel,
|
||||
ProofOfPlayApexTransaction,
|
||||
WyrmBlock,
|
||||
WyrmLabel,
|
||||
WyrmTransaction,
|
||||
|
@ -58,11 +68,13 @@ class Network(Enum):
|
|||
ethereum = "ethereum"
|
||||
polygon = "polygon"
|
||||
mumbai = "mumbai"
|
||||
amoy = "amoy"
|
||||
xdai = "xdai"
|
||||
wyrm = "wyrm"
|
||||
zksync_era_testnet = "zksync_era_testnet"
|
||||
zksync_era = "zksync_era"
|
||||
zksync_era_sepolia = "zksync_era_sepolia"
|
||||
arbitrum_one = "arbitrum_one"
|
||||
arbitrum_nova = "arbitrum_nova"
|
||||
arbitrum_sepolia = "arbitrum_sepolia"
|
||||
xai = "xai"
|
||||
|
@ -71,17 +83,20 @@ class Network(Enum):
|
|||
avalanche_fuji = "avalanche_fuji"
|
||||
blast = "blast"
|
||||
blast_sepolia = "blast_sepolia"
|
||||
proofofplay_apex = "proofofplay_apex"
|
||||
|
||||
|
||||
tx_raw_types = Union[
|
||||
EthereumTransaction,
|
||||
MumbaiTransaction,
|
||||
AmoyTransaction,
|
||||
PolygonTransaction,
|
||||
WyrmTransaction,
|
||||
XDaiTransaction,
|
||||
ZkSyncEraTestnetTransaction,
|
||||
ZkSyncEraTransaction,
|
||||
ZkSyncEraSepoliaTransaction,
|
||||
ArbitrumOneTransaction,
|
||||
ArbitrumNovaTransaction,
|
||||
ArbitrumSepoliaTransaction,
|
||||
XaiTransaction,
|
||||
|
@ -90,6 +105,7 @@ tx_raw_types = Union[
|
|||
AvalancheFujiTransaction,
|
||||
BlastTransaction,
|
||||
BlastSepoliaTransaction,
|
||||
ProofOfPlayApexTransaction,
|
||||
]
|
||||
|
||||
MODELS: Dict[Network, Dict[str, Base]] = {
|
||||
|
@ -103,6 +119,11 @@ MODELS: Dict[Network, Dict[str, Base]] = {
|
|||
"labels": MumbaiLabel,
|
||||
"transactions": MumbaiTransaction,
|
||||
},
|
||||
Network.amoy: {
|
||||
"blocks": AmoyBlock,
|
||||
"labels": AmoyLabel,
|
||||
"transactions": AmoyTransaction,
|
||||
},
|
||||
Network.polygon: {
|
||||
"blocks": PolygonBlock,
|
||||
"labels": PolygonLabel,
|
||||
|
@ -133,6 +154,11 @@ MODELS: Dict[Network, Dict[str, Base]] = {
|
|||
"labels": ZkSyncEraLabel,
|
||||
"transactions": ZkSyncEraTransaction,
|
||||
},
|
||||
Network.arbitrum_one: {
|
||||
"blocks": ArbitrumOneBlock,
|
||||
"labels": ArbitrumOneLabel,
|
||||
"transactions": ArbitrumOneTransaction,
|
||||
},
|
||||
Network.arbitrum_nova: {
|
||||
"blocks": ArbitrumNovaBlock,
|
||||
"labels": ArbitrumNovaLabel,
|
||||
|
@ -173,4 +199,54 @@ MODELS: Dict[Network, Dict[str, Base]] = {
|
|||
"labels": BlastSepoliaLabel,
|
||||
"transactions": BlastSepoliaTransaction,
|
||||
},
|
||||
Network.proofofplay_apex: {
|
||||
"blocks": ProofOfPlayApexBlock,
|
||||
"labels": ProofOfPlayApexLabel,
|
||||
"transactions": ProofOfPlayApexTransaction,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def blockchain_type_to_network_type(
|
||||
blockchain_type: AvailableBlockchainType,
|
||||
) -> Network:
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
return Network.ethereum
|
||||
elif blockchain_type == AvailableBlockchainType.POLYGON:
|
||||
return Network.polygon
|
||||
elif blockchain_type == AvailableBlockchainType.MUMBAI:
|
||||
return Network.mumbai
|
||||
elif blockchain_type == AvailableBlockchainType.AMOY:
|
||||
return Network.amoy
|
||||
elif blockchain_type == AvailableBlockchainType.XDAI:
|
||||
return Network.xdai
|
||||
elif blockchain_type == AvailableBlockchainType.WYRM:
|
||||
return Network.wyrm
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_TESTNET:
|
||||
return Network.zksync_era_testnet
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA:
|
||||
return Network.zksync_era
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_SEPOLIA:
|
||||
return Network.zksync_era_sepolia
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_ONE:
|
||||
return Network.arbitrum_one
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
return Network.arbitrum_nova
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
return Network.arbitrum_sepolia
|
||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||
return Network.xai
|
||||
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
return Network.xai_sepolia
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE:
|
||||
return Network.avalanche
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE_FUJI:
|
||||
return Network.avalanche_fuji
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST:
|
||||
return Network.blast
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST_SEPOLIA:
|
||||
return Network.blast_sepolia
|
||||
elif blockchain_type == AvailableBlockchainType.PROOFOFPLAY_APEX:
|
||||
return Network.proofofplay_apex
|
||||
else:
|
||||
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
|
||||
|
|
|
@ -0,0 +1,134 @@
|
|||
from enum import Enum
|
||||
|
||||
from .blockchain import AvailableBlockchainType
|
||||
|
||||
|
||||
class SubscriptionTypes(Enum):
|
||||
POLYGON_BLOCKCHAIN = "polygon_smartcontract"
|
||||
ETHEREUM_BLOCKCHAIN = "ethereum_smartcontract"
|
||||
MUMBAI_BLOCKCHAIN = "mumbai_smartcontract"
|
||||
AMOY_BLOCKCHAIN = "amoy_smartcontract"
|
||||
XDAI_BLOCKCHAIN = "xdai_smartcontract"
|
||||
WYRM_BLOCKCHAIN = "wyrm_smartcontract"
|
||||
ZKSYNC_ERA_TESTNET_BLOCKCHAIN = "zksync_era_testnet_smartcontract"
|
||||
ZKSYNC_ERA_BLOCKCHAIN = "zksync_era_smartcontract"
|
||||
ZKSYNC_ERA_SEPOLIA_BLOCKCHAIN = "zksync_era_sepolia_smartcontract"
|
||||
ARBITRUM_ONE_BLOCKCHAIN = "arbitrum_one_smartcontract"
|
||||
ARBITRUM_NOVA_BLOCKCHAIN = "arbitrum_nova_smartcontract"
|
||||
ARBITRUM_SEPOLIA_BLOCKCHAIN = "arbitrum_sepolia_smartcontract"
|
||||
XAI_BLOCKCHAIN = "xai_smartcontract"
|
||||
XAI_SEPOLIA_BLOCKCHAIN = "xai_sepolia_smartcontract"
|
||||
AVALANCHE_BLOCKCHAIN = "avalanche_smartcontract"
|
||||
AVALANCHE_FUJI_BLOCKCHAIN = "avalanche_fuji_smartcontract"
|
||||
BLAST_BLOCKCHAIN = "blast_smartcontract"
|
||||
BLAST_SEPOLIA_BLOCKCHAIN = "blast_sepolia_smartcontract"
|
||||
PROOFOFPLAY_APEX_BLOCKCHAIN = "proofofplay_apex_smartcontract"
|
||||
|
||||
|
||||
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.AMOY:
|
||||
return SubscriptionTypes.AMOY_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.ZKSYNC_ERA_SEPOLIA:
|
||||
return SubscriptionTypes.ZKSYNC_ERA_SEPOLIA_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_ONE:
|
||||
return SubscriptionTypes.ARBITRUM_ONE_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
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE:
|
||||
return SubscriptionTypes.AVALANCHE_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE_FUJI:
|
||||
return SubscriptionTypes.AVALANCHE_FUJI_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST:
|
||||
return SubscriptionTypes.BLAST_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.BLAST_SEPOLIA:
|
||||
return SubscriptionTypes.BLAST_SEPOLIA_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.PROOFOFPLAY_APEX:
|
||||
return SubscriptionTypes.PROOFOFPLAY_APEX_BLOCKCHAIN
|
||||
else:
|
||||
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
|
||||
|
||||
|
||||
subscription_id_by_blockchain = {
|
||||
"ethereum": "ethereum_smartcontract",
|
||||
"polygon": "polygon_smartcontract",
|
||||
"mumbai": "mumbai_smartcontract",
|
||||
"amoy": "amoy_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_one": "arbitrum_one_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",
|
||||
"blast": "blast_smartcontract",
|
||||
"blast_sepolia": "blast_sepolia_smartcontract",
|
||||
"proofofplay_apex": "proofofplay_apex_smartcontract",
|
||||
}
|
||||
|
||||
blockchain_by_subscription_id = {
|
||||
"ethereum_blockchain": "ethereum",
|
||||
"polygon_blockchain": "polygon",
|
||||
"mumbai_blockchain": "mumbai",
|
||||
"amoy_blockchain": "amoy",
|
||||
"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_one_blockchain": "arbitrum_one",
|
||||
"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",
|
||||
"blast_blockchain": "blast",
|
||||
"blast_sepolia_blockchain": "blast_sepolia",
|
||||
"proofofplay_apex_blockchain": "proofofplay_apex",
|
||||
"ethereum_smartcontract": "ethereum",
|
||||
"polygon_smartcontract": "polygon",
|
||||
"mumbai_smartcontract": "mumbai",
|
||||
"amoy_smartcontract": "amoy",
|
||||
"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_one_smartcontract": "arbitrum_one",
|
||||
"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",
|
||||
"blast_smartcontract": "blast",
|
||||
"blast_sepolia_smartcontract": "blast_sepolia",
|
||||
"proofofplay_apex_smartcontract": "proofofplay_apex",
|
||||
}
|
|
@ -2,4 +2,4 @@
|
|||
Moonstream database version.
|
||||
"""
|
||||
|
||||
MOONSTREAMDB_VERSION = "0.3.12"
|
||||
MOONSTREAMDB_VERSION = "0.4.4"
|
||||
|
|
Ładowanie…
Reference in New Issue