Skip to content

the example that fetches rps of bNEO using given blockcount #10

@dusmart

Description

@dusmart

V17 has built a robot processing all rPS history data. The data is located in Azure Storage. Here is an example that fetches rPS from Azure.

async function burger_gas_per_neo_per_second(block, duration) {
    const start = `https://neoburger.blob.core.windows.net/status/${block}.json`;
    const stop = `https://neoburger.blob.core.windows.net/status/${block - duration}.json`;
    const resp = await Promise.all([fetch(start, { method: 'GET' }), fetch(stop, { method: 'GET' })])
    const [jx, jy] = await Promise.all(resp.map(v => v.json()))
    const drps = jx.rps - jy.rps
    const dtime = jx.timestamp - jy.timestamp
    return drps * 1000 / dtime;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions