# STEP 9:RUNNING THE SWT NODE THROUGH TMUX

Let’s begin with starting the SWT client node. This action is quite easy if you follow our different steps. But before, be sure that you have well secured your installation with our chapter “**How to secure your VPS**”.

### **1. STARTING SWT CLIENT NODE**

For now, your Tmux session looks like this:

<figure><img src="/files/lxOzbtLmluo0eBHL2BfH" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Every program running into the panels must be closed gracefully with CTRL+C. For example, if you reboot your server without closing the node client with CTRL+C, there is a great probability that you will crash your database and then restart synchronization from 0%. So please be cautious, hold CTRL and then press C!
{% endhint %}

{% hint style="info" %}
If you just need to shut down your PC or Mac and want to let the node run, you don't have to close your panels with CTRL+C. Just close your windows with the cross.
{% endhint %}

#### **1. Hit CTRL-B and when you're ready, type this:**

```bash
cd /home/swt/swtnode
```

#### **2. Then start the SWT client node with:**

```
~/swtnode$ ./node
```

#### **3. Type “g” to generate public and private keys, then press Enter.**

<figure><img src="/files/EHqrbSveH459i1QwA9jz" alt=""><figcaption></figcaption></figure>

#### **4. When you press the ‘G’ key, you will see a sequence of 24 words that you must carefully save in case of losing your private key. You can simply highlight these 24 words with your mouse pointer (it copy them) and paste them in the text editor of your choice.**

<figure><img src="/files/r4ftFOMiLCFBRBSOAw3N" alt=""><figcaption></figcaption></figure>

#### **5. Then it's strongly recommended to choose to Encrypt with password your private key file \[1], followed by Enter.**

<figure><img src="/files/2OeD7iZspi7s0rXPeN2H" alt=""><figcaption></figcaption></figure>

#### **6. You now have the choice between two methods of encryption, the method of encryption by password (P) or the access method by indicating the path of a defined file (F).**

<figure><img src="/files/gpYbxCS3TDlwmsJDr6xZ" alt=""><figcaption></figcaption></figure>

**The password encryption method** allows you to encrypt your private key with a strong and complex password. It will encrypt your private key so that you will have a private key on your node but it will not allow access to your swt portfolio. It is a substitute key in some way and its goal is to start your SWT node. Your real private key can be visible only with the password that you will create in the next point. This password will be asked each time you want to launch your node.

**The other method (access by a file)** allows you to launch your node by indicating the path of a file on your node. This file can be a text file, a video file or any kind of file you want. It is a very ingenious system because you are the only one to know what is the name of this file and where it is.

In this tutorial, for practical reasons we will only go through the password method. **Choose a password as complex as possible.** In the example that follows, we will encode a password of more than 26 characters, which seems to be more than enough.

#### **7. Press 'P' (encryption method with a password), then enter your password, confirm it a second time and type Enter.**

<figure><img src="/files/LBNJS5bELjhFDbrzb37i" alt=""><figcaption></figcaption></figure>

#### **8. After having confirmed the chosen password a second time, you will have the option to display your Public key and your "real" Private key (unencrypted) for 10 seconds, by pressing the 'S' key. Once you have taken note of it with a copy/paste, press the 'ENTER' key to continue the SWT node boot process.**

<figure><img src="/files/mMRCSXj99aA0yunSnRLK" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Don’t worry if you didn’t press the ‘S’ key, because later in this chapter we will see how to backup the Public and the “real” Private key.
{% endhint %}

Your SWT node is starting, please be patient… The sync process will appear soon. Once it's running, the first time it can take a while before your node is 100% synchronized, it's totally normal.

<figure><img src="/files/jK5embvzwxoht8yXSTVe" alt=""><figcaption></figcaption></figure>

**Congrats, you SWT node is running!**

**PS**: every time you will start your node after a stop, you will have the possibility to change your password by pressing the '**P**' key.

<figure><img src="/files/IVpEdwioboHxzCEECfxq" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you want your node to be synchronized much faster, you can ask to SWT team for the latest database files, if they are available.

Once downloaded, you will have to upload this database files in */home/swt/swtnode* folder, and then to extract them.
{% endhint %}

### **2. PRIVATE AND PUBLIC NODE ADDRESSES BACKUP**

Now that your node is running, you have to backup your private and public node addresses.

Via FileZilla, go to your **SWT** folder, and you will see two files among the others: **NodePrivate.txt** and **NodePublic.txt.**

Copy them and paste them into a **secure folder outside your VPS (or best, on a sheet).**

### **3. OPENING NODE WALLET WITH ENCRYPTED PRIVATE KEY**

In **Part 1 (“Starting SWT client node”)**, we have choosen to encrypt private key. Therefore this key is protected and can only be used to run your node, **not to open your wallet.**

To open the node wallet, you need to generate the unencrypted key in a file. In this exemple, you will generate a file named **myNode1.json** but you can replace this name by the file name you want.

With **Tmux**, select a free panel (not running the client or anything else) or create a new one (**CTRL-B** + % or “), and type:

```bash
cd ~/swtnode
./node --dumpkeys myNode1.json
```

{% hint style="info" %}
Be careful, you must type a double dash just before “*dumpkeys myNode1.json*”
{% endhint %}

<figure><img src="/files/wnvcza7knIzPhg5lAwmU" alt=""><figcaption></figcaption></figure>

Enter your password and then hit **Enter**. This will generate the **myNode1.json** file in your **swt** folder. Now you can use **FileZilla** to copy this file on your own computer and save it in a safe place. This file can be directly used to open wallet client applications (SWT web wallet or desktop wallet). Open your wallet, click on “**Sign in**”, then “**Upload file**”, and choose the **.json** file previously generated!

Last thing to do to be safe is to **delete this file on the VPS**. Go back to your Tmux terminal and type the following line:

```bash
rm myNode1.json
```

### **4. SENDING SWT TO THE NODE WALLET**

If you want to participate in transactions validation and **earn SWT rewards**, you have to send **more than 1.000.000 SWT** to your node wallet (ie: 1.000.001 SWT), and **stake it for as long as you want to earn SWT rewards.**

Thus, you have to send this amount from your current wallet to the SWT node address written in your **NodePublic.txt** file. That's it!

### **5. REINSTALLING A SWT NODE**

If you want to reinstall your node, please first backup your files for a better safety (through FileZilla) and then follow this steps.

First you are going to delete your SWT folder.

#### **1. Move in /home/swt folder:**

```bash
cd /home/swt/
```

#### **2. List the repertory:**

```bash
ls
```

#### **3. Delete 'swtnode' repertory and its content:**

```bash
rm -rvf swtnode
```

#### **4. Delete your previous tar.gz archive (modify its name in the following command if needed)**

```bash
rm Linux_Main-4.2.432.0.tgz
```

#### **5. Now that it's done, you just have to follow again the&#x20;*****Step 7 (Upload of the swt software with FileZilla)*****&#x20;and&#x20;*****Step 8 (Extract the swt software folder)*****&#x20;sections.**

### **6. UPDATING A SWT NODE**

If you want to know if you SWT node software is up to date or need an upgrade to the last version, you can find out which version of the SWT node software you are running, simply by going to the swt folder and typing the following command:

```bash
./node –version
```

Then, if you need to update your swt node with a new release without installing again the whole system, it's quite easy. Just follow this steps:

#### **1. Download the new SWT node release from SWT website.**

#### **2. With FileZilla, upload the file into your&#x20;*****/home/swt*****&#x20;folder.**

#### **3. Go back to PuTTY and shut down your current client with CTRL+C (you can then type&#x20;*****exit*****).**

#### **4. Restart your node**

```bash
sudo reboot
```

#### **5. Update and upgrade your VPS**

```bash
sudo apt-get update
sudo apt-get upgrade
```

#### **6. Connected as swt user, open Tmux, and type into an empty Tmux panel:**

```bash
cd ~/
```

#### **7. IF, AND ONLY IF, a previous backup folder named swtnode\_old has already been created and not removed yet (you can check it with ls -lrt command, or in FileZilla), delete it by typing:**

```bash
rm -rf swtnode_old/
```

#### **8. Create a backup of the actual swtnode folder by renaming it into a folder named swtnode\_old:**

```bash
mv swtnode/ swtnode_old
```

#### **9. Extract and install the new release (replace the following file name by the exact name of the current release)**

```bash
tar xzvf Linux_Main-4.2.432.0.tgz
```

#### **10. Then, we move the NodePublic.txt and NodePrivate.txt files located in the swtnode\_old folder into the freshly swtnode extracted folder:**

```bash
mv ./swtnode_old/NodeP* ./swtnode/
```

#### **11. We also get back the database (check its name with FileZilla):**

```bash
mv ./swtnode_old/db/ ./swtnode/
```

#### **12. Now, connect to your node folder via Tmux:**

```bash
cd /home/swt/swtnode
```

#### **13. Restart your node and wait for its total synchronization:**

```bash
./node
```


---

# 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.swttoken.com/getting-started/network-node/step-9-running-the-swt-node-through-tmux.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.
