> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# StateSet Network Quickstart

> Getting started with the StateSet Network

### Prerequisites

First we need to install Git, Node.js, Go and Rust:

#### Install Git

```jsx bash theme={null}
sudo apt-get update
sudo apt-get install git
```

#### Install Node.js with NVM

```jsx bash theme={null}
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
```

Currently, StateSet Network uses Go 1.19 to compile the code.

Install GO

Install Go 1.19

Verify the installation by typing go version in your terminal.

```bash jsx theme={null}
go version 
go version go1.18.1 darwin/amd64
```

## Setup

1. Stop your node
2. Reset `StateSetd unsafe-reset-all`
3. Remove genesis `rm .StateSet/config/genesis.json`
4. Remove gentxs `rm -r .StateSet/config/gentx/`
5. Follow generate gentx as normal below

**Genesis File**

[Genesis File](/StateSet-1/genesis.json):

```bash theme={null}
   curl -s  https://raw.githubusercontent.com/StateSet/networks/main/StateSet-1/genesis.json > ~/.StateSet/config/genesis.json
```

**StateSetd version**

```bash theme={null}
$ StateSetd version
latest-8e35a4d3
```

## Setup

**Prerequisites:** Make sure to have [Golang >=1.19](https://golang.org/).

#### Build from source

You need to ensure your gopath configuration is correct. If the following **'make'** step does not work then you might have to add these lines to your .profile or .zshrc in the users home folder:

```bash theme={null}
nano ~/.profile
```

```bash theme={null}
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
```

Source update .profile

```bash theme={null}
source .profile
```

```bash theme={null}
git clone https://github.com/StateSet/StateSet
cd StateSet
make build && make install
```

This will build and install `StateSetd` binary into `$GOBIN`.

Note: When building from source, it is important to have your `$GOPATH` set correctly. When in doubt, the following should do:

```bash theme={null}
mkdir ~/go
export GOPATH=~/go
```

### Minimum hardware requirements

* 8-16GB RAM
* 100GB of disk space
* 2 cores

## Setup validator node

Below are the instructions to generate & submit your genesis transaction

### Generate genesis transaction (gentx)

1. Initialize the StateSet directories and create the local genesis file with the correct chain-id:

   ```bash theme={null}
   StateSetd init <moniker-name> --chain-id=StateSet-1
   ```

2. Create a local key pair:

   ```bash theme={null}
   StateSetd keys add <key-name>
   ```

3. Add your account to your local genesis file with a given amount and the key you just created.

   ```bash theme={null}
   StateSetd add-genesis-account $(StateSetd keys show <key-name> -a) 10000000000ustate
   ```

4. Create the gentx, use only `9000000000ustate`:

   ```bash theme={null}
   StateSetd gentx <key-name> 9000000000ustate --chain-id=StateSet-1-testnet
   ```

   If all goes well, you will see a message similar to the following:

   ```bash theme={null}
   Genesis transaction written to "/home/user/.StateSet/config/gentx/gentx-******.json"
   ```

### Submit genesis transaction

* Fork [the networks repo](https://github.com/StateSet/networks) into your Github account

* Clone your repo using

  ```bash theme={null}
  git clone https://github.com/<your-github-username>/networks
  ```

* Copy the generated gentx json file to `<repo_path>/networks/StateSet-1/gentx/`

  ```bash theme={null}
  > cd testnets
  > cp ~/.StateSet/config/gentx/gentx*.json ./StateSet-1/gentx/
  ```

* Commit and push to your repo

* Create a PR onto [https://github.com/StateSet/networks](https://github.com/StateSet/networks)

* Only PRs from individuals / groups with a history successfully running nodes will be accepted. This is to ensure the network successfully starts on time.
