Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3 state crawler #1142

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

V3 state crawler #1142

wants to merge 13 commits into from

Conversation

Andrei-Dolgolev
Copy link
Contributor

@Andrei-Dolgolev Andrei-Dolgolev commented Nov 26, 2024

State jobs have ability run over v3 instaces.

state-crawler --web3-uri  crawl-jobs --blockchain game7_testnet  --customer-db-uri

Added --customer-db-uri parameter.

new types of jobs available.

[{
    "customer_id": "uuid",
    "instance_id": int,
    "v3": true,
    "type": "function",
    "stateMutability": "view",
    "inputs": [],
    "name": "symbol",
    "constant": true,
    "payable": false,
    "outputs": [
        {
            "name": "",
            "type": "string"
        }
    ],
    "address": {
            "customer_id": "uuid",
            "instance_id": int,
            "type": "queryAPI",
            "query_url": "template_arbitrum_gateway_tokens",
            "blockchain": "<chain>",
            "params": {
                "address": "<address>"
            },
            "keys": [
                "address"
            ]
        }
}]

Request connection string from the Moonstream API.
"""
response = requests.get(
f"https://mdb-v3-api.moonstream.to/customers/{customer_id}/instances/{instance_id}/creds/seer/url",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create env var for mdb-v3 api pls. Actually it is already exists MOONSTREAM_DB_V3_CONTROLLER_API

crawlers/mooncrawl/mooncrawl/data.py Show resolved Hide resolved
Determines the table names based on the blockchain and labels version.
Returns an empty dictionary if blockchain is not provided.
"""
if not request_data.blockchain:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better to throw exception here?

### bytea
address=HexBytes(call["address"]),
block_number=call["block_number"],
transaction_hash="0x2653135e31407726a25dd8d304878578cdfcc7d69a2b319d1aca4a37ed66956a",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded tx hash?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me think about that table require it me need check if i can simple reduce that unique constrain.

@@ -39,6 +39,7 @@ MarkupSafe==2.1.1
moonstream==0.1.1
moonstreamdb==0.4.5
moonstreamdb-v3==0.0.18
moonstreamtypes==0.0.6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In setup.py version is 0.0.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants