# Creating A Node

### Deployment Process

#### 1. Node Creation

Nodes are created through the NodeFactory using `deployFullNode`:

```solidity
function deployFullNode(
    NodeInitArgs calldata initArgs,
    bytes[] calldata nodePayload,
    SetupCall[] calldata setupCalls,
    bytes32 salt
) external returns (INode node, address escrow)

struct NodeInitArgs {
    string name;
    string symbol;
    address asset;
    address owner;
}

struct SetupCall {
    address target;
    bytes payload;
}
```

#### Constructor Parameters

| Parameter         | Description                                                                                               | Constraints                             |
| ----------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| `initArgs.name`   | Name of the Node token                                                                                    | Cannot be empty                         |
| `initArgs.symbol` | Symbol of the Node token                                                                                  | Cannot be empty                         |
| `initArgs.asset`  | Address of the underlying asset                                                                           | Cannot be zero address                  |
| `initArgs.owner`  | Address of the Node owner                                                                                 | Cannot be zero address                  |
| `nodePayload`     | Arbitrary data to pre-configure the Node. E.g. add components, set allocation, whitelist rebalancers etc. | Executed directly on the Node.          |
| `setupCalls`      | Used to configure Policies                                                                                | Arbitrary calls, potentially dangerous. |
| `salt`            | Unique deployment salt                                                                                    | Any bytes32 value.                      |

#### Default Values

The Node is created with these default values that can be modified by the owner:

```solidity
lastRebalance = uint64(block.timestamp - rebalanceWindow);
lastPayment = uint64(block.timestamp);
rebalanceCooldown = 23 hours;
rebalanceWindow = 1 hours;
maxDepositSize = 10_000_000 * 10 ** decimals();
```

### Post-Creation Configuration

The Node owner can modify these parameters after creation:

* Management fees and fee recipient
* Maximum deposit size
* Rebalance cooldown and window periods
* Component allocations and parameters
* Additional routers and rebalancers
* Policies

### Security Considerations

1. All components must be whitelisted in their respective routers
2. Component allocation weights must sum to 100% (1e18) with reserve ratio
3. Routers must be whitelisted in the Registry
4. Rebalancers must be whitelisted in the Registry
5. Policies must be whitelisted in the Registry
