query.traceNeighbors
traceNeighbors(nodeId: string, depth?: number): stringAdd a topology filter that retains only nodes whose out-degree is at least depth.
Currently implemented as a minimum out-degree filter: nodes with fewer
than depth outgoing edges are hidden. Recorded in history as
"AddFilter"; undoable.
nodeId | string | Currently unused by the filter body; retained to preserve the signature that the planned neighbourhood-hop query will use. |
depth | number | Minimum out-degree required for a node to remain visible; defaults to 2. |
Returns: string
Example
const filterId = api.query.traceNeighbors("s1", 3); // keeps nodes with outDegree ≥ 3
api.filter.list().find(h => h.id === filterId)?.remove();