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

Return jobs endpoint #876

Merged
merged 8 commits into from
Aug 31, 2023
Merged

Return jobs endpoint #876

merged 8 commits into from
Aug 31, 2023

Conversation

Andrei-Dolgolev
Copy link
Contributor

@Andrei-Dolgolev Andrei-Dolgolev commented Jul 31, 2023

Retrun jobs endpoint:

get moonworm_tasks jobs:

GET http://127.0.0.1:7481/subscriptions/eec5123c-cd6f-4b12-b865-45cd1da18d74/jobs
Authorization: Bearer <moonstream_tasks>

response example

 {
    "entry_url": "https://spire.bugout.dev/journals/8cebecca-bcaf-41b4-a37e-b084dfdbf968/entries/2ea79228-18c9-4eb6-ba6e-5a0465d45b01",
    "content_url": "https://spire.bugout.dev/journals/8cebecca-bcaf-41b4-a37e-b084dfdbf968/entries/2ea79228-18c9-4eb6-ba6e-5a0465d45b01/content",
    "title": "0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC",
    "content": "{\n    \"anonymous\": false,\n    \"inputs\": [\n        {\n            \"indexed\": false,\n            \"internalType\": \"bytes32[]\",\n            \"name\": \"orderHashes\",\n            \"type\": \"bytes32[]\"\n        }\n    ],\n    \"name\": \"OrdersMatched\",\n    \"type\": \"event\"\n}",
    "tags": [
      "abi_method_hash:e3c4a22bb4446d427761446d1ee76776",
      "abi_name:OrdersMatched",
      "abi_selector:0x4b9f2d36",
      "address:0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC",
      "historical_crawl_status:finished",
      "historical_crawl_status:in_progress",
      "moonworm_task_pickedup:True",
      "progress:100.08999999999999",
      "status:active",
      "subscription_type:polygon_smartcontract",
      "task_type:moonworm",
      "type:event"
    ],
    "created_at": "2023-08-08 09:50:11.036637+00:00",
    "updated_at": "2023-08-08 09:50:11.036637+00:00",
    "score": 1.0,
    "context_type": "bugout",
    "context_url": null,
    "context_id": null
  }

will return list of moonworm tasks which was part of that subscription.

Fix supported_interfaces endpoint for blockchains without deployed multiacll contract.

GET http://127.0.0.1:7481/subscriptions/supported_interfaces?address=0xcc1eBf6Dbb9fF24A745D1cc7F6DC3eeDa5f9fa71&blockchain=zksync_era_testnet
Authorization: Bearer <moonstream_token>

Copy link
Contributor

@kompotkot kompotkot left a comment

Choose a reason for hiding this comment

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

smch

moonstreamapi/moonstreamapi/actions.py Outdated Show resolved Hide resolved

list_of_interfaces.sort()
contract = web3_client.eth.contract(
Copy link
Contributor

Choose a reason for hiding this comment

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

I would put this after line 868 if not is_contract: so we will not run additional operation if error will be raised

]


def filter_tasks(entries, tag_filters):
Copy link
Contributor

Choose a reason for hiding this comment

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

why we need this func if we use it only in 1 place?

moonstreamapi/moonstreamapi/routes/subscriptions.py Outdated Show resolved Hide resolved
Copy link
Contributor

@kompotkot kompotkot left a comment

Choose a reason for hiding this comment

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

lg

@Andrei-Dolgolev Andrei-Dolgolev merged commit 87997ad into main Aug 31, 2023
1 check failed
@Andrei-Dolgolev Andrei-Dolgolev deleted the return-jobs-endpoint branch August 31, 2023 10:40
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