Command-Line Interface (CLI)/Wallet Setup – Linux
Note: This guide assumes you already have some previous knowledge of Linux functions and commands.
This document will walk you through setting up the ScPrime Command-Line Interface or CLI for Linux. We do however You can use the CLI software as a wallet for your $SCP coins as well as to run a storage provider instance from it.
First you will need to download the Command Line software via the 1) Terminal or 2) Web browser.
Download via Terminal:
These steps will help you create a folder, download and unzip the software all through the terminal.
Create software directory
$ mkdir ScPrime && cd ScPrime
Download the software
$ wget https://releases.scpri.me/1.6.2/ScPrime-v1.6.2-linux-amd64.zip
If running Ubuntu Server you’ll need to install unzip first, you don’t have to if you’re running Ubuntu Desktop
$ sudo apt install unzip
Unzip the software
$ unzip ScPrime-v1.6.2-linux-amd64.zip
Remove .zip-file
$ rm -r ScPrime-v1.6.2-linux-amd64.zip
Move into the software folder
$ cd ScPrime-v1.6.2-linux-amd64
Download via Web Browser
These steps will help download the software via Web browser and use the terminal to create a folder to move and unzip the software.
Download the latest Linux software here and open the terminal for the following commands.
Create software directory
$ mkdir ScPrime
Move software to created directory
$ mv Downloads/ScPrime-v1.6.2-linux-amd64.zip ScPrime/ScPrime-v1.6.0-linux-amd64.zip
Unzip the software
$ unzip ScPrime-v1.6.2-linux-amd64.zip
Remove .zip-file
$ rm -r ScPrime-v1.6.2-linux-amd64.zip
Move into the software folder
$ cd ScPrime/ScPrime-v1.6.2-linux-amd64
Once downloaded, extract the files and place them in their own folder. You can place them where you want. For this guide, I chose to create a folder called ‘ScPrime’ in which I’ve put the software. When you use the following command you’ll see the following screen:
$ ll
Let’s fire up the daemon. As shown below. For this you will need to enable the terminal, navigate to the folder you put the spd and spc executable in and run the following command:
./spd
It may take a minute or so, but you will know the daemon is running when you get the ‘Finished full startup…’ message.
Important note: If you’re planning to use the CLI to run a storage provider instance and not just as a wallet, you’ll need to be aware of where you are keeping your metadata. If there is a sure way to corrupt your Storage Provider’s metadata and lose all contracts and collateral, it’s by keeping your metadata on a drive that may run out of HD space. The default location is $HOME/.scprime. I used the default location for this guide as I have over 100GB free on my system drive. However, if your system drive is lacking on free space or you have reserved too little space for system-updates and/or growth for metadata (consensus, contractdb, etc) this could prevent the Storage Provider from writing to or accessing the metadata folder. If this happens, your host may be unrecoverable.
To avoid this, ensure your system drive has ample free space. How much space can be different for each instance, but 100GB is a safe bet. An easier route however, would be to put your metadata on a non system drive or disk partition. To do this, swap out the default location above, with where you would like your metadata to be stored instead (see example below).
Note: If your not planning on using the renter, it is advisable to not load the renter-module as it will use a lot of system memory. You can do this by using the following flag ‘-M gctwh’ (see example below as well).
$ ./spd -d /home/<username>/.scprime -M gctwh
The ScPrime Daemon is now running. Leave this Terminal Tab open.
Now you will need to open a second Terminal Tab and navigate to your folder with spc in it and run that file. Wait until the daemon is synced with the network. You can keep checking the status of the syncing by typing:
./spc
To initiate a new wallet, type in:
./spc wallet init
You will get your wallet’s seed. Note that the password for the wallet will also be the seed. Be sure to record this seed and keep it in a safe place.
For convenience, you can also change the wallet password from the seed into something easier to remember using:
./spc wallet change-password
If you want to restore a previous wallet using its seed, instead of the command above, you’d use:
./spc wallet init-seed
And then you’d be prompted to enter the wallet’s seed.
To unlock the wallet you will use:
./spc wallet unlock
You will be prompted for the password. It will be the wallet seed unless you already changed the password. If you enter the correct password, you will go back to the prompt. If there was an error, it will tell you.
If you type in the following command, you will see that the status of the wallet is now unlocked.:
./spc
Now we need to get an address so you or someone else can send SCP to this wallet. Use the following command to get one:
./spc wallet address
I sent 200 SCP to the above address earlier. Using the following command we can check the balance:
./spc wallet
We can see 200 SCP has arrived. The CLI shows balances in kilos (KS) and hastings (H) instead of SCP. Balances above 1000 SCP will be shown as 1 KS for instance (1 KS = 1000 SCP). Unconfirmed transactions on the blockchain are shown as “Unconfirmed Delta”, Confirmed transactions on the blockchain are shown as “Confirmed Balance”.
To send funds from your wallet you will use the command:
./spc wallet send scprimecoins (amount)SCP (address)
As you can see in the example below the command was:
./spc wallet send scprimecoins 100SCP 6dc1811bbf4caf7f880de828624dae1b14550ce9e7330cae3664ac2cae9238c43c4d67dac0d0
The following command will show you all your transactions from the wallet:
./spc wallet transactions
Now type:
./spc wallet addresses
This command will show you all the addresses attached to that wallet. The reason for multiple addresses is for privacy. You can use one address or multiple addresses. It’s up to you. Each address will only show the transactions for that particular address and not the entire wallet. For example, if you gave an unused address to a friend to send you 100 SCP, when he entered that address into the network explorer, he would only see the 100 SCP he sent, not your entire balance.
When you are done, type:
./spc stop
This will stop the daemon and once it shuts down you can close both windows.
Go to your first Terminal Tab and wait until all modules have closed accordingly before you shutdown the Terminal/PC.