kopia lustrzana https://github.com/bugout-dev/moonstream
Merge pull request #1121 from moonstream-to/game7-testnet-2
Add game 7 testnet.pull/1122/head moonstreamdbv3/v0.0.16
commit
0b012f25a2
|
@ -39,6 +39,7 @@ export MOONSTREAM_MANTLE_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node
|
|||
export MOONSTREAM_MANTLE_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_IMX_ZKEVM_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_IMX_ZKEVM_SEPOLIA_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
export MOONSTREAM_GAME7_TESTNET_WEB3_PROVIDER_URI="https://<connection_path_uri_to_node>"
|
||||
|
||||
export MOONSTREAM_QUERIES_JOURNAL_ID="<bugout_journal_id_where_store_queries_for_executing>"
|
||||
export MOONSTREAM_USAGE_REPORTS_JOURNAL_ID="<bugout_journal_id_where_save_generated_reports>"
|
||||
|
|
|
@ -282,6 +282,17 @@ CANONICAL_SUBSCRIPTION_TYPES = {
|
|||
stripe_price_id=None,
|
||||
active=True,
|
||||
),
|
||||
"game7_testnet_smartcontract": SubscriptionTypeResourceData(
|
||||
id="game7_testnet_smartcontract",
|
||||
name="Game7 Testnet smartcontracts",
|
||||
blockchain="game7_testnet",
|
||||
choices=["input:address", "tag:erc721"],
|
||||
description="Contracts events and tx_calls of contract of Game7 testnet blockchain.",
|
||||
icon_url="https://static.simiotics.com/moonstream/assets/game7-testnet-token-logo.png",
|
||||
stripe_product_id=None,
|
||||
stripe_price_id=None,
|
||||
active=True,
|
||||
),
|
||||
"ethereum_blockchain": SubscriptionTypeResourceData(
|
||||
id="ethereum_blockchain",
|
||||
name="Ethereum transactions",
|
||||
|
|
|
@ -267,6 +267,15 @@ if MOONSTREAM_IMX_ZKEVM_SEPOLIA_WEB3_PROVIDER_URI == "":
|
|||
"MOONSTREAM_IMX_ZKEVM_SEPOLIA_WEB3_PROVIDER_URI environment variable must be set"
|
||||
)
|
||||
|
||||
MOONSTREAM_GAME7_TESTNET_WEB3_PROVIDER_URI = os.environ.get(
|
||||
"MOONSTREAM_GAME7_TESTNET_WEB3_PROVIDER_URI", ""
|
||||
)
|
||||
if MOONSTREAM_GAME7_TESTNET_WEB3_PROVIDER_URI == "":
|
||||
raise Exception(
|
||||
"MOONSTREAM_GAME7_TESTNET_WEB3_PROVIDER_URI env variable is not set"
|
||||
)
|
||||
|
||||
|
||||
## QueryAPI
|
||||
|
||||
MOONSTREAM_S3_QUERIES_BUCKET = os.environ.get("MOONSTREAM_S3_QUERIES_BUCKET", "")
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
Moonstream library and API version.
|
||||
"""
|
||||
|
||||
MOONSTREAMAPI_VERSION = "0.4.6"
|
||||
MOONSTREAMAPI_VERSION = "0.4.7"
|
||||
|
|
|
@ -36,6 +36,7 @@ from .settings import (
|
|||
MOONSTREAM_ZKSYNC_ERA_SEPOLIA_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_ZKSYNC_ERA_TESTNET_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_ZKSYNC_ERA_WEB3_PROVIDER_URI,
|
||||
MOONSTREAM_GAME7_TESTNET_WEB3_PROVIDER_URI,
|
||||
NB_ACCESS_ID_HEADER,
|
||||
multicall_contract_abi,
|
||||
multicall_contracts,
|
||||
|
@ -124,6 +125,8 @@ def connect(
|
|||
web3_uri = MOONSTREAM_IMX_ZKEVM_WEB3_PROVIDER_URI
|
||||
elif blockchain_type == AvailableBlockchainType.IMX_ZKEVM_SEPOLIA:
|
||||
web3_uri = MOONSTREAM_IMX_ZKEVM_SEPOLIA_WEB3_PROVIDER_URI
|
||||
elif blockchain_type == AvailableBlockchainType.GAME7_TESTNET:
|
||||
web3_uri = MOONSTREAM_GAME7_TESTNET_WEB3_PROVIDER_URI
|
||||
else:
|
||||
raise Exception("Wrong blockchain type provided for web3 URI")
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ Mako==1.2.3
|
|||
MarkupSafe==2.1.1
|
||||
moonstream==0.1.1
|
||||
moonstreamdb==0.4.5
|
||||
moonstreamdb-v3==0.0.15
|
||||
moonstreamdb-v3==0.0.16
|
||||
multiaddr==0.0.9
|
||||
multidict==6.0.2
|
||||
netaddr==0.8.0
|
||||
|
|
|
@ -17,7 +17,7 @@ setup(
|
|||
"fastapi",
|
||||
"moonstream",
|
||||
"moonstreamdb>=0.4.5",
|
||||
"moonstreamdb-v3>=0.0.15",
|
||||
"moonstreamdb-v3>=0.0.16",
|
||||
"humbug",
|
||||
"pydantic==1.10.2",
|
||||
"pyevmasm",
|
||||
|
|
|
@ -36,6 +36,7 @@ from moonstreamdbv3.models import (
|
|||
BlastSepoliaLabel,
|
||||
EthereumLabel,
|
||||
Game7OrbitArbitrumSepoliaLabel,
|
||||
Game7TestnetLabel,
|
||||
ImxZkevmLabel,
|
||||
ImxZkevmSepoliaLabel,
|
||||
MantleLabel,
|
||||
|
@ -69,6 +70,7 @@ def include_symbol(tablename, schema):
|
|||
ArbitrumOneLabel.__tablename__,
|
||||
ArbitrumSepoliaLabel.__tablename__,
|
||||
Game7OrbitArbitrumSepoliaLabel.__tablename__,
|
||||
Game7TestnetLabel.__tablename__,
|
||||
XaiLabel.__tablename__,
|
||||
XaiSepoliaLabel.__tablename__,
|
||||
AvalancheLabel.__tablename__,
|
||||
|
|
|
@ -0,0 +1,195 @@
|
|||
"""Add game7 testnet
|
||||
|
||||
Revision ID: db9559f9566c
|
||||
Revises: 211646463e9f
|
||||
Create Date: 2024-08-05 16:24:26.159323
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "db9559f9566c"
|
||||
down_revision: Union[str, None] = "211646463e9f"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
"game7_testnet_labels",
|
||||
sa.Column("id", sa.UUID(), nullable=False),
|
||||
sa.Column("label", sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column("transaction_hash", sa.VARCHAR(length=128), nullable=False),
|
||||
sa.Column("log_index", sa.Integer(), nullable=True),
|
||||
sa.Column("block_number", sa.BigInteger(), nullable=False),
|
||||
sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column("block_timestamp", sa.BigInteger(), nullable=False),
|
||||
sa.Column("caller_address", sa.LargeBinary(), nullable=True),
|
||||
sa.Column("origin_address", sa.LargeBinary(), nullable=True),
|
||||
sa.Column("address", sa.LargeBinary(), nullable=False),
|
||||
sa.Column("label_name", sa.Text(), nullable=True),
|
||||
sa.Column("label_type", sa.VARCHAR(length=64), nullable=True),
|
||||
sa.Column("label_data", postgresql.JSONB(astext_type=sa.Text()), nullable=True),
|
||||
sa.Column(
|
||||
"created_at",
|
||||
sa.DateTime(timezone=True),
|
||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
||||
nullable=False,
|
||||
),
|
||||
sa.PrimaryKeyConstraint("id", name=op.f("pk_game7_testnet_labels")),
|
||||
sa.UniqueConstraint("id", name=op.f("uq_game7_testnet_labels_id")),
|
||||
)
|
||||
op.create_index(
|
||||
"ix_game7_testnet_labels_addr_block_num",
|
||||
"game7_testnet_labels",
|
||||
["address", "block_number"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
"ix_game7_testnet_labels_addr_block_ts",
|
||||
"game7_testnet_labels",
|
||||
["address", "block_timestamp"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_labels_address"),
|
||||
"game7_testnet_labels",
|
||||
["address"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_labels_block_number"),
|
||||
"game7_testnet_labels",
|
||||
["block_number"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_labels_caller_address"),
|
||||
"game7_testnet_labels",
|
||||
["caller_address"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_labels_label"),
|
||||
"game7_testnet_labels",
|
||||
["label"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_labels_label_name"),
|
||||
"game7_testnet_labels",
|
||||
["label_name"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_labels_label_type"),
|
||||
"game7_testnet_labels",
|
||||
["label_type"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_labels_origin_address"),
|
||||
"game7_testnet_labels",
|
||||
["origin_address"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_labels_transaction_hash"),
|
||||
"game7_testnet_labels",
|
||||
["transaction_hash"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
"uk_game7_testnet_labels_tx_hash_log_idx_evt",
|
||||
"game7_testnet_labels",
|
||||
["transaction_hash", "log_index"],
|
||||
unique=True,
|
||||
postgresql_where=sa.text("label='seer' and label_type='event'"),
|
||||
)
|
||||
op.create_index(
|
||||
"uk_game7_testnet_labels_tx_hash_log_idx_evt_raw",
|
||||
"game7_testnet_labels",
|
||||
["transaction_hash", "log_index"],
|
||||
unique=True,
|
||||
postgresql_where=sa.text("label='seer-raw' and label_type='event'"),
|
||||
)
|
||||
op.create_index(
|
||||
"uk_game7_testnet_labels_tx_hash_tx_call",
|
||||
"game7_testnet_labels",
|
||||
["transaction_hash"],
|
||||
unique=True,
|
||||
postgresql_where=sa.text("label='seer' and label_type='tx_call'"),
|
||||
)
|
||||
op.create_index(
|
||||
"uk_game7_testnet_labels_tx_hash_tx_call_raw",
|
||||
"game7_testnet_labels",
|
||||
["transaction_hash"],
|
||||
unique=True,
|
||||
postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"),
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(
|
||||
"uk_game7_testnet_labels_tx_hash_tx_call_raw",
|
||||
table_name="game7_testnet_labels",
|
||||
postgresql_where=sa.text("label='seer-raw' and label_type='tx_call'"),
|
||||
)
|
||||
op.drop_index(
|
||||
"uk_game7_testnet_labels_tx_hash_tx_call",
|
||||
table_name="game7_testnet_labels",
|
||||
postgresql_where=sa.text("label='seer' and label_type='tx_call'"),
|
||||
)
|
||||
op.drop_index(
|
||||
"uk_game7_testnet_labels_tx_hash_log_idx_evt_raw",
|
||||
table_name="game7_testnet_labels",
|
||||
postgresql_where=sa.text("label='seer-raw' and label_type='event'"),
|
||||
)
|
||||
op.drop_index(
|
||||
"uk_game7_testnet_labels_tx_hash_log_idx_evt",
|
||||
table_name="game7_testnet_labels",
|
||||
postgresql_where=sa.text("label='seer' and label_type='event'"),
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_labels_transaction_hash"),
|
||||
table_name="game7_testnet_labels",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_labels_origin_address"),
|
||||
table_name="game7_testnet_labels",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_labels_label_type"), table_name="game7_testnet_labels"
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_labels_label_name"), table_name="game7_testnet_labels"
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_labels_label"), table_name="game7_testnet_labels"
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_labels_caller_address"),
|
||||
table_name="game7_testnet_labels",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_labels_block_number"), table_name="game7_testnet_labels"
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_labels_address"), table_name="game7_testnet_labels"
|
||||
)
|
||||
op.drop_index(
|
||||
"ix_game7_testnet_labels_addr_block_ts", table_name="game7_testnet_labels"
|
||||
)
|
||||
op.drop_index(
|
||||
"ix_game7_testnet_labels_addr_block_num", table_name="game7_testnet_labels"
|
||||
)
|
||||
op.drop_table("game7_testnet_labels")
|
||||
# ### end Alembic commands ###
|
|
@ -44,6 +44,10 @@ from moonstreamdbv3.models_indexes import (
|
|||
Game7OrbitArbitrumSepoliaLogIndex,
|
||||
Game7OrbitArbitrumSepoliaReorgs,
|
||||
Game7OrbitArbitrumSepoliaTransactionIndex,
|
||||
Game7TestnetBlockIndex,
|
||||
Game7TestnetLogIndex,
|
||||
Game7TestnetReorgs,
|
||||
Game7TestnetTransactionIndex,
|
||||
ImxZkevmBlockIndex,
|
||||
ImxZkevmLogIndex,
|
||||
ImxZkevmReorgs,
|
||||
|
@ -105,6 +109,10 @@ def include_symbol(tablename, schema):
|
|||
Game7OrbitArbitrumSepoliaTransactionIndex.__tablename__,
|
||||
Game7OrbitArbitrumSepoliaLogIndex.__tablename__,
|
||||
Game7OrbitArbitrumSepoliaReorgs.__tablename__,
|
||||
Game7TestnetBlockIndex.__tablename__,
|
||||
Game7TestnetTransactionIndex.__tablename__,
|
||||
Game7TestnetLogIndex.__tablename__,
|
||||
Game7TestnetReorgs.__tablename__,
|
||||
MantleBlockIndex.__tablename__,
|
||||
MantleTransactionIndex.__tablename__,
|
||||
MantleLogIndex.__tablename__,
|
||||
|
|
|
@ -0,0 +1,273 @@
|
|||
"""Add game7 testnet
|
||||
|
||||
Revision ID: b89a8affe2c3
|
||||
Revises: f19652e59bc5
|
||||
Create Date: 2024-08-05 16:29:33.091636
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "b89a8affe2c3"
|
||||
down_revision: Union[str, None] = "f19652e59bc5"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table(
|
||||
"game7_testnet_blocks",
|
||||
sa.Column("l1_block_number", sa.BigInteger(), nullable=False),
|
||||
sa.Column("block_number", sa.BigInteger(), nullable=False),
|
||||
sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column("block_timestamp", sa.BigInteger(), nullable=False),
|
||||
sa.Column("parent_hash", sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column("row_id", sa.BigInteger(), nullable=False),
|
||||
sa.Column("path", sa.Text(), nullable=False),
|
||||
sa.Column(
|
||||
"indexed_at",
|
||||
sa.DateTime(timezone=True),
|
||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
||||
nullable=False,
|
||||
),
|
||||
sa.PrimaryKeyConstraint("block_number", name=op.f("pk_game7_testnet_blocks")),
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_blocks_block_number"),
|
||||
"game7_testnet_blocks",
|
||||
["block_number"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_blocks_block_timestamp"),
|
||||
"game7_testnet_blocks",
|
||||
["block_timestamp"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_table(
|
||||
"game7_testnet_reorgs",
|
||||
sa.Column("id", sa.UUID(), nullable=False),
|
||||
sa.Column("block_number", sa.BigInteger(), nullable=False),
|
||||
sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False),
|
||||
sa.PrimaryKeyConstraint("id", name=op.f("pk_game7_testnet_reorgs")),
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_reorgs_block_hash"),
|
||||
"game7_testnet_reorgs",
|
||||
["block_hash"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_reorgs_block_number"),
|
||||
"game7_testnet_reorgs",
|
||||
["block_number"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_table(
|
||||
"game7_testnet_transactions",
|
||||
sa.Column("block_number", sa.BigInteger(), nullable=False),
|
||||
sa.Column("hash", sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column("from_address", sa.LargeBinary(length=20), nullable=False),
|
||||
sa.Column("to_address", sa.LargeBinary(length=20), nullable=False),
|
||||
sa.Column("selector", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("type", sa.Integer(), nullable=True),
|
||||
sa.Column("row_id", sa.BigInteger(), nullable=False),
|
||||
sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column("index", sa.BigInteger(), nullable=False),
|
||||
sa.Column("path", sa.Text(), nullable=False),
|
||||
sa.Column(
|
||||
"indexed_at",
|
||||
sa.DateTime(timezone=True),
|
||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
||||
nullable=False,
|
||||
),
|
||||
sa.ForeignKeyConstraint(
|
||||
["block_number"],
|
||||
["game7_testnet_blocks.block_number"],
|
||||
name=op.f(
|
||||
"fk_game7_testnet_transactions_block_number_game7_testnet_blocks"
|
||||
),
|
||||
ondelete="CASCADE",
|
||||
),
|
||||
sa.PrimaryKeyConstraint("hash", name=op.f("pk_game7_testnet_transactions")),
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_transactions_block_hash"),
|
||||
"game7_testnet_transactions",
|
||||
["block_hash"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_transactions_block_number"),
|
||||
"game7_testnet_transactions",
|
||||
["block_number"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_transactions_from_address"),
|
||||
"game7_testnet_transactions",
|
||||
["from_address"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_transactions_hash"),
|
||||
"game7_testnet_transactions",
|
||||
["hash"],
|
||||
unique=True,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_transactions_index"),
|
||||
"game7_testnet_transactions",
|
||||
["index"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_transactions_selector"),
|
||||
"game7_testnet_transactions",
|
||||
["selector"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_transactions_to_address"),
|
||||
"game7_testnet_transactions",
|
||||
["to_address"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_transactions_type"),
|
||||
"game7_testnet_transactions",
|
||||
["type"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_table(
|
||||
"game7_testnet_logs",
|
||||
sa.Column("transaction_hash", sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column("block_hash", sa.VARCHAR(length=256), nullable=False),
|
||||
sa.Column("address", sa.LargeBinary(length=20), nullable=False),
|
||||
sa.Column("row_id", sa.BigInteger(), nullable=False),
|
||||
sa.Column("selector", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("topic1", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("topic2", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("topic3", sa.VARCHAR(length=256), nullable=True),
|
||||
sa.Column("log_index", sa.BigInteger(), nullable=False),
|
||||
sa.Column("path", sa.Text(), nullable=False),
|
||||
sa.Column(
|
||||
"indexed_at",
|
||||
sa.DateTime(timezone=True),
|
||||
server_default=sa.text("TIMEZONE('utc', statement_timestamp())"),
|
||||
nullable=False,
|
||||
),
|
||||
sa.ForeignKeyConstraint(
|
||||
["transaction_hash"],
|
||||
["game7_testnet_transactions.hash"],
|
||||
name=op.f(
|
||||
"fk_game7_testnet_logs_transaction_hash_game7_testnet_transactions"
|
||||
),
|
||||
ondelete="CASCADE",
|
||||
),
|
||||
sa.PrimaryKeyConstraint(
|
||||
"transaction_hash", "log_index", name="pk_game7_testnet_log_index"
|
||||
),
|
||||
sa.UniqueConstraint(
|
||||
"transaction_hash",
|
||||
"log_index",
|
||||
name="uq_game7_testnet_log_index_transaction_hash_log_index",
|
||||
),
|
||||
)
|
||||
op.create_index(
|
||||
"idx_game7_testnet_logs_address_selector",
|
||||
"game7_testnet_logs",
|
||||
["address", "selector"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_logs_address"),
|
||||
"game7_testnet_logs",
|
||||
["address"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_logs_block_hash"),
|
||||
"game7_testnet_logs",
|
||||
["block_hash"],
|
||||
unique=False,
|
||||
)
|
||||
op.create_index(
|
||||
op.f("ix_game7_testnet_logs_transaction_hash"),
|
||||
"game7_testnet_logs",
|
||||
["transaction_hash"],
|
||||
unique=False,
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_logs_transaction_hash"), table_name="game7_testnet_logs"
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_logs_block_hash"), table_name="game7_testnet_logs"
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_logs_address"), table_name="game7_testnet_logs"
|
||||
)
|
||||
op.drop_index(
|
||||
"idx_game7_testnet_logs_address_selector", table_name="game7_testnet_logs"
|
||||
)
|
||||
op.drop_table("game7_testnet_logs")
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_transactions_type"),
|
||||
table_name="game7_testnet_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_transactions_to_address"),
|
||||
table_name="game7_testnet_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_transactions_selector"),
|
||||
table_name="game7_testnet_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_transactions_index"),
|
||||
table_name="game7_testnet_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_transactions_hash"),
|
||||
table_name="game7_testnet_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_transactions_from_address"),
|
||||
table_name="game7_testnet_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_transactions_block_number"),
|
||||
table_name="game7_testnet_transactions",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_transactions_block_hash"),
|
||||
table_name="game7_testnet_transactions",
|
||||
)
|
||||
op.drop_table("game7_testnet_transactions")
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_reorgs_block_number"), table_name="game7_testnet_reorgs"
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_reorgs_block_hash"), table_name="game7_testnet_reorgs"
|
||||
)
|
||||
op.drop_table("game7_testnet_reorgs")
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_blocks_block_timestamp"),
|
||||
table_name="game7_testnet_blocks",
|
||||
)
|
||||
op.drop_index(
|
||||
op.f("ix_game7_testnet_blocks_block_number"), table_name="game7_testnet_blocks"
|
||||
)
|
||||
op.drop_table("game7_testnet_blocks")
|
||||
# ### end Alembic commands ###
|
|
@ -16,6 +16,7 @@ from .models import (
|
|||
ArbitrumOneLabel,
|
||||
ArbitrumSepoliaLabel,
|
||||
Game7OrbitArbitrumSepoliaLabel,
|
||||
Game7TestnetLabel,
|
||||
XaiLabel,
|
||||
XaiSepoliaLabel,
|
||||
AvalancheLabel,
|
||||
|
@ -55,6 +56,7 @@ class AvailableBlockchainType(Enum):
|
|||
MANTLE = "mantle"
|
||||
MANTLE_SEPOLIA = "mantle_sepolia"
|
||||
GAME7_ORBIT_ARBITRUM_SEPOLIA = "game7_orbit_arbitrum_sepolia"
|
||||
GAME7_TESTNET = "game7_testnet"
|
||||
|
||||
|
||||
def get_label_model(blockchain_type: AvailableBlockchainType) -> Type[
|
||||
|
@ -72,6 +74,7 @@ def get_label_model(blockchain_type: AvailableBlockchainType) -> Type[
|
|||
ArbitrumOneLabel,
|
||||
ArbitrumSepoliaLabel,
|
||||
Game7OrbitArbitrumSepoliaLabel,
|
||||
Game7TestnetLabel,
|
||||
XaiLabel,
|
||||
XaiSepoliaLabel,
|
||||
AvalancheLabel,
|
||||
|
@ -104,6 +107,7 @@ def get_label_model(blockchain_type: AvailableBlockchainType) -> Type[
|
|||
ArbitrumOneLabel,
|
||||
ArbitrumSepoliaLabel,
|
||||
Game7OrbitArbitrumSepoliaLabel,
|
||||
Game7TestnetLabel,
|
||||
XaiLabel,
|
||||
XaiSepoliaLabel,
|
||||
AvalancheLabel,
|
||||
|
@ -164,6 +168,8 @@ def get_label_model(blockchain_type: AvailableBlockchainType) -> Type[
|
|||
label_model = MantleSepoliaLabel
|
||||
elif blockchain_type == AvailableBlockchainType.GAME7_ORBIT_ARBITRUM_SEPOLIA:
|
||||
label_model = Game7OrbitArbitrumSepoliaLabel
|
||||
elif blockchain_type == AvailableBlockchainType.GAME7_TESTNET:
|
||||
label_model = Game7TestnetLabel
|
||||
else:
|
||||
raise ValueError(f"Unknown blockchain type: {blockchain_type}")
|
||||
|
||||
|
|
|
@ -1287,3 +1287,48 @@ class ImxZkevmSepoliaLabel(EvmBasedLabel): # type: ignore
|
|||
postgresql_where=text("label='seer-raw' and label_type='event'"),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
class Game7TestnetLabel(EvmBasedLabel): # type: ignore
|
||||
__tablename__ = "game7_testnet_labels"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"ix_game7_testnet_labels_addr_block_num",
|
||||
"address",
|
||||
"block_number",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"ix_game7_testnet_labels_addr_block_ts",
|
||||
"address",
|
||||
"block_timestamp",
|
||||
unique=False,
|
||||
),
|
||||
Index(
|
||||
"uk_game7_testnet_labels_tx_hash_tx_call",
|
||||
"transaction_hash",
|
||||
unique=True,
|
||||
postgresql_where=text("label='seer' and label_type='tx_call'"),
|
||||
),
|
||||
Index(
|
||||
"uk_game7_testnet_labels_tx_hash_log_idx_evt",
|
||||
"transaction_hash",
|
||||
"log_index",
|
||||
unique=True,
|
||||
postgresql_where=text("label='seer' and label_type='event'"),
|
||||
),
|
||||
Index(
|
||||
"uk_game7_testnet_labels_tx_hash_tx_call_raw",
|
||||
"transaction_hash",
|
||||
unique=True,
|
||||
postgresql_where=text("label='seer-raw' and label_type='tx_call'"),
|
||||
),
|
||||
Index(
|
||||
"uk_game7_testnet_labels_tx_hash_log_idx_evt_raw",
|
||||
"transaction_hash",
|
||||
"log_index",
|
||||
unique=True,
|
||||
postgresql_where=text("label='seer-raw' and label_type='event'"),
|
||||
),
|
||||
)
|
||||
|
|
|
@ -725,6 +725,54 @@ class ImxZkevmSepoliaReorgs(EvmBasedReorgs):
|
|||
__tablename__ = "imx_zkevm_sepolia_reorgs"
|
||||
|
||||
|
||||
class Game7TestnetBlockIndex(EvmBasedBlocks):
|
||||
__tablename__ = "game7_testnet_blocks"
|
||||
|
||||
l1_block_number = Column(BigInteger, nullable=False)
|
||||
|
||||
|
||||
class Game7TestnetTransactionIndex(EvmBasedTransactions):
|
||||
__tablename__ = "game7_testnet_transactions"
|
||||
|
||||
block_number = Column(
|
||||
BigInteger,
|
||||
ForeignKey("game7_testnet_blocks.block_number", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
|
||||
|
||||
class Game7TestnetLogIndex(EvmBasedLogs):
|
||||
__tablename__ = "game7_testnet_logs"
|
||||
|
||||
__table_args__ = (
|
||||
Index(
|
||||
"idx_game7_testnet_logs_address_selector",
|
||||
"address",
|
||||
"selector",
|
||||
unique=False,
|
||||
),
|
||||
UniqueConstraint(
|
||||
"transaction_hash",
|
||||
"log_index",
|
||||
name="uq_game7_testnet_log_index_transaction_hash_log_index",
|
||||
),
|
||||
PrimaryKeyConstraint(
|
||||
"transaction_hash", "log_index", name="pk_game7_testnet_log_index"
|
||||
),
|
||||
)
|
||||
transaction_hash = Column(
|
||||
VARCHAR(256),
|
||||
ForeignKey("game7_testnet_transactions.hash", ondelete="CASCADE"),
|
||||
nullable=False,
|
||||
index=True,
|
||||
)
|
||||
|
||||
|
||||
class Game7TestnetReorgs(EvmBasedReorgs):
|
||||
__tablename__ = "game7_testnet_reorgs"
|
||||
|
||||
|
||||
### ABI Jobs
|
||||
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.0.15
|
||||
0.0.16
|
||||
|
|
|
@ -79,6 +79,7 @@ from moonstreamdbv3.models import EthereumLabel as EthereumLabelV3
|
|||
from moonstreamdbv3.models import (
|
||||
Game7OrbitArbitrumSepoliaLabel as Game7OrbitArbitrumSepoliaLabelV3,
|
||||
)
|
||||
from moonstreamdbv3.models import Game7TestnetLabel as Game7TestnetLabelV3
|
||||
from moonstreamdbv3.models import ImxZkevmLabel as ImxZkevmLabelV3
|
||||
from moonstreamdbv3.models import ImxZkevmSepoliaLabel as ImxZkevmSepoliaLabelV3
|
||||
from moonstreamdbv3.models import MantleLabel as MantleLabelV3
|
||||
|
@ -112,6 +113,7 @@ class AvailableBlockchainType(Enum):
|
|||
ARBITRUM_NOVA = "arbitrum_nova"
|
||||
ARBITRUM_SEPOLIA = "arbitrum_sepolia"
|
||||
GAME7_ORBIT_ARBITRUM_SEPOLIA = "game7_orbit_arbitrum_sepolia"
|
||||
GAME7_TESTNET = "game7_testnet"
|
||||
XAI = "xai"
|
||||
XAI_SEPOLIA = "xai_sepolia"
|
||||
AVALANCHE = "avalanche"
|
||||
|
@ -269,6 +271,7 @@ def get_label_model(
|
|||
ArbitrumOneLabelV3,
|
||||
ArbitrumSepoliaLabelV3,
|
||||
Game7OrbitArbitrumSepoliaLabelV3,
|
||||
Game7TestnetLabelV3,
|
||||
XaiLabelV3,
|
||||
XaiSepoliaLabelV3,
|
||||
AvalancheLabelV3,
|
||||
|
@ -327,6 +330,7 @@ def get_label_model(
|
|||
ArbitrumOneLabelV3,
|
||||
ArbitrumSepoliaLabelV3,
|
||||
Game7OrbitArbitrumSepoliaLabelV3,
|
||||
Game7TestnetLabelV3,
|
||||
XaiLabelV3,
|
||||
XaiSepoliaLabelV3,
|
||||
AvalancheLabelV3,
|
||||
|
@ -414,6 +418,8 @@ def get_label_model(
|
|||
label_model = ArbitrumSepoliaLabelV3
|
||||
elif blockchain_type == AvailableBlockchainType.GAME7_ORBIT_ARBITRUM_SEPOLIA:
|
||||
label_model = Game7OrbitArbitrumSepoliaLabelV3
|
||||
elif blockchain_type == AvailableBlockchainType.GAME7_TESTNET:
|
||||
label_model = Game7TestnetLabelV3
|
||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||
label_model = XaiLabelV3
|
||||
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
|
|
|
@ -80,6 +80,7 @@ from moonstreamdbv3.models import EthereumLabel as EthereumLabelV3
|
|||
from moonstreamdbv3.models import (
|
||||
Game7OrbitArbitrumSepoliaLabel as Game7OrbitArbitrumSepoliaLabelV3,
|
||||
)
|
||||
from moonstreamdbv3.models import Game7TestnetLabel as Game7TestnetLabelV3
|
||||
from moonstreamdbv3.models import ImxZkevmLabel as ImxZkevmLabelV3
|
||||
from moonstreamdbv3.models import ImxZkevmSepoliaLabel as ImxZkevmSepoliaLabelV3
|
||||
from moonstreamdbv3.models import MantleLabel as MantleLabelV3
|
||||
|
@ -115,6 +116,7 @@ class Network(Enum):
|
|||
arbitrum_nova = "arbitrum_nova"
|
||||
arbitrum_sepolia = "arbitrum_sepolia"
|
||||
game7_orbit_arbitrum_sepolia = "game7_orbit_arbitrum_sepolia"
|
||||
game7_testnet = "game7_testnet"
|
||||
xai = "xai"
|
||||
xai_sepolia = "xai_sepolia"
|
||||
avalanche = "avalanche"
|
||||
|
@ -302,6 +304,9 @@ MODELS_V3: Dict[Network, Dict[str, Base]] = {
|
|||
Network.game7_orbit_arbitrum_sepolia: {
|
||||
"labels": Game7OrbitArbitrumSepoliaLabelV3,
|
||||
},
|
||||
Network.game7_testnet: {
|
||||
"labels": Game7TestnetLabelV3,
|
||||
},
|
||||
Network.xai: {
|
||||
"labels": XaiLabelV3,
|
||||
},
|
||||
|
@ -378,6 +383,8 @@ def blockchain_type_to_network_type(
|
|||
return Network.arbitrum_sepolia
|
||||
elif blockchain_type == AvailableBlockchainType.GAME7_ORBIT_ARBITRUM_SEPOLIA:
|
||||
return Network.game7_orbit_arbitrum_sepolia
|
||||
elif blockchain_type == AvailableBlockchainType.GAME7_TESTNET:
|
||||
return Network.game7_testnet
|
||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||
return Network.xai
|
||||
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
|
|
|
@ -21,6 +21,7 @@ class SubscriptionTypes(Enum):
|
|||
GAME7_ORBIT_ARBITRUM_SEPOLIA_BLOCKCHAIN = (
|
||||
"game7_orbit_arbitrum_sepolia_smartcontract"
|
||||
)
|
||||
GAME7_TESTNET_BLOCKCHAIN = "game7_testnet_smartcontract"
|
||||
XAI_BLOCKCHAIN = "xai_smartcontract"
|
||||
XAI_SEPOLIA_BLOCKCHAIN = "xai_sepolia_smartcontract"
|
||||
AVALANCHE_BLOCKCHAIN = "avalanche_smartcontract"
|
||||
|
@ -69,6 +70,8 @@ def blockchain_type_to_subscription_type(
|
|||
return SubscriptionTypes.ARBITRUM_SEPOLIA_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.GAME7_ORBIT_ARBITRUM_SEPOLIA:
|
||||
return SubscriptionTypes.GAME7_ORBIT_ARBITRUM_SEPOLIA_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.GAME7_TESTNET:
|
||||
return SubscriptionTypes.GAME7_TESTNET_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.XAI:
|
||||
return SubscriptionTypes.XAI_BLOCKCHAIN
|
||||
elif blockchain_type == AvailableBlockchainType.XAI_SEPOLIA:
|
||||
|
@ -115,6 +118,7 @@ subscription_id_by_blockchain = {
|
|||
"arbitrum_nova": "arbitrum_nova_smartcontract",
|
||||
"arbitrum_sepolia": "arbitrum_sepolia_smartcontract",
|
||||
"game7_orbit_arbitrum_sepolia": "game7_orbit_arbitrum_sepolia_smartcontract",
|
||||
"game7_testnet": "game7_testnet_smartcontract",
|
||||
"xai": "xai_smartcontract",
|
||||
"xai_sepolia": "xai_sepolia_smartcontract",
|
||||
"avalanche": "avalanche_smartcontract",
|
||||
|
@ -146,6 +150,7 @@ blockchain_by_subscription_id = {
|
|||
"arbitrum_nova_blockchain": "arbitrum_nova",
|
||||
"arbitrum_sepolia_blockchain": "arbitrum_sepolia",
|
||||
"game7_orbit_arbitrum_sepolia_blockchain": "game7_orbit_arbitrum_sepolia",
|
||||
"game7_testnet_blockchain": "game7_testnet",
|
||||
"xai_blockchain": "xai",
|
||||
"xai_sepolia_blockchain": "xai_sepolia",
|
||||
"avalanche_blockchain": "avalanche",
|
||||
|
@ -173,6 +178,7 @@ blockchain_by_subscription_id = {
|
|||
"arbitrum_nova_smartcontract": "arbitrum_nova",
|
||||
"arbitrum_sepolia_smartcontract": "arbitrum_sepolia",
|
||||
"game7_orbit_arbitrum_sepolia_smartcontract": "game7_orbit_arbitrum_sepolia",
|
||||
"game7_testnet_smartcontract": "game7_testnet",
|
||||
"xai_smartcontract": "xai",
|
||||
"xai_sepolia_smartcontract": "xai_sepolia",
|
||||
"avalanche_smartcontract": "avalanche",
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.0.5
|
||||
0.0.6
|
||||
|
|
|
@ -34,7 +34,7 @@ setup(
|
|||
zip_safe=False,
|
||||
install_requires=[
|
||||
"moonstreamdb>=0.4.5",
|
||||
"moonstreamdb-v3>=0.0.15",
|
||||
"moonstreamdb-v3>=0.0.16",
|
||||
],
|
||||
extras_require={
|
||||
"dev": ["black", "isort", "mypy"],
|
||||
|
|
Ładowanie…
Reference in New Issue