mistakia / nano-community

Community gateway and knowledge hub for Nano (digital money)
https://nano.community
MIT License
26 stars 24 forks source link

feat: implement similar API functionality as `mynano.ninja/api` #74

Open mistakia opened 11 months ago

mistakia commented 11 months ago

API Endpoint: https://nano.community/api/accounts/<address> Example: https://nano.community/api/accounts/nano_37imps4zk1dfahkqweqa91xpysacb7scqxf3jqhktepeofcxqnpx531b3mnt Current output:

{
    "account": "nano_37imps4zk1dfahkqweqa91xpysacb7scqxf3jqhktepeofcxqnpx531b3mnt",
    "alias": "Kraken",
    "monitor_url": null,
    "watt_hour": null,
    "representative": 1,
    "last_seen": 1690774803,
    "account_meta": {
        "account": "nano_37imps4zk1dfahkqweqa91xpysacb7scqxf3jqhktepeofcxqnpx531b3mnt",
        "modified_timestamp": 1681837680,
        "account_version": 2,
        "representative": "nano_37imps4zk1dfahkqweqa91xpysacb7scqxf3jqhktepeofcxqnpx531b3mnt",
        "pending": 2.5e+23,
        "balance": 1.9901168e+31,
        "block_count": 40,
        "weight": 1.1820291789118035e+37,
        "confirmation_height": 40
    },
    "representative_meta": {
        "account": "nano_37imps4zk1dfahkqweqa91xpysacb7scqxf3jqhktepeofcxqnpx531b3mnt",
        "cpu_cores": null,
        "cpu_description": null,
        "cpu_model": null,
        "bandwidth_description": null,
        "ram": null,
        "ram_description": null,
        "dedicated": null,
        "type": null,
        "provider": "AMAZON-02",
        "created_at": 1573504301,
        "description": null,
        "mynano_ninja": "https://mynano.ninja/account/kraken",
        "ninja_ram_description": null,
        "ninja_cpu_description": null,
        "ninja_description": null,
        "ninja_type": null,
        "ninja_created_at": 1573504301,
        "ninja_provider": "AMAZON-02",
        "reddit": "",
        "twitter": "@krakenfx",
        "discord": "",
        "github": "",
        "timestamp": 1690560003
    },
    "uptime": [ ... ],
    "telemetry": {
        "account": "nano_37imps4zk1dfahkqweqa91xpysacb7scqxf3jqhktepeofcxqnpx531b3mnt",
        "weight": 1.182029178911803e+37,
        "block_count": 180844302,
        "block_behind": 320,
        "cemented_count": 180844302,
        "cemented_behind": 0,
        "unchecked_count": 9,
        "account_count": 31111048,
        "bandwidth_cap": 10485760,
        "peer_count": 205,
        "protocol_version": 19,
        "uptime": 3334496,
        "major_version": 25,
        "minor_version": 1,
        "patch_version": 0,
        "pre_release_version": "0",
        "maker": "0",
        "node_id": "node_31fbnnf9w6ygstiqesabx8frnjdumeqp9qucixxcc9xkx849zpxoxaabu7ji",
        "address": "::ffff:52.24.24.124",
        "port": 7075,
        "telemetry_timestamp": 1690774798,
        "timestamp": 1690774803
    },
    "telemetry_history": [ ... ],
    "network": {
        "account": "nano_37imps4zk1dfahkqweqa91xpysacb7scqxf3jqhktepeofcxqnpx531b3mnt",
        "address": "::ffff:52.24.24.124",
        "continent": "North America",
        "country": "United States",
        "countryCode": "US",
        "region": "OR",
        "regionName": "Oregon",
        "city": "Portland",
        "zip": "97207",
        "lat": "45.5235",
        "lon": "-122.676",
        "timezone": "America/Los_Angeles",
        "isp": "Amazon.com, Inc.",
        "org": "AWS EC2 (us-west-2)",
        "as": "AS16509 Amazon.com, Inc.",
        "asname": "AMAZON-02",
        "hosted": 1,
        "timestamp": 1690551003
    },
    "last_online": 1690774803,
    "last_offline": 1687440302,
    "uptime_summary": {
        "days_7": {
            "account": "nano_37imps4zk1dfahkqweqa91xpysacb7scqxf3jqhktepeofcxqnpx531b3mnt",
            "online_count": 2013,
            "offline_count": 0
        },
        "days_30": {
            "account": "nano_37imps4zk1dfahkqweqa91xpysacb7scqxf3jqhktepeofcxqnpx531b3mnt",
            "online_count": 8637,
            "offline_count": 0
        },
        "days_60": {
            "account": "nano_37imps4zk1dfahkqweqa91xpysacb7scqxf3jqhktepeofcxqnpx531b3mnt",
            "online_count": 11666,
            "offline_count": 5611
        },
        "days_90": {
            "account": "nano_37imps4zk1dfahkqweqa91xpysacb7scqxf3jqhktepeofcxqnpx531b3mnt",
            "online_count": 20303,
            "offline_count": 5613
        }
    },
    "delegators": [
        {
            "account": "nano_3cpz7oh9qr5b7obbcb5867omqf8esix4sdd5w6mh8kkknamjgbnwrimxsaaf",
            "balance": 1.07933861207158e+37,
            "alias": "Kraken Hot Wallet "
        },
        {
            "account": "nano_1fngydktrrxd8pofswmyhi5suootfdbgfd54bty3o3xgon8rk4djaco9xfeu",
            "balance": 1.0088521727976398e+36,
            "alias": null
        },
        {
            "account": "nano_3kfk99hf1xruiz95eo4jgp96mzej6xkn7uusd7fjs414dem3kkpbkbkcrg9z",
            "balance": 1.109351477368e+34,
            "alias": null
        },
        {
            "account": "nano_33c9huwmg5z4kzrt3dip7qheigriia544qmfwhbqwi4754tq3mihdxac9sjy",
            "balance": 4.4737555276600006e+33,
            "alias": null
        },
        {
            "account": "nano_1n9appfj4a4q6smupnn995z3bubtdenufynpwi9jk5ibjkw5fjb8oh78ehq9",
            "balance": 8.726979e+32,
            "alias": null
        },
        {
            "account": "nano_1gcrycfxurynummehyk8jf55bs1hiut6gtypgnxgpiu8sh95xsmqdbgt1neh",
            "balance": 4.845431859999999e+32,
            "alias": null
        },
        {
            "account": "nano_1kgxi638oogp3z4fdxt5ee5ns5swgkbquzxbt3rm7kyrn7pky4waieeaw3gm",
            "balance": 4.5538416362e+32,
            "alias": null
        },
        {
            "account": "nano_1e3dytot6zwmmm6pxcn94qycsamkahg6duoz95qsntcwnayc3zrun9hd8s1a",
            "balance": 4.257142668976543e+32,
            "alias": null
        },
        {
            "account": "nano_3x31xgc43temh6i4q1puucoyjmsgak89fiaegj56cyntsinxxfjzfmsrmdq9",
            "balance": 5.408255811999998e+31,
            "alias": null
        },
        {
            "account": "nano_3jbodz81oxir6ospqued61xto9sg7epcrzs7y9bf3wr6y8ajs9rf7d4e8s77",
            "balance": 5.007687152e+31,
            "alias": null
        },
        {
            "account": "nano_3qkiz1fg5kyxyp85a3sgdm4rrc86aj8qasx4bdzetu7gkhqbenw44zxrzhwd",
            "balance": 3.489455100000001e+31,
            "alias": null
        },
        {
            "account": "nano_1u56g96j4ft1fs7ahrw87zkjwr7o6kaufz4nk5skkxnowmwc8yo8mgo1z8bb",
            "balance": 3.0713002600000003e+31,
            "alias": null
        },
        {
            "account": "nano_13egkbp8mi7ff5s5eafx6yoiatr5w6fmn3mpbpbm9gsobxxeput1tq5pyfzm",
            "balance": 2.714574680195511e+31,
            "alias": "unMineable Payouts"
        },
        {
            "account": "nano_37imps4zk1dfahkqweqa91xpysacb7scqxf3jqhktepeofcxqnpx531b3mnt",
            "balance": 1.9901167999999998e+31,
            "alias": "Kraken"
        },
        {
            "account": "nano_13bynzptptihqmsasno87ykgezdm7dwiehxxtes5qeojm67n9kycyttxoky1",
            "balance": 1.1214368200000002e+31,
            "alias": null
        },
        {
            "account": "nano_3kmznukjdmr4acpq4bnkbbx4fxjhbtgk85k7akjrnchj49b13arb75fm47zs",
            "balance": 9.999999999999999e+30,
            "alias": null
        },
        {
            "account": "nano_3aaq4w1qihiozewz9za1ejjnnh3b7cetcrrmpm1fxi1yt6spbpsywruwzdhn",
            "balance": 9.370301727653219e+30,
            "alias": null
        }
    ]
}
nano2dev commented 11 months ago

I made these to fix https://Nault.Pro:

https://rpc.nano.to/#reps

https://rpc.nano.to/#rep_info

Do they help in any way?

mistakia commented 11 months ago

@nano2dev yea possibly — looks like it has most of the same metrics (uptime, alias, last_voted). Will evaluate it.

I think it makes sense for me to implement it as well for redundancy, I can use the same schema.

Any public information on how score is calculated?

nano2dev commented 11 months ago

On Fri, Aug 4, 2023 at 11:02 PM trashman @.***> wrote:

@nano2dev yea possibly — looks like it has most of the same metrics ( uptime, alias, last_voted). Will evaluate it.

I think it makes sense for me to implement it as well for redundancy, I can use the same schema.

Any public information on how score is calculated?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

qwahzi commented 11 months ago

@nano2dev @mistakia - Here are the old scoring details for MNN:

image

nano2dev commented 10 months ago

https://github.com/Nault/Nault/blob/master/src/app/services/ninja.service.ts

This file is responsible for doing Nault's MNN interfacing.