> For the complete documentation index, see [llms.txt](https://nashpoint.gitbook.io/nashpoint/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nashpoint.gitbook.io/nashpoint/adding-routers-and-components-step-by-step-guide.md).

# Adding Routers and Components - Step by Step Guide

Adding new routers and components to a Node must be done in the correct order. The following constraints apply:

1. A Node Owner cannot add a Router that is not whitelisted at the protocol level
2. A Node Owner cannot add a component unless both:
   1. The component is whitelisted on a Router by the RegistryOwner
   2. This specific Router has already been added to the Node by the owner

#### 1. Protocol Owner Actions

```solidity
// Must happen first - whitelist router at protocol level
registry.setRegistryType(routerAddress, RegistryType.ROUTER, true);
```

#### 2. Registry Owner Actions

```solidity
// Whitelist component on specific router
router.setWhitelistStatus(componentAddress, true);
```

#### 3. Node Owner Actions

```solidity
// First add router to node
node.addRouter(routerAddress);

// Then add component that uses that router
node.addComponent(
    componentAddress,    // component address
    targetWeight,       // e.g., 0.7 ether for 70%
    maxDelta,          // acceptable deviation
    routerAddress      // must match router added above
);
```

If steps are performed out of order:

* Adding component before router: Reverts with `RouterNotApproved`
* Adding component before router whitelist: Reverts with `NotWhitelisted`
* Adding router before protocol whitelist: Reverts with `NotWhitelisted`
* Adding component before component whitelist: Reverts with `NotWhitelisted`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://nashpoint.gitbook.io/nashpoint/adding-routers-and-components-step-by-step-guide.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
