# Node Operator Manual

## Steps to become a Tranchess node operator

1. Provide Tranchess team with a `name` for display, and an address `operatorOwner` for operator registration. Note that `operatorOwner` holds the admin role for most properties of a registered node operator. Please properly secure the access. We recommend leveraging hardware wallets like Ledger to keep its private key.
2. Wait for the Tranchess team to register you in the smart contract. Once registered, you are assigned with a unique `id`, `withdrawalCredential` and `withdrawalAddress`
   * `id` is your node operator ID, which could help you look up all relevant data on profile through the `NodeOperatorRegistry` contract deployed at <https://etherscan.io/address/0xE926F01953c3B94222FcAC7474b31e3F8eAfb308>
   * `withdrawalCredential` is required for generating the `signature` in Step 3
   * `withdrawalAddress` is required for configuring beacon chain validators in Step 5
3. Generate `pubkey` and `signature` for a few validators
   * Use 32 ETH as the deposit amount
   * Use the `withdrawalCredential` in the previous step
   * 10 validators are enough to start
   * All validators’ `pubkey` and `signature` can be found in the generated deposit data JSON file
4. Navigate to [Tranchess Operator Portal](https://tranchess.com/operator). Drag and drop the generated deposit data JSON file to the right column. The tool is designed to conduct several sanity checks such as key lengths and duplicates. If all looks good, click the “Add Keys” button to initiate the `addKeys` transaction. (You can also manually assemble the transaction. Please refer to the specific operation in the "Alternative Step 4" section below.)

> ### **Alternative Step 4**
>
> Pack `pubkey` and `signature` into bytes arrays and submit them to the registry contract using the `addKeys` method:
>
> 1. Navigate to the “Write Contract” tab: <https://etherscan.io/address/0xE926F01953c3B94222FcAC7474b31e3F8eAfb308#writeContract>
> 2. Click ”Connect to Web3” and connect your operator owner address
> 3. Expand the first function `addKeys` and fill in the parameters as follows
>    1. `id`: Node operator ID
>    2. `pubkeys`: Concatenate all pubkeys and add a “0x” prefix
>    3. `signatures`: Concatenate all signatures and add a “0x” prefix
> 4. Optionally, you could send the encoded `pubkeys` and `signatures` to Tranchess team in advance so that we could verify the submission before you sign any transaction
> 5. Click the “Write” button and sign the transaction
>
> ```solidity
> function addKeys(uint256 id, bytes calldata pubkeys, bytes calldata signatures)
> ```

5\. Configure the execution layer fee recipient of the validators to `withdrawalAddress` (see your validator’s doc for more info about fee recipient, e.g. [Prysm Doc](https://docs.prylabs.network/docs/execution-node/fee-recipient) and [Lighthouse Doc](https://lighthouse-book.sigmaprime.io/suggested-fee-recipient.html#:~:text=The%20fee%20recipient%20is%20an,fee%20recipient%20for%20your%20validators)). Make sure that the validator node has already gone live, since the validator key assignments could happen any minute following Step 6.

6\. As the `operatorOwner`, you could now lift up the `depositLimit:`

1. Navigate to the “Write Contract” tab:     <https://etherscan.io/address/0xE926F01953c3B94222FcAC7474b31e3F8eAfb308#writeContract>
2. Click ”Connect to Web3” and connect your operator owner address (if you haven’t done so)
3. Expand the 7th function `updateDepositLimit`:
   1. `id`: Node operator ID
   2. `newDepositLimit`: The new maximal number of active validators assigned. We recommend it to be the current total number of validator keys, but it could go beyond the current total validator keys.
4. Click the “Write” button and sign the transaction

```solidity
function updateDepositLimit(uint256 id, uint64 newDepositLimit)
```

7\. Optionally, you could also update the `rewardAddress`, which will receive operator fee in the future. By default, it is the same as `operatorOwner`.

```solidity
function updateRewardAddress(uint256 id, address newRewardAddress)
```

## Steps to batch remove unused validators

In rare occasions when signature verification failed for newly added keys or when withdrawal credentials got an update, the Tranchess team will send out a notification for the corresponding operator to truncate all used keys

1. Coordinate with Tranchess team to find out the keys that will be removed;
2. Invoke `truncateUnusedKeys` to truncate all unused keys.

```solidity
function truncateUnusedKeys(uint256 id) external
```


---

# 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://docs.tranchess.com/tech-support/node-operator/node-operator-manual.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.
