Skip to content

Feature request: expose neighbour node IDs in /api/v1/nodes #64

Description

@MrAlders0n

Context

Supports MeshCore-Beacon/beacon-web#11.

To draw neighbour relationships on the map, the client needs the set of
neighbour node IDs per node. Currently /api/v1/nodes returns
knownNeighborCount but not the IDs themselves.

Proposal

Return neighbour node IDs from the nodes poll. To avoid bloating the
default Nodes tab load, gate this behind an opt-in query param rather than
returning it by default:

GET /api/v1/nodes?neighbours

When the param is present, each node object includes a neighbours array
of node UUIDs. When absent, the response is unchanged (current behaviour).

Current response

{
    "id": "430ec815-5466-46a3-9764-119611fdde88",
    "publicKey": "b1fbd6aa2b0eb5707666da5340b78107b7e3a86b011e49b1000f7c5b57d9a0c4",
    "nodeType": 2,
    "nodeTypeName": "repeater",
    "name": "e7her.nod3",
    "isObserver": false,
    "lat": 45.31041,
    "lng": -75.894805,
    "iatas": [
        { "iata": "YOW", "lastHeard": 1782491184810 }
    ],
    "knownNeighborCount": 10
}

Proposed response (with ?neighbours)

{
    "id": "430ec815-5466-46a3-9764-119611fdde88",
    "publicKey": "b1fbd6aa2b0eb5707666da5340b78107b7e3a86b011e49b1000f7c5b57d9a0c4",
    "nodeType": 2,
    "nodeTypeName": "repeater",
    "name": "e7her.nod3",
    "isObserver": false,
    "lat": 45.31041,
    "lng": -75.894805,
    "neighbours": [
        "9f2c1a44-1111-2222-3333-444455556666",
        "7a8b9c00-aaaa-bbbb-cccc-ddddeeeeffff",
        "1d2e3f40-5555-6666-7777-888899990000"
    ],
    "iatas": [
        { "iata": "YOW", "lastHeard": 1782491184810 }
    ],
    "knownNeighborCount": 10
}

Notes

  • neighbours is an array of node UUIDs (matching the id field format),
    not raw tokens.
  • Naming: existing API uses American spelling (knownNeighborCount).
    Suggest neighbors for the new field to stay consistent, unless British
    spelling is preferred project-wide.

Metadata

Metadata

Assignees

Labels

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions