diff --git a/crawlers/deploy/deploy-basic.bash b/crawlers/deploy/deploy-basic.bash index 1a442dca..943edd9b 100755 --- a/crawlers/deploy/deploy-basic.bash +++ b/crawlers/deploy/deploy-basic.bash @@ -113,6 +113,16 @@ 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" +# Mantle +MANTLE_MISSING_SERVICE_FILE="mantle-missing.service" +MANTLE_MISSING_TIMER_FILE="mantle-missing.timer" +MANTLE_SYNCHRONIZE_SERVICE="mantle-synchronize.service" + +# Mantle Sepolia +MANTLE_SEPOLIA_MISSING_SERVICE_FILE="mantle-sepolia-missing.service" +MANTLE_SEPOLIA_MISSING_TIMER_FILE="mantle-sepolia-missing.timer" +MANTLE_SEPOLIA_SYNCHRONIZE_SERVICE="mantle-sepolia-synchronize.service" + set -eu echo @@ -465,3 +475,39 @@ cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_MISSING_SERVICE_FILE}" "/home/ubuntu/.confi 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}" + +# Mantle +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle block with transactions syncronizer service definition with ${MANTLE_SYNCHRONIZE_SERVICE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_SYNCHRONIZE_SERVICE}" +cp "${SCRIPT_DIR}/${MANTLE_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${MANTLE_SYNCHRONIZE_SERVICE}" +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MANTLE_SYNCHRONIZE_SERVICE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle missing service and timer with: ${MANTLE_MISSING_SERVICE_FILE}, ${MANTLE_MISSING_TIMER_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${MANTLE_MISSING_TIMER_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_MISSING_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_MISSING_TIMER_FILE}" +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MANTLE_MISSING_TIMER_FILE}" + +# Mantle sepolia +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle sepolia block with transactions syncronizer service definition with ${MANTLE_SEPOLIA_SYNCHRONIZE_SERVICE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_SEPOLIA_SYNCHRONIZE_SERVICE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${MANTLE_SEPOLIA_SYNCHRONIZE_SERVICE}" +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MANTLE_SEPOLIA_SYNCHRONIZE_SERVICE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle sepolia missing service and timer with: ${MANTLE_SEPOLIA_MISSING_SERVICE_FILE}, ${MANTLE_SEPOLIA_MISSING_TIMER_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_SEPOLIA_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${MANTLE_SEPOLIA_MISSING_TIMER_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_SEPOLIA_MISSING_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_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 "${MANTLE_SEPOLIA_MISSING_TIMER_FILE}" diff --git a/crawlers/deploy/deploy-historical.bash b/crawlers/deploy/deploy-historical.bash index 222d51d4..05ec2f98 100755 --- a/crawlers/deploy/deploy-historical.bash +++ b/crawlers/deploy/deploy-historical.bash @@ -84,6 +84,17 @@ XAI_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="xai-sepolia-historical-cra XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="xai-sepolia-historical-crawl-events.service" XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="xai-sepolia-historical-crawl-events.timer" +# Mantle +MANTLE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="mantle-historical-crawl-events.service" +MANTLE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="mantle-historical-crawl-events.timer" +MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="mantle-historical-crawl-transactions.service" +MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="mantle-historical-crawl-transactions.timer" + +# Mantle Sepolia +MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="mantle-sepolia-historical-crawl-events.service" +MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="mantle-sepolia-historical-crawl-events.timer" +MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="mantle-sepolia-historical-crawl-transactions.service" +MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="mantle-sepolia-historical-crawl-transactions.timer" set -eu @@ -302,4 +313,40 @@ chmod 644 "${SCRIPT_DIR}/${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "$ cp "${SCRIPT_DIR}/${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" cp "${SCRIPT_DIR}/${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_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 "${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" \ No newline at end of file +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle historical events crawler service and timer with: ${MANTLE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${MANTLE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_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 "${MANTLE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle historical transactions crawler service and timer with: ${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_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 "${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle sepolia historical events crawler service and timer with: ${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_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 "${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle sepolia historical transactions crawler service and timer with: ${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_SEPOLIA_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 "${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" diff --git a/crawlers/deploy/deploy-moonworm.bash b/crawlers/deploy/deploy-moonworm.bash index 9210cfdd..e84f0167 100755 --- a/crawlers/deploy/deploy-moonworm.bash +++ b/crawlers/deploy/deploy-moonworm.bash @@ -41,6 +41,8 @@ AVALANCHE_FUJI_MOONWORM_CRAWLER_SERVICE_FILE="avalanche-fuji-moonworm-crawler.se 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" +MANTLE_MOONWORM_CRAWLER_SERVICE_FILE="mantle-moonworm-crawler.service" +MANTLE_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE="mantle-sepolia-moonworm-crawler.service" set -eu @@ -209,3 +211,19 @@ 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 Mantle moonworm crawler service definition with ${MANTLE_MOONWORM_CRAWLER_SERVICE_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_MOONWORM_CRAWLER_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_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 "${MANTLE_MOONWORM_CRAWLER_SERVICE_FILE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle sepolia moonworm crawler service definition with ${MANTLE_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_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 "${MANTLE_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" diff --git a/crawlers/deploy/deploy.bash b/crawlers/deploy/deploy.bash index 5db45345..b35ebfad 100755 --- a/crawlers/deploy/deploy.bash +++ b/crawlers/deploy/deploy.bash @@ -147,7 +147,6 @@ XAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="xai-historical-crawl-events.timer" XAI_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="xai-historical-crawl-transactions.service" XAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="xai-historical-crawl-transactions.timer" - # Xai sepolia XAI_SEPOLIA_MISSING_SERVICE_FILE="xai-sepolia-missing.service" XAI_SEPOLIA_MISSING_TIMER_FILE="xai-sepolia-missing.timer" @@ -198,6 +197,25 @@ PROOFOFPLAY_APEX_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="proofofplay-apex-hist 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" +# Mantle +MANTLE_MISSING_SERVICE_FILE="mantle-missing.service" +MANTLE_MISSING_TIMER_FILE="mantle-missing.timer" +MANTLE_MOONWORM_CRAWLER_SERVICE_FILE="mantle-moonworm-crawler.service" +MANTLE_SYNCHRONIZE_SERVICE="mantle-synchronize.service" +MANTLE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="mantle-historical-crawl-events.service" +MANTLE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="mantle-historical-crawl-events.timer" +MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="mantle-historical-crawl-transactions.service" +MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="mantle-historical-crawl-transactions.timer" + +# Mantle Sepolia +MANTLE_SEPOLIA_MISSING_SERVICE_FILE="mantle-sepolia-missing.service" +MANTLE_SEPOLIA_MISSING_TIMER_FILE="mantle-sepolia-missing.timer" +MANTLE_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE="mantle-sepolia-moonworm-crawler.service" +MANTLE_SEPOLIA_SYNCHRONIZE_SERVICE="mantle-sepolia-synchronize.service" +MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="mantle-sepolia-historical-crawl-events.service" +MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="mantle-sepolia-historical-crawl-events.timer" +MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="mantle-sepolia-historical-crawl-transactions.service" +MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="mantle-sepolia-historical-crawl-transactions.timer" set -eu @@ -959,7 +977,6 @@ XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${BLAST_SE # Proofofplay Apex - echo echo echo -e "${PREFIX_INFO} Replacing existing Proofofplay Apex block with transactions syncronizer service definition with ${PROOFOFPLAY_APEX_SYNCHRONIZE_SERVICE}" @@ -1002,3 +1019,91 @@ cp "${SCRIPT_DIR}/${PROOFOFPLAY_APEX_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/ho 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}" + +# Mantle +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle block with transactions syncronizer service definition with ${MANTLE_SYNCHRONIZE_SERVICE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_SYNCHRONIZE_SERVICE}" +cp "${SCRIPT_DIR}/${MANTLE_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${MANTLE_SYNCHRONIZE_SERVICE}" +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MANTLE_SYNCHRONIZE_SERVICE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle missing service and timer with: ${MANTLE_MISSING_SERVICE_FILE}, ${MANTLE_MISSING_TIMER_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${MANTLE_MISSING_TIMER_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_MISSING_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_MISSING_TIMER_FILE}" +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MANTLE_MISSING_TIMER_FILE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle moonworm crawler service definition with ${MANTLE_MOONWORM_CRAWLER_SERVICE_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_MOONWORM_CRAWLER_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_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 "${MANTLE_MOONWORM_CRAWLER_SERVICE_FILE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle historical events crawler service and timer with: ${MANTLE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${MANTLE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_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 "${MANTLE_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle historical transactions crawler service and timer with: ${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_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 "${MANTLE_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" + +# Mantle sepolia +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle sepolia block with transactions syncronizer service definition with ${MANTLE_SEPOLIA_SYNCHRONIZE_SERVICE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_SEPOLIA_SYNCHRONIZE_SERVICE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${MANTLE_SEPOLIA_SYNCHRONIZE_SERVICE}" +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload +XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${MANTLE_SEPOLIA_SYNCHRONIZE_SERVICE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle sepolia missing service and timer with: ${MANTLE_SEPOLIA_MISSING_SERVICE_FILE}, ${MANTLE_SEPOLIA_MISSING_TIMER_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_SEPOLIA_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${MANTLE_SEPOLIA_MISSING_TIMER_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_SEPOLIA_MISSING_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_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 "${MANTLE_SEPOLIA_MISSING_TIMER_FILE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle sepolia moonworm crawler service definition with ${MANTLE_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_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 "${MANTLE_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle sepolia historical events crawler service and timer with: ${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_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 "${MANTLE_SEPOLIA_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" + +echo +echo +echo -e "${PREFIX_INFO} Replacing existing Mantle sepolia historical transactions crawler service and timer with: ${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" +chmod 644 "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" +cp "${SCRIPT_DIR}/${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${MANTLE_SEPOLIA_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 "${MANTLE_SEPOLIA_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" diff --git a/crawlers/deploy/mantle-historical-crawl-events.service b/crawlers/deploy/mantle-historical-crawl-events.service new file mode 100644 index 00000000..ff742f6d --- /dev/null +++ b/crawlers/deploy/mantle-historical-crawl-events.service @@ -0,0 +1,17 @@ +[Unit] +Description=Mantle historical events 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 historical-crawl --blockchain-type mantle --find-deployed-blocks --end 0 --tasks-journal --only-events +CPUWeight=70 +SyslogIdentifier=mantle-historical-crawl-events + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/crawlers/deploy/mantle-historical-crawl-events.timer b/crawlers/deploy/mantle-historical-crawl-events.timer new file mode 100644 index 00000000..ee4deaee --- /dev/null +++ b/crawlers/deploy/mantle-historical-crawl-events.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Runs events historical crawler on Mantle blockchain + +[Timer] +OnBootSec=60s +OnUnitActiveSec=10m + +[Install] +WantedBy=timers.target diff --git a/crawlers/deploy/mantle-historical-crawl-transactions.service b/crawlers/deploy/mantle-historical-crawl-transactions.service new file mode 100644 index 00000000..c2ab7c0d --- /dev/null +++ b/crawlers/deploy/mantle-historical-crawl-transactions.service @@ -0,0 +1,17 @@ +[Unit] +Description=Mantle historical transactions 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 historical-crawl --blockchain-type mantle --find-deployed-blocks --end 0 --tasks-journal --only-functions +CPUWeight=70 +SyslogIdentifier=mantle-historical-crawl-transactions + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/crawlers/deploy/mantle-historical-crawl-transactions.timer b/crawlers/deploy/mantle-historical-crawl-transactions.timer new file mode 100644 index 00000000..cff5392a --- /dev/null +++ b/crawlers/deploy/mantle-historical-crawl-transactions.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Runs transactions historical crawler on mantle blockchain + +[Timer] +OnBootSec=60s +OnUnitActiveSec=10m + +[Install] +WantedBy=timers.target diff --git a/crawlers/deploy/mantle-missing.service b/crawlers/deploy/mantle-missing.service new file mode 100644 index 00000000..e43ea303 --- /dev/null +++ b/crawlers/deploy/mantle-missing.service @@ -0,0 +1,11 @@ +[Unit] +Description=Fill missing blocks at Mantle 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 mantle -n +CPUWeight=50 +SyslogIdentifier=mantle-missing \ No newline at end of file diff --git a/crawlers/deploy/mantle-missing.timer b/crawlers/deploy/mantle-missing.timer new file mode 100644 index 00000000..7b641850 --- /dev/null +++ b/crawlers/deploy/mantle-missing.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Fill missing blocks at Mantle database + +[Timer] +OnBootSec=120s +OnUnitActiveSec=15m + +[Install] +WantedBy=timers.target diff --git a/crawlers/deploy/mantle-moonworm-crawler.service b/crawlers/deploy/mantle-moonworm-crawler.service new file mode 100644 index 00000000..d236da3b --- /dev/null +++ b/crawlers/deploy/mantle-moonworm-crawler.service @@ -0,0 +1,17 @@ +[Unit] +Description=Mantle 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 mantle --confirmations 10 --min-blocks-batch 20 +CPUWeight=70 +SyslogIdentifier=mantle-moonworm-crawler + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/crawlers/deploy/mantle-sepolia-historical-crawl-events.service b/crawlers/deploy/mantle-sepolia-historical-crawl-events.service new file mode 100644 index 00000000..b0a47854 --- /dev/null +++ b/crawlers/deploy/mantle-sepolia-historical-crawl-events.service @@ -0,0 +1,17 @@ +[Unit] +Description=Mantle sepolia historical events 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 historical-crawl --blockchain-type mantle_sepolia --find-deployed-blocks --end 0 --tasks-journal --only-events +CPUWeight=70 +SyslogIdentifier=mantle-sepolia-historical-crawl-events + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/crawlers/deploy/mantle-sepolia-historical-crawl-events.timer b/crawlers/deploy/mantle-sepolia-historical-crawl-events.timer new file mode 100644 index 00000000..9d1ef89a --- /dev/null +++ b/crawlers/deploy/mantle-sepolia-historical-crawl-events.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Runs events historical crawler on Mantle sepolia blockchain + +[Timer] +OnBootSec=60s +OnUnitActiveSec=10m + +[Install] +WantedBy=timers.target diff --git a/crawlers/deploy/mantle-sepolia-historical-crawl-transactions.service b/crawlers/deploy/mantle-sepolia-historical-crawl-transactions.service new file mode 100644 index 00000000..03b9c9e5 --- /dev/null +++ b/crawlers/deploy/mantle-sepolia-historical-crawl-transactions.service @@ -0,0 +1,17 @@ +[Unit] +Description=Mantle sepolia historical transactions 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 historical-crawl --blockchain-type mantle-sepolia --find-deployed-blocks --end 0 --tasks-journal --only-functions +CPUWeight=70 +SyslogIdentifier=mantle-sepolia-historical-crawl-transactions + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/crawlers/deploy/mantle-sepolia-historical-crawl-transactions.timer b/crawlers/deploy/mantle-sepolia-historical-crawl-transactions.timer new file mode 100644 index 00000000..8453ae3c --- /dev/null +++ b/crawlers/deploy/mantle-sepolia-historical-crawl-transactions.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Runs transactions historical crawler on mantle-sepolia blockchain + +[Timer] +OnBootSec=60s +OnUnitActiveSec=10m + +[Install] +WantedBy=timers.target diff --git a/crawlers/deploy/mantle-sepolia-missing.service b/crawlers/deploy/mantle-sepolia-missing.service new file mode 100644 index 00000000..b7693141 --- /dev/null +++ b/crawlers/deploy/mantle-sepolia-missing.service @@ -0,0 +1,11 @@ +[Unit] +Description=Fill missing blocks at Mantle sepolia database +After=network.target + +[Service] +Type=oneshot +WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl +EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env +ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain mantle-sepolia -n +CPUWeight=50 +SyslogIdentifier=mantle-sepolia-missing \ No newline at end of file diff --git a/crawlers/deploy/mantle-sepolia-missing.timer b/crawlers/deploy/mantle-sepolia-missing.timer new file mode 100644 index 00000000..51441bdf --- /dev/null +++ b/crawlers/deploy/mantle-sepolia-missing.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Fill missing blocks at Mantle sepolia database + +[Timer] +OnBootSec=120s +OnUnitActiveSec=15m + +[Install] +WantedBy=timers.target diff --git a/crawlers/deploy/mantle-sepolia-moonworm-crawler.service b/crawlers/deploy/mantle-sepolia-moonworm-crawler.service new file mode 100644 index 00000000..9ef6ab24 --- /dev/null +++ b/crawlers/deploy/mantle-sepolia-moonworm-crawler.service @@ -0,0 +1,17 @@ +[Unit] +Description=Mantle sepolia moonworm crawler +After=network.target +StartLimitIntervalSec=300 +StartLimitBurst=3 + +[Service] +WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl +EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env +Restart=on-failure +RestartSec=15s +ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli crawl -b mantle-sepolia --confirmations 10 --min-blocks-batch 20 +CPUWeight=70 +SyslogIdentifier=mantle-sepolia-moonworm-crawler + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/crawlers/deploy/mantle-sepolia-synchronize.service b/crawlers/deploy/mantle-sepolia-synchronize.service new file mode 100644 index 00000000..6c670825 --- /dev/null +++ b/crawlers/deploy/mantle-sepolia-synchronize.service @@ -0,0 +1,17 @@ +[Unit] +Description=Mantle sepolia block with transactions synchronizer +StartLimitIntervalSec=300 +StartLimitBurst=3 +After=network.target + +[Service] +Restart=on-failure +RestartSec=15s +WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl +EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env +ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain mantle_sepolia -c 10 -j 2 +CPUWeight=90 +SyslogIdentifier=mantle-sepolia-synchronize + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/crawlers/deploy/mantle-synchronize.service b/crawlers/deploy/mantle-synchronize.service new file mode 100644 index 00000000..6d85afba --- /dev/null +++ b/crawlers/deploy/mantle-synchronize.service @@ -0,0 +1,17 @@ +[Unit] +Description=Mantle 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 mantle -c 10 -j 2 +CPUWeight=90 +SyslogIdentifier=mantle-synchronize + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/crawlers/mooncrawl/mooncrawl/moonworm_crawler/cli.py b/crawlers/mooncrawl/mooncrawl/moonworm_crawler/cli.py index ca4e583f..32af00d8 100644 --- a/crawlers/mooncrawl/mooncrawl/moonworm_crawler/cli.py +++ b/crawlers/mooncrawl/mooncrawl/moonworm_crawler/cli.py @@ -245,7 +245,9 @@ def handle_crawl_v3(args: argparse.Namespace) -> None: logger.info("Using PoA middleware") web3.middleware_onion.inject(geth_poa_middleware, layer=0) - last_labeled_block = get_last_labeled_block_number(db_session, blockchain_type) + last_labeled_block = get_last_labeled_block_number( + db_session, blockchain_type, db_version=3 + ) logger.info(f"Last labeled block: {last_labeled_block}") start_block = args.start diff --git a/crawlers/mooncrawl/setup.py b/crawlers/mooncrawl/setup.py index 90f35ee0..3e57aadf 100644 --- a/crawlers/mooncrawl/setup.py +++ b/crawlers/mooncrawl/setup.py @@ -37,9 +37,9 @@ setup( "bugout>=0.2.13", "chardet", "fastapi", - "moonstreamdb>=0.4.4", + "moonstreamdb>=0.4.5", "moonstreamdb-v3>=0.0.11", - "moonstream-types>=0.0.3", + "moonstream-types>=0.0.4", "moonstream>=0.1.1", "moonworm[moonstream]>=0.9.2", "humbug", diff --git a/moonstreamdb-v3/moonstreamdbv3/alembic_indexes/versions/27086791044c_add_topic_3.py b/moonstreamdb-v3/moonstreamdbv3/alembic_indexes/versions/27086791044c_add_topic_3.py new file mode 100644 index 00000000..6a61eb3e --- /dev/null +++ b/moonstreamdb-v3/moonstreamdbv3/alembic_indexes/versions/27086791044c_add_topic_3.py @@ -0,0 +1,68 @@ +"""Add topic 3 + +Revision ID: 27086791044c +Revises: e02c90ea67bb +Create Date: 2024-07-11 13:15:45.273275 + +""" + +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision: str = "27086791044c" +down_revision: Union[str, None] = "e02c90ea67bb" +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.add_column( + "arbitrum_one_logs", sa.Column("topic3", sa.VARCHAR(length=256), nullable=True) + ) + op.add_column( + "arbitrum_sepolia_logs", + sa.Column("topic3", sa.VARCHAR(length=256), nullable=True), + ) + op.add_column( + "ethereum_logs", sa.Column("topic3", sa.VARCHAR(length=256), nullable=True) + ) + op.add_column( + "game7_orbit_arbitrum_sepolia_logs", + sa.Column("topic3", sa.VARCHAR(length=256), nullable=True), + ) + op.add_column( + "mantle_logs", sa.Column("topic3", sa.VARCHAR(length=256), nullable=True) + ) + op.add_column( + "mantle_sepolia_logs", + sa.Column("topic3", sa.VARCHAR(length=256), nullable=True), + ) + op.add_column( + "polygon_logs", sa.Column("topic3", sa.VARCHAR(length=256), nullable=True) + ) + op.add_column( + "xai_logs", sa.Column("topic3", sa.VARCHAR(length=256), nullable=True) + ) + op.add_column( + "xai_sepolia_logs", sa.Column("topic3", sa.VARCHAR(length=256), nullable=True) + ) + # ### end Alembic commands ### + + +def downgrade() -> None: + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column("xai_sepolia_logs", "topic3") + op.drop_column("xai_logs", "topic3") + op.drop_column("polygon_logs", "topic3") + op.drop_column("mantle_sepolia_logs", "topic3") + op.drop_column("mantle_logs", "topic3") + op.drop_column("game7_orbit_arbitrum_sepolia_logs", "topic3") + op.drop_column("ethereum_logs", "topic3") + op.drop_column("arbitrum_sepolia_logs", "topic3") + op.drop_column("arbitrum_one_logs", "topic3") + # ### end Alembic commands ### diff --git a/moonstreamdb-v3/moonstreamdbv3/models_indexes.py b/moonstreamdb-v3/moonstreamdbv3/models_indexes.py index 7438e088..4125704f 100644 --- a/moonstreamdb-v3/moonstreamdbv3/models_indexes.py +++ b/moonstreamdb-v3/moonstreamdbv3/models_indexes.py @@ -86,6 +86,7 @@ class EvmBasedLogs(Base): selector = Column(VARCHAR(256), nullable=True, index=False) topic1 = Column(VARCHAR(256), nullable=True, index=False) topic2 = Column(VARCHAR(256), nullable=True, index=False) + topic3 = Column(VARCHAR(256), nullable=True, index=False) log_index = Column(BigInteger, nullable=False, index=False) path = Column(Text, nullable=False) indexed_at = Column(