# Initialize IOTA repository

First, we need to initialize our main repository object. We can do that by typing:

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

Easy, right? Now we have our repository object that is going to take care of all the communication between us and the IRI.&#x20;

![Example of repository class methods](https://2043776177-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Laz1nydn5IbWWiM1u12%2F-LdNr6dOtdJsA6ygx7dS%2F-LdNr7DGI4uF2uLrEK4-%2Fimage.png?alt=media\&token=1f413789-c356-4b17-b56d-a4d9d17d60a9)

If you are connected to a known IRI and you are sure that the node is stable for most cases, connecting like this is just fine. But sometimes there are cases where you need to have a fall back mechanism in case the node you are connected to fails, goes offline or is not in sync with the rest of the network. A solution can be carried out as follows:

```csharp
var IRI_Nodes = new List<string>() {
    "https://altnodes.devnet.iota.org",
    "https://nodes.devnet.thetangle.org:443/",
    "https://nodes.devnet.iota.org:443/",
};
var repository = IotaRepositoryFactory.CreateWithFallback(IRI_Nodes);
```

As you can see in the above picture, we have a list of IRIs instead of just a single one. In case a node times out (5 seconds by default) or is unresponsive, it will automatically try to connect to the next node. The behavior is similar to a [circuit breaker](https://martinfowler.com/bliki/CircuitBreaker.html).


---

# 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/make-an-iota-repository.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.
