Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
www
 
 
 
 
 
 
 
 
 
 
 
 

StorjNet

Useful APIs

GET /api/neighbors/<subnet>

Where subnet may be actual subnet address like 1.2.3.0 or just IP 1.2.3.4.

Response

{"ok": true, "result": {"count": 3}}

POST /api/neighbors

Request payload

{
  "subnets": ["1.2.3.4", "2.3.4.0", "2.3.5.0"],
  "myNodeIds": ["1AaaAA","1AaaAB","1AaaAC"]
}
  • subnets — list of subnets/IPs;
  • myNodeIds — optional list of node IDs to count foreign nodes.

Response

{
  "ok": true,
  "result": {
    "counts": [
      {
        "subnet": "1.2.3.0",
        "nodesTotal": 4,
        "foreignNodesCount": 2
      },
      {
        "subnet": "2.3.4.0",
        "nodesTotal": 1,
        "foreignNodesCount": 0
      }
    ]
  }
}
  • subnet — requested subnet (with trailing .0);
  • nodesTotal — total nodes in subnet;
  • foreignNodesCount — count of subnet nodes except myNodeIds.

Items will be absent for empty subnets.

DB setup

sudo su - postgres
createuser storjnet -P  # with password "storj"
createdb storjnet_db -O storjnet --echo
psql storjnet_db -c "CREATE SCHEMA storjnet AUTHORIZATION storjnet"
psql storjnet_db -c "CREATE EXTENSION pgcrypto WITH SCHEMA storjnet"

go run migrations/*.go init
go run migrations/*.go

About

Storj v3 network statistics

Resources

Releases

No releases published

Packages

No packages published