{"id":26027781,"url":"https://github.com/biluohc/keepstats","last_synced_at":"2025-06-23T06:37:18.089Z","repository":{"id":201123300,"uuid":"298432633","full_name":"biluohc/KeepStats","owner":"biluohc","description":null,"archived":false,"fork":false,"pushed_at":"2020-11-29T08:24:06.000Z","size":157,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T16:57:28.783Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/biluohc.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-09-25T01:07:18.000Z","updated_at":"2020-11-29T08:24:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"141c2d73-49c3-4e71-8b51-37af730f6e90","html_url":"https://github.com/biluohc/KeepStats","commit_stats":null,"previous_names":["biluohc/keepstats"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/biluohc/KeepStats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biluohc%2FKeepStats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biluohc%2FKeepStats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biluohc%2FKeepStats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biluohc%2FKeepStats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biluohc","download_url":"https://codeload.github.com/biluohc/KeepStats/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biluohc%2FKeepStats/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261430524,"owners_count":23157160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-06T16:57:29.780Z","updated_at":"2025-06-23T06:37:13.070Z","avatar_url":"https://github.com/biluohc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [KeepStats](http://keepstats.top/)\n\n## Compile and deploy\n\n### GeoIP supported by free MaxmindDB\n\nIt's not bundled: you have to download it separately. Download `GeoLite2 City` dataset in binary format from [dev.maxmind.com](https://dev.maxmind.com/geoip/geoip2/geolite2/#Downloads) or [wp-statistics](https://github.com/wp-statistics/GeoLite2-City) and unzip it.\n\n### Configuration PostgreSQL\n\nView [sql/](https://github.com/biluohc/KeepStats/tree/master/sql)\n\n### Compile\n\n```\nmake build\n```\n\n### Generate Docker image\n\n```\nmake image\n```\n\n### Configuration modified Keep-Core and Keep-ECDSA\n\n#### Keep-Core: https://github.com/biluohc/keep-core/releases/tag/v1.3.0-keepstats\n\nadd follows to its config:\n\n```\n[Diagnostics]\nPort = 3911\n```\n\n#### Keep-ECDSA: https://github.com/biluohc/keep-ecdsa/releases/tag/v1.2.0-keepstats\n\nadd follows to its config:\n\n```\n[Diagnostics]\nPort = 3921\n```\n\n### Run Api\n\n```\nmake run\n```\n\n### Test the api\n\n```\n# netid is ethereum netid, mainnet is 1, ropsten is 3.\n\ncurl  -v  'localhost:8080/api/peers?netid=3\u0026kind=keep_core\u0026lastActiveHours=2'\ncurl  -v  'localhost:8080/api/peers?netid=3\u0026kind=keep_ecdsa\u0026lastActiveHours=5'\n\ncurl  -v  'localhost:8080/api/peerstats?netid=3\u0026kind=keep_core\u0026days=30' | jq .\ncurl  -v  'localhost:8080/api/tokenstats?netid=3\u0026token=keep\u0026days=10' | jq .\ncurl  -v  'localhost:8080/api/tokenstats?netid=3\u0026token=tbtc\u0026days=10' | jq .\ncurl  'localhost:8080/api/operatorstats?netid=3\u0026kind=keep_core' |jq . |head -n 20\ncurl  'localhost:8080/api/operatorstats?netid=3\u0026kind=keep_ecdsa' |jq . |head -n 20\n```\n\n## How it works\n\n### Get peers information\n\nI modified the p2p and diagnostics modules of keep-core so that it provides more information, such as the network address of peers. keep-ecdsa can also provide these Information when let keep-ecdsa use the modified keep-core.\n\nThe information provided by the modified interface as follows:\n\n```\ncurl http://127.0.0.1:3911/diagnostics |jq .|head -n 20\n{\n  \"client_info\": {\n    \"datetime\": \"2020-09-30 14:04:34\",\n    \"ethereum_address\": \"0xDa0794DeeCe014ec3Ee131a2977dba7D244A5cEE\",\n    \"network_addrs\": [\n      \"35.239.155.151:3919\"\n    ],\n    \"network_id\": \"16Uiu2HAm78w8pUm1aYxjCP4atWFDsUeLaoFk2CLn3JEJGmWWUX98\"\n  },\n  \"connected_peers\": [\n    {\n      \"ethereum_address\": \"0xa89fF596ceA4027326F111a356C8C0FeF154bEe2\",\n      \"network_addr\": \"165.227.86.51:3919\",\n      \"network_id\": \"16Uiu2HAmKdsGDBKqny3giAudLvkvoq5WVT62MtnCd1hQdzRwsrGp\"\n    },\n    {\n      \"ethereum_address\": \"0x5025d9F14D5E673Fb3bb514e238731DdaDa94Cc8\",\n      \"network_addr\": \"95.179.138.192:3919\",\n      \"network_id\": \"16Uiu2HAmGaQBt11kNqZaRYanHpGmmbhjf2KAc1FBoEn9sBUBAmxK\"\n    },\n```\n\n### Store peers information\n\nWrite a crawler to periodically grab peers' data from their diagnostics API and save it to PostgreSQL.\n\n### Provide API for frontend\n\nImplement an API that provides peers' information, and fill in the location information for every peer through its network address.\n\n### Display keep network node information\n\nUse React and Google Maps to show the distribution of keep nodes around the world.\n\n## Plans\nSince the geographical distribution of keep nodes has been shown, I plan to add more on-chain data to the website to make [KeepStats](http://keepstats.top/)  more practical and beautiful:\n1. Statistics of KEEP and TBTC, etc. \n2. On-chain status of each node's wallet.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiluohc%2Fkeepstats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiluohc%2Fkeepstats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiluohc%2Fkeepstats/lists"}