Developers
  • SWT PROTOCOL
    • Introduction
    • Accounts
    • Transactions
    • Fees
    • Smart Contracts
  • GETTING STARTED
    • Network Node
      • Introduction
      • STEP 1:RENTING A LINUX VPS
      • STEP 2:INSTALLATION OF PUTTY
      • STEP 3:INSTALLATION OF FILEZILLA
      • STEP 4:VPS CONNECTION AND LINUX CONFIGURATION WITH PUTTY (SSH)
      • STEP 5:HOW TO SECURE YOUR VPS
      • STEP 6:USING TMUX THROUGH PUTTY
      • STEP 7:UPLOAD OF THE SWT SOFTWARE WITH FILEZILLA
      • STEP 8:EXTRACT THE SWT SOFTWARE FOLDER
      • STEP 9:RUNNING THE SWT NODE THROUGH TMUX
      • STEP 10:RUNNING THE MONITORING TOOLS
  • API REFERENCE
    • Apache Thrift API
      • Transactions
      • Blocks
      • Smart contract
      • Tokens
      • Wallets
      • Sync info
      • Data structures
    • REST API
      • GetBlocks()
      • GetNodeInfo()
      • GetBalance()
      • GetWalletInfo()
      • GetTokenBalance()
      • GetTransactionsByWallet()
      • GetTransactionInfo()
      • GetEstimatedFee()
      • GetContractByAddress()
      • GetContractFromTransaction()
      • GetContractMethods()
      • ContractValidation()
      • ContractCall()
      • TransactionPack()
      • TransactionExec()
  • SMART CONTRACTS
    • Creating "Hello-world" Smart Contract
    • Smart Contract Methods
    • Smart Contract Standarts
      • Token Smart Contract
      • Escrow Smart Contract
      • Stable coin Token
  • HOW TO REST API
    • Introduction
    • Retrieve a balance from the blockchain
    • Request a specific transaction from the blockchain
    • Sending Transactions to the SWT Blockchain
    • Validating and deploying a Smart Contract with REST API
Powered by GitBook
On this page
  • 1. STARTING SWT CLIENT NODE
  • 2. PRIVATE AND PUBLIC NODE ADDRESSES BACKUP
  • 3. OPENING NODE WALLET WITH ENCRYPTED PRIVATE KEY
  • 4. SENDING SWT TO THE NODE WALLET
  • 5. REINSTALLING A SWT NODE
  • 6. UPDATING A SWT NODE
  1. GETTING STARTED
  2. Network Node

STEP 9:RUNNING THE SWT NODE THROUGH TMUX

PreviousSTEP 8:EXTRACT THE SWT SOFTWARE FOLDERNextSTEP 10:RUNNING THE MONITORING TOOLS

Last updated 1 year ago

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:

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!

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.

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

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.

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.

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

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).

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.

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.

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.

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.

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.

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.

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:

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

Be careful, you must type a double dash just before “dumpkeys myNode1.json”

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:

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:

cd /home/swt/

2. List the repertory:

ls

3. Delete 'swtnode' repertory and its content:

rm -rvf swtnode

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

rm Linux_Main-4.2.432.0.tgz

5. Now that it's done, you just have to follow again the Step 7 (Upload of the swt software with FileZilla) and Step 8 (Extract the swt software folder) 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:

./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 /home/swt folder.

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

4. Restart your node

sudo reboot

5. Update and upgrade your VPS

sudo apt-get update
sudo apt-get upgrade

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

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:

rm -rf swtnode_old/

8. Create a backup of the actual swtnode folder by renaming it into a folder named swtnode_old:

mv swtnode/ swtnode_old

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

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:

mv ./swtnode_old/NodeP* ./swtnode/

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

mv ./swtnode_old/db/ ./swtnode/

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

cd /home/swt/swtnode

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

./node