# Keeper Registration and Update

## Overview

$$
\cdot \cdot \cdot
$$

## Specification

### Keeper registration

The caller provides worker address (which is used in the off-chain keeper software configuration) and initial CVP deposit for stake.&#x20;

Each new keeper is assigned an id (id of the previous registered keeper, incremented by 1, starting from 0).&#x20;

{% code overflow="wrap" %}

```solidity
function registerAsKeeper(
    
    //address of the keeper worker account
    address worker_,
    
    //initial CVP deposit amount to stake for this worker
    uint256 initialDepositAmount
    
    //returns id of the newly registered keeper
    ) public virtual returns (uint256 keeperId)
{
    //worker address is not already assigned to any registered keeper in the Agent contract
    _assertWorkerNotAssigned();
    
    //CVP is not less than the minimal allowed CVP stake
    _minKeeperCvpAssertion();
}
```

{% endcode %}

A single keeper address can have multiple workers assigned to the same Admin contract.&#x20;

Once the registration is complete, the keeper is assumed to be up and running. It will start participating in the network as soon as the off-chain software is configured and launched.

### Worker address update

If for any reason the keeper wants to change their worker address, a function [`setWorkerAddress` ](/powerpool-and-poweragent-network/power-agent/old-pages/keeper-old.md#setworkeraddress)is used.

The [mappings ](/powerpool-and-poweragent-network/power-agent/old-pages/keeper-old.md#mappings)`workerKeeperIds` and `keepers` are updated accordingly.

Upon successful change of the worker address the function emits

{% code overflow="wrap" %}

```solidity
event SetWorkerAddress(
    //id of the keeper for which the worker address was changed
    keeperId_,
    
    //previous worker address
    prev,
    
    //new worker address
    worker
)
```

{% endcode %}


---

# 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.powerpool.finance/powerpool-and-poweragent-network/power-agent/old-pages/keeper-old/keeper-registration-and-update.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.
