Skip to content

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Sep 2, 2024

This pull request moves the implementation of REST API exposing deals eligible for testing from spark-stats to spark-api, as discussed in CheckerNetwork/spark-stats#194 (comment)

Links:

Example request:

GET /miner/f0814049/deals/eligible/summary

Example response:

{
  "minerId": "f0814049",
  "dealCount": 10006,
  "clients": [
    { "clientId": "f02516933", "dealCount": 6880 },
    { "clientId": "f02833886", "dealCount": 3126 }
  ]
}

Example request:

GET /clients/f0215074/deals/eligible/summary

Example response:

{
  "clientId": "f0215074",
  "dealCount": 5350,
  "providers": [
    { "minerId": "f0406478", "dealCount": 4592 },
    { "minerId": "f0814049", "dealCount": 758 }
  ]
}

Example request:

GET /allocator/f03015751/deals/eligible/summary

Example response:

{
  "allocatorId": "f03019831",
  "dealCount": 117596,
  "clients": [
    { "clientId": "f02056762", "dealCount": 64674 },
    { "clientId": "f03146638", "dealCount": 21405 }
  ]
}

Example request:

```
GET /retrievable-deals/miner/:minerId
```

Example response:

```json
[
  {
    "clientId": "f02516933",
    "dealCount": 6880
  },
  {
    "clientId": "f02833886",
    "dealCount": 3126
  }
]
```

Example request:

```
GET /retrievable-deals/client/:clientId
```

Example response:

```json
[
  {
    "minerId": "f0406478",
    "dealCount": 4592
  },
  {
    "minerId": "f0814049",
    "dealCount": 758
  }
]
```

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@bajtos bajtos requested a review from juliangruber September 2, 2024 09:51
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Copy link
Member

@juliangruber juliangruber left a comment

Choose a reason for hiding this comment

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

Great! Awesome that you followed up with this 🙇

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@bajtos bajtos merged commit fd83a09 into main Sep 2, 2024
8 checks passed
@bajtos bajtos deleted the expose-eligible-deals branch September 2, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants