# 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](https://2043776177-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Laz1nydn5IbWWiM1u12%2F-LdNrUXk0YV8JNmWPno3%2F-LdNrm9yJ7fQyAEOYj4C%2Fimage.png?alt=media\&token=ac0e2eed-8802-48d2-b326-b7fef6430087)

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"
});
```

