Crawling the stacks network to find nodes

I was wondering if there is a data dictionary associated with all the RPC endpoints somewhere. Specifically I am looking to understand the data returned by the /v2/neighbors endpoint. Below is a sample response from one of my nodes. Looking to understand what the samples, inbound and outbound arrays represent and also what the data definition of the other element contained in the arrays.

Also, the port in the data returned appears to be the P2P port. Is there a way to figure out what the RPC port may be for the nodes ?

Thanks.

{
"sample": [
{
"network_id": 1,
"peer_version": 402653189,
"ip": "3.72.228.3",
"port": 20444,
"public_key_hash": "3196e71a0a1b94e11e1702396a6f426af8ba0de5",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "45.79.131.55",
"port": 20444,
"public_key_hash": "511ecf25bbc2e6e8c7eb22e495f68fb8e7d2babf",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "0.0.0.0",
"port": 20444,
"public_key_hash": "f876dbba4362d953b33d0bb3ff845c545a99d617",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "132.145.183.187",
"port": 20444,
"public_key_hash": "458c3dfd7c6fce257f81b1acf4ab13c2e77069ae",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "157.90.236.162",
"port": 20444,
"public_key_hash": "248ad5cf3e9f4e0fa4b1eb4916de69992fe965a0",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "34.226.141.10",
"port": 20444,
"public_key_hash": "eb8b3e5bcd99f9c95e3767cfa14385960f5b421e",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "34.86.228.189",
"port": 20444,
"public_key_hash": "bf02066806af9698d8204bf65c5ebd23ceb74b66",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "143.244.177.179",
"port": 20444,
"public_key_hash": "f6958e7c6d9eb2ab986cb9a8f3aee454b4e3b0a3",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "52.0.54.100",
"port": 20444,
"public_key_hash": "f7d1d40f5444e3e5f1d0abee7cbc0a69dcd44b48",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "167.172.228.153",
"port": 20444,
"public_key_hash": "1aba1f33013469d044425e9919ecc351448d19e0",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "172.31.5.90",
"port": 20444,
"public_key_hash": "a05378b0d85125ab1c2111b9a6215f409ee50cf7",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "47.243.240.87",
"port": 20444,
"public_key_hash": "7947c9eb3aa9c9fe1566e28556b901f1f8e06bea",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "20.82.122.70",
"port": 20444,
"public_key_hash": "ce29d103d0b1f904f573ffd1dd72dcda5ab2286d",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "175.41.164.183",
"port": 20444,
"public_key_hash": "3883ffcda0b3ff5f7e735005edd451733dbbff28",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "34.168.36.39",
"port": 20444,
"public_key_hash": "738ac20577f8b739d3d2abaf74a69e83619e9822",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "47.242.123.146",
"port": 20444,
"public_key_hash": "a155ebecb5bacd874237f92f068eb6bcf41bfcea",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "13.214.49.15",
"port": 20444,
"public_key_hash": "4fe5edbad9df5e3685f22dcead34be3407eb9fed",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.199.6.155",
"port": 20444,
"public_key_hash": "a7a33c5e9cf835f92a83d16e1765c4d3b8dee6c0",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "54.87.83.114",
"port": 20444,
"public_key_hash": "a02012f135dd5e2a0fe691942f2a9b49be2897ec",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "54.144.204.81",
"port": 20444,
"public_key_hash": "d533b05f1ac7b3e01a1124fd9064f4b2d885b6a3",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "193.142.201.80",
"port": 20444,
"public_key_hash": "ba57711b461a5ed84af835b2143e20915f36cc6d",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "18.142.26.229",
"port": 20444,
"public_key_hash": "adb850343979a8f042f58c67d4c35ceffab2d2d7",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "23.23.19.109",
"port": 20444,
"public_key_hash": "ebb706f6d5c058c2f3f7bce5602547971310a1cd",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "52.76.29.56",
"port": 20444,
"public_key_hash": "b52a028c13c1a913e41f7c3a1519ff46bcbae317",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "34.168.91.195",
"port": 20444,
"public_key_hash": "738ac20577f8b739d3d2abaf74a69e83619e9822",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "34.194.129.81",
"port": 20444,
"public_key_hash": "6b70d7e33b16eccc064805c9aed00c160747877b",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "73.119.245.23",
"port": 20444,
"public_key_hash": "2290c8492d5c762a3ac50602747a23cd7e888cdb",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "65.108.203.23",
"port": 20444,
"public_key_hash": "dcef89922978d374887f78ea4e7439cbc1d870bf",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "34.125.104.149",
"port": 20444,
"public_key_hash": "11efc2ef9bb48989e1a88d45f7642298b01fdbc0",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "3.237.176.147",
"port": 20444,
"public_key_hash": "422d36429e1a2537baa7ceacf5afdfe551efade6",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "34.106.64.122",
"port": 20444,
"public_key_hash": "f876dbba4362d953b33d0bb3ff845c545a99d617",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "18.184.252.114",
"port": 20444,
"public_key_hash": "8ec4ed43fd7207006e5564861ed82dc8f4a9c147",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "95.217.62.83",
"port": 20444,
"public_key_hash": "b4d299a6431e738e191fb77c2e218cb1831047df",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "65.108.200.230",
"port": 20444,
"public_key_hash": "0c6cdfd1cbc8e43dd1df557cf9625df88c9d32b3",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "94.16.104.221",
"port": 20444,
"public_key_hash": "8be356fd5b5bf749ce6839006c4039e57225b2a2",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "18.197.228.98",
"port": 20444,
"public_key_hash": "ea149d5a7bc801f6ca847202a82aca8fc39180fc",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.245.226.0",
"port": 20444,
"public_key_hash": "8d3cb91e558e4450681da80c1815164f725c05db",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "157.245.70.196",
"port": 20444,
"public_key_hash": "b8de7b7a66cef49d916bd09f3437d72e5a05b367",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "159.65.230.163",
"port": 20444,
"public_key_hash": "23f01417a1a08fba38e8d9ad1eb06e82a0b3794a",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "185.232.71.18",
"port": 20444,
"public_key_hash": "6b99048d50a6d900dfe689c9683c8339b8e57a97",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "64.68.204.60",
"port": 20444,
"public_key_hash": "a9b8b8df4a55a153b8d1efc267421de2e3669f15",
"authenticated": true
}
],
"inbound": [
{
"network_id": 1,
"peer_version": 402653189,
"ip": "172.31.5.90",
"port": 60686,
"public_key_hash": "a05378b0d85125ab1c2111b9a6215f409ee50cf7",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "34.134.28.252",
"port": 42028,
"public_key_hash": "45c844cc1bcacf4ed8ee59e01dc6f2de1699a473",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.199.30.198",
"port": 56808,
"public_key_hash": "a7a33c5e9cf835f92a83d16e1765c4d3b8dee6c0",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.199.30.198",
"port": 1275,
"public_key_hash": "e377d2cb2cdf9fda5bece4dc37d3f8eef59d4141",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.199.30.198",
"port": 11472,
"public_key_hash": "e377d2cb2cdf9fda5bece4dc37d3f8eef59d4141",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.199.30.198",
"port": 31702,
"public_key_hash": "8d3cb91e558e4450681da80c1815164f725c05db",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "54.177.156.31",
"port": 34066,
"public_key_hash": "31f491f148f41d10cee20f6d652d345571f08995",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "23.23.19.109",
"port": 40962,
"public_key_hash": "ebb706f6d5c058c2f3f7bce5602547971310a1cd",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "18.184.252.114",
"port": 34526,
"public_key_hash": "8ec4ed43fd7207006e5564861ed82dc8f4a9c147",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.199.30.198",
"port": 12055,
"public_key_hash": "e377d2cb2cdf9fda5bece4dc37d3f8eef59d4141",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "129.213.23.63",
"port": 59002,
"public_key_hash": "458c3dfd7c6fce257f81b1acf4ab13c2e77069ae",
"authenticated": true
},
{
"network_id": 0,
"peer_version": 0,
"ip": "164.92.77.191",
"port": 46244,
"public_key_hash": "0000000000000000000000000000000000000000",
"authenticated": false
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.225.1.93",
"port": 60892,
"public_key_hash": "ea239a8e48715fd1337c47e296433c44c2771678",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.199.30.198",
"port": 1452,
"public_key_hash": "e377d2cb2cdf9fda5bece4dc37d3f8eef59d4141",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.199.30.198",
"port": 29213,
"public_key_hash": "e377d2cb2cdf9fda5bece4dc37d3f8eef59d4141",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.72.82.195",
"port": 59308,
"public_key_hash": "54431b5f4b31bc11c71011c379a2a54ce2d83a33",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "172.31.51.15",
"port": 51304,
"public_key_hash": "c12e38b2248d1963f370641cb31ad169327485e0",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.195.111.234",
"port": 16394,
"public_key_hash": "f0b63394fdb0c8270aa6dcb1372351d005e81a17",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "54.85.1.24",
"port": 3602,
"public_key_hash": "083c7e5ca0b52c9ded549577502e3bc710091f13",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "150.136.147.85",
"port": 34586,
"public_key_hash": "458c3dfd7c6fce257f81b1acf4ab13c2e77069ae",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "13.215.127.39",
"port": 40084,
"public_key_hash": "4e55bb0bfedb445dd7fc2b034e0133512dd121e4",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "5.189.154.15",
"port": 51138,
"public_key_hash": "fda2d60a98f91c3d66871f58bba677328df95f9c",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "34.105.116.82",
"port": 59932,
"public_key_hash": "d2b12fee74724b370fc4324d8c6bc62c69ce11cc",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "3.91.7.9",
"port": 57234,
"public_key_hash": "91104ccf9e64b1f790e9eb0aa1eee0ad33847c98",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "172.31.6.211",
"port": 47570,
"public_key_hash": "a05378b0d85125ab1c2111b9a6215f409ee50cf7",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "65.108.201.19",
"port": 50728,
"public_key_hash": "d4ec7063aaf8c5e4f837e2338ee101cfba443ca8",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "147.182.195.76",
"port": 38354,
"public_key_hash": "f876dbba4362d953b33d0bb3ff845c545a99d617",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "164.92.106.62",
"port": 49826,
"public_key_hash": "f876dbba4362d953b33d0bb3ff845c545a99d617",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "3.227.72.188",
"port": 58566,
"public_key_hash": "a81ca7a6608d6d16edf9b80f54b28524eb70d304",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "54.81.166.240",
"port": 50246,
"public_key_hash": "fae744dbc4e0905924973ba2710175b8244b0a33",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "15.165.142.140",
"port": 48424,
"public_key_hash": "5caab733cfbb4790201a9e272de75b1dae301a9a",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "54.185.208.8",
"port": 25367,
"public_key_hash": "b22e84cff4a5c4a4b5e3e461c9415c2d5d6ba95b",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "143.198.146.39",
"port": 60696,
"public_key_hash": "f876dbba4362d953b33d0bb3ff845c545a99d617",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "18.166.218.108",
"port": 56108,
"public_key_hash": "e98f006bbeda35d0d8238549649f3a8754763894",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "13.209.60.161",
"port": 63539,
"public_key_hash": "6a0d78713923cbce9d50330a20bffeaace9996b8",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.199.30.198",
"port": 22667,
"public_key_hash": "9b0462452fa381708537a43e5623083aa4679673",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.199.30.198",
"port": 29322,
"public_key_hash": "e377d2cb2cdf9fda5bece4dc37d3f8eef59d4141",
"authenticated": true
},
{
"network_id": 0,
"peer_version": 0,
"ip": "47.90.29.31",
"port": 60032,
"public_key_hash": "0000000000000000000000000000000000000000",
"authenticated": false
}
],
"outbound": [
{
"network_id": 1,
"peer_version": 402653189,
"ip": "23.23.19.109",
"port": 20444,
"public_key_hash": "ebb706f6d5c058c2f3f7bce5602547971310a1cd",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "47.243.240.87",
"port": 20444,
"public_key_hash": "7947c9eb3aa9c9fe1566e28556b901f1f8e06bea",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "18.184.252.114",
"port": 20444,
"public_key_hash": "8ec4ed43fd7207006e5564861ed82dc8f4a9c147",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "65.108.203.23",
"port": 20444,
"public_key_hash": "dcef89922978d374887f78ea4e7439cbc1d870bf",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "34.125.104.149",
"port": 20444,
"public_key_hash": "11efc2ef9bb48989e1a88d45f7642298b01fdbc0",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "34.226.141.10",
"port": 20444,
"public_key_hash": "eb8b3e5bcd99f9c95e3767cfa14385960f5b421e",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "143.244.177.179",
"port": 20444,
"public_key_hash": "f6958e7c6d9eb2ab986cb9a8f3aee454b4e3b0a3",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "159.65.230.163",
"port": 20444,
"public_key_hash": "23f01417a1a08fba38e8d9ad1eb06e82a0b3794a",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "34.106.64.122",
"port": 20444,
"public_key_hash": "f876dbba4362d953b33d0bb3ff845c545a99d617",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "34.86.228.189",
"port": 20444,
"public_key_hash": "bf02066806af9698d8204bf65c5ebd23ceb74b66",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "45.79.131.55",
"port": 20444,
"public_key_hash": "511ecf25bbc2e6e8c7eb22e495f68fb8e7d2babf",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "65.108.200.230",
"port": 20444,
"public_key_hash": "0c6cdfd1cbc8e43dd1df557cf9625df88c9d32b3",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "47.242.123.146",
"port": 20444,
"public_key_hash": "a155ebecb5bacd874237f92f068eb6bcf41bfcea",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "34.168.91.195",
"port": 20444,
"public_key_hash": "738ac20577f8b739d3d2abaf74a69e83619e9822",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "54.144.204.81",
"port": 20444,
"public_key_hash": "d533b05f1ac7b3e01a1124fd9064f4b2d885b6a3",
"authenticated": true
},
{
"network_id": 1,
"peer_version": 402653189,
"ip": "35.199.6.155",
"port": 20444,
"public_key_hash": "a7a33c5e9cf835f92a83d16e1765c4d3b8dee6c0",
"authenticated": true
}
]
}

The node reports its inbound neighbors (i.e. peers that connected to it) and outbound neighbors (i.e. peers this node reached out to) based on the state of the P2P state machine. P2P connections are persistent, unlike RPC connections, so this information doesn’t change very quickly.

The sample object is just a random sample of nodes that this node has seen at some point in the recent past, even if they’re not connected right now. It’s used to help find additional nodes that might be online, in addition to the ones that the node is currently talking to.

Yes – you will need to send a Handshake message to the P2P address, and parse out the HandshakeAccept message it sends back. Included in that message is a data_url field, which contains the URL to the RPC endpoint.

1 Like