# Node control

Now that we have obtained the knowledge on how to initialize our main IOTA repository object, we can explore what are we able to do with the node that we are connected to.

The first thing we can do is to fetch node info by calling the method ***GetNodeInfo*****&#x20;as follows**:

```csharp
var repository = IotaRepositoryFactory.Create("https://altnodes.devnet.iota.org");
var info = repository.GetNodeInfo();
```

![NodeInfo](/files/-LdNrm9yJ7fQyAEOYj4C)

As we can see, the method returns quite a lot of information about the node that we are currently connected to. One of the things to pay attention to here is the LatestMilestoneIndex and the LatestSolidSubtangleMilestoneIndex numbers. If both numbers are equal, it means that the node is currently in sync with the network.

{% hint style="info" %}
**WARNING**: The next set of methods are by default blocked by the nodes. The only way to access them is from localhost.
{% endhint %}

Another method we can call is ***GetNeighbors*** which will return the list of IRI neighbors:

```csharp
var repository = IotaRepositoryFactory.Create("https://altnodes.devnet.iota.org");
var neighbors = repository.GetNeighbors();
```

We can also add neighbors to the node by calling ***AddNeighbors*** method:

```csharp
var repository = IotaRepositoryFactory.Create("https://altnodes.devnet.iota.org");
var response = repository.AddNeighbors(new List<string>() {
    "https://to.add.neighbor.URL"
});
```

We're also able to remove them by calling ***RemoveNeighbors*** method:

```csharp
var repository = IotaRepositoryFactory.Create("https://altnodes.devnet.iota.org");
var response = repository.RemoveNeighbors(new List<string>() {
    "https://to.remove.neighbor.URL"
});
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://patriq.gitbook.io/iota/development/node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
