> For the complete documentation index, see [llms.txt](https://nodedocs.saga.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nodedocs.saga.xyz/validator-and-full-node-setup/mainnet-pre-genesis-validator-setup.md).

# Mainnet Pre-genesis validator setup

### Initialize your repository

To initialize your repository, run&#x20;

```bash
sscd init <moniker> --chain-id ssc-1
```

where moniker is any name you would like to give your validator.

{% hint style="info" %}
This will create the home directory for the Saga Security Chain. By default, the folder should be located in your home directory `~/.ssc` on Linux/Mac machines and the `\Users\<username>\.ssc` directory on Windows.
{% endhint %}

### Loading in keys

Before creating a validator, you must [add a key](/key-management/adding-keys.md) to your keyring.

New validators can create their keys by running&#x20;

```bash
sscd keys add <your-validator-key-name>
```

If you have an existing key, you can [load in your `sscd` key](/key-management/adding-keys.md#import-an-existing-key-into-sscd) by passing in the `--recover` flag to the command above.

For details on how to manage keys on SSC, please see the [key management](/key-management/key-management-overview.md) section of these docs.

Ensure that your validator key is added to `sscd` by typing

```bash
sscd keys list
```

This should print out some output like this:

```bash
- address: saga1nlv6stt25sdest7fl2fxxp3lncxruegfwqsmw0
  name: mykey1
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A923CFCYWYBK58XocadjTaEm+F2g6iebyf2F9lZ1vMF7"}'
  type: local
```

**Provide your key address (starts with `saga`) to the Saga Support Team and wait for further instructions before proceeding.**

<figure><img src="https://images.unsplash.com/photo-1572670014853-1d3a3f22b40f?crop=entropy&#x26;cs=srgb&#x26;fm=jpg&#x26;ixid=M3wxOTcwMjR8MHwxfHNlYXJjaHw2fHxzdG9wfGVufDB8fHx8MTY5NzY1ODg5N3ww&#x26;ixlib=rb-4.0.3&#x26;q=85" alt="" width="188"><figcaption></figcaption></figure>

## Gentx setup

{% hint style="danger" %}
Once the Saga team has collected the addresses for the initial validator set, we will publicize the `ssc-1` repository with the relevant genesis file. Once this has been done, you should be able to continue with these steps.
{% endhint %}

### Creating a validator genesis transaction

When joining a network as a genesis validator, we need to collect the genesis transaction a.k.a. `gentx,` from each validator.&#x20;

#### What you will need to create the genesis transaction:

1. The `genesis.json` file provided by the Saga team. Copy the genesis file provided by the Saga team to your `sscd` config directory. The following command does this:

<pre class="language-bash"><code class="lang-bash"><strong>git clone git@github.com:sagaxyz/mainnet.git
</strong><strong>cp mainnet/genesis/genesis.json ~/.ssc/config/genesis.json
</strong></code></pre>

2. The account-number, associated with your key, from the genesis file `genesis.json` (see the image below for reference)

<figure><img src="https://562718476-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcDAlM2N6lUxmizxIiVEu%2Fuploads%2FSnib6xRWYKMXTN1dzP7B%2FScreenshot%20from%202023-10-18%2013-59-15.png?alt=media&amp;token=1ced5b69-9626-4a34-b126-b45e4bbafc6e" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Note that you will have to use the same key that you provided to the Saga team in order to create the genesis transaction.
{% endhint %}

\
You can find `<your-validator-address>` running `sscd keys show -a <your-validator-key-name>`

Then you can run this command to find your account number:

```
cat ~/.ssc/config/genesis.json | jq -r '.app_state.auth.accounts[] | select( .address == "your-validator-address>") | .account_number'
```

3. A public IP address for your node where your validator can be accessed

{% hint style="danger" %}
It is important to ensure that the IP address you use when creating the genesis transaction is a publicly accessible IP address, and is the same IP address you will be exposing for your node.
{% endhint %}

Now, you are ready to create the `gentx` or the genesis transaction.

1. Create the genesis transaction using the `sscd` daemon:

   ```bash
   sscd gentx <validator-key-name> 8000000usaga \
       --chain-id ssc-1 \
       --account-number X \
       --ip X.X.X.X
   ```
2. This should create a `gentx-*.json` file under your `~/.ssc/config/gentx/` folder on your machine. Verify that this file exists.
3. Create a new branch in the `mainnet` repository.
4. Add your `gentx` file to the \<gentx folder of public testnet> folder, commit it to the repo and then push your branch to the SSC public testnet repository in Github.
5. Create a PR to merge your branch into `main` branch.

{% hint style="warning" %}
Make sure to back up your `~/.ssc/config/priv_validator_key.json` file!
{% endhint %}

The `gentx` will be processed by the team and a new genesis file will be created prior to the actual network launch. This updated genesis file will also be provided to you.

<figure><img src="https://images.unsplash.com/photo-1572670014853-1d3a3f22b40f?crop=entropy&#x26;cs=srgb&#x26;fm=jpg&#x26;ixid=M3wxOTcwMjR8MHwxfHNlYXJjaHw2fHxzdG9wfGVufDB8fHx8MTY5NzY1ODg5N3ww&#x26;ixlib=rb-4.0.3&#x26;q=85" alt="" width="188"><figcaption></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://nodedocs.saga.xyz/validator-and-full-node-setup/mainnet-pre-genesis-validator-setup.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
