subscan-explorer / subscan-issue-tracker

The issue tracker for Subscan.io.
3 stars 5 forks source link

The value of Storage capacity and Data stored for Crust is diff from website vs api response. #81

Closed stayForward09 closed 5 months ago

stayForward09 commented 6 months ago

Confirmation

Affected Network(s)

Crust

Steps to reproduce

I'm going to add Crust keymetrics of Storage data and Data stored to our website https://depin.ninja. And I found the perfect info from https://crust.subscan.io/tools/charts?type=crust_storage, and tried to get this data from api https://crust.api.subscan.io/api/scan/swork/daily. But I just noticed, the response from api is different from the value of main site.

Expected output

image image I wanna get exact value the same as these site.

Actual output

But the response of api is;

{
    "code": 0,
    "message": "Success",
    "generated_at": 1703756151,
    "data": {
        "list": [
            {
                "time_utc": "2023-12-20T00:00:00Z",
                "node_count": 1470,
                "storage": "9141834907008794",
                "file_count": 2180108,
                "total_storage": "739157354267426586"
            },
            {
                "time_utc": "2023-12-21T00:00:00Z",
                "node_count": 1471,
                "storage": "9131808845402033",
                "file_count": 2180224,
                "total_storage": "739633610845523889"
            },
            {
                "time_utc": "2023-12-22T00:00:00Z",
                "node_count": 1476,
                "storage": "9163123395409894",
                "file_count": 2180411,
                "total_storage": "740375513776011238"
            },
            {
                "time_utc": "2023-12-23T00:00:00Z",
                "node_count": 1477,
                "storage": "9103205178519414",
                "file_count": 2180598,
                "total_storage": "740500088026804086"
            },
            {
                "time_utc": "2023-12-24T00:00:00Z",
                "node_count": 1475,
                "storage": "9084350993543192",
                "file_count": 2180752,
                "total_storage": "739159990232428568"
            },
            {
                "time_utc": "2023-12-25T00:00:00Z",
                "node_count": 1474,
                "storage": "9012645096185415",
                "file_count": 2180850,
                "total_storage": "738345194863320647"
            },
            {
                "time_utc": "2023-12-26T00:00:00Z",
                "node_count": 1480,
                "storage": "9065630419258241",
                "file_count": 2180914,
                "total_storage": "741563248960998273"
            },
            {
                "time_utc": "2023-12-27T00:00:00Z",
                "node_count": 1481,
                "storage": "9065504766113431",
                "file_count": 2181138,
                "total_storage": "741795335009678999"
            },
            {
                "time_utc": "2023-12-28T00:00:00Z",
                "node_count": 1478,
                "storage": "8988126086097400",
                "file_count": 2181824,
                "total_storage": "740137793838049784"
            }
        ]
    }
}

Would you please help me to find the reason, or I think, I did misunderstand about api or main site. Thanks.

Additional factoids or references

No response

stayForward09 commented 6 months ago

And may I have one more question? Where or when should I use API_key? I can successfully run api request without api key.

curl --location --request POST 'https://crust.api.subscan.io/api/scan/swork/daily' \
--header 'User-Agent: Apidog/1.0.0 (https://apidog.com)' \
--header 'Content-Type: application/json' \
--data-raw '{
    "category": "nodes",
    "end": "string",
    "start": "string"
}'

And I can't find any room to embed api key in this sample query. Could you please help me? Thanks.

freehere107 commented 6 months ago

@stayForward09 Hi, You can ref this doc https://support.subscan.io/doc-361777

stayForward09 commented 6 months ago

Thanks, @freehere107, I got it. And sorry to say, but would you please tell me about the first issue?

carlhong commented 5 months ago

@stayForward09 The amount is calculated by total_storage (TB) / (1024 1024 1024 * 1024)

stayForward09 commented 5 months ago

Thanks so much! @carlhong @freehere107