# Operator Onboarding

This page describes how to create an operator, register it in SatLayer, and create a vault on SatLayer testnet. SatLayer's testnet exists as a set of smart contracts on top of Babylon's own [testnet](https://testnet.babylon.explorers.guru/) `bbn-test-5`. \
\
In order to onboard onto SatLayer testnet, operators have to complete the following steps:\
\
1\) Generate an address via a wallet app such as Keplr.

2\) Instantiate your address as a signer.&#x20;

<pre class="language-typescript"><code class="lang-typescript"><strong>const chainId = "bbn-test-5";
</strong>const endpoint = "https://babylon-testnet-rpc.nodes.guru";

import { GasPrice } from "@cosmjs/stargate";
import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate";
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing";
import { stringToPath } from "@cosmjs/crypto";

const gasPrice = GasPrice.fromString("0.002000ubbn");

// create signer object using mnemonic phrase you created in Keplr
const signer = await DirectSecp256k1HdWallet.fromMnemonic("[YOUR MNEMONIC PHRASE]", {
  prefix: "bbn",
});

const client = await SigningCosmWasmClient.connectWithSigner(endpoint, signer, { gasPrice });
</code></pre>

3\) Register your operator in the `bvs-registry`.&#x20;

<pre class="language-typescript"><code class="lang-typescript"><strong>const registry = "bbn1a9tleevqygn862ll2la49g637fjttfzzlttdrmmua35fadpuvnksuyud7a";
</strong><strong>
</strong>const executeMsg = {
    register_as_operator: {
        metadata: {
            name: "[YOUR OPERATOR NAME]",
            uri: "[YOUR OPERATOR URI]"
        }
    }
};

await client.execute("[YOUR OPERATOR ADDRESS]", registry, executeMsg, "auto");
</code></pre>

4\) Create a `Vault` to start accepting collateral. `Vaults`can be configured to accept either `cw20`or `bank`module tokens.

**CW20:**

```typescript
const factory = "bbn1tnpg0hs099tpmaavzjzx02kvf7lcqhwmkrp0spg30aejmfydxnkqfzwdyx";

const executeMsg = {
    deploy_cw20: {
        cw20: "[YOUR CW20 ADDRESS]"
    }
};

const response = await client.execute("[YOUR OPERATOR ADDRESS]", factory, executeMsg, "auto");
```

Where the `cw20`argument is the address of the cw20 token that you wish to accept as collateral.

**Bank Module:**

<pre class="language-typescript"><code class="lang-typescript">const factory = "bbn1tnpg0hs099tpmaavzjzx02kvf7lcqhwmkrp0spg30aejmfydxnkqfzwdyx";

const executeMsg = {
    deploy_bank: {
        denom: "[YOUR BANK DENOM]"
    }
};

<strong>const response = await client.execute("[YOUR OPERATOR ADDRESS]", factory, executeMsg, "auto");
</strong></code></pre>

Where the `denom`argument is the `denom`of the `x/bank`module token which you wish to accept as collateral.&#x20;

5\) Whitelist your vault in the `router`&#x20;

<pre class="language-typescript"><code class="lang-typescript">const router = "bbn1tztx8vkgw24rm5f6ny52qyt6kpg7gyfd5nggvfgjjfj8n7ggkx7qfhvdum";

const executeMsg = {
<strong>  set_vault: {
</strong>    vault: "[YOUR VAULT ADDRESS]",
    whitelisted: true,
  }    
};

await client.execute("[YOUR OPERATOR ADDRESS]", router, executeMsg, "auto");
</code></pre>

After completing these steps, you will have created an `operator`and a `vault`, linked them together, and whitelisted this `vault`in the router. The final step to get set up on testnet is to identify a Bitcoin Validated Service (BVS) you wish to validate and register to validate it.

6\) Register services you want to validate to your `operator`. First you need to identify the address of the service in SatLayer. This address represents the BVS'es on-chain footprint.&#x20;

<pre class="language-typescript"><code class="lang-typescript"><strong>const executeMsg = {
</strong>    register_service_to_operator: {
        service: "[SERVICE ADDRESS]"
    }
}

await client.execute("[YOUR OPERATOR ADDRESS]", registry, executeMsg, "auto");
</code></pre>


---

# 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.satlayer.xyz/satlayer-testnet/operator-onboarding.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.
