kopia lustrzana https://github.com/bugout-dev/moonstream
Change xai testnet -> sepolia.
rodzic
41b817660a
commit
3f9a2923a4
|
@ -146,11 +146,11 @@ XAI_MISSING_TIMER_FILE="xai-missing.timer"
|
||||||
XAI_MOONWORM_CRAWLER_SERVICE_FILE="xai-moonworm-crawler.service"
|
XAI_MOONWORM_CRAWLER_SERVICE_FILE="xai-moonworm-crawler.service"
|
||||||
XAI_SYNCHRONIZE_SERVICE="xai-synchronize.service"
|
XAI_SYNCHRONIZE_SERVICE="xai-synchronize.service"
|
||||||
|
|
||||||
# Xai testnet
|
# Xai sepolia
|
||||||
XAI_TESTNET_MISSING_SERVICE_FILE="xai-testnet-missing.service"
|
XAI_SEPOLIA_MISSING_SERVICE_FILE="xai-sepolia-missing.service"
|
||||||
XAI_TESTNET_MISSING_TIMER_FILE="xai-testnet-missing.timer"
|
XAI_SEPOLIA_MISSING_TIMER_FILE="xai-sepolia-missing.timer"
|
||||||
XAI_TESTNET_MOONWORM_CRAWLER_SERVICE_FILE="xai-testnet-moonworm-crawler.service"
|
XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE="xai-sepolia-moonworm-crawler.service"
|
||||||
XAI_TESTNET_SYNCHRONIZE_SERVICE="xai-testnet-synchronize.service"
|
XAI_SEPOLIA_SYNCHRONIZE_SERVICE="xai-sepolia-synchronize.service"
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
@ -724,28 +724,28 @@ XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||||
|
|
||||||
|
|
||||||
# Xai testnet
|
# Xai sepolia
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
echo -e "${PREFIX_INFO} Replacing existing Xai testnet block with transactions syncronizer service definition with ${XAI_TESTNET_SYNCHRONIZE_SERVICE}"
|
echo -e "${PREFIX_INFO} Replacing existing Xai sepolia block with transactions syncronizer service definition with ${XAI_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||||
chmod 644 "${SCRIPT_DIR}/${XAI_TESTNET_SYNCHRONIZE_SERVICE}"
|
chmod 644 "${SCRIPT_DIR}/${XAI_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||||
cp "${SCRIPT_DIR}/${XAI_TESTNET_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${XAI_TESTNET_SYNCHRONIZE_SERVICE}"
|
cp "${SCRIPT_DIR}/${XAI_SEPOLIA_SYNCHRONIZE_SERVICE}" "/home/ubuntu/.config/systemd/user/${XAI_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_TESTNET_SYNCHRONIZE_SERVICE}"
|
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_SEPOLIA_SYNCHRONIZE_SERVICE}"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
echo -e "${PREFIX_INFO} Replacing existing Xai testnet missing service and timer with: ${XAI_TESTNET_MISSING_SERVICE_FILE}, ${XAI_TESTNET_MISSING_TIMER_FILE}"
|
echo -e "${PREFIX_INFO} Replacing existing Xai sepolia missing service and timer with: ${XAI_SEPOLIA_MISSING_SERVICE_FILE}, ${XAI_SEPOLIA_MISSING_TIMER_FILE}"
|
||||||
chmod 644 "${SCRIPT_DIR}/${XAI_TESTNET_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${XAI_TESTNET_MISSING_TIMER_FILE}"
|
chmod 644 "${SCRIPT_DIR}/${XAI_SEPOLIA_MISSING_SERVICE_FILE}" "${SCRIPT_DIR}/${XAI_SEPOLIA_MISSING_TIMER_FILE}"
|
||||||
cp "${SCRIPT_DIR}/${XAI_TESTNET_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_TESTNET_MISSING_SERVICE_FILE}"
|
cp "${SCRIPT_DIR}/${XAI_SEPOLIA_MISSING_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_SEPOLIA_MISSING_SERVICE_FILE}"
|
||||||
cp "${SCRIPT_DIR}/${XAI_TESTNET_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_TESTNET_MISSING_TIMER_FILE}"
|
cp "${SCRIPT_DIR}/${XAI_SEPOLIA_MISSING_TIMER_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_SEPOLIA_MISSING_TIMER_FILE}"
|
||||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_TESTNET_MISSING_TIMER_FILE}"
|
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_SEPOLIA_MISSING_TIMER_FILE}"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
echo -e "${PREFIX_INFO} Replacing existing Xai testnet moonworm crawler service definition with ${XAI_TESTNET_MOONWORM_CRAWLER_SERVICE_FILE}"
|
echo -e "${PREFIX_INFO} Replacing existing Xai sepolia moonworm crawler service definition with ${XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||||
chmod 644 "${SCRIPT_DIR}/${XAI_TESTNET_MOONWORM_CRAWLER_SERVICE_FILE}"
|
chmod 644 "${SCRIPT_DIR}/${XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||||
cp "${SCRIPT_DIR}/${XAI_TESTNET_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_TESTNET_MOONWORM_CRAWLER_SERVICE_FILE}"
|
cp "${SCRIPT_DIR}/${XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}" "/home/ubuntu/.config/systemd/user/${XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user daemon-reload
|
||||||
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_TESTNET_MOONWORM_CRAWLER_SERVICE_FILE}"
|
XDG_RUNTIME_DIR="/run/user/1000" systemctl --user restart --no-block "${XAI_SEPOLIA_MOONWORM_CRAWLER_SERVICE_FILE}"
|
||||||
|
|
|
@ -9,7 +9,7 @@ Restart=on-failure
|
||||||
RestartSec=15s
|
RestartSec=15s
|
||||||
WorkingDirectory=/home/ubuntu/
|
WorkingDirectory=/home/ubuntu/
|
||||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/monitoring.env
|
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-testnet-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 arbitrum-nova-moonworm-crawler.service -service arbitrum-sepolia-moonworm-crawler.service -service xai-moonworm-crawler.service -service xai-sepolia-moonworm-crawler.service
|
||||||
CPUWeight=90
|
CPUWeight=90
|
||||||
SyslogIdentifier=monitoring-crawlers
|
SyslogIdentifier=monitoring-crawlers
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Fill missing blocks at Xai testnet database
|
Description=Fill missing blocks at Xai sepolia database
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
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_testnet -n
|
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks missing --blockchain xai_sepolia -n
|
||||||
CPUWeight=50
|
CPUWeight=50
|
||||||
SyslogIdentifier=xai-testnet-missing
|
SyslogIdentifier=xai-sepolia-missing
|
|
@ -1,5 +1,5 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Fill missing blocks at Xai testnet database
|
Description=Fill missing blocks at Xai sepolia database
|
||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnBootSec=120s
|
OnBootSec=120s
|
|
@ -1,5 +1,5 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Xai testnet moonworm crawler
|
Description=Xai sepolia moonworm crawler
|
||||||
After=network.target
|
After=network.target
|
||||||
StartLimitIntervalSec=300
|
StartLimitIntervalSec=300
|
||||||
StartLimitBurst=3
|
StartLimitBurst=3
|
||||||
|
@ -9,9 +9,9 @@ WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=15s
|
RestartSec=15s
|
||||||
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl -b xai_testnet --confirmations 10 --min-blocks-batch 20
|
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.moonworm_crawler.cli --access-id "${NB_CONTROLLER_ACCESS_ID}" crawl -b xai_sepolia --confirmations 10 --min-blocks-batch 20
|
||||||
CPUWeight=70
|
CPUWeight=70
|
||||||
SyslogIdentifier=xai-test-moonworm-crawler
|
SyslogIdentifier=xai-sepolia-moonworm-crawler
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
|
@ -1,5 +1,5 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Xai testnet block with transactions synchronizer
|
Description=Xai sepolia block with transactions synchronizer
|
||||||
StartLimitIntervalSec=300
|
StartLimitIntervalSec=300
|
||||||
StartLimitBurst=3
|
StartLimitBurst=3
|
||||||
After=network.target
|
After=network.target
|
||||||
|
@ -9,9 +9,9 @@ Restart=on-failure
|
||||||
RestartSec=15s
|
RestartSec=15s
|
||||||
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
WorkingDirectory=/home/ubuntu/moonstream/crawlers/mooncrawl
|
||||||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env
|
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_testnet -c 10 -j 2
|
ExecStart=/home/ubuntu/moonstream-env/bin/python -m mooncrawl.crawler --access-id "${NB_CONTROLLER_ACCESS_ID}" blocks synchronize --blockchain xai_sepolia -c 10 -j 2
|
||||||
CPUWeight=90
|
CPUWeight=90
|
||||||
SyslogIdentifier=xai-testnet-synchronize
|
SyslogIdentifier=xai-sepolia-synchronize
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
|
@ -29,7 +29,7 @@ from .settings import (
|
||||||
MOONSTREAM_POLYGON_WEB3_PROVIDER_URI,
|
MOONSTREAM_POLYGON_WEB3_PROVIDER_URI,
|
||||||
MOONSTREAM_WYRM_WEB3_PROVIDER_URI,
|
MOONSTREAM_WYRM_WEB3_PROVIDER_URI,
|
||||||
MOONSTREAM_XAI_WEB3_PROVIDER_URI,
|
MOONSTREAM_XAI_WEB3_PROVIDER_URI,
|
||||||
MOONSTREAM_XAI_TESTNET_WEB3_PROVIDER_URI,
|
MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI,
|
||||||
MOONSTREAM_XDAI_WEB3_PROVIDER_URI,
|
MOONSTREAM_XDAI_WEB3_PROVIDER_URI,
|
||||||
MOONSTREAM_ZKSYNC_ERA_TESTNET_WEB3_PROVIDER_URI,
|
MOONSTREAM_ZKSYNC_ERA_TESTNET_WEB3_PROVIDER_URI,
|
||||||
MOONSTREAM_ZKSYNC_ERA_WEB3_PROVIDER_URI,
|
MOONSTREAM_ZKSYNC_ERA_WEB3_PROVIDER_URI,
|
||||||
|
@ -85,8 +85,8 @@ def connect(
|
||||||
web3_uri = MOONSTREAM_ARBITRUM_SEPOLIA_WEB3_PROVIDER_URI
|
web3_uri = MOONSTREAM_ARBITRUM_SEPOLIA_WEB3_PROVIDER_URI
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||||
web3_uri = MOONSTREAM_XAI_WEB3_PROVIDER_URI
|
web3_uri = MOONSTREAM_XAI_WEB3_PROVIDER_URI
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI_TESTNET:
|
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||||
web3_uri = MOONSTREAM_XAI_TESTNET_WEB3_PROVIDER_URI
|
web3_uri = MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI
|
||||||
else:
|
else:
|
||||||
raise Exception("Wrong blockchain type provided for web3 URI")
|
raise Exception("Wrong blockchain type provided for web3 URI")
|
||||||
|
|
||||||
|
@ -188,7 +188,7 @@ def add_block(db_session, block: Any, blockchain_type: AvailableBlockchainType)
|
||||||
block_obj.send_root = block.get("sendRoot", "")
|
block_obj.send_root = block.get("sendRoot", "")
|
||||||
block_obj.mix_hash = block.get("mixHash", "")
|
block_obj.mix_hash = block.get("mixHash", "")
|
||||||
|
|
||||||
if blockchain_type == AvailableBlockchainType.XAI_TESTNET:
|
if blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||||
block_obj.sha3_uncles = block.get("sha3Uncles", "")
|
block_obj.sha3_uncles = block.get("sha3Uncles", "")
|
||||||
block_obj.l1_block_number = hex_to_int(block.get("l1BlockNumber"))
|
block_obj.l1_block_number = hex_to_int(block.get("l1BlockNumber"))
|
||||||
block_obj.send_count = hex_to_int(block.get("sendCount"))
|
block_obj.send_count = hex_to_int(block.get("sendCount"))
|
||||||
|
@ -246,7 +246,7 @@ def add_block_transactions(
|
||||||
if blockchain_type == AvailableBlockchainType.XAI:
|
if blockchain_type == AvailableBlockchainType.XAI:
|
||||||
tx_obj.y_parity = hex_to_int(tx.get("yParity"))
|
tx_obj.y_parity = hex_to_int(tx.get("yParity"))
|
||||||
|
|
||||||
if blockchain_type == AvailableBlockchainType.XAI_TESTNET:
|
if blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||||
tx_obj.y_parity = hex_to_int(tx.get("yParity"))
|
tx_obj.y_parity = hex_to_int(tx.get("yParity"))
|
||||||
|
|
||||||
db_session.add(tx_obj)
|
db_session.add(tx_obj)
|
||||||
|
|
|
@ -140,8 +140,8 @@ def continuous_crawler(
|
||||||
network = Network.arbitrum_sepolia
|
network = Network.arbitrum_sepolia
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||||
network = Network.xai
|
network = Network.xai
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI_TESTNET:
|
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||||
network = Network.xai_testnet
|
network = Network.xai_sepolia
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
|
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class SubscriptionTypes(Enum):
|
||||||
ARBITRUM_NOVA_BLOCKCHAIN = "arbitrum_nova_smartcontract"
|
ARBITRUM_NOVA_BLOCKCHAIN = "arbitrum_nova_smartcontract"
|
||||||
ARBITRUM_SEPOLIA_BLOCKCHAIN = "arbitrum_sepolia_smartcontract"
|
ARBITRUM_SEPOLIA_BLOCKCHAIN = "arbitrum_sepolia_smartcontract"
|
||||||
XAI_BLOCKCHAIN = "xai_smartcontract"
|
XAI_BLOCKCHAIN = "xai_smartcontract"
|
||||||
XAI_TESTNET_BLOCKCHAIN = "xai_testnet_smartcontract"
|
XAI_SEPOLIA_BLOCKCHAIN = "xai_testnet_smartcontract"
|
||||||
|
|
||||||
|
|
||||||
def abi_input_signature(input_abi: Dict[str, Any]) -> str:
|
def abi_input_signature(input_abi: Dict[str, Any]) -> str:
|
||||||
|
@ -155,7 +155,7 @@ def blockchain_type_to_subscription_type(
|
||||||
return SubscriptionTypes.ARBITRUM_SEPOLIA_BLOCKCHAIN
|
return SubscriptionTypes.ARBITRUM_SEPOLIA_BLOCKCHAIN
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||||
return SubscriptionTypes.XAI_BLOCKCHAIN
|
return SubscriptionTypes.XAI_BLOCKCHAIN
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI_TESTNET:
|
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||||
return SubscriptionTypes.XAI_TESTNET_BLOCKCHAIN
|
return SubscriptionTypes.XAI_TESTNET_BLOCKCHAIN
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
|
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
|
||||||
|
|
|
@ -78,8 +78,8 @@ def function_call_crawler(
|
||||||
network = Network.arbitrum_sepolia
|
network = Network.arbitrum_sepolia
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||||
network = Network.xai
|
network = Network.xai
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI_TESTNET:
|
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||||
network = Network.xai_testnet
|
network = Network.xai_sepolia
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
|
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
|
||||||
|
|
||||||
|
|
|
@ -71,8 +71,8 @@ def historical_crawler(
|
||||||
network = Network.arbitrum_sepolia
|
network = Network.arbitrum_sepolia
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||||
network = Network.xai
|
network = Network.xai
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI_TESTNET:
|
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||||
network = Network.xai_testnet
|
network = Network.xai_sepolia
|
||||||
else:
|
else:
|
||||||
raise Exception("Unsupported blockchain type provided")
|
raise Exception("Unsupported blockchain type provided")
|
||||||
|
|
||||||
|
|
|
@ -144,11 +144,11 @@ MOONSTREAM_XAI_WEB3_PROVIDER_URI = os.environ.get(
|
||||||
if MOONSTREAM_XAI_WEB3_PROVIDER_URI == "":
|
if MOONSTREAM_XAI_WEB3_PROVIDER_URI == "":
|
||||||
raise Exception("MOONSTREAM_XAI_WEB3_PROVIDER_URI env variable is not set")
|
raise Exception("MOONSTREAM_XAI_WEB3_PROVIDER_URI env variable is not set")
|
||||||
|
|
||||||
MOONSTREAM_XAI_TESTNET_WEB3_PROVIDER_URI = os.environ.get(
|
MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI = os.environ.get(
|
||||||
"MOONSTREAM_XAI_TESTNET_WEB3_PROVIDER_URI", ""
|
"MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI", ""
|
||||||
)
|
)
|
||||||
if MOONSTREAM_XAI_TESTNET_WEB3_PROVIDER_URI == "":
|
if MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI == "":
|
||||||
raise Exception("MOONSTREAM_XAI_TESTNET_WEB3_PROVIDER_URI env variable is not set")
|
raise Exception("MOONSTREAM_XAI_SEPOLIA_WEB3_PROVIDER_URI env variable is not set")
|
||||||
|
|
||||||
MOONSTREAM_CRAWL_WORKERS = 4
|
MOONSTREAM_CRAWL_WORKERS = 4
|
||||||
MOONSTREAM_CRAWL_WORKERS_RAW = os.environ.get("MOONSTREAM_CRAWL_WORKERS")
|
MOONSTREAM_CRAWL_WORKERS_RAW = os.environ.get("MOONSTREAM_CRAWL_WORKERS")
|
||||||
|
|
|
@ -59,7 +59,7 @@ subscription_id_by_blockchain = {
|
||||||
"arbitrum_nova": "arbitrum_nova_smartcontract",
|
"arbitrum_nova": "arbitrum_nova_smartcontract",
|
||||||
"arbitrum_sepolia": "arbitrum_sepolia_smartcontract",
|
"arbitrum_sepolia": "arbitrum_sepolia_smartcontract",
|
||||||
"xai": "xai_smartcontract",
|
"xai": "xai_smartcontract",
|
||||||
"xai_testnet": "xai_testnet_smartcontract",
|
"xai_sepolia": "xai_sepolia_smartcontract",
|
||||||
}
|
}
|
||||||
|
|
||||||
blockchain_by_subscription_id = {
|
blockchain_by_subscription_id = {
|
||||||
|
@ -72,7 +72,7 @@ blockchain_by_subscription_id = {
|
||||||
"arbitrum_nova_blockchain": "arbitrum_nova",
|
"arbitrum_nova_blockchain": "arbitrum_nova",
|
||||||
"arbitrum_sepolia_blockchain": "arbitrum_sepolia",
|
"arbitrum_sepolia_blockchain": "arbitrum_sepolia",
|
||||||
"xai_blockchain": "xai",
|
"xai_blockchain": "xai",
|
||||||
"xai_testnet_blockchain": "xai_testnet",
|
"xai_sepolia_blockchain": "xai_sepolia",
|
||||||
"ethereum_smartcontract": "ethereum",
|
"ethereum_smartcontract": "ethereum",
|
||||||
"polygon_smartcontract": "polygon",
|
"polygon_smartcontract": "polygon",
|
||||||
"mumbai_smartcontract": "mumbai",
|
"mumbai_smartcontract": "mumbai",
|
||||||
|
@ -83,7 +83,7 @@ blockchain_by_subscription_id = {
|
||||||
"arbitrum_nova_smartcontract": "arbitrum_nova",
|
"arbitrum_nova_smartcontract": "arbitrum_nova",
|
||||||
"arbitrum_sepolia_smartcontract": "arbitrum_sepolia",
|
"arbitrum_sepolia_smartcontract": "arbitrum_sepolia",
|
||||||
"xai_smartcontract": "xai",
|
"xai_smartcontract": "xai",
|
||||||
"xai_testnet_smartcontract": "xai_testnet",
|
"xai_sepolia_smartcontract": "xai_sepolia",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,9 +32,9 @@ from .models import (
|
||||||
XaiBlock,
|
XaiBlock,
|
||||||
XaiLabel,
|
XaiLabel,
|
||||||
XaiTransaction,
|
XaiTransaction,
|
||||||
XaiTestnetBlock,
|
XaiSepoliaBlock,
|
||||||
XaiTestnetLabel,
|
XaiSepoliaLabel,
|
||||||
XaiTestnetTransaction,
|
XaiSepoliaTransaction,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ class AvailableBlockchainType(Enum):
|
||||||
ARBITRUM_NOVA = "arbitrum_nova"
|
ARBITRUM_NOVA = "arbitrum_nova"
|
||||||
ARBITRUM_SEPOLIA = "arbitrum_sepolia"
|
ARBITRUM_SEPOLIA = "arbitrum_sepolia"
|
||||||
XAI = "xai"
|
XAI = "xai"
|
||||||
XAI_TESTNET = "xai_testnet"
|
XAI_SEPOLIA = "xai_testnet"
|
||||||
|
|
||||||
|
|
||||||
def get_block_model(
|
def get_block_model(
|
||||||
|
@ -66,11 +66,11 @@ def get_block_model(
|
||||||
ArbitrumNovaBlock,
|
ArbitrumNovaBlock,
|
||||||
ArbitrumSepoliaBlock,
|
ArbitrumSepoliaBlock,
|
||||||
XaiBlock,
|
XaiBlock,
|
||||||
XaiTestnetBlock,
|
XaiSepoliaBlock,
|
||||||
]
|
]
|
||||||
]:
|
]:
|
||||||
"""
|
"""
|
||||||
Depends on provided blockchain type: Ethereum, Polygon, Mumbai, XDai, Wyrm, ZkSyncEra, ZkSyncEraTestnet, ArbitrumNovaBlock, ArbitrumSepoliaBlock, XaiBlock, XaiTestnetBlock
|
Depends on provided blockchain type: Ethereum, Polygon, Mumbai, XDai, Wyrm, ZkSyncEra, ZkSyncEraTestnet, ArbitrumNova, ArbitrumSepolia, Xai, XaiSepolia
|
||||||
set proper blocks model.
|
set proper blocks model.
|
||||||
"""
|
"""
|
||||||
block_model: Type[
|
block_model: Type[
|
||||||
|
@ -85,7 +85,7 @@ def get_block_model(
|
||||||
ArbitrumNovaBlock,
|
ArbitrumNovaBlock,
|
||||||
ArbitrumSepoliaBlock,
|
ArbitrumSepoliaBlock,
|
||||||
XaiBlock,
|
XaiBlock,
|
||||||
XaiTestnetBlock,
|
XaiSepoliaBlock,
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||||
|
@ -108,8 +108,8 @@ def get_block_model(
|
||||||
block_model = ArbitrumSepoliaBlock
|
block_model = ArbitrumSepoliaBlock
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||||
block_model = XaiBlock
|
block_model = XaiBlock
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI_TESTNET:
|
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||||
block_model = XaiTestnetBlock
|
block_model = XaiSepoliaBlock
|
||||||
else:
|
else:
|
||||||
raise Exception("Unsupported blockchain type provided")
|
raise Exception("Unsupported blockchain type provided")
|
||||||
|
|
||||||
|
@ -130,11 +130,11 @@ def get_label_model(
|
||||||
ArbitrumNovaLabel,
|
ArbitrumNovaLabel,
|
||||||
ArbitrumSepoliaLabel,
|
ArbitrumSepoliaLabel,
|
||||||
XaiLabel,
|
XaiLabel,
|
||||||
XaiTestnetLabel,
|
XaiSepoliaLabel,
|
||||||
]
|
]
|
||||||
]:
|
]:
|
||||||
"""
|
"""
|
||||||
Depends on provided blockchain type: Ethereum, Polygon, Mumbai, XDai, Wyrm, ZkSyncEra, ZkSyncEraTestnet, ArbitrumNovaLabel, ArbitrumSepoliaLabel, XaiLabel, XaiTestnetLabel
|
Depends on provided blockchain type: Ethereum, Polygon, Mumbai, XDai, Wyrm, ZkSyncEra, ZkSyncEraTestnet, ArbitrumNova, ArbitrumSepolia, Xai, XaiSepolia
|
||||||
set proper block label model.
|
set proper block label model.
|
||||||
"""
|
"""
|
||||||
label_model: Type[
|
label_model: Type[
|
||||||
|
@ -149,7 +149,7 @@ def get_label_model(
|
||||||
ArbitrumNovaLabel,
|
ArbitrumNovaLabel,
|
||||||
ArbitrumSepoliaLabel,
|
ArbitrumSepoliaLabel,
|
||||||
XaiLabel,
|
XaiLabel,
|
||||||
XaiTestnetLabel,
|
XaiSepoliaLabel,
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||||
|
@ -172,8 +172,8 @@ def get_label_model(
|
||||||
label_model = ArbitrumSepoliaLabel
|
label_model = ArbitrumSepoliaLabel
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||||
label_model = XaiLabel
|
label_model = XaiLabel
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI_TESTNET:
|
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||||
label_model = XaiTestnetLabel
|
label_model = XaiSepoliaLabel
|
||||||
else:
|
else:
|
||||||
raise Exception("Unsupported blockchain type provided")
|
raise Exception("Unsupported blockchain type provided")
|
||||||
|
|
||||||
|
@ -194,11 +194,11 @@ def get_transaction_model(
|
||||||
ArbitrumNovaTransaction,
|
ArbitrumNovaTransaction,
|
||||||
ArbitrumSepoliaTransaction,
|
ArbitrumSepoliaTransaction,
|
||||||
XaiTransaction,
|
XaiTransaction,
|
||||||
XaiTestnetTransaction,
|
XaiSepoliaTransaction,
|
||||||
]
|
]
|
||||||
]:
|
]:
|
||||||
"""
|
"""
|
||||||
Depends on provided blockchain type: Ethereum, Polygon, Mumbai, XDai, Wyrm, ZkSyncEra, ZkSyncEraTestnet, ArbitrumNovaTransaction, ArbitrumSepoliaTransaction, XaiTransaction, XaiTestnetTransaction
|
Depends on provided blockchain type: Ethereum, Polygon, Mumbai, XDai, Wyrm, ZkSyncEra, ZkSyncEraTestnet, ArbitrumNova, ArbitrumSepolia, Xai, XaiSepolia
|
||||||
set proper block transactions model.
|
set proper block transactions model.
|
||||||
"""
|
"""
|
||||||
transaction_model: Type[
|
transaction_model: Type[
|
||||||
|
@ -213,7 +213,7 @@ def get_transaction_model(
|
||||||
ArbitrumNovaTransaction,
|
ArbitrumNovaTransaction,
|
||||||
ArbitrumSepoliaTransaction,
|
ArbitrumSepoliaTransaction,
|
||||||
XaiTransaction,
|
XaiTransaction,
|
||||||
XaiTestnetTransaction,
|
XaiSepoliaTransaction,
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
if blockchain_type == AvailableBlockchainType.ETHEREUM:
|
||||||
|
@ -236,8 +236,8 @@ def get_transaction_model(
|
||||||
transaction_model = ArbitrumSepoliaTransaction
|
transaction_model = ArbitrumSepoliaTransaction
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||||
transaction_model = XaiTransaction
|
transaction_model = XaiTransaction
|
||||||
elif blockchain_type == AvailableBlockchainType.XAI_TESTNET:
|
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||||
transaction_model = XaiTestnetTransaction
|
transaction_model = XaiSepoliaTransaction
|
||||||
else:
|
else:
|
||||||
raise Exception("Unsupported blockchain type provided")
|
raise Exception("Unsupported blockchain type provided")
|
||||||
|
|
||||||
|
|
|
@ -1101,8 +1101,8 @@ class XaiLabel(Base): # type: ignore
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class XaiTestnetBlock(Base): # type: ignore
|
class XaiSepoliaBlock(Base): # type: ignore
|
||||||
__tablename__ = "xai_testnet_blocks"
|
__tablename__ = "xai_sepolia_blocks"
|
||||||
|
|
||||||
block_number = Column(
|
block_number = Column(
|
||||||
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
BigInteger, primary_key=True, unique=True, nullable=False, index=True
|
||||||
|
@ -1136,15 +1136,15 @@ class XaiTestnetBlock(Base): # type: ignore
|
||||||
mix_hash = Column(VARCHAR(256), nullable=True)
|
mix_hash = Column(VARCHAR(256), nullable=True)
|
||||||
|
|
||||||
|
|
||||||
class XaiTestnetTransaction(Base): # type: ignore
|
class XaiSepoliaTransaction(Base): # type: ignore
|
||||||
__tablename__ = "xai_testnet_transactions"
|
__tablename__ = "xai_sepolia_transactions"
|
||||||
|
|
||||||
hash = Column(
|
hash = Column(
|
||||||
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
VARCHAR(256), primary_key=True, unique=True, nullable=False, index=True
|
||||||
)
|
)
|
||||||
block_number = Column(
|
block_number = Column(
|
||||||
BigInteger,
|
BigInteger,
|
||||||
ForeignKey("xai_testnet_blocks.block_number", ondelete="CASCADE"),
|
ForeignKey("xai_sepolia_blocks.block_number", ondelete="CASCADE"),
|
||||||
nullable=False,
|
nullable=False,
|
||||||
index=True,
|
index=True,
|
||||||
)
|
)
|
||||||
|
@ -1167,8 +1167,8 @@ class XaiTestnetTransaction(Base): # type: ignore
|
||||||
y_parity = Column(BigInteger, nullable=True)
|
y_parity = Column(BigInteger, nullable=True)
|
||||||
|
|
||||||
|
|
||||||
class XaiTestnetLabel(Base): # type: ignore
|
class XaiSepoliaLabel(Base): # type: ignore
|
||||||
__tablename__ = "xai_testnet_labels"
|
__tablename__ = "xai_sepolia_labels"
|
||||||
|
|
||||||
id = Column(
|
id = Column(
|
||||||
UUID(as_uuid=True),
|
UUID(as_uuid=True),
|
||||||
|
|
|
@ -33,9 +33,9 @@ from .models import (
|
||||||
XaiBlock,
|
XaiBlock,
|
||||||
XaiLabel,
|
XaiLabel,
|
||||||
XaiTransaction,
|
XaiTransaction,
|
||||||
XaiTestnetBlock,
|
XaiSepoliaBlock,
|
||||||
XaiTestnetLabel,
|
XaiSepoliaLabel,
|
||||||
XaiTestnetTransaction,
|
XaiSepoliaTransaction,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class Network(Enum):
|
||||||
arbitrum_nova = "arbitrum_nova"
|
arbitrum_nova = "arbitrum_nova"
|
||||||
arbitrum_sepolia = "arbitrum_sepolia"
|
arbitrum_sepolia = "arbitrum_sepolia"
|
||||||
xai = "xai"
|
xai = "xai"
|
||||||
xai_testnet = "xai_testnet"
|
xai_sepolia = "xai_sepolia"
|
||||||
|
|
||||||
|
|
||||||
tx_raw_types = Union[
|
tx_raw_types = Union[
|
||||||
|
@ -64,7 +64,7 @@ tx_raw_types = Union[
|
||||||
ArbitrumNovaTransaction,
|
ArbitrumNovaTransaction,
|
||||||
ArbitrumSepoliaTransaction,
|
ArbitrumSepoliaTransaction,
|
||||||
XaiTransaction,
|
XaiTransaction,
|
||||||
XaiTestnetTransaction,
|
XaiSepoliaTransaction,
|
||||||
]
|
]
|
||||||
|
|
||||||
MODELS: Dict[Network, Dict[str, Base]] = {
|
MODELS: Dict[Network, Dict[str, Base]] = {
|
||||||
|
@ -118,9 +118,9 @@ MODELS: Dict[Network, Dict[str, Base]] = {
|
||||||
"labels": XaiLabel,
|
"labels": XaiLabel,
|
||||||
"transactions": XaiTransaction,
|
"transactions": XaiTransaction,
|
||||||
},
|
},
|
||||||
Network.xai_testnet: {
|
Network.xai_sepolia: {
|
||||||
"blocks": XaiTestnetBlock,
|
"blocks": XaiSepoliaBlock,
|
||||||
"labels": XaiTestnetLabel,
|
"labels": XaiSepoliaLabel,
|
||||||
"transactions": XaiTestnetTransaction,
|
"transactions": XaiSepoliaTransaction,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue