kopia lustrzana https://github.com/bugout-dev/moonstream
Merge branch 'main' into xai-testnet
commit
8196912e6e
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain arbitrum_nova -n
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain arbitrum_nova -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=arbitrum-nova-missing
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl -b arbitrum_nova --confirmations 10 --min-blocks-batch 20
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli crawl -b arbitrum_nova --confirmations 10 --min-blocks-batch 20
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=arbitrum-nova-moonworm-crawler
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain arbitrum_nova -c 10 -j 2
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain arbitrum_nova -c 10 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=arbitrum-nova-synchronize
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain arbitrum_sepolia -n
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain arbitrum_sepolia -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=arbitrum-sepolia-missing
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl -b arbitrum_sepolia --confirmations 10 --min-blocks-batch 20
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli crawl -b arbitrum_sepolia --confirmations 10 --min-blocks-batch 20
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=arbitrum-sepolia-moonworm-crawler
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain arbitrum_sepolia -c 10 -j 2
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain arbitrum_sepolia -c 10 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=arbitrum-sepolia-synchronize
|
||||
|
||||
|
|
|
@ -31,8 +31,6 @@ LEADERBOARDS_WORKER_TIMER_FILE="leaderboards-worker.timer"
|
|||
|
||||
# Ethereum service files
|
||||
ETHEREUM_SYNCHRONIZE_SERVICE_FILE="ethereum-synchronize.service"
|
||||
ETHEREUM_TRENDING_SERVICE_FILE="ethereum-trending.service"
|
||||
ETHEREUM_TRENDING_TIMER_FILE="ethereum-trending.timer"
|
||||
ETHEREUM_MISSING_SERVICE_FILE="ethereum-missing.service"
|
||||
ETHEREUM_MISSING_TIMER_FILE="ethereum-missing.timer"
|
||||
ETHEREUM_MOONWORM_CRAWLER_SERVICE_FILE="ethereum-moonworm-crawler.service"
|
||||
|
@ -83,7 +81,6 @@ MUMBAI_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="mumbai-historical-crawl-transac
|
|||
MUMBAI_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="mumbai-historical-crawl-events.service"
|
||||
MUMBAI_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="mumbai-historical-crawl-events.timer"
|
||||
|
||||
|
||||
# XDai service files
|
||||
XDAI_SYNCHRONIZE_SERVICE="xdai-synchronize.service"
|
||||
XDAI_MISSING_SERVICE_FILE="xdai-missing.service"
|
||||
|
@ -94,16 +91,6 @@ XDai_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="xdai-historical-crawl-transaction
|
|||
XDai_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="xdai-historical-crawl-events.service"
|
||||
XDai_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="xdai-historical-crawl-events.timer"
|
||||
|
||||
# Wyrm service files
|
||||
WYRM_SYNCHRONIZE_SERVICE="wyrm-synchronize.service"
|
||||
WYRM_MISSING_SERVICE_FILE="wyrm-missing.service"
|
||||
WYRM_MISSING_TIMER_FILE="wyrm-missing.timer"
|
||||
WYRM_MOONWORM_CRAWLER_SERVICE_FILE="wyrm-moonworm-crawler.service"
|
||||
WYRM_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE="wyrm-historical-crawl-transactions.service"
|
||||
WYRM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE="wyrm-historical-crawl-transactions.timer"
|
||||
WYRM_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE="wyrm-historical-crawl-events.service"
|
||||
WYRM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE="wyrm-historical-crawl-events.timer"
|
||||
|
||||
# ZkSync Era
|
||||
ZKSYNC_ERA_SYNCHRONIZE_SERVICE="zksync-era-synchronize.service"
|
||||
ZKSYNC_ERA_MISSING_SERVICE_FILE="zksync-era-missing.service"
|
||||
|
@ -117,6 +104,10 @@ ZKSYNC_ERA_STATE_SERVICE_FILE="zksync-era-state.service"
|
|||
ZKSYNC_ERA_STATE_TIMER_FILE="zksync-era-state.timer"
|
||||
ZKSYNC_ERA_STATE_CLEAN_SERVICE_FILE="zksync-era-state-clean.service"
|
||||
ZKSYNC_ERA_STATE_CLEAN_TIMER_FILE="zksync-era-state-clean.timer"
|
||||
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"
|
||||
ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE="zksync-era-sepolia-moonworm-crawler.service"
|
||||
|
||||
# ZkSync Era testnet
|
||||
ZKSYNC_ERA_TESTNET_SYNCHRONIZE_SERVICE="zksync-era-testnet-synchronize.service"
|
||||
|
@ -207,15 +198,6 @@ cp "${SCRIPT_DIR}/${ETHEREUM_SYNCHRONIZE_SERVICE_FILE}" "/home/ubuntu/.config/sy
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_SYNCHRONIZE_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Ethereum trending service and timer with: ${ETHEREUM_TRENDING_SERVICE_FILE}, ${ETHEREUM_TRENDING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ETHEREUM_TRENDING_SERVICE_FILE}" "${SCRIPT_DIR}/${ETHEREUM_TRENDING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_TRENDING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_TRENDING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ETHEREUM_TRENDING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ETHEREUM_TRENDING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ETHEREUM_TRENDING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Ethereum missing service and timer with: ${ETHEREUM_MISSING_SERVICE_FILE}, ${ETHEREUM_MISSING_TIMER_FILE}"
|
||||
|
@ -483,49 +465,6 @@ cp "${SCRIPT_DIR}/${XDai_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.con
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XDai_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Wyrm block with transactions syncronizer service definition with ${WYRM_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${WYRM_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${WYRM_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${WYRM_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${WYRM_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Wyrn missing service and timer with: ${WYRM_MISSING_SERVICE_FILE}, ${WYRM_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${WYRM_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${WYRM_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${WYRM_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${WYRM_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${WYRM_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${WYRM_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${WYRM_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Wyrm moonworm crawler service definition with ${WYRM_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${WYRM_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${WYRM_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${WYRM_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 "${WYRM_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Wyrm historical transactions crawler service and timer with: ${WYRM_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}, ${WYRM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${WYRM_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "${SCRIPT_DIR}/${WYRM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${WYRM_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${WYRM_HISTORICAL_CRAWL_TRANSACTIONS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${WYRM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${WYRM_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 "${WYRM_HISTORICAL_CRAWL_TRANSACTIONS_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing Wyrm historical events crawler service and timer with: ${WYRM_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}, ${WYRM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${WYRM_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "${SCRIPT_DIR}/${WYRM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${WYRM_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${WYRM_HISTORICAL_CRAWL_EVENTS_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${WYRM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${WYRM_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 "${WYRM_HISTORICAL_CRAWL_EVENTS_TIMER_FILE}"
|
||||
|
||||
# ZkSync Era
|
||||
echo
|
||||
echo
|
||||
|
@ -642,6 +581,32 @@ cp "${SCRIPT_DIR}/${LEADERBOARDS_WORKER_TIMER_FILE}" "/home/ubuntu/.config/syste
|
|||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${LEADERBOARDS_WORKER_TIMER_FILE}"
|
||||
|
||||
# ZkSync Era Sepolia
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia block with transactions syncronizer service definition with ${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia missing service and timer with: ${ZKSYNC_ERA_SEPOLIA_MISSING_SERVICE_FILE}, ${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_MISSING_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_MISSING_TIMER_FILE}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Replacing existing ZkSync Era Sepolia moonworm crawler service definition with ${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
chmod 644 "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
cp "${SCRIPT_DIR}/${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${ZKSYNC_ERA_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||
|
||||
# Arbitrum Nova
|
||||
echo
|
||||
echo
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" historical-crawl --blockchain-type ethereum --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 ethereum --find-deployed-blocks --end 0 --tasks-journal --only-events
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=ethereum-historical-crawl-events
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" historical-crawl --blockchain-type ethereum --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 ethereum --find-deployed-blocks --end 0 --tasks-journal --only-functions
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=ethereum-historical-crawl-transactions
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain ethereum -n
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain ethereum -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=ethereum-missing
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl -b ethereum
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli crawl -b ethereum
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=ethereum-moonworm-crawler
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" clean-state-labels --blockchain ethereum -N 10000
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.state_crawler.cli clean-state-labels --blockchain ethereum -N 10000
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=ethereum-state-clean
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl-jobs --moonstream-token "${MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN}" --blockchain ethereum --jobs-file /home/ubuntu/moonstream/crawlers/mooncrawl/mooncrawl/state_crawler/jobs/ethereum-jobs.json
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.state_crawler.cli crawl-jobs --moonstream-token "${MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN}" --blockchain ethereum --jobs-file /home/ubuntu/moonstream/crawlers/mooncrawl/mooncrawl/state_crawler/jobs/ethereum-jobs.json
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=ethereum-state
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain ethereum -c 6 -j 2
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain ethereum -c 6 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=ethereum-synchronize
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
[Unit]
|
||||
Description=Load trending Ethereum addresses to the 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" trending
|
||||
CPUWeight=30
|
||||
SyslogIdentifier=ethereum-trending
|
|
@ -1,9 +0,0 @@
|
|||
[Unit]
|
||||
Description=Load trending Ethereum addresses to the database every 5 minutes
|
||||
|
||||
[Timer]
|
||||
OnBootSec=60s
|
||||
OnUnitActiveSec=5m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -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 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 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
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=monitoring-crawlers
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" 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 mumbai --find-deployed-blocks --end 0 --tasks-journal --only-events
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=mumbai-historical-crawl-events
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" 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 mumbai --find-deployed-blocks --end 0 --tasks-journal --only-functions
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=mumbai-historical-crawl-transactions
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain mumbai -n
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain mumbai -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=mumbai-missing
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl -b mumbai --confirmations 40
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli crawl -b mumbai --confirmations 40
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=mumbai-moonworm-crawler
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" clean-state-labels --blockchain mumbai -N 10000
|
||||
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
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" 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
|
||||
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
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain mumbai -c 20 -j 2
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain mumbai -c 20 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=mumbai-synchronize
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" historical-crawl --blockchain-type polygon --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 polygon --find-deployed-blocks --end 0 --tasks-journal --only-events
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=polygon-historical-crawl-events
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" historical-crawl --blockchain-type polygon --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 polygon --find-deployed-blocks --end 0 --tasks-journal --only-functions
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=polygon-historical-crawl-transactions
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain polygon -n
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain polygon -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=polygon-missing
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl -b polygon --confirmations 50 --min-blocks-batch 20
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli crawl -b polygon --confirmations 50 --min-blocks-batch 20
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=polygon-moonworm-crawler
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" clean-state-labels --blockchain polygon -N 10000
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.state_crawler.cli clean-state-labels --blockchain polygon -N 10000
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=polygon-state-clean
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl-jobs --moonstream-token "${MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN}" --blockchain polygon --infura --jobs-file /home/ubuntu/moonstream/crawlers/mooncrawl/mooncrawl/state_crawler/jobs/polygon-jobs.json
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.state_crawler.cli crawl-jobs --moonstream-token "${MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN}" --blockchain polygon --infura --jobs-file /home/ubuntu/moonstream/crawlers/mooncrawl/mooncrawl/state_crawler/jobs/polygon-jobs.json
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=polygon-state
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain polygon --confirmations 40 --jobs 2
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain polygon --confirmations 40 --jobs 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=polygon-synchronize
|
||||
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
[Unit]
|
||||
Description=Wyrm 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" historical-crawl --blockchain-type wyrm --find-deployed-blocks --end 0 --tasks-journal --only-events
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=wyrm-historical-crawl-events
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,9 +0,0 @@
|
|||
[Unit]
|
||||
Description=Runs events historical crawler on wyrm
|
||||
|
||||
[Timer]
|
||||
OnBootSec=60s
|
||||
OnUnitActiveSec=10m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -1,17 +0,0 @@
|
|||
[Unit]
|
||||
Description=Wyrm 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" historical-crawl --blockchain-type wyrm --find-deployed-blocks --end 0 --tasks-journal --only-functions
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=wyrm-historical-crawl-transactions
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,9 +0,0 @@
|
|||
[Unit]
|
||||
Description=Runs transactions historical crawler on wyrm
|
||||
|
||||
[Timer]
|
||||
OnBootSec=60s
|
||||
OnUnitActiveSec=10m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -1,9 +0,0 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at Wyrm database
|
||||
|
||||
[Timer]
|
||||
OnBootSec=120s
|
||||
OnUnitActiveSec=15m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain xai -n
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain xai -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=xai-missing
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl -b xai --confirmations 10 --min-blocks-batch 20
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli crawl -b xai --confirmations 10 --min-blocks-batch 20
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=xai-moonworm-crawler
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain xai -c 10 -j 2
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain xai -c 10 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=xai-synchronize
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" historical-crawl --blockchain-type xdai --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 xdai --find-deployed-blocks --end 0 --tasks-journal --only-events
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=xdai-historical-crawl-events
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" historical-crawl --blockchain-type xdai --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 xdai --find-deployed-blocks --end 0 --tasks-journal --only-functions
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=xdai-historical-crawl-transactions
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain xdai -n
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain xdai -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=xdai-missing
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl -b xdai
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli crawl -b xdai
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=xdai-moonworm-crawler
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain xdai -c 60 -j 2
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain xdai -c 60 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=xdai-synchronize
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" historical-crawl --blockchain-type zksync_era --find-deployed-blocks --end 0 --tasks-journal --only-events
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli historical-crawl --blockchain-type zksync_era --find-deployed-blocks --end 0 --tasks-journal --only-events
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=zksync-era-historical-crawl-events
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" historical-crawl --blockchain-type zksync_era --find-deployed-blocks --end 0 --tasks-journal --only-functions
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli historical-crawl --blockchain-type zksync_era --find-deployed-blocks --end 0 --tasks-journal --only-functions
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=zksync-era-historical-crawl-transactions
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain zksync_era -n
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain zksync_era -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=zksync-era-missing
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl -b zksync_era --confirmations 20 --min-blocks-batch 20
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli crawl -b zksync_era --confirmations 20 --min-blocks-batch 20
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=zksync-era-moonworm-crawler
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at Wyrm database
|
||||
Description=Fill missing blocks at ZkSync Era 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain wyrm
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain zksync_era_sepolia -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=wyrm-missing
|
||||
SyslogIdentifier=zksync-era-sepolia-missing
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Fill missing blocks at ZkSync Era Sepolia database
|
||||
|
||||
[Timer]
|
||||
OnBootSec=120s
|
||||
OnUnitActiveSec=15m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=Wyrm moonworm crawler
|
||||
Description=ZkSync Era Sepolia 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl --blockchain wyrm --poa --no-confirmations --start 0 --min-blocks-batch 1
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli crawl -b zksync_era_sepolia --confirmations 20 --min-blocks-batch 20
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=wyrm-moonworm-crawler
|
||||
SyslogIdentifier=zksync-era-sepolia-moonworm-crawler
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
WantedBy=multi-user.target
|
|
@ -1,5 +1,5 @@
|
|||
[Unit]
|
||||
Description=Wyrm block with transactions synchronizer
|
||||
Description=ZkSync Era 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain wyrm -c 0 -j 1
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain zksync_era_sepolia -c 20 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=wyrm-synchronize
|
||||
SyslogIdentifier=zksync-era-sepolia-synchronize
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" clean-state-labels --blockchain zksync_era -N 10000
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.state_crawler.cli clean-state-labels --blockchain zksync_era -N 10000
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=zksync-era-state-clean
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl-jobs --moonstream-token "${MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN}" --blockchain zksync_era --jobs-file /home/ubuntu/moonstream/crawlers/mooncrawl/mooncrawl/state_crawler/jobs/zksync-era-jobs.json
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.state_crawler.cli crawl-jobs --moonstream-token "${MOONSTREAM_PUBLIC_QUERIES_DATA_ACCESS_TOKEN}" --blockchain zksync_era --jobs-file /home/ubuntu/moonstream/crawlers/mooncrawl/mooncrawl/state_crawler/jobs/zksync-era-jobs.json
|
||||
CPUWeight=60
|
||||
SyslogIdentifier=zksync-era-state
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain zksync_era -c 20 -j 2
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain zksync_era -c 20 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=zksync-era-synchronize
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" historical-crawl --blockchain-type zksync_era_testnet --find-deployed-blocks --end 0 --tasks-journal --only-events
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli historical-crawl --blockchain-type zksync_era_testnet --find-deployed-blocks --end 0 --tasks-journal --only-events
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=zksync-era-testnet-historical-crawl-events
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" historical-crawl --blockchain-type zksync_era_testnet --find-deployed-blocks --end 0 --tasks-journal --only-functions
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli historical-crawl --blockchain-type zksync_era_testnet --find-deployed-blocks --end 0 --tasks-journal --only-functions
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=zksync-era-testnet-historical-crawl-transactions
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ After=network.target
|
|||
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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain zksync_era_testnet -n
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks missing --blockchain zksync_era_testnet -n
|
||||
CPUWeight=50
|
||||
SyslogIdentifier=zksync-era-testnet-missing
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl -b zksync_era_testnet --confirmations 20 --min-blocks-batch 20
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli crawl -b zksync_era_testnet --confirmations 20 --min-blocks-batch 20
|
||||
CPUWeight=70
|
||||
SyslogIdentifier=zksync-era-testnet-moonworm-crawler
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain zksync_era_testnet -c 20 -j 2
|
||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler blocks synchronize --blockchain zksync_era_testnet -c 20 -j 2
|
||||
CPUWeight=90
|
||||
SyslogIdentifier=zksync-era-testnet-synchronize
|
||||
|
||||
|
|
|
@ -1,24 +1,24 @@
|
|||
from collections import OrderedDict
|
||||
from datetime import datetime
|
||||
import hashlib
|
||||
import json
|
||||
import logging
|
||||
import time
|
||||
from typing import Any, Dict, Optional, Union
|
||||
import uuid
|
||||
|
||||
|
||||
from bugout.data import (
|
||||
BugoutResources,
|
||||
)
|
||||
from bugout.exceptions import BugoutResponseException
|
||||
from moonstream.client import Moonstream, ENDPOINT_QUERIES, MoonstreamQueryResultUrl # type: ignore
|
||||
import requests # type: ignore
|
||||
from .middleware import MoonstreamHTTPException
|
||||
from .settings import bugout_client as bc
|
||||
|
||||
from collections import OrderedDict
|
||||
from datetime import datetime
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import boto3 # type: ignore
|
||||
import requests # type: ignore
|
||||
from bugout.data import BugoutResources
|
||||
from bugout.exceptions import BugoutResponseException
|
||||
from moonstream.client import ( # type: ignore
|
||||
ENDPOINT_QUERIES,
|
||||
Moonstream,
|
||||
MoonstreamQueryResultUrl,
|
||||
)
|
||||
|
||||
from .middleware import MoonstreamHTTPException
|
||||
from .settings import bugout_client as bc
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
The Mooncrawl HTTP API
|
||||
"""
|
||||
|
||||
import logging
|
||||
import time
|
||||
from cgi import test
|
||||
|
@ -37,7 +38,6 @@ from .settings import (
|
|||
MOONSTREAM_S3_QUERIES_BUCKET_PREFIX,
|
||||
MOONSTREAM_S3_SMARTCONTRACTS_ABI_BUCKET,
|
||||
MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX,
|
||||
NB_CONTROLLER_ACCESS_ID,
|
||||
ORIGINS,
|
||||
)
|
||||
from .settings import bugout_client as bc
|
||||
|
@ -152,7 +152,6 @@ async def status_handler(
|
|||
timescales=stats_update.timescales,
|
||||
dashboard=dashboard_resource,
|
||||
subscription_by_id=subscription_by_id,
|
||||
access_id=NB_CONTROLLER_ACCESS_ID,
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
@ -21,20 +21,20 @@ from web3.types import BlockData
|
|||
from .data import DateRange
|
||||
from .db import yield_db_session, yield_db_session_ctx
|
||||
from .settings import (
|
||||
MOONSTREAM_ARBITRUM_NOVA_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_ARBITRUM_SEPOLIA_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_CRAWL_WORKERS,
|
||||
MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_POLYGON_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_WYRM_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_XAI_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_XDAI_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_ZKSYNC_ERA_TESTNET_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_ZKSYNC_ERA_WEB3_PROVIDER_URI,
|
||||
NB_ACCESS_ID_HEADER,
|
||||
NB_DATA_SOURCE_HEADER,
|
||||
MOONSTREAM_NODE_ARBITRUM_NOVA_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_AVALANCHE_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_AVALANCHE_FUJI_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_ETHEREUM_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_MUMBAI_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_POLYGON_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_XAI_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_XAI_SEPOLIA_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_XDAI_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_ZKSYNC_ERA_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_ZKSYNC_ERA_SEPOLIA_A_EXTERNAL_URI,
|
||||
MOONSTREAM_NODE_ZKSYNC_ERA_TESTNET_A_EXTERNAL_URI,
|
||||
WEB3_CLIENT_REQUEST_TIMEOUT_SECONDS,
|
||||
)
|
||||
|
||||
|
@ -49,44 +49,42 @@ class BlockCrawlError(Exception):
|
|||
|
||||
|
||||
def connect(
|
||||
blockchain_type: AvailableBlockchainType,
|
||||
blockchain_type: Optional[AvailableBlockchainType] = None,
|
||||
web3_uri: Optional[str] = None,
|
||||
access_id: Optional[UUID] = None,
|
||||
) -> Web3:
|
||||
if blockchain_type is None and web3_uri is None:
|
||||
raise Exception("Both blockchain_type and web3_uri could not be None")
|
||||
|
||||
web3_provider: Union[IPCProvider, HTTPProvider] = Web3.IPCProvider()
|
||||
|
||||
request_kwargs: Any = None
|
||||
if access_id is not None:
|
||||
request_kwargs = {
|
||||
"headers": {
|
||||
NB_ACCESS_ID_HEADER: str(access_id),
|
||||
NB_DATA_SOURCE_HEADER: "blockchain",
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
}
|
||||
request_kwargs: Dict[str, Any] = {"headers": {"Content-Type": "application/json"}}
|
||||
if web3_uri is None:
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
web3_uri = MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI
|
||||
web3_uri = MOONSTREAM_NODE_ETHEREUM_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.POLYGON:
|
||||
web3_uri = MOONSTREAM_POLYGON_WEB3_PROVIDER_URI
|
||||
web3_uri = MOONSTREAM_NODE_POLYGON_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.MUMBAI:
|
||||
web3_uri = MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI
|
||||
web3_uri = MOONSTREAM_NODE_MUMBAI_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.XDAI:
|
||||
web3_uri = MOONSTREAM_XDAI_WEB3_PROVIDER_URI
|
||||
elif blockchain_type == AvailableBlockchainType.WYRM:
|
||||
web3_uri = MOONSTREAM_WYRM_WEB3_PROVIDER_URI
|
||||
web3_uri = MOONSTREAM_NODE_XDAI_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_TESTNET:
|
||||
web3_uri = MOONSTREAM_ZKSYNC_ERA_TESTNET_WEB3_PROVIDER_URI
|
||||
web3_uri = MOONSTREAM_NODE_ZKSYNC_ERA_TESTNET_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA:
|
||||
web3_uri = MOONSTREAM_ZKSYNC_ERA_WEB3_PROVIDER_URI
|
||||
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_NOVA:
|
||||
web3_uri = MOONSTREAM_ARBITRUM_NOVA_WEB3_PROVIDER_URI
|
||||
web3_uri = MOONSTREAM_NODE_ARBITRUM_NOVA_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
web3_uri = MOONSTREAM_ARBITRUM_SEPOLIA_WEB3_PROVIDER_URI
|
||||
web3_uri = MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||
web3_uri = MOONSTREAM_XAI_WEB3_PROVIDER_URI
|
||||
web3_uri = MOONSTREAM_NODE_XAI_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
web3_uri = MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI
|
||||
web3_uri = MOONSTREAM_NODE_XAI_SEPOLIA_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE:
|
||||
web3_uri = MOONSTREAM_NODE_AVALANCHE_A_EXTERNAL_URI
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE_FUJI:
|
||||
web3_uri = MOONSTREAM_NODE_AVALANCHE_FUJI_A_EXTERNAL_URI
|
||||
else:
|
||||
raise Exception("Wrong blockchain type provided for web3 URI")
|
||||
|
||||
|
@ -167,33 +165,32 @@ def add_block(db_session, block: Any, blockchain_type: AvailableBlockchainType)
|
|||
if block.get("l1BatchTimestamp") is not None
|
||||
else None
|
||||
)
|
||||
if blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
if (
|
||||
blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA
|
||||
or blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA
|
||||
):
|
||||
block_obj.sha3_uncles = block.get("sha3Uncles", "")
|
||||
block_obj.l1_block_number = hex_to_int(block.get("l1BlockNumber"))
|
||||
block_obj.send_count = hex_to_int(block.get("sendCount"))
|
||||
block_obj.send_root = block.get("sendRoot", "")
|
||||
block_obj.mix_hash = block.get("mixHash", "")
|
||||
|
||||
if blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
if blockchain_type == AvailableBlockchainType.XAI or blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
block_obj.sha3_uncles = block.get("sha3Uncles", "")
|
||||
block_obj.l1_block_number = hex_to_int(block.get("l1BlockNumber"))
|
||||
block_obj.send_count = hex_to_int(block.get("sendCount"))
|
||||
block_obj.send_root = block.get("sendRoot", "")
|
||||
block_obj.mix_hash = block.get("mixHash", "")
|
||||
|
||||
if blockchain_type == AvailableBlockchainType.XAI:
|
||||
block_obj.sha3_uncles = block.get("sha3Uncles", "")
|
||||
block_obj.l1_block_number = hex_to_int(block.get("l1BlockNumber"))
|
||||
block_obj.send_count = hex_to_int(block.get("sendCount"))
|
||||
block_obj.send_root = block.get("sendRoot", "")
|
||||
block_obj.mix_hash = block.get("mixHash", "")
|
||||
|
||||
if blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
block_obj.sha3_uncles = block.get("sha3Uncles", "")
|
||||
block_obj.l1_block_number = hex_to_int(block.get("l1BlockNumber"))
|
||||
block_obj.send_count = hex_to_int(block.get("sendCount"))
|
||||
block_obj.send_root = block.get("sendRoot", "")
|
||||
if (
|
||||
blockchain_type == AvailableBlockchainType.AVALANCHE
|
||||
or blockchain_type == AvailableBlockchainType.AVALANCHE_FUJI
|
||||
):
|
||||
block_obj.mix_hash = block.get("mixHash", "")
|
||||
block_obj.block_extra_data = block.get("blockExtraData")
|
||||
block_obj.block_gas_cost = block.get("blockGasCost")
|
||||
block_obj.ext_data_gas_used = block.get("extDataGasUsed", "")
|
||||
block_obj.ext_data_hash = block.get("extDataHash", "")
|
||||
|
||||
db_session.add(block_obj)
|
||||
|
||||
|
@ -237,16 +234,12 @@ def add_block_transactions(
|
|||
if tx.get("l1BatchTxIndex") is not None
|
||||
else None
|
||||
)
|
||||
if blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
tx_obj.y_parity = hex_to_int(tx.get("yParity"))
|
||||
|
||||
if blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
tx_obj.y_parity = hex_to_int(tx.get("yParity"))
|
||||
|
||||
if blockchain_type == AvailableBlockchainType.XAI:
|
||||
tx_obj.y_parity = hex_to_int(tx.get("yParity"))
|
||||
|
||||
if blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
if (
|
||||
blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA
|
||||
or blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA
|
||||
or blockchain_type == AvailableBlockchainType.XAI
|
||||
or blockchain_type == AvailableBlockchainType.XAI_SEPOLIA
|
||||
):
|
||||
tx_obj.y_parity = hex_to_int(tx.get("yParity"))
|
||||
|
||||
db_session.add(tx_obj)
|
||||
|
@ -255,7 +248,7 @@ def add_block_transactions(
|
|||
def get_latest_blocks(
|
||||
blockchain_type: AvailableBlockchainType,
|
||||
confirmations: int = 0,
|
||||
access_id: Optional[UUID] = None,
|
||||
web3_uri: Optional[str] = None,
|
||||
) -> Tuple[Optional[int], int]:
|
||||
"""
|
||||
Retrieve the latest block from the connected node (connection is created by the connect(AvailableBlockchainType) method).
|
||||
|
@ -263,7 +256,7 @@ def get_latest_blocks(
|
|||
If confirmations > 0, and the latest block on the node has block number N, this returns the block
|
||||
with block_number (N - confirmations)
|
||||
"""
|
||||
web3_client = connect(blockchain_type, access_id=access_id)
|
||||
web3_client = connect(blockchain_type, web3_uri=web3_uri)
|
||||
latest_block_number: int = web3_client.eth.block_number
|
||||
if confirmations > 0:
|
||||
latest_block_number -= confirmations
|
||||
|
@ -286,12 +279,12 @@ def crawl_blocks(
|
|||
blockchain_type: AvailableBlockchainType,
|
||||
blocks_numbers: List[int],
|
||||
with_transactions: bool = False,
|
||||
access_id: Optional[UUID] = None,
|
||||
web3_uri: Optional[str] = None,
|
||||
) -> None:
|
||||
"""
|
||||
Open database and geth sessions and fetch block data from blockchain.
|
||||
"""
|
||||
web3_client = connect(blockchain_type, access_id=access_id)
|
||||
web3_client = connect(blockchain_type, web3_uri=web3_uri)
|
||||
with yield_db_session_ctx() as db_session:
|
||||
pbar = tqdm(total=len(blocks_numbers))
|
||||
for block_number in blocks_numbers:
|
||||
|
@ -332,7 +325,7 @@ def check_missing_blocks(
|
|||
blockchain_type: AvailableBlockchainType,
|
||||
blocks_numbers: List[int],
|
||||
notransactions=False,
|
||||
access_id: Optional[UUID] = None,
|
||||
web3_uri: Optional[str] = None,
|
||||
) -> List[int]:
|
||||
"""
|
||||
Query block from postgres. If block does not presented in database,
|
||||
|
@ -371,7 +364,7 @@ def check_missing_blocks(
|
|||
[block[0], block[1]] for block in blocks_exist_raw_query.all()
|
||||
]
|
||||
|
||||
web3_client = connect(blockchain_type, access_id=access_id)
|
||||
web3_client = connect(blockchain_type, web3_uri=web3_uri)
|
||||
|
||||
blocks_exist_len = len(blocks_exist)
|
||||
pbar = tqdm(total=blocks_exist_len)
|
||||
|
@ -413,7 +406,7 @@ def crawl_blocks_executor(
|
|||
block_numbers_list: List[int],
|
||||
with_transactions: bool = False,
|
||||
num_processes: int = MOONSTREAM_CRAWL_WORKERS,
|
||||
access_id: Optional[UUID] = None,
|
||||
web3_uri: Optional[str] = None,
|
||||
) -> None:
|
||||
"""
|
||||
Execute crawler in processes.
|
||||
|
@ -442,7 +435,7 @@ def crawl_blocks_executor(
|
|||
if num_processes == 1:
|
||||
logger.warning("Executing block crawler in lazy mod")
|
||||
return crawl_blocks(
|
||||
blockchain_type, block_numbers_list, with_transactions, access_id=access_id
|
||||
blockchain_type, block_numbers_list, with_transactions, web3_uri=web3_uri
|
||||
)
|
||||
else:
|
||||
with ThreadPoolExecutor(max_workers=MOONSTREAM_CRAWL_WORKERS) as executor:
|
||||
|
@ -454,7 +447,7 @@ def crawl_blocks_executor(
|
|||
blockchain_type,
|
||||
block_chunk,
|
||||
with_transactions,
|
||||
access_id,
|
||||
web3_uri,
|
||||
)
|
||||
result.add_done_callback(record_error)
|
||||
results.append(result)
|
||||
|
|
|
@ -10,7 +10,6 @@ from web3 import Web3
|
|||
|
||||
from ..blockchain import connect
|
||||
from ..db import yield_db_session_ctx
|
||||
from ..settings import NB_CONTROLLER_ACCESS_ID
|
||||
from .deployment_crawler import ContractDeploymentCrawler, MoonstreamDataStore
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
@ -118,7 +117,7 @@ def run_crawler_desc(
|
|||
|
||||
def handle_parser(args: argparse.Namespace):
|
||||
with yield_db_session_ctx() as session:
|
||||
w3 = connect(AvailableBlockchainType.ETHEREUM, access_id=args.access_id)
|
||||
w3 = connect(AvailableBlockchainType.ETHEREUM, web3_uri=args.web3_uri)
|
||||
if args.order == "asc":
|
||||
run_crawler_asc(
|
||||
w3=w3,
|
||||
|
@ -156,10 +155,8 @@ def generate_parser():
|
|||
parser = argparse.ArgumentParser(description="Moonstream Deployment Crawler")
|
||||
|
||||
parser.add_argument(
|
||||
"--access-id",
|
||||
default=NB_CONTROLLER_ACCESS_ID,
|
||||
type=UUID,
|
||||
help="User access ID",
|
||||
"--web3-uri",
|
||||
help="Node JSON RPC uri",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
Moonstream crawlers CLI.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import logging
|
||||
|
@ -12,8 +13,8 @@ from enum import Enum
|
|||
from typing import Iterator, List
|
||||
from uuid import UUID
|
||||
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType
|
||||
import dateutil.parser # type: ignore
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType
|
||||
|
||||
from .blockchain import (
|
||||
DateRange,
|
||||
|
@ -23,7 +24,7 @@ from .blockchain import (
|
|||
trending,
|
||||
)
|
||||
from .publish import publish_json
|
||||
from .settings import MOONSTREAM_CRAWL_WORKERS, NB_CONTROLLER_ACCESS_ID
|
||||
from .settings import MOONSTREAM_CRAWL_WORKERS
|
||||
from .version import MOONCRAWL_VERSION
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
@ -96,7 +97,7 @@ def crawler_blocks_sync_handler(args: argparse.Namespace) -> None:
|
|||
latest_stored_block_number, latest_block_number = get_latest_blocks(
|
||||
AvailableBlockchainType(args.blockchain),
|
||||
args.confirmations,
|
||||
access_id=args.access_id,
|
||||
web3_uri=args.web3_uri,
|
||||
)
|
||||
if latest_stored_block_number is None:
|
||||
latest_stored_block_number = 0
|
||||
|
@ -140,7 +141,7 @@ def crawler_blocks_sync_handler(args: argparse.Namespace) -> None:
|
|||
block_numbers_list=blocks_numbers_list,
|
||||
with_transactions=True,
|
||||
num_processes=args.jobs,
|
||||
access_id=args.access_id,
|
||||
web3_uri=args.web3_uri,
|
||||
)
|
||||
logger.info(
|
||||
f"Synchronized blocks from {latest_stored_block_number} to {latest_block_number}"
|
||||
|
@ -159,7 +160,7 @@ def crawler_blocks_add_handler(args: argparse.Namespace) -> None:
|
|||
blockchain_type=AvailableBlockchainType(args.blockchain),
|
||||
block_numbers_list=blocks_numbers_list,
|
||||
with_transactions=True,
|
||||
access_id=args.access_id,
|
||||
web3_uri=args.web3_uri,
|
||||
)
|
||||
|
||||
logger.info(
|
||||
|
@ -184,7 +185,7 @@ def crawler_blocks_missing_handler(args: argparse.Namespace) -> None:
|
|||
_, latest_block_number = get_latest_blocks(
|
||||
AvailableBlockchainType(args.blockchain),
|
||||
confirmations,
|
||||
access_id=args.access_id,
|
||||
web3_uri=args.web3_uri,
|
||||
)
|
||||
start_block_number = (
|
||||
latest_block_number - shift if latest_block_number - shift >= 1 else 1
|
||||
|
@ -200,7 +201,7 @@ def crawler_blocks_missing_handler(args: argparse.Namespace) -> None:
|
|||
blockchain_type=AvailableBlockchainType(args.blockchain),
|
||||
blocks_numbers=blocks_numbers_list,
|
||||
notransactions=args.notransactions,
|
||||
access_id=args.access_id,
|
||||
web3_uri=args.web3_uri,
|
||||
)
|
||||
if len(missing_blocks_numbers) > 0:
|
||||
logger.info(f"Found {len(missing_blocks_numbers)} missing blocks")
|
||||
|
@ -217,7 +218,7 @@ def crawler_blocks_missing_handler(args: argparse.Namespace) -> None:
|
|||
block_numbers_list=missing_blocks_numbers_total,
|
||||
with_transactions=True,
|
||||
num_processes=1 if args.lazy else MOONSTREAM_CRAWL_WORKERS,
|
||||
access_id=args.access_id,
|
||||
web3_uri=args.web3_uri,
|
||||
)
|
||||
logger.info(
|
||||
f"Required {time.time() - startTime} with {MOONSTREAM_CRAWL_WORKERS} workers "
|
||||
|
@ -259,10 +260,8 @@ def main() -> None:
|
|||
time_now = datetime.now(timezone.utc)
|
||||
|
||||
parser.add_argument(
|
||||
"--access-id",
|
||||
default=NB_CONTROLLER_ACCESS_ID,
|
||||
type=UUID,
|
||||
help="User access ID",
|
||||
"--web3-uri",
|
||||
help="Node JSON RPC uri",
|
||||
)
|
||||
|
||||
# Blockchain blocks parser
|
||||
|
|
|
@ -11,11 +11,7 @@ from moonstreamdb.blockchain import (
|
|||
get_label_model,
|
||||
get_transaction_model,
|
||||
)
|
||||
from moonstreamdb.models import (
|
||||
Base,
|
||||
EthereumTransaction,
|
||||
PolygonTransaction,
|
||||
)
|
||||
from moonstreamdb.models import Base, EthereumTransaction, PolygonTransaction
|
||||
from moonworm.crawler.function_call_crawler import ( # type: ignore
|
||||
ContractFunctionCall,
|
||||
utfy_dict,
|
||||
|
@ -26,10 +22,7 @@ from tqdm import tqdm
|
|||
from web3 import Web3
|
||||
from web3._utils.events import get_event_data
|
||||
|
||||
from ..moonworm_crawler.db import (
|
||||
add_events_to_session,
|
||||
commit_session,
|
||||
)
|
||||
from ..moonworm_crawler.db import add_events_to_session, commit_session
|
||||
from ..moonworm_crawler.event_crawler import Event, get_block_timestamp
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
|
|
@ -10,7 +10,6 @@ from web3.middleware import geth_poa_middleware
|
|||
|
||||
from ..blockchain import connect
|
||||
from ..db import yield_db_session_ctx
|
||||
from ..settings import NB_CONTROLLER_ACCESS_ID
|
||||
from .base import crawl, get_checkpoint, populate_with_events
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
@ -39,7 +38,7 @@ def handle_nft_crawler(args: argparse.Namespace) -> None:
|
|||
logger.info(
|
||||
"No web3 provider URL provided, using default (blockchan.py: connect())"
|
||||
)
|
||||
web3 = connect(blockchain_type, access_id=args.access_id)
|
||||
web3 = connect(blockchain_type, web3_uri=args.web3_uri)
|
||||
else:
|
||||
logger.info(f"Using web3 provider URL: {args.web3}")
|
||||
web3 = Web3(
|
||||
|
@ -91,7 +90,7 @@ def populate_with_erc20_transfers(args: argparse.Namespace) -> None:
|
|||
logger.info(
|
||||
"No web3 provider URL provided, using default (blockchan.py: connect())"
|
||||
)
|
||||
web3 = connect(blockchain_type, access_id=args.access_id)
|
||||
web3 = connect(blockchain_type, web3_uri=args.web3_uri)
|
||||
else:
|
||||
logger.info(f"Using web3 provider URL: {args.web3}")
|
||||
web3 = Web3(
|
||||
|
@ -137,7 +136,7 @@ def handle_crawl(args: argparse.Namespace) -> None:
|
|||
logger.info(
|
||||
"No web3 provider URL provided, using default (blockchan.py: connect())"
|
||||
)
|
||||
web3 = connect(blockchain_type, access_id=args.access_id)
|
||||
web3 = connect(blockchain_type, web3_uri=args.web3_uri)
|
||||
else:
|
||||
logger.info(f"Using web3 provider URL: {args.web3}")
|
||||
web3 = Web3(
|
||||
|
@ -172,10 +171,8 @@ def main():
|
|||
subparsers = parser.add_subparsers()
|
||||
|
||||
parser.add_argument(
|
||||
"--access-id",
|
||||
default=NB_CONTROLLER_ACCESS_ID,
|
||||
type=UUID,
|
||||
help="User access ID",
|
||||
"--web3-uri",
|
||||
help="Node JSON RPC uri",
|
||||
)
|
||||
|
||||
crawl_parser = subparsers.add_parser("crawl", help="Crawl with abi")
|
||||
|
|
|
@ -1,24 +1,22 @@
|
|||
import argparse
|
||||
import json
|
||||
import logging
|
||||
from typing import cast, List
|
||||
import uuid
|
||||
from typing import List, cast
|
||||
|
||||
import requests # type: ignore
|
||||
from bugout.data import BugoutSearchResult
|
||||
|
||||
from .utils import get_results_for_moonstream_query, leaderboard_push_batch
|
||||
from ..settings import (
|
||||
MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
MOONSTREAM_LEADERBOARD_GENERATOR_JOURNAL_ID,
|
||||
MOONSTREAM_API_URL,
|
||||
MOONSTREAM_ENGINE_URL,
|
||||
MOONSTREAM_LEADERBOARD_GENERATOR_BATCH_SIZE,
|
||||
MOONSTREAM_LEADERBOARD_GENERATOR_JOURNAL_ID,
|
||||
MOONSTREAM_LEADERBOARD_GENERATOR_PUSH_TIMEOUT_SECONDS,
|
||||
)
|
||||
|
||||
from ..settings import bugout_client as bc
|
||||
|
||||
from .utils import get_results_for_moonstream_query, leaderboard_push_batch
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.setLevel(logging.INFO)
|
||||
|
|
|
@ -3,8 +3,7 @@ import json
|
|||
import logging
|
||||
import os
|
||||
import time
|
||||
from typing import Any, Dict, Optional, List
|
||||
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
import requests # type: ignore
|
||||
|
||||
|
@ -15,7 +14,6 @@ from ..settings import (
|
|||
MOONSTREAM_LEADERBOARD_GENERATOR_PUSH_TIMEOUT_SECONDS,
|
||||
)
|
||||
|
||||
|
||||
logging.basicConfig()
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -9,10 +9,7 @@ from urllib.error import HTTPError
|
|||
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType
|
||||
|
||||
from ..db import (
|
||||
yield_db_preping_session_ctx,
|
||||
yield_db_read_only_preping_session_ctx,
|
||||
)
|
||||
from ..db import yield_db_preping_session_ctx, yield_db_read_only_preping_session_ctx
|
||||
from .db import (
|
||||
clean_labels_from_db,
|
||||
get_current_metadata_for_address,
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import logging
|
||||
import json
|
||||
from typing import Dict, Any, Optional, List
|
||||
import logging
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType, get_label_model
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy.sql import text
|
||||
|
||||
from ..data import TokenURIs
|
||||
from ..settings import VIEW_STATE_CRAWLER_LABEL, METADATA_CRAWLER_LABEL, CRAWLER_LABEL
|
||||
from ..settings import CRAWLER_LABEL, METADATA_CRAWLER_LABEL, VIEW_STATE_CRAWLER_LABEL
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
@ -9,21 +9,20 @@ from web3.middleware import geth_poa_middleware
|
|||
|
||||
from ..db import yield_db_session_ctx
|
||||
from ..settings import (
|
||||
MOONSTREAM_MOONWORM_TASKS_JOURNAL,
|
||||
NB_CONTROLLER_ACCESS_ID,
|
||||
HISTORICAL_CRAWLER_STATUSES,
|
||||
HISTORICAL_CRAWLER_STATUS_TAG_PREFIXES,
|
||||
HISTORICAL_CRAWLER_STATUSES,
|
||||
MOONSTREAM_MOONWORM_TASKS_JOURNAL,
|
||||
)
|
||||
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,
|
||||
make_function_call_crawl_jobs,
|
||||
find_all_deployed_blocks,
|
||||
update_job_state_with_filters,
|
||||
moonworm_crawler_update_job_as_pickedup,
|
||||
update_job_state_with_filters,
|
||||
)
|
||||
from .db import get_first_labeled_block_number, get_last_labeled_block_number
|
||||
from .historical_crawler import historical_crawler
|
||||
|
@ -71,7 +70,7 @@ def handle_crawl(args: argparse.Namespace) -> None:
|
|||
logger.info(
|
||||
"No web3 provider URL provided, using default (blockchan.py: connect())"
|
||||
)
|
||||
web3 = _retry_connect_web3(blockchain_type, access_id=args.access_id)
|
||||
web3 = _retry_connect_web3(blockchain_type, web3_uri=args.web3_uri)
|
||||
else:
|
||||
logger.info(f"Using web3 provider URL: {args.web3}")
|
||||
web3 = Web3(
|
||||
|
@ -133,7 +132,7 @@ def handle_crawl(args: argparse.Namespace) -> None:
|
|||
args.min_sleep_time,
|
||||
args.heartbeat_interval,
|
||||
args.new_jobs_refetch_interval,
|
||||
access_id=args.access_id,
|
||||
web3_uri=args.web3_uri,
|
||||
)
|
||||
|
||||
|
||||
|
@ -250,7 +249,7 @@ def handle_historical_crawl(args: argparse.Namespace) -> None:
|
|||
logger.info(
|
||||
"No web3 provider URL provided, using default (blockchan.py: connect())"
|
||||
)
|
||||
web3 = _retry_connect_web3(blockchain_type, access_id=args.access_id)
|
||||
web3 = _retry_connect_web3(blockchain_type, web3_uri=args.web3_uri)
|
||||
else:
|
||||
logger.info(f"Using web3 provider URL: {args.web3}")
|
||||
web3 = Web3(
|
||||
|
@ -336,7 +335,7 @@ def handle_historical_crawl(args: argparse.Namespace) -> None:
|
|||
end_block,
|
||||
args.max_blocks_batch,
|
||||
args.min_sleep_time,
|
||||
access_id=args.access_id,
|
||||
web3_uri=args.web3_uri,
|
||||
addresses_deployment_blocks=addresses_deployment_blocks,
|
||||
)
|
||||
|
||||
|
@ -346,10 +345,8 @@ def main() -> None:
|
|||
parser.set_defaults(func=lambda _: parser.print_help())
|
||||
|
||||
parser.add_argument(
|
||||
"--access-id",
|
||||
default=NB_CONTROLLER_ACCESS_ID,
|
||||
type=UUID,
|
||||
help="User access ID",
|
||||
"--web3-uri",
|
||||
help="Node JSON RPC uri",
|
||||
)
|
||||
|
||||
subparsers = parser.add_subparsers()
|
||||
|
|
|
@ -100,7 +100,8 @@ def continuous_crawler(
|
|||
min_sleep_time: float = 0.1,
|
||||
heartbeat_interval: float = 60,
|
||||
new_jobs_refetch_interval: float = 120,
|
||||
access_id: Optional[UUID] = None,
|
||||
web3_uri: Optional[str] = None,
|
||||
max_insert_batch: int = 10000,
|
||||
):
|
||||
crawler_type = "continuous"
|
||||
assert (
|
||||
|
@ -118,7 +119,7 @@ def continuous_crawler(
|
|||
|
||||
jobs_refetchet_time = crawl_start_time
|
||||
if web3 is None:
|
||||
web3 = _retry_connect_web3(blockchain_type, access_id=access_id)
|
||||
web3 = _retry_connect_web3(blockchain_type, web3_uri=web3_uri)
|
||||
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
network = Network.ethereum
|
||||
|
@ -134,6 +135,8 @@ def continuous_crawler(
|
|||
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:
|
||||
|
@ -142,6 +145,10 @@ def continuous_crawler(
|
|||
network = Network.xai
|
||||
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
network = Network.xai_sepolia
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE:
|
||||
network = Network.avalanche
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE_FUJI:
|
||||
network = Network.avalanche_fuji
|
||||
else:
|
||||
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
|
||||
|
||||
|
@ -206,7 +213,16 @@ def continuous_crawler(
|
|||
f"Crawled {len(all_events)} events from {start_block} to {end_block}."
|
||||
)
|
||||
|
||||
add_events_to_session(db_session, all_events, blockchain_type)
|
||||
if len(all_events) > max_insert_batch:
|
||||
|
||||
for i in range(0, len(all_events), max_insert_batch):
|
||||
add_events_to_session(
|
||||
db_session,
|
||||
all_events[i : i + max_insert_batch],
|
||||
blockchain_type,
|
||||
)
|
||||
else:
|
||||
add_events_to_session(db_session, all_events, blockchain_type)
|
||||
|
||||
logger.info(
|
||||
f"Crawling function calls from {start_block} to {end_block}"
|
||||
|
@ -222,9 +238,18 @@ def continuous_crawler(
|
|||
f"Crawled {len(all_function_calls)} function calls from {start_block} to {end_block}."
|
||||
)
|
||||
|
||||
add_function_calls_to_session(
|
||||
db_session, all_function_calls, blockchain_type
|
||||
)
|
||||
if len(all_function_calls) > max_insert_batch:
|
||||
|
||||
for i in range(0, len(all_function_calls), max_insert_batch):
|
||||
add_function_calls_to_session(
|
||||
db_session,
|
||||
all_function_calls[i : i + max_insert_batch],
|
||||
blockchain_type,
|
||||
)
|
||||
else:
|
||||
add_function_calls_to_session(
|
||||
db_session, all_function_calls, blockchain_type
|
||||
)
|
||||
|
||||
current_time = datetime.utcnow()
|
||||
|
||||
|
@ -248,11 +273,11 @@ def continuous_crawler(
|
|||
|
||||
jobs_refetchet_time = current_time
|
||||
|
||||
commit_session(db_session)
|
||||
|
||||
if current_time - last_heartbeat_time > timedelta(
|
||||
seconds=heartbeat_interval
|
||||
):
|
||||
# Commiting to db
|
||||
commit_session(db_session)
|
||||
# Update heartbeat
|
||||
heartbeat_template["last_block"] = end_block
|
||||
heartbeat_template["current_time"] = _date_to_str(current_time)
|
||||
|
@ -287,7 +312,7 @@ def continuous_crawler(
|
|||
logger.error("Too many failures, exiting")
|
||||
raise e
|
||||
try:
|
||||
web3 = _retry_connect_web3(blockchain_type, access_id=access_id)
|
||||
web3 = _retry_connect_web3(blockchain_type, web3_uri=web3_uri)
|
||||
except Exception as err:
|
||||
logger.error(f"Failed to reconnect: {err}")
|
||||
logger.exception(err)
|
||||
|
|
|
@ -108,7 +108,7 @@ def _retry_connect_web3(
|
|||
blockchain_type: AvailableBlockchainType,
|
||||
retry_count: int = 10,
|
||||
sleep_time: float = 5,
|
||||
access_id: Optional[UUID] = None,
|
||||
web3_uri: Optional[str] = None,
|
||||
) -> Web3:
|
||||
"""
|
||||
Retry connecting to the blockchain.
|
||||
|
@ -116,7 +116,7 @@ def _retry_connect_web3(
|
|||
while retry_count > 0:
|
||||
retry_count -= 1
|
||||
try:
|
||||
web3 = connect(blockchain_type, access_id=access_id)
|
||||
web3 = connect(blockchain_type, web3_uri=web3_uri)
|
||||
web3.eth.block_number
|
||||
logger.info(f"Connected to {blockchain_type}")
|
||||
return web3
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import logging
|
||||
import json
|
||||
import logging
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType, get_label_model
|
||||
from moonstreamdb.models import Base
|
||||
from moonworm.crawler.function_call_crawler import ContractFunctionCall # type: ignore
|
||||
from sqlalchemy import Integer, String, column, exists, func, select, text, values
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from ..settings import CRAWLER_LABEL
|
||||
|
@ -152,36 +153,47 @@ def add_events_to_session(
|
|||
blockchain_type: AvailableBlockchainType,
|
||||
label_name=CRAWLER_LABEL,
|
||||
) -> None:
|
||||
|
||||
if len(events) == 0:
|
||||
return
|
||||
|
||||
label_model = get_label_model(blockchain_type)
|
||||
|
||||
events_hashes_to_save = [event.transaction_hash for event in events]
|
||||
events_hashes_to_save = set([event.transaction_hash for event in events])
|
||||
|
||||
existing_labels = (
|
||||
db_session.query(label_model.transaction_hash, label_model.log_index)
|
||||
# Define a CTE VALUES expression to escape big IN clause
|
||||
hashes_cte = select(
|
||||
values(column("transaction_hash", String), name="hashes").data(
|
||||
[(hash,) for hash in events_hashes_to_save]
|
||||
)
|
||||
).cte()
|
||||
|
||||
# Retrieve existing transaction hashes and registered log indexes
|
||||
query = (
|
||||
db_session.query(
|
||||
label_model.transaction_hash.label("transaction_hash"),
|
||||
func.array_agg(label_model.log_index).label("log_indexes"),
|
||||
)
|
||||
.filter(
|
||||
label_model.label == label_name,
|
||||
label_model.log_index != None,
|
||||
label_model.transaction_hash.in_(events_hashes_to_save),
|
||||
label_model.log_index.isnot(None),
|
||||
exists().where(
|
||||
label_model.transaction_hash == hashes_cte.c.transaction_hash
|
||||
),
|
||||
)
|
||||
.all()
|
||||
.group_by(label_model.transaction_hash)
|
||||
)
|
||||
|
||||
existing_labels_transactions = []
|
||||
existing_log_index_by_tx_hash: Dict[str, List[int]] = {}
|
||||
for label in existing_labels:
|
||||
if label[0] not in existing_labels_transactions:
|
||||
existing_labels_transactions.append(label[0])
|
||||
existing_log_index_by_tx_hash[label[0]] = []
|
||||
existing_log_index_by_tx_hash[label[0]].append(label[1])
|
||||
existing_log_index_by_tx_hash = {
|
||||
row.transaction_hash: row.log_indexes for row in query
|
||||
}
|
||||
|
||||
labels_to_save = []
|
||||
for event in events:
|
||||
if event.transaction_hash not in existing_labels_transactions:
|
||||
labels_to_save.append(_event_to_label(blockchain_type, event, label_name))
|
||||
elif (
|
||||
event.log_index not in existing_log_index_by_tx_hash[event.transaction_hash]
|
||||
):
|
||||
labels_to_save.append(_event_to_label(blockchain_type, event, label_name))
|
||||
labels_to_save = [
|
||||
_event_to_label(blockchain_type, event, label_name)
|
||||
for event in events
|
||||
if event.transaction_hash not in existing_log_index_by_tx_hash
|
||||
or event.log_index not in existing_log_index_by_tx_hash[event.transaction_hash]
|
||||
]
|
||||
|
||||
logger.info(f"Saving {len(labels_to_save)} event labels to session")
|
||||
db_session.add_all(labels_to_save)
|
||||
|
@ -193,27 +205,38 @@ def add_function_calls_to_session(
|
|||
blockchain_type: AvailableBlockchainType,
|
||||
label_name=CRAWLER_LABEL,
|
||||
) -> None:
|
||||
label_model = get_label_model(blockchain_type)
|
||||
transactions_hashes_to_save = [
|
||||
function_call.transaction_hash for function_call in function_calls
|
||||
]
|
||||
|
||||
existing_labels = (
|
||||
db_session.query(label_model.transaction_hash)
|
||||
.filter(
|
||||
label_model.label == label_name,
|
||||
label_model.log_index == None,
|
||||
label_model.transaction_hash.in_(transactions_hashes_to_save),
|
||||
)
|
||||
.all()
|
||||
if len(function_calls) == 0:
|
||||
return
|
||||
|
||||
label_model = get_label_model(blockchain_type)
|
||||
|
||||
transactions_hashes_to_save = list(
|
||||
set([function_call.transaction_hash for function_call in function_calls])
|
||||
)
|
||||
|
||||
existing_labels_transactions = [label[0] for label in existing_labels]
|
||||
# Define a CTE VALUES expression to escape big IN clause
|
||||
hashes_cte = select(
|
||||
values(column("transaction_hash", String), name="hashes").data(
|
||||
[(hash,) for hash in transactions_hashes_to_save]
|
||||
)
|
||||
).cte()
|
||||
|
||||
# Retrieve existing transaction hashes
|
||||
query = db_session.query(
|
||||
label_model.transaction_hash.label("transaction_hash")
|
||||
).filter(
|
||||
label_model.label == label_name,
|
||||
label_model.log_index.is_(None),
|
||||
exists().where(label_model.transaction_hash == hashes_cte.c.transaction_hash),
|
||||
)
|
||||
|
||||
existing_tx_hashes = [row.transaction_hash for row in query]
|
||||
|
||||
labels_to_save = [
|
||||
_function_call_to_label(blockchain_type, function_call)
|
||||
for function_call in function_calls
|
||||
if function_call.transaction_hash not in existing_labels_transactions
|
||||
if function_call.transaction_hash not in existing_tx_hashes
|
||||
]
|
||||
|
||||
logger.info(f"Saving {len(labels_to_save)} labels to session")
|
||||
|
|
|
@ -3,7 +3,10 @@ from dataclasses import dataclass
|
|||
from typing import Any, Dict, List, Optional, Tuple
|
||||
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType, get_block_model
|
||||
from moonworm.crawler.log_scanner import _fetch_events_chunk, _crawl_events as moonworm_autoscale_crawl_events # type: ignore
|
||||
from moonworm.crawler.log_scanner import (
|
||||
_crawl_events as moonworm_autoscale_crawl_events, # type: ignore
|
||||
)
|
||||
from moonworm.crawler.log_scanner import _fetch_events_chunk
|
||||
from sqlalchemy.orm.session import Session
|
||||
from sqlalchemy.sql.expression import and_
|
||||
from web3 import Web3
|
||||
|
|
|
@ -36,8 +36,9 @@ def historical_crawler(
|
|||
end_block: int,
|
||||
max_blocks_batch: int = 100,
|
||||
min_sleep_time: float = 0.1,
|
||||
access_id: Optional[UUID] = None,
|
||||
web3_uri: Optional[str] = None,
|
||||
addresses_deployment_blocks: Optional[Dict[ChecksumAddress, int]] = None,
|
||||
max_insert_batch: int = 10000,
|
||||
):
|
||||
assert max_blocks_batch > 0, "max_blocks_batch must be greater than 0"
|
||||
assert min_sleep_time > 0, "min_sleep_time must be greater than 0"
|
||||
|
@ -45,7 +46,7 @@ def historical_crawler(
|
|||
assert end_block > 0, "end_block must be greater than 0"
|
||||
|
||||
if web3 is None:
|
||||
web3 = _retry_connect_web3(blockchain_type, access_id=access_id)
|
||||
web3 = _retry_connect_web3(blockchain_type, web3_uri=web3_uri)
|
||||
|
||||
assert (
|
||||
web3.eth.block_number >= start_block
|
||||
|
@ -129,7 +130,18 @@ def historical_crawler(
|
|||
f"Crawled {len(all_events)} events from {start_block} to {batch_end_block}."
|
||||
)
|
||||
|
||||
add_events_to_session(db_session, all_events, blockchain_type)
|
||||
if len(all_events) > max_insert_batch:
|
||||
|
||||
for i in range(0, len(all_events), max_insert_batch):
|
||||
add_events_to_session(
|
||||
db_session,
|
||||
all_events[i : i + max_insert_batch],
|
||||
blockchain_type,
|
||||
)
|
||||
|
||||
else:
|
||||
|
||||
add_events_to_session(db_session, all_events, blockchain_type)
|
||||
|
||||
if function_call_crawl_jobs:
|
||||
logger.info(
|
||||
|
@ -146,9 +158,19 @@ def historical_crawler(
|
|||
f"Crawled {len(all_function_calls)} function calls from {start_block} to {batch_end_block}."
|
||||
)
|
||||
|
||||
add_function_calls_to_session(
|
||||
db_session, all_function_calls, blockchain_type
|
||||
)
|
||||
if len(all_function_calls) > max_insert_batch:
|
||||
|
||||
for i in range(0, len(all_function_calls), max_insert_batch):
|
||||
add_function_calls_to_session(
|
||||
db_session,
|
||||
all_function_calls[i : i + max_insert_batch],
|
||||
blockchain_type,
|
||||
)
|
||||
else:
|
||||
|
||||
add_function_calls_to_session(
|
||||
db_session, all_function_calls, blockchain_type
|
||||
)
|
||||
|
||||
if addresses_deployment_blocks:
|
||||
for address, deployment_block in addresses_deployment_blocks.items():
|
||||
|
@ -185,7 +207,7 @@ def historical_crawler(
|
|||
logger.error("Too many failures, exiting")
|
||||
raise e
|
||||
try:
|
||||
web3 = _retry_connect_web3(blockchain_type, access_id=access_id)
|
||||
web3 = _retry_connect_web3(blockchain_type, web3_uri=web3_uri)
|
||||
except Exception as err:
|
||||
logger.error(f"Failed to reconnect: {err}")
|
||||
logger.exception(err)
|
||||
|
|
|
@ -3,22 +3,20 @@ import csv
|
|||
import datetime
|
||||
import json
|
||||
import logging
|
||||
from io import StringIO
|
||||
from moonstream.client import Moonstream # type: ignore
|
||||
import requests # type: ignore
|
||||
import time
|
||||
from io import StringIO
|
||||
from typing import Any, Dict, Union
|
||||
from uuid import UUID
|
||||
|
||||
from typing import Any, Dict, Union
|
||||
import requests # type: ignore
|
||||
from moonstream.client import Moonstream # type: ignore
|
||||
|
||||
|
||||
from .queries import tokenomics_queries, cu_bank_queries, tokenomics_orange_dao_queries
|
||||
from ..actions import recive_S3_data_from_query
|
||||
from ..settings import (
|
||||
MOONSTREAM_S3_PUBLIC_DATA_BUCKET,
|
||||
MOONSTREAM_S3_PUBLIC_DATA_BUCKET_PREFIX,
|
||||
)
|
||||
|
||||
from .queries import cu_bank_queries, tokenomics_orange_dao_queries, tokenomics_queries
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
|
|
@ -78,77 +78,93 @@ except:
|
|||
)
|
||||
|
||||
# Geth connection address
|
||||
MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI", ""
|
||||
MOONSTREAM_NODE_ETHEREUM_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_ETHEREUM_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI == "":
|
||||
raise Exception("MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI env variable is not set")
|
||||
if MOONSTREAM_NODE_ETHEREUM_A_EXTERNAL_URI == "":
|
||||
raise Exception("MOONSTREAM_NODE_ETHEREUM_A_EXTERNAL_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_POLYGON_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_POLYGON_WEB3_PROVIDER_URI", ""
|
||||
MOONSTREAM_NODE_POLYGON_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_POLYGON_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_POLYGON_WEB3_PROVIDER_URI == "":
|
||||
raise Exception("MOONSTREAM_POLYGON_WEB3_PROVIDER_URI env variable is not set")
|
||||
if MOONSTREAM_NODE_POLYGON_A_EXTERNAL_URI == "":
|
||||
raise Exception("MOONSTREAM_NODE_POLYGON_A_EXTERNAL_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI", ""
|
||||
MOONSTREAM_NODE_MUMBAI_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_MUMBAI_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI == "":
|
||||
raise Exception("MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI env variable is not set")
|
||||
if MOONSTREAM_NODE_MUMBAI_A_EXTERNAL_URI == "":
|
||||
raise Exception("MOONSTREAM_NODE_MUMBAI_A_EXTERNAL_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_XDAI_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_XDAI_WEB3_PROVIDER_URI", ""
|
||||
MOONSTREAM_NODE_XDAI_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_XDAI_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_XDAI_WEB3_PROVIDER_URI == "":
|
||||
raise Exception("MOONSTREAM_XDAI_WEB3_PROVIDER_URI env variable is not set")
|
||||
if MOONSTREAM_NODE_XDAI_A_EXTERNAL_URI == "":
|
||||
raise Exception("MOONSTREAM_NODE_XDAI_A_EXTERNAL_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_WYRM_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_WYRM_WEB3_PROVIDER_URI", ""
|
||||
MOONSTREAM_NODE_ZKSYNC_ERA_TESTNET_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_ZKSYNC_ERA_TESTNET_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_WYRM_WEB3_PROVIDER_URI == "":
|
||||
raise Exception("MOONSTREAM_WYRM_WEB3_PROVIDER_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_ZKSYNC_ERA_TESTNET_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_ZKSYNC_ERA_TESTNET_WEB3_PROVIDER_URI", ""
|
||||
)
|
||||
if MOONSTREAM_ZKSYNC_ERA_TESTNET_WEB3_PROVIDER_URI == "":
|
||||
if MOONSTREAM_NODE_ZKSYNC_ERA_TESTNET_A_EXTERNAL_URI == "":
|
||||
raise Exception(
|
||||
"MOONSTREAM_ZKSYNC_ERA_TESTNET_WEB3_PROVIDER_URI env variable is not set"
|
||||
"MOONSTREAM_NODE_ZKSYNC_ERA_TESTNET_A_EXTERNAL_URI env variable is not set"
|
||||
)
|
||||
|
||||
MOONSTREAM_ZKSYNC_ERA_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_ZKSYNC_ERA_WEB3_PROVIDER_URI", ""
|
||||
MOONSTREAM_NODE_ZKSYNC_ERA_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_ZKSYNC_ERA_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_ZKSYNC_ERA_WEB3_PROVIDER_URI == "":
|
||||
raise Exception("MOONSTREAM_ZKSYNC_ERA_WEB3_PROVIDER_URI env variable is not set")
|
||||
if MOONSTREAM_NODE_ZKSYNC_ERA_A_EXTERNAL_URI == "":
|
||||
raise Exception("MOONSTREAM_NODE_ZKSYNC_ERA_A_EXTERNAL_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_ARBITRUM_NOVA_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_ARBITRUM_NOVA_WEB3_PROVIDER_URI", ""
|
||||
MOONSTREAM_NODE_ZKSYNC_ERA_SEPOLIA_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_ZKSYNC_ERA_SEPOLIA_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_ARBITRUM_NOVA_WEB3_PROVIDER_URI == "":
|
||||
if MOONSTREAM_NODE_ZKSYNC_ERA_SEPOLIA_A_EXTERNAL_URI == "":
|
||||
raise Exception(
|
||||
"MOONSTREAM_ARBITRUM_NOVA_WEB3_PROVIDER_URI env variable is not set"
|
||||
"MOONSTREAM_NODE_ZKSYNC_ERA_SEPOLIA_A_EXTERNAL_URI env variable is not set"
|
||||
)
|
||||
|
||||
MOONSTREAM_ARBITRUM_SEPOLIA_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_ARBITRUM_SEPOLIA_WEB3_PROVIDER_URI", ""
|
||||
MOONSTREAM_NODE_ARBITRUM_NOVA_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_ARBITRUM_NOVA_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_ARBITRUM_SEPOLIA_WEB3_PROVIDER_URI == "":
|
||||
if MOONSTREAM_NODE_ARBITRUM_NOVA_A_EXTERNAL_URI == "":
|
||||
raise Exception(
|
||||
"MOONSTREAM_ARBITRUM_SEPOLIA_WEB3_PROVIDER_URI env variable is not set"
|
||||
"MOONSTREAM_NODE_ARBITRUM_NOVA_A_EXTERNAL_URI env variable is not set"
|
||||
)
|
||||
|
||||
MOONSTREAM_XAI_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_XAI_WEB3_PROVIDER_URI", ""
|
||||
MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_XAI_WEB3_PROVIDER_URI == "":
|
||||
raise Exception("MOONSTREAM_XAI_WEB3_PROVIDER_URI env variable is not set")
|
||||
if MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI == "":
|
||||
raise Exception(
|
||||
"MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI env variable is not set"
|
||||
)
|
||||
|
||||
MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI", ""
|
||||
MOONSTREAM_NODE_XAI_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_XAI_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI == "":
|
||||
raise Exception("MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI env variable is not set")
|
||||
if MOONSTREAM_NODE_XAI_A_EXTERNAL_URI == "":
|
||||
raise Exception("MOONSTREAM_NODE_XAI_A_EXTERNAL_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_NODE_XAI_SEPOLIA_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_XAI_SEPOLIA_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_NODE_XAI_SEPOLIA_A_EXTERNAL_URI == "":
|
||||
raise Exception("MOONSTREAM_NODE_XAI_SEPOLIA_A_EXTERNAL_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_NODE_AVALANCHE_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_AVALANCHE_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_NODE_AVALANCHE_A_EXTERNAL_URI == "":
|
||||
raise Exception("MOONSTREAM_NODE_AVALANCHE_A_EXTERNAL_URI env variable is not set")
|
||||
|
||||
MOONSTREAM_NODE_AVALANCHE_FUJI_A_EXTERNAL_URI = os.environ.get(
|
||||
"MOONSTREAM_NODE_AVALANCHE_FUJI_A_EXTERNAL_URI", ""
|
||||
)
|
||||
if MOONSTREAM_NODE_AVALANCHE_FUJI_A_EXTERNAL_URI == "":
|
||||
raise Exception(
|
||||
"MOONSTREAM_NODE_AVALANCHE_FUJI_A_EXTERNAL_URI env variable is not set"
|
||||
)
|
||||
|
||||
MOONSTREAM_CRAWL_WORKERS = 4
|
||||
MOONSTREAM_CRAWL_WORKERS_RAW = os.environ.get("MOONSTREAM_CRAWL_WORKERS")
|
||||
|
|
|
@ -10,23 +10,19 @@ from pprint import pprint
|
|||
from typing import Any, Dict, List, Optional
|
||||
from uuid import UUID
|
||||
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType
|
||||
from moonstream.client import Moonstream # type: ignore
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType
|
||||
from web3.middleware import geth_poa_middleware
|
||||
|
||||
from mooncrawl.moonworm_crawler.crawler import _retry_connect_web3
|
||||
|
||||
from ..actions import recive_S3_data_from_query
|
||||
from ..blockchain import connect
|
||||
from ..db import PrePing_SessionLocal
|
||||
from ..settings import (
|
||||
INFURA_PROJECT_ID,
|
||||
NB_CONTROLLER_ACCESS_ID,
|
||||
infura_networks,
|
||||
multicall_contracts,
|
||||
)
|
||||
from ..settings import INFURA_PROJECT_ID, infura_networks, multicall_contracts
|
||||
from .db import clean_labels, commit_session, view_call_to_label
|
||||
from .Multicall2_interface import Contract as Multicall2
|
||||
from .web3_util import FunctionSignature, connect
|
||||
from .web3_util import FunctionSignature
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -306,8 +302,8 @@ def parse_jobs(
|
|||
web3_provider_uri: Optional[str],
|
||||
block_number: Optional[int],
|
||||
batch_size: int,
|
||||
access_id: UUID,
|
||||
moonstream_token: str,
|
||||
web3_uri: Optional[str] = None,
|
||||
):
|
||||
"""
|
||||
Parse jobs from list and generate web3 interfaces for each contract.
|
||||
|
@ -321,13 +317,12 @@ def parse_jobs(
|
|||
if web3_provider_uri is not None:
|
||||
try:
|
||||
logger.info(
|
||||
f"Connecting to blockchain : {blockchain_type} with custom provider!"
|
||||
f"Connecting to blockchain: {blockchain_type} with custom provider!"
|
||||
)
|
||||
|
||||
web3_client = connect(web3_provider_uri)
|
||||
|
||||
if blockchain_type != AvailableBlockchainType.ETHEREUM:
|
||||
web3_client.middleware_onion.inject(geth_poa_middleware, layer=0)
|
||||
web3_client = connect(
|
||||
blockchain_type=blockchain_type, web3_uri=web3_provider_uri
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
f"Web3 connection to custom provider {web3_provider_uri} failed error: {e}"
|
||||
|
@ -336,7 +331,7 @@ def parse_jobs(
|
|||
else:
|
||||
logger.info(f"Connecting to blockchain: {blockchain_type} with Node balancer.")
|
||||
web3_client = _retry_connect_web3(
|
||||
blockchain_type=blockchain_type, access_id=access_id
|
||||
blockchain_type=blockchain_type, web3_uri=web3_uri
|
||||
)
|
||||
|
||||
logger.info(f"Crawler started connected to blockchain: {blockchain_type}")
|
||||
|
@ -519,7 +514,7 @@ def handle_crawl(args: argparse.Namespace) -> None:
|
|||
|
||||
blockchain_type = AvailableBlockchainType(args.blockchain)
|
||||
|
||||
custom_web3_provider = args.custom_web3_provider
|
||||
custom_web3_provider = args.web3_uri
|
||||
|
||||
if args.infura and INFURA_PROJECT_ID is not None:
|
||||
if blockchain_type not in infura_networks:
|
||||
|
@ -535,8 +530,8 @@ def handle_crawl(args: argparse.Namespace) -> None:
|
|||
custom_web3_provider,
|
||||
args.block_number,
|
||||
args.batch_size,
|
||||
args.access_id,
|
||||
args.moonstream_token,
|
||||
args.web3_uri,
|
||||
)
|
||||
|
||||
|
||||
|
@ -563,7 +558,7 @@ def clean_labels_handler(args: argparse.Namespace) -> None:
|
|||
blockchain_type = AvailableBlockchainType(args.blockchain)
|
||||
|
||||
web3_client = _retry_connect_web3(
|
||||
blockchain_type=blockchain_type, access_id=args.access_id
|
||||
blockchain_type=blockchain_type, web3_uri=args.web3_uri
|
||||
)
|
||||
|
||||
logger.info(f"Label cleaner connected to blockchain: {blockchain_type}")
|
||||
|
@ -583,10 +578,8 @@ def main() -> None:
|
|||
parser.set_defaults(func=lambda _: parser.print_help())
|
||||
|
||||
parser.add_argument(
|
||||
"--access-id",
|
||||
default=NB_CONTROLLER_ACCESS_ID,
|
||||
type=UUID,
|
||||
help="User access ID",
|
||||
"--web3-uri",
|
||||
help="Node JSON RPC uri",
|
||||
)
|
||||
|
||||
subparsers = parser.add_subparsers()
|
||||
|
@ -614,12 +607,6 @@ def main() -> None:
|
|||
action="store_true",
|
||||
help="Use infura as web3 provider",
|
||||
)
|
||||
view_state_crawler_parser.add_argument(
|
||||
"--custom-web3-provider",
|
||||
"-w3",
|
||||
type=str,
|
||||
help="Type of blovkchain wich writng in database",
|
||||
)
|
||||
view_state_crawler_parser.add_argument(
|
||||
"--block-number", "-N", type=str, help="Block number."
|
||||
)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import logging
|
||||
import json
|
||||
from typing import Dict, Any
|
||||
import logging
|
||||
from typing import Any, Dict
|
||||
|
||||
from moonstreamdb.blockchain import AvailableBlockchainType, get_label_model
|
||||
from sqlalchemy.orm import Session
|
||||
|
|
|
@ -31,5 +31,36 @@
|
|||
}
|
||||
],
|
||||
"address": "0xe1dC516B1486Aba548eecD2947A11273518434a4"
|
||||
},
|
||||
{
|
||||
"type": "function",
|
||||
"stateMutability": "view",
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "uint256",
|
||||
"name": "tokenId",
|
||||
"type": "uint256",
|
||||
"value": {
|
||||
"type": "queryAPI",
|
||||
"query_url": "template_erc721_minting",
|
||||
"blockchain": "ethereum",
|
||||
"params": {
|
||||
"address": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
|
||||
},
|
||||
"keys": [
|
||||
"token_id"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"name": "tokenURI",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "string",
|
||||
"name": "",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"address": "0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"
|
||||
}
|
||||
]
|
|
@ -2,17 +2,17 @@ import getpass
|
|||
import os
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
|
||||
|
||||
from eth_abi import decode_single, encode_single
|
||||
from eth_account.account import Account # type: ignore
|
||||
from eth_abi import encode_single, decode_single
|
||||
from eth_typing.evm import ChecksumAddress
|
||||
from eth_utils import function_signature_to_4byte_selector
|
||||
from hexbytes.main import HexBytes
|
||||
from web3 import Web3
|
||||
from web3._utils.abi import normalize_event_input_types
|
||||
from web3.contract import ContractFunction
|
||||
from web3.providers.ipc import IPCProvider
|
||||
from web3.providers.rpc import HTTPProvider
|
||||
from web3.types import ABI, Nonce, TxParams, TxReceipt, Wei
|
||||
from web3._utils.abi import normalize_event_input_types
|
||||
|
||||
|
||||
class ContractConstructor:
|
||||
|
@ -165,28 +165,6 @@ def read_keys_from_env() -> Tuple[ChecksumAddress, str]:
|
|||
)
|
||||
|
||||
|
||||
def connect(web3_uri: str) -> Web3:
|
||||
web3_provider: Union[IPCProvider, HTTPProvider] = Web3.IPCProvider()
|
||||
if web3_uri.startswith("http://") or web3_uri.startswith("https://"):
|
||||
web3_provider = Web3.HTTPProvider(web3_uri)
|
||||
else:
|
||||
web3_provider = Web3.IPCProvider(web3_uri)
|
||||
web3_client = Web3(web3_provider)
|
||||
return web3_client
|
||||
|
||||
|
||||
def read_web3_provider_from_env() -> Web3:
|
||||
provider_path = os.environ.get("MOONWORM_WEB3_PROVIDER_URI")
|
||||
if provider_path is None:
|
||||
raise ValueError("MOONWORM_WEB3_PROVIDER_URI env variable is not set")
|
||||
return connect(provider_path)
|
||||
|
||||
|
||||
def read_web3_provider_from_cli() -> Web3:
|
||||
provider_path = input("Enter web3 uri path: ")
|
||||
return connect(provider_path)
|
||||
|
||||
|
||||
def cast_to_python_type(evm_type: str) -> Callable:
|
||||
if evm_type.startswith(("uint", "int")):
|
||||
return int
|
||||
|
|
|
@ -40,7 +40,6 @@ from ..settings import (
|
|||
MOONSTREAM_ADMIN_ACCESS_TOKEN,
|
||||
MOONSTREAM_S3_SMARTCONTRACTS_ABI_BUCKET,
|
||||
MOONSTREAM_S3_SMARTCONTRACTS_ABI_PREFIX,
|
||||
NB_CONTROLLER_ACCESS_ID,
|
||||
)
|
||||
from ..settings import bugout_client as bc
|
||||
|
||||
|
@ -370,7 +369,7 @@ def generate_list_of_names(
|
|||
def process_external_merged(
|
||||
external_calls: Dict[str, Dict[str, Any]],
|
||||
blockchain: AvailableBlockchainType,
|
||||
access_id: Optional[UUID] = None,
|
||||
web3_uri: Optional[str] = None,
|
||||
):
|
||||
"""
|
||||
Process external calls
|
||||
|
@ -415,7 +414,7 @@ def process_external_merged(
|
|||
logger.error(f"Error processing external call: {e}")
|
||||
|
||||
if external_calls_normalized:
|
||||
web3_client = connect(blockchain, access_id=access_id)
|
||||
web3_client = connect(blockchain, web3_uri=web3_uri)
|
||||
|
||||
for extcall in external_calls_normalized:
|
||||
try:
|
||||
|
@ -436,7 +435,7 @@ def process_external_merged(
|
|||
def process_external(
|
||||
abi_external_calls: List[Dict[str, Any]],
|
||||
blockchain: AvailableBlockchainType,
|
||||
access_id: Optional[UUID] = None,
|
||||
web3_uri: Optional[str] = None,
|
||||
):
|
||||
"""
|
||||
Request all required external data
|
||||
|
@ -482,7 +481,7 @@ def process_external(
|
|||
logger.error(f"Error processing external call: {e}")
|
||||
|
||||
if external_calls:
|
||||
web3_client = connect(blockchain, access_id=access_id)
|
||||
web3_client = connect(blockchain, web3_uri=web3_uri)
|
||||
|
||||
for extcall in external_calls:
|
||||
try:
|
||||
|
@ -533,7 +532,7 @@ def generate_web3_metrics(
|
|||
address: str,
|
||||
crawler_label: str,
|
||||
abi_json: Any,
|
||||
access_id: Optional[UUID] = None,
|
||||
web3_uri: Optional[str] = None,
|
||||
) -> List[Any]:
|
||||
"""
|
||||
Generate stats for cards components
|
||||
|
@ -546,7 +545,7 @@ def generate_web3_metrics(
|
|||
extention_data = process_external(
|
||||
abi_external_calls=abi_external_calls,
|
||||
blockchain=blockchain_type,
|
||||
access_id=access_id,
|
||||
web3_uri=web3_uri,
|
||||
)
|
||||
|
||||
extention_data.append(
|
||||
|
@ -876,7 +875,7 @@ def stats_generate_handler(args: argparse.Namespace):
|
|||
external_calls_results = process_external_merged(
|
||||
external_calls=merged_external_calls["merged"],
|
||||
blockchain=blockchain_type,
|
||||
access_id=args.access_id,
|
||||
web3_uri=args.web3_uri,
|
||||
)
|
||||
|
||||
for address in address_dashboard_id_subscription_id_tree.keys():
|
||||
|
@ -1042,7 +1041,7 @@ def stats_generate_api_task(
|
|||
timescales: List[str],
|
||||
dashboard: BugoutResource,
|
||||
subscription_by_id: Dict[str, BugoutJournalEntity],
|
||||
access_id: Optional[UUID] = None,
|
||||
web3_uri: Optional[str] = None,
|
||||
):
|
||||
"""
|
||||
Start crawler with generate.
|
||||
|
@ -1118,7 +1117,7 @@ def stats_generate_api_task(
|
|||
address=address, # type: ignore
|
||||
crawler_label=crawler_label,
|
||||
abi_json=abi_json,
|
||||
access_id=access_id,
|
||||
web3_uri=web3_uri,
|
||||
)
|
||||
|
||||
# Generate blocks state information
|
||||
|
@ -1195,10 +1194,8 @@ def main() -> None:
|
|||
parser.set_defaults(func=lambda _: parser.print_help())
|
||||
|
||||
parser.add_argument(
|
||||
"--access-id",
|
||||
default=NB_CONTROLLER_ACCESS_ID,
|
||||
type=UUID,
|
||||
help="User access ID",
|
||||
"--web3-uri",
|
||||
help="Node JSON RPC uri",
|
||||
)
|
||||
|
||||
subcommands = parser.add_subparsers(
|
||||
|
|
|
@ -1,21 +1,17 @@
|
|||
import csv
|
||||
from collections import OrderedDict
|
||||
import hashlib
|
||||
import json
|
||||
import logging
|
||||
import re
|
||||
from collections import OrderedDict
|
||||
from io import StringIO
|
||||
from typing import Any, Dict
|
||||
|
||||
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
from sqlalchemy.sql import text
|
||||
from sqlalchemy.sql.expression import TextClause
|
||||
|
||||
from ..actions import push_data_to_bucket
|
||||
from ..reporter import reporter
|
||||
|
||||
|
||||
from ..db import RO_pre_ping_query_engine
|
||||
from ..reporter import reporter
|
||||
from ..settings import MOONSTREAM_S3_QUERIES_BUCKET_PREFIX
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
Moonstream crawlers version.
|
||||
"""
|
||||
|
||||
MOONCRAWL_VERSION = "0.3.9"
|
||||
MOONCRAWL_VERSION = "0.4.1"
|
||||
|
|
|
@ -21,17 +21,19 @@ export MOONSTREAM_ADMIN_ACCESS_TOKEN="<Bugout_access_token_for_moonstream>"
|
|||
export NFT_HUMBUG_TOKEN="<Token_for_nft_crawler>"
|
||||
|
||||
# Blockchain nodes environment variables
|
||||
export MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI="https://<connection_path_uri_to_ethereum_node>"
|
||||
export MOONSTREAM_POLYGON_WEB3_PROVIDER_URI="https://<connection_path_uri_to_polygon_node>"
|
||||
export MOONSTREAM_MUMBAI_WEB3_PROVIDER_URI="https://<connection_path_uri_to_mumbai_node>"
|
||||
export MOONSTREAM_XDAI_WEB3_PROVIDER_URI="https://<connection_path_uri_to_xdai_node>"
|
||||
export MOONSTREAM_WYRM_WEB3_PROVIDER_URI="https://<connection_path_uri_to_wyrm_node>"
|
||||
export MOONSTREAM_ZKSYNC_ERA_TESTNET_WEB3_PROVIDER_URI="https://<connection_path_uri_to_zksync_era_testnet_node>"
|
||||
export MOONSTREAM_ZKSYNC_ERA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_zksync_era_node>"
|
||||
export MOONSTREAM_ARBITRUM_NOVA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_arbitrum_nova_node>"
|
||||
export MOONSTREAM_ARBITRUM_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_arbitrum_sepolia_node>"
|
||||
export MOONSTREAM_XAI_WEB3_PROVIDER_URI="https://<connection_path_uri_to_xai_node>"
|
||||
export MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_xai_sepolia_node>"
|
||||
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_MUMBAI_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_XDAI_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_ZKSYNC_ERA_TESTNET_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_ZKSYNC_ERA_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_ZKSYNC_ERA_SEPOLIA_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_ARBITRUM_NOVA_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_ARBITRUM_SEPOLIA_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_XAI_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_XAI_SEPOLIA_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_AVALANCHE_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_NODE_AVALANCHE_FUJI_A_EXTERNAL_URI="https://<connection_path_uri_to_node>"
|
||||
export NB_CONTROLLER_ACCESS_ID="<access_uuid_for_moonstream_nodebalancer>"
|
||||
|
||||
# AWS environment variables
|
||||
|
|
|
@ -949,8 +949,14 @@ def check_if_smart_contract(
|
|||
web3_client = connect(blockchain_type, user_token=user_token)
|
||||
|
||||
is_contract = False
|
||||
try:
|
||||
code = web3_client.eth.getCode(address)
|
||||
except Exception as e:
|
||||
logger.warning(
|
||||
f"Error while getting code of address: {e} in blockchain: {blockchain_type}"
|
||||
)
|
||||
code = b""
|
||||
|
||||
code = web3_client.eth.getCode(address)
|
||||
if code != b"":
|
||||
is_contract = True
|
||||
|
||||
|
|
|
@ -25,6 +25,18 @@ target_metadata = MoonstreamBase.metadata
|
|||
# my_important_option = config.get_main_option("my_important_option")
|
||||
# ... etc.
|
||||
from moonstreamdb.models import (
|
||||
ArbitrumNovaBlock,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumNovaTransaction,
|
||||
ArbitrumSepoliaBlock,
|
||||
ArbitrumSepoliaLabel,
|
||||
ArbitrumSepoliaTransaction,
|
||||
AvalancheBlock,
|
||||
AvalancheFujiBlock,
|
||||
AvalancheFujiLabel,
|
||||
AvalancheFujiTransaction,
|
||||
AvalancheLabel,
|
||||
AvalancheTransaction,
|
||||
ESDEventSignature,
|
||||
ESDFunctionSignature,
|
||||
EthereumBlock,
|
||||
|
@ -40,24 +52,24 @@ from moonstreamdb.models import (
|
|||
WyrmBlock,
|
||||
WyrmLabel,
|
||||
WyrmTransaction,
|
||||
XDaiBlock,
|
||||
XDaiLabel,
|
||||
XDaiTransaction,
|
||||
ZkSyncEraTestnetBlock,
|
||||
ZkSyncEraTestnetLabel,
|
||||
ZkSyncEraTestnetTransaction,
|
||||
ArbitrumNovaBlock,
|
||||
ArbitrumNovaTransaction,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumSepoliaBlock,
|
||||
ArbitrumSepoliaTransaction,
|
||||
ArbitrumSepoliaLabel,
|
||||
XaiBlock,
|
||||
XaiLabel,
|
||||
XaiTransaction,
|
||||
XaiSepoliaBlock,
|
||||
XaiSepoliaLabel,
|
||||
XaiSepoliaTransaction,
|
||||
XaiTransaction,
|
||||
XDaiBlock,
|
||||
XDaiLabel,
|
||||
XDaiTransaction,
|
||||
ZkSyncEraBlock,
|
||||
ZkSyncEraLabel,
|
||||
ZkSyncEraSepoliaBlock,
|
||||
ZkSyncEraSepoliaLabel,
|
||||
ZkSyncEraSepoliaTransaction,
|
||||
ZkSyncEraTestnetBlock,
|
||||
ZkSyncEraTestnetLabel,
|
||||
ZkSyncEraTestnetTransaction,
|
||||
ZkSyncEraTransaction,
|
||||
)
|
||||
|
||||
|
||||
|
@ -84,6 +96,12 @@ def include_symbol(tablename, schema):
|
|||
ZkSyncEraTestnetBlock.__tablename__,
|
||||
ZkSyncEraTestnetLabel.__tablename__,
|
||||
ZkSyncEraTestnetTransaction.__tablename__,
|
||||
ZkSyncEraBlock.__tablename__,
|
||||
ZkSyncEraLabel.__tablename__,
|
||||
ZkSyncEraTransaction.__tablename__,
|
||||
ZkSyncEraSepoliaBlock.__tablename__,
|
||||
ZkSyncEraSepoliaLabel.__tablename__,
|
||||
ZkSyncEraSepoliaTransaction.__tablename__,
|
||||
ArbitrumNovaBlock.__tablename__,
|
||||
ArbitrumNovaTransaction.__tablename__,
|
||||
ArbitrumNovaLabel.__tablename__,
|
||||
|
@ -96,6 +114,12 @@ def include_symbol(tablename, schema):
|
|||
XaiSepoliaBlock.__tablename__,
|
||||
XaiSepoliaLabel.__tablename__,
|
||||
XaiSepoliaTransaction.__tablename__,
|
||||
AvalancheBlock.__tablename__,
|
||||
AvalancheFujiBlock.__tablename__,
|
||||
AvalancheFujiLabel.__tablename__,
|
||||
AvalancheFujiTransaction.__tablename__,
|
||||
AvalancheLabel.__tablename__,
|
||||
AvalancheTransaction.__tablename__,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,331 @@
|
|||
"""Avalanche and Zksync Era Sepolia blockchains
|
||||
|
||||
Revision ID: a95cbab56a0b
|
||||
Revises: a99b97acc39e
|
||||
Create Date: 2024-03-28 11:08:06.677075
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'a95cbab56a0b'
|
||||
down_revision = 'a99b97acc39e'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('avalanche_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('mix_hash', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('block_extra_data', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('block_gas_cost', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('ext_data_gas_used', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('ext_data_hash', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.PrimaryKeyConstraint('block_number', name=op.f('pk_avalanche_blocks'))
|
||||
)
|
||||
op.create_index(op.f('ix_avalanche_blocks_block_number'), 'avalanche_blocks', ['block_number'], unique=True)
|
||||
op.create_index(op.f('ix_avalanche_blocks_hash'), 'avalanche_blocks', ['hash'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_blocks_timestamp'), 'avalanche_blocks', ['timestamp'], unique=False)
|
||||
op.create_table('avalanche_fuji_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('mix_hash', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('block_extra_data', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('block_gas_cost', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('ext_data_gas_used', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('ext_data_hash', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.PrimaryKeyConstraint('block_number', name=op.f('pk_avalanche_fuji_blocks'))
|
||||
)
|
||||
op.create_index(op.f('ix_avalanche_fuji_blocks_block_number'), 'avalanche_fuji_blocks', ['block_number'], unique=True)
|
||||
op.create_index(op.f('ix_avalanche_fuji_blocks_hash'), 'avalanche_fuji_blocks', ['hash'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_fuji_blocks_timestamp'), 'avalanche_fuji_blocks', ['timestamp'], unique=False)
|
||||
op.create_table('avalanche_fuji_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_avalanche_fuji_labels')),
|
||||
sa.UniqueConstraint('id', name=op.f('uq_avalanche_fuji_labels_id'))
|
||||
)
|
||||
op.create_index(op.f('ix_avalanche_fuji_labels_address'), 'avalanche_fuji_labels', ['address'], unique=False)
|
||||
op.create_index('ix_avalanche_fuji_labels_address_block_number', 'avalanche_fuji_labels', ['address', 'block_number'], unique=False)
|
||||
op.create_index('ix_avalanche_fuji_labels_address_block_timestamp', 'avalanche_fuji_labels', ['address', 'block_timestamp'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_fuji_labels_block_number'), 'avalanche_fuji_labels', ['block_number'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_fuji_labels_block_timestamp'), 'avalanche_fuji_labels', ['block_timestamp'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_fuji_labels_label'), 'avalanche_fuji_labels', ['label'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_fuji_labels_transaction_hash'), 'avalanche_fuji_labels', ['transaction_hash'], unique=False)
|
||||
op.create_table('avalanche_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_avalanche_labels')),
|
||||
sa.UniqueConstraint('id', name=op.f('uq_avalanche_labels_id'))
|
||||
)
|
||||
op.create_index(op.f('ix_avalanche_labels_address'), 'avalanche_labels', ['address'], unique=False)
|
||||
op.create_index('ix_avalanche_labels_address_block_number', 'avalanche_labels', ['address', 'block_number'], unique=False)
|
||||
op.create_index('ix_avalanche_labels_address_block_timestamp', 'avalanche_labels', ['address', 'block_timestamp'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_labels_block_number'), 'avalanche_labels', ['block_number'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_labels_block_timestamp'), 'avalanche_labels', ['block_timestamp'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_labels_label'), 'avalanche_labels', ['label'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_labels_transaction_hash'), 'avalanche_labels', ['transaction_hash'], unique=False)
|
||||
op.create_table('zksync_era_sepolia_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('mix_hash', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('sha3_uncles', sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column('l1_batch_number', sa.BigInteger(), nullable=True),
|
||||
sa.Column('l1_batch_timestamp', sa.BigInteger(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('block_number', name=op.f('pk_zksync_era_sepolia_blocks'))
|
||||
)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_blocks_block_number'), 'zksync_era_sepolia_blocks', ['block_number'], unique=True)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_blocks_hash'), 'zksync_era_sepolia_blocks', ['hash'], unique=False)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_blocks_timestamp'), 'zksync_era_sepolia_blocks', ['timestamp'], unique=False)
|
||||
op.create_table('zksync_era_sepolia_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_zksync_era_sepolia_labels')),
|
||||
sa.UniqueConstraint('id', name=op.f('uq_zksync_era_sepolia_labels_id'))
|
||||
)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_labels_address'), 'zksync_era_sepolia_labels', ['address'], unique=False)
|
||||
op.create_index('ix_zksync_era_sepolia_labels_address_block_number', 'zksync_era_sepolia_labels', ['address', 'block_number'], unique=False)
|
||||
op.create_index('ix_zksync_era_sepolia_labels_address_block_timestamp', 'zksync_era_sepolia_labels', ['address', 'block_timestamp'], unique=False)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_labels_block_number'), 'zksync_era_sepolia_labels', ['block_number'], unique=False)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_labels_block_timestamp'), 'zksync_era_sepolia_labels', ['block_timestamp'], unique=False)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_labels_label'), 'zksync_era_sepolia_labels', ['label'], unique=False)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_labels_transaction_hash'), 'zksync_era_sepolia_labels', ['transaction_hash'], unique=False)
|
||||
op.create_table('avalanche_fuji_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'], ['avalanche_fuji_blocks.block_number'], name=op.f('fk_avalanche_fuji_transactions_block_number_avalanche_fuji_blocks'), ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('hash', name=op.f('pk_avalanche_fuji_transactions'))
|
||||
)
|
||||
op.create_index(op.f('ix_avalanche_fuji_transactions_block_number'), 'avalanche_fuji_transactions', ['block_number'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_fuji_transactions_from_address'), 'avalanche_fuji_transactions', ['from_address'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_fuji_transactions_gas'), 'avalanche_fuji_transactions', ['gas'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_fuji_transactions_gas_price'), 'avalanche_fuji_transactions', ['gas_price'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_fuji_transactions_hash'), 'avalanche_fuji_transactions', ['hash'], unique=True)
|
||||
op.create_index(op.f('ix_avalanche_fuji_transactions_to_address'), 'avalanche_fuji_transactions', ['to_address'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_fuji_transactions_value'), 'avalanche_fuji_transactions', ['value'], unique=False)
|
||||
op.create_table('avalanche_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'], ['avalanche_blocks.block_number'], name=op.f('fk_avalanche_transactions_block_number_avalanche_blocks'), ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('hash', name=op.f('pk_avalanche_transactions'))
|
||||
)
|
||||
op.create_index(op.f('ix_avalanche_transactions_block_number'), 'avalanche_transactions', ['block_number'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_transactions_from_address'), 'avalanche_transactions', ['from_address'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_transactions_gas'), 'avalanche_transactions', ['gas'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_transactions_gas_price'), 'avalanche_transactions', ['gas_price'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_transactions_hash'), 'avalanche_transactions', ['hash'], unique=True)
|
||||
op.create_index(op.f('ix_avalanche_transactions_to_address'), 'avalanche_transactions', ['to_address'], unique=False)
|
||||
op.create_index(op.f('ix_avalanche_transactions_value'), 'avalanche_transactions', ['value'], unique=False)
|
||||
op.create_table('zksync_era_sepolia_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('l1_batch_number', sa.BigInteger(), nullable=True),
|
||||
sa.Column('l1_batch_tx_index', sa.BigInteger(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['block_number'], ['zksync_era_sepolia_blocks.block_number'], name=op.f('fk_zksync_era_sepolia_transactions_block_number_zksync_era_sepolia_blocks'), ondelete='CASCADE'),
|
||||
sa.PrimaryKeyConstraint('hash', name=op.f('pk_zksync_era_sepolia_transactions'))
|
||||
)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_transactions_block_number'), 'zksync_era_sepolia_transactions', ['block_number'], unique=False)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_transactions_from_address'), 'zksync_era_sepolia_transactions', ['from_address'], unique=False)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_transactions_gas'), 'zksync_era_sepolia_transactions', ['gas'], unique=False)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_transactions_gas_price'), 'zksync_era_sepolia_transactions', ['gas_price'], unique=False)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_transactions_hash'), 'zksync_era_sepolia_transactions', ['hash'], unique=True)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_transactions_to_address'), 'zksync_era_sepolia_transactions', ['to_address'], unique=False)
|
||||
op.create_index(op.f('ix_zksync_era_sepolia_transactions_value'), 'zksync_era_sepolia_transactions', ['value'], unique=False)
|
||||
op.create_index('ix_arbitrum_nova_labels_address_block_number', 'arbitrum_nova_labels', ['address', 'block_number'], unique=False)
|
||||
op.create_index('ix_arbitrum_nova_labels_address_block_timestamp', 'arbitrum_nova_labels', ['address', 'block_timestamp'], unique=False)
|
||||
op.create_index('ix_arbitrum_sepolia_labels_address_block_number', 'arbitrum_sepolia_labels', ['address', 'block_number'], unique=False)
|
||||
op.create_index('ix_arbitrum_sepolia_labels_address_block_timestamp', 'arbitrum_sepolia_labels', ['address', 'block_timestamp'], unique=False)
|
||||
op.create_unique_constraint(op.f('uq_arbitrum_sepolia_labels_id'), 'arbitrum_sepolia_labels', ['id'])
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_constraint(op.f('uq_zksync_era_testnet_labels_id'), 'zksync_era_testnet_labels', type_='unique')
|
||||
op.drop_constraint(op.f('uq_zksync_era_labels_id'), 'zksync_era_labels', type_='unique')
|
||||
op.drop_constraint(op.f('uq_xdai_labels_id'), 'xdai_labels', type_='unique')
|
||||
op.drop_constraint(op.f('uq_xai_labels_id'), 'xai_labels', type_='unique')
|
||||
op.drop_constraint(op.f('uq_wyrm_labels_id'), 'wyrm_labels', type_='unique')
|
||||
op.drop_constraint(op.f('uq_polygon_labels_id'), 'polygon_labels', type_='unique')
|
||||
op.drop_constraint(op.f('uq_opensea_crawler_state_id'), 'opensea_crawler_state', type_='unique')
|
||||
op.drop_constraint(op.f('uq_mumbai_labels_id'), 'mumbai_labels', type_='unique')
|
||||
op.create_index('idx_ethereum_labels_opensea_nft_name', 'ethereum_labels', [sa.text("(label_data ->> 'name'::text)")], unique=False)
|
||||
op.drop_constraint(op.f('uq_arbitrum_sepolia_labels_id'), 'arbitrum_sepolia_labels', type_='unique')
|
||||
op.drop_index('ix_arbitrum_sepolia_labels_address_block_timestamp', table_name='arbitrum_sepolia_labels')
|
||||
op.drop_index('ix_arbitrum_sepolia_labels_address_block_number', table_name='arbitrum_sepolia_labels')
|
||||
op.drop_index('ix_arbitrum_nova_labels_address_block_timestamp', table_name='arbitrum_nova_labels')
|
||||
op.drop_index('ix_arbitrum_nova_labels_address_block_number', table_name='arbitrum_nova_labels')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_transactions_value'), table_name='zksync_era_sepolia_transactions')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_transactions_to_address'), table_name='zksync_era_sepolia_transactions')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_transactions_hash'), table_name='zksync_era_sepolia_transactions')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_transactions_gas_price'), table_name='zksync_era_sepolia_transactions')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_transactions_gas'), table_name='zksync_era_sepolia_transactions')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_transactions_from_address'), table_name='zksync_era_sepolia_transactions')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_transactions_block_number'), table_name='zksync_era_sepolia_transactions')
|
||||
op.drop_table('zksync_era_sepolia_transactions')
|
||||
op.drop_index(op.f('ix_avalanche_transactions_value'), table_name='avalanche_transactions')
|
||||
op.drop_index(op.f('ix_avalanche_transactions_to_address'), table_name='avalanche_transactions')
|
||||
op.drop_index(op.f('ix_avalanche_transactions_hash'), table_name='avalanche_transactions')
|
||||
op.drop_index(op.f('ix_avalanche_transactions_gas_price'), table_name='avalanche_transactions')
|
||||
op.drop_index(op.f('ix_avalanche_transactions_gas'), table_name='avalanche_transactions')
|
||||
op.drop_index(op.f('ix_avalanche_transactions_from_address'), table_name='avalanche_transactions')
|
||||
op.drop_index(op.f('ix_avalanche_transactions_block_number'), table_name='avalanche_transactions')
|
||||
op.drop_table('avalanche_transactions')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_transactions_value'), table_name='avalanche_fuji_transactions')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_transactions_to_address'), table_name='avalanche_fuji_transactions')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_transactions_hash'), table_name='avalanche_fuji_transactions')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_transactions_gas_price'), table_name='avalanche_fuji_transactions')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_transactions_gas'), table_name='avalanche_fuji_transactions')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_transactions_from_address'), table_name='avalanche_fuji_transactions')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_transactions_block_number'), table_name='avalanche_fuji_transactions')
|
||||
op.drop_table('avalanche_fuji_transactions')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_labels_transaction_hash'), table_name='zksync_era_sepolia_labels')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_labels_label'), table_name='zksync_era_sepolia_labels')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_labels_block_timestamp'), table_name='zksync_era_sepolia_labels')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_labels_block_number'), table_name='zksync_era_sepolia_labels')
|
||||
op.drop_index('ix_zksync_era_sepolia_labels_address_block_timestamp', table_name='zksync_era_sepolia_labels')
|
||||
op.drop_index('ix_zksync_era_sepolia_labels_address_block_number', table_name='zksync_era_sepolia_labels')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_labels_address'), table_name='zksync_era_sepolia_labels')
|
||||
op.drop_table('zksync_era_sepolia_labels')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_blocks_timestamp'), table_name='zksync_era_sepolia_blocks')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_blocks_hash'), table_name='zksync_era_sepolia_blocks')
|
||||
op.drop_index(op.f('ix_zksync_era_sepolia_blocks_block_number'), table_name='zksync_era_sepolia_blocks')
|
||||
op.drop_table('zksync_era_sepolia_blocks')
|
||||
op.drop_index(op.f('ix_avalanche_labels_transaction_hash'), table_name='avalanche_labels')
|
||||
op.drop_index(op.f('ix_avalanche_labels_label'), table_name='avalanche_labels')
|
||||
op.drop_index(op.f('ix_avalanche_labels_block_timestamp'), table_name='avalanche_labels')
|
||||
op.drop_index(op.f('ix_avalanche_labels_block_number'), table_name='avalanche_labels')
|
||||
op.drop_index('ix_avalanche_labels_address_block_timestamp', table_name='avalanche_labels')
|
||||
op.drop_index('ix_avalanche_labels_address_block_number', table_name='avalanche_labels')
|
||||
op.drop_index(op.f('ix_avalanche_labels_address'), table_name='avalanche_labels')
|
||||
op.drop_table('avalanche_labels')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_labels_transaction_hash'), table_name='avalanche_fuji_labels')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_labels_label'), table_name='avalanche_fuji_labels')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_labels_block_timestamp'), table_name='avalanche_fuji_labels')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_labels_block_number'), table_name='avalanche_fuji_labels')
|
||||
op.drop_index('ix_avalanche_fuji_labels_address_block_timestamp', table_name='avalanche_fuji_labels')
|
||||
op.drop_index('ix_avalanche_fuji_labels_address_block_number', table_name='avalanche_fuji_labels')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_labels_address'), table_name='avalanche_fuji_labels')
|
||||
op.drop_table('avalanche_fuji_labels')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_blocks_timestamp'), table_name='avalanche_fuji_blocks')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_blocks_hash'), table_name='avalanche_fuji_blocks')
|
||||
op.drop_index(op.f('ix_avalanche_fuji_blocks_block_number'), table_name='avalanche_fuji_blocks')
|
||||
op.drop_table('avalanche_fuji_blocks')
|
||||
op.drop_index(op.f('ix_avalanche_blocks_timestamp'), table_name='avalanche_blocks')
|
||||
op.drop_index(op.f('ix_avalanche_blocks_hash'), table_name='avalanche_blocks')
|
||||
op.drop_index(op.f('ix_avalanche_blocks_block_number'), table_name='avalanche_blocks')
|
||||
op.drop_table('avalanche_blocks')
|
||||
# ### end Alembic commands ###
|
|
@ -2,6 +2,18 @@ from enum import Enum
|
|||
from typing import Type, Union
|
||||
|
||||
from .models import (
|
||||
ArbitrumNovaBlock,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumNovaTransaction,
|
||||
ArbitrumSepoliaBlock,
|
||||
ArbitrumSepoliaLabel,
|
||||
ArbitrumSepoliaTransaction,
|
||||
AvalancheBlock,
|
||||
AvalancheFujiBlock,
|
||||
AvalancheFujiLabel,
|
||||
AvalancheFujiTransaction,
|
||||
AvalancheLabel,
|
||||
AvalancheTransaction,
|
||||
EthereumBlock,
|
||||
EthereumLabel,
|
||||
EthereumTransaction,
|
||||
|
@ -14,27 +26,24 @@ from .models import (
|
|||
WyrmBlock,
|
||||
WyrmLabel,
|
||||
WyrmTransaction,
|
||||
XDaiBlock,
|
||||
XDaiLabel,
|
||||
XDaiTransaction,
|
||||
ZkSyncEraTestnetBlock,
|
||||
ZkSyncEraTestnetLabel,
|
||||
ZkSyncEraTestnetTransaction,
|
||||
ZkSyncEraBlock,
|
||||
ZkSyncEraLabel,
|
||||
ZkSyncEraTransaction,
|
||||
ArbitrumNovaBlock,
|
||||
ArbitrumNovaTransaction,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumSepoliaBlock,
|
||||
ArbitrumSepoliaTransaction,
|
||||
ArbitrumSepoliaLabel,
|
||||
XaiBlock,
|
||||
XaiLabel,
|
||||
XaiTransaction,
|
||||
XaiSepoliaBlock,
|
||||
XaiSepoliaLabel,
|
||||
XaiSepoliaTransaction,
|
||||
XaiTransaction,
|
||||
XDaiBlock,
|
||||
XDaiLabel,
|
||||
XDaiTransaction,
|
||||
ZkSyncEraBlock,
|
||||
ZkSyncEraLabel,
|
||||
ZkSyncEraSepoliaBlock,
|
||||
ZkSyncEraSepoliaLabel,
|
||||
ZkSyncEraSepoliaTransaction,
|
||||
ZkSyncEraTestnetBlock,
|
||||
ZkSyncEraTestnetLabel,
|
||||
ZkSyncEraTestnetTransaction,
|
||||
ZkSyncEraTransaction,
|
||||
)
|
||||
|
||||
|
||||
|
@ -44,12 +53,15 @@ class AvailableBlockchainType(Enum):
|
|||
MUMBAI = "mumbai"
|
||||
XDAI = "xdai"
|
||||
WYRM = "wyrm"
|
||||
ZKSYNC_ERA_TESTNET = "zksync_era_testnet"
|
||||
ZKSYNC_ERA = "zksync_era"
|
||||
ZKSYNC_ERA_TESTNET = "zksync_era_testnet"
|
||||
ZKSYNC_ERA_SEPOLIA = "zksync_era_sepolia"
|
||||
ARBITRUM_NOVA = "arbitrum_nova"
|
||||
ARBITRUM_SEPOLIA = "arbitrum_sepolia"
|
||||
XAI = "xai"
|
||||
XAI_SEPOLIA = "xai_sepolia"
|
||||
AVALANCHE = "avalanche"
|
||||
AVALANCHE_FUJI = "avalanche_fuji"
|
||||
|
||||
|
||||
def get_block_model(
|
||||
|
@ -63,10 +75,13 @@ def get_block_model(
|
|||
WyrmBlock,
|
||||
ZkSyncEraTestnetBlock,
|
||||
ZkSyncEraBlock,
|
||||
ZkSyncEraSepoliaBlock,
|
||||
ArbitrumNovaBlock,
|
||||
ArbitrumSepoliaBlock,
|
||||
XaiBlock,
|
||||
XaiSepoliaBlock,
|
||||
AvalancheBlock,
|
||||
AvalancheFujiBlock,
|
||||
]
|
||||
]:
|
||||
"""
|
||||
|
@ -82,10 +97,13 @@ def get_block_model(
|
|||
WyrmBlock,
|
||||
ZkSyncEraTestnetBlock,
|
||||
ZkSyncEraBlock,
|
||||
ZkSyncEraSepoliaBlock,
|
||||
ArbitrumNovaBlock,
|
||||
ArbitrumSepoliaBlock,
|
||||
XaiBlock,
|
||||
XaiSepoliaBlock,
|
||||
AvalancheBlock,
|
||||
AvalancheFujiBlock,
|
||||
]
|
||||
]
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
|
@ -102,6 +120,8 @@ def get_block_model(
|
|||
block_model = ZkSyncEraTestnetBlock
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA:
|
||||
block_model = ZkSyncEraBlock
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_SEPOLIA:
|
||||
block_model = ZkSyncEraSepoliaBlock
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
block_model = ArbitrumNovaBlock
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
|
@ -110,6 +130,10 @@ def get_block_model(
|
|||
block_model = XaiBlock
|
||||
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
block_model = XaiSepoliaBlock
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE:
|
||||
block_model = AvalancheBlock
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE_FUJI:
|
||||
block_model = AvalancheFujiBlock
|
||||
else:
|
||||
raise Exception("Unsupported blockchain type provided")
|
||||
|
||||
|
@ -127,10 +151,13 @@ def get_label_model(
|
|||
WyrmLabel,
|
||||
ZkSyncEraTestnetLabel,
|
||||
ZkSyncEraLabel,
|
||||
ZkSyncEraSepoliaLabel,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumSepoliaLabel,
|
||||
XaiLabel,
|
||||
XaiSepoliaLabel,
|
||||
AvalancheLabel,
|
||||
AvalancheFujiLabel,
|
||||
]
|
||||
]:
|
||||
"""
|
||||
|
@ -146,10 +173,13 @@ def get_label_model(
|
|||
WyrmLabel,
|
||||
ZkSyncEraTestnetLabel,
|
||||
ZkSyncEraLabel,
|
||||
ZkSyncEraSepoliaLabel,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumSepoliaLabel,
|
||||
XaiLabel,
|
||||
XaiSepoliaLabel,
|
||||
AvalancheLabel,
|
||||
AvalancheFujiLabel,
|
||||
]
|
||||
]
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
|
@ -166,6 +196,8 @@ def get_label_model(
|
|||
label_model = ZkSyncEraTestnetLabel
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA:
|
||||
label_model = ZkSyncEraLabel
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_SEPOLIA:
|
||||
label_model = ZkSyncEraSepoliaLabel
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
label_model = ArbitrumNovaLabel
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
|
@ -174,6 +206,10 @@ def get_label_model(
|
|||
label_model = XaiLabel
|
||||
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
label_model = XaiSepoliaLabel
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE:
|
||||
label_model = AvalancheLabel
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE_FUJI:
|
||||
label_model = AvalancheFujiLabel
|
||||
else:
|
||||
raise Exception("Unsupported blockchain type provided")
|
||||
|
||||
|
@ -191,10 +227,13 @@ def get_transaction_model(
|
|||
WyrmTransaction,
|
||||
ZkSyncEraTestnetTransaction,
|
||||
ZkSyncEraTransaction,
|
||||
ZkSyncEraSepoliaTransaction,
|
||||
ArbitrumNovaTransaction,
|
||||
ArbitrumSepoliaTransaction,
|
||||
XaiTransaction,
|
||||
XaiSepoliaTransaction,
|
||||
AvalancheTransaction,
|
||||
AvalancheFujiTransaction,
|
||||
]
|
||||
]:
|
||||
"""
|
||||
|
@ -210,10 +249,13 @@ def get_transaction_model(
|
|||
WyrmTransaction,
|
||||
ZkSyncEraTestnetTransaction,
|
||||
ZkSyncEraTransaction,
|
||||
ZkSyncEraSepoliaTransaction,
|
||||
ArbitrumNovaTransaction,
|
||||
ArbitrumSepoliaTransaction,
|
||||
XaiTransaction,
|
||||
XaiSepoliaTransaction,
|
||||
AvalancheTransaction,
|
||||
AvalancheFujiTransaction,
|
||||
]
|
||||
]
|
||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||
|
@ -230,6 +272,8 @@ def get_transaction_model(
|
|||
transaction_model = ZkSyncEraTestnetTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA:
|
||||
transaction_model = ZkSyncEraTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.ZKSYNC_ERA_SEPOLIA:
|
||||
transaction_model = ZkSyncEraSepoliaTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_NOVA:
|
||||
transaction_model = ArbitrumNovaTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.ARBITRUM_SEPOLIA:
|
||||
|
@ -238,6 +282,10 @@ def get_transaction_model(
|
|||
transaction_model = XaiTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
transaction_model = XaiSepoliaTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE:
|
||||
transaction_model = AvalancheTransaction
|
||||
elif blockchain_type == AvailableBlockchainType.AVALANCHE_FUJI:
|
||||
transaction_model = AvalancheFujiTransaction
|
||||
else:
|
||||
raise Exception("Unsupported blockchain type provided")
|
||||
|
||||
|
|
|
@ -801,6 +801,122 @@ class ZkSyncEraTestnetLabel(Base): # type: ignore
|
|||
)
|
||||
|
||||
|
||||
class ZkSyncEraSepoliaBlock(Base): # type: ignore
|
||||
__tablename__ = "zksync_era_sepolia_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
|
||||
)
|
||||
|
||||
mix_hash = Column(VARCHAR(256), nullable=True)
|
||||
sha3_uncles = Column(VARCHAR(256), nullable=True)
|
||||
|
||||
l1_batch_number = Column(BigInteger, nullable=True)
|
||||
l1_batch_timestamp = Column(BigInteger, nullable=True)
|
||||
|
||||
|
||||
class ZkSyncEraSepoliaTransaction(Base): # type: ignore
|
||||
__tablename__ = "zksync_era_sepolia_transactions"
|
||||
|
||||
hash = Column(
|
||||
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
||||
)
|
||||
block_number = Column(
|
||||
BigInteger,
|
||||
ForeignKey("zksync_era_sepolia_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
|
||||
)
|
||||
|
||||
l1_batch_number = Column(BigInteger, nullable=True)
|
||||
l1_batch_tx_index = Column(BigInteger, nullable=True)
|
||||
|
||||
|
||||
class ZkSyncEraSepoliaLabel(Base): # type: ignore
|
||||
__tablename__ = "zksync_era_sepolia_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_zksync_era_sepolia_labels_address_block_number",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_zksync_era_sepolia_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 ArbitrumNovaBlock(Base): # type: ignore
|
||||
__tablename__ = "arbitrum_nova_blocks"
|
||||
|
||||
|
@ -870,6 +986,21 @@ class ArbitrumNovaTransaction(Base): # type: ignore
|
|||
class ArbitrumNovaLabel(Base): # type: ignore
|
||||
__tablename__ = "arbitrum_nova_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_arbitrum_nova_labels_address_block_number",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_arbitrum_nova_labels_address_block_timestamp",
|
||||
"address",
|
||||
"block_timestamp",
|
||||
unique=False,
|
||||
),
|
||||
)
|
||||
|
||||
id = Column(
|
||||
UUID(as_uuid=True),
|
||||
primary_key=True,
|
||||
|
@ -970,6 +1101,21 @@ class ArbitrumSepoliaTransaction(Base): # type: ignore
|
|||
class ArbitrumSepoliaLabel(Base): # type: ignore
|
||||
__tablename__ = "arbitrum_sepolia_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_arbitrum_sepolia_labels_address_block_number",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_arbitrum_sepolia_labels_address_block_timestamp",
|
||||
"address",
|
||||
"block_timestamp",
|
||||
unique=False,
|
||||
),
|
||||
)
|
||||
|
||||
id = Column(
|
||||
UUID(as_uuid=True),
|
||||
primary_key=True,
|
||||
|
@ -1070,6 +1216,21 @@ class XaiTransaction(Base): # type: ignore
|
|||
class XaiLabel(Base): # type: ignore
|
||||
__tablename__ = "xai_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_xai_labels_address_block_number",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_xai_labels_address_block_timestamp",
|
||||
"address",
|
||||
"block_timestamp",
|
||||
unique=False,
|
||||
),
|
||||
)
|
||||
|
||||
id = Column(
|
||||
UUID(as_uuid=True),
|
||||
primary_key=True,
|
||||
|
@ -1170,6 +1331,247 @@ class XaiSepoliaTransaction(Base): # type: ignore
|
|||
class XaiSepoliaLabel(Base): # type: ignore
|
||||
__tablename__ = "xai_sepolia_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_xai_sepolia_labels_address_block_number",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_xai_sepolia_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 AvalancheBlock(Base): # type: ignore
|
||||
__tablename__ = "avalanche_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
|
||||
)
|
||||
|
||||
mix_hash = Column(VARCHAR(256), nullable=True)
|
||||
block_extra_data = Column(VARCHAR(256), nullable=True)
|
||||
block_gas_cost = Column(VARCHAR(256), nullable=True)
|
||||
ext_data_gas_used = Column(VARCHAR(256), nullable=True)
|
||||
ext_data_hash = Column(VARCHAR(256), nullable=True)
|
||||
|
||||
|
||||
class AvalancheTransaction(Base): # type: ignore
|
||||
__tablename__ = "avalanche_transactions"
|
||||
|
||||
hash = Column(
|
||||
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
||||
)
|
||||
block_number = Column(
|
||||
BigInteger,
|
||||
ForeignKey("avalanche_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 AvalancheLabel(Base): # type: ignore
|
||||
__tablename__ = "avalanche_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_avalanche_labels_address_block_number",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_avalanche_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 AvalancheFujiBlock(Base): # type: ignore
|
||||
__tablename__ = "avalanche_fuji_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
|
||||
)
|
||||
|
||||
mix_hash = Column(VARCHAR(256), nullable=True)
|
||||
block_extra_data = Column(VARCHAR(256), nullable=True)
|
||||
block_gas_cost = Column(VARCHAR(256), nullable=True)
|
||||
ext_data_gas_used = Column(VARCHAR(256), nullable=True)
|
||||
ext_data_hash = Column(VARCHAR(256), nullable=True)
|
||||
|
||||
|
||||
class AvalancheFujiTransaction(Base): # type: ignore
|
||||
__tablename__ = "avalanche_fuji_transactions"
|
||||
|
||||
hash = Column(
|
||||
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
||||
)
|
||||
block_number = Column(
|
||||
BigInteger,
|
||||
ForeignKey("avalanche_fuji_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 AvalancheFujiLabel(Base): # type: ignore
|
||||
__tablename__ = "avalanche_fuji_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_avalanche_fuji_labels_address_block_number",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_avalanche_fuji_labels_address_block_timestamp",
|
||||
"address",
|
||||
"block_timestamp",
|
||||
unique=False,
|
||||
),
|
||||
)
|
||||
|
||||
id = Column(
|
||||
UUID(as_uuid=True),
|
||||
primary_key=True,
|
||||
|
|
|
@ -2,6 +2,18 @@ from enum import Enum
|
|||
from typing import Dict, Union
|
||||
|
||||
from .models import (
|
||||
ArbitrumNovaBlock,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumNovaTransaction,
|
||||
ArbitrumSepoliaBlock,
|
||||
ArbitrumSepoliaLabel,
|
||||
ArbitrumSepoliaTransaction,
|
||||
AvalancheBlock,
|
||||
AvalancheFujiBlock,
|
||||
AvalancheFujiLabel,
|
||||
AvalancheFujiTransaction,
|
||||
AvalancheLabel,
|
||||
AvalancheTransaction,
|
||||
Base,
|
||||
EthereumBlock,
|
||||
EthereumLabel,
|
||||
|
@ -15,27 +27,24 @@ from .models import (
|
|||
WyrmBlock,
|
||||
WyrmLabel,
|
||||
WyrmTransaction,
|
||||
XDaiBlock,
|
||||
XDaiLabel,
|
||||
XDaiTransaction,
|
||||
ZkSyncEraTestnetBlock,
|
||||
ZkSyncEraTestnetLabel,
|
||||
ZkSyncEraTestnetTransaction,
|
||||
ZkSyncEraBlock,
|
||||
ZkSyncEraLabel,
|
||||
ZkSyncEraTransaction,
|
||||
ArbitrumNovaBlock,
|
||||
ArbitrumNovaTransaction,
|
||||
ArbitrumNovaLabel,
|
||||
ArbitrumSepoliaBlock,
|
||||
ArbitrumSepoliaTransaction,
|
||||
ArbitrumSepoliaLabel,
|
||||
XaiBlock,
|
||||
XaiLabel,
|
||||
XaiTransaction,
|
||||
XaiSepoliaBlock,
|
||||
XaiSepoliaLabel,
|
||||
XaiSepoliaTransaction,
|
||||
XaiTransaction,
|
||||
XDaiBlock,
|
||||
XDaiLabel,
|
||||
XDaiTransaction,
|
||||
ZkSyncEraBlock,
|
||||
ZkSyncEraLabel,
|
||||
ZkSyncEraSepoliaBlock,
|
||||
ZkSyncEraSepoliaLabel,
|
||||
ZkSyncEraSepoliaTransaction,
|
||||
ZkSyncEraTestnetBlock,
|
||||
ZkSyncEraTestnetLabel,
|
||||
ZkSyncEraTestnetTransaction,
|
||||
ZkSyncEraTransaction,
|
||||
)
|
||||
|
||||
|
||||
|
@ -47,10 +56,13 @@ class Network(Enum):
|
|||
wyrm = "wyrm"
|
||||
zksync_era_testnet = "zksync_era_testnet"
|
||||
zksync_era = "zksync_era"
|
||||
zksync_era_sepolia = "zksync_era_sepolia"
|
||||
arbitrum_nova = "arbitrum_nova"
|
||||
arbitrum_sepolia = "arbitrum_sepolia"
|
||||
xai = "xai"
|
||||
xai_sepolia = "xai_sepolia"
|
||||
avalanche = "avalanche"
|
||||
avalanche_fuji = "avalanche_fuji"
|
||||
|
||||
|
||||
tx_raw_types = Union[
|
||||
|
@ -61,10 +73,13 @@ tx_raw_types = Union[
|
|||
XDaiTransaction,
|
||||
ZkSyncEraTestnetTransaction,
|
||||
ZkSyncEraTransaction,
|
||||
ZkSyncEraSepoliaTransaction,
|
||||
ArbitrumNovaTransaction,
|
||||
ArbitrumSepoliaTransaction,
|
||||
XaiTransaction,
|
||||
XaiSepoliaTransaction,
|
||||
AvalancheTransaction,
|
||||
AvalancheFujiTransaction,
|
||||
]
|
||||
|
||||
MODELS: Dict[Network, Dict[str, Base]] = {
|
||||
|
@ -99,6 +114,11 @@ MODELS: Dict[Network, Dict[str, Base]] = {
|
|||
"transactions": ZkSyncEraTestnetTransaction,
|
||||
},
|
||||
Network.zksync_era: {
|
||||
"blocks": ZkSyncEraSepoliaBlock,
|
||||
"labels": ZkSyncEraSepoliaLabel,
|
||||
"transactions": ZkSyncEraSepoliaTransaction,
|
||||
},
|
||||
Network.zksync_era_sepolia: {
|
||||
"blocks": ZkSyncEraBlock,
|
||||
"labels": ZkSyncEraLabel,
|
||||
"transactions": ZkSyncEraTransaction,
|
||||
|
@ -123,4 +143,14 @@ MODELS: Dict[Network, Dict[str, Base]] = {
|
|||
"labels": XaiSepoliaLabel,
|
||||
"transactions": XaiSepoliaTransaction,
|
||||
},
|
||||
Network.avalanche: {
|
||||
"blocks": AvalancheBlock,
|
||||
"labels": AvalancheLabel,
|
||||
"transactions": AvalancheTransaction,
|
||||
},
|
||||
Network.avalanche_fuji: {
|
||||
"blocks": AvalancheFujiBlock,
|
||||
"labels": AvalancheFujiLabel,
|
||||
"transactions": AvalancheFujiTransaction,
|
||||
},
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue