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. Current CLI version is 1.6.2.
Download via Terminal:
These steps will help you create a folder, download and unzip the software all through the terminal;
$ mkdir ScPrime && cd ScPrime – create software directory
$ wget https://releases.scpri.me/1.6.2/ScPrime-v1.6.2-linux-amd64.zip – download the software (please check for the latest version)
$ sudo apt install unzip – if you’re running Ubuntu Server you’ll need to install unzip first, you don’t have to if you’re running Ubuntu Desktop.
$ unzip ScPrime-v1.6.2-linux-amd64.zip – unzip the software
$ rm -r ScPrime-v1.6.2-linux-amd64.zip – remove .zip-file
$ cd ScPrime-v1.6.2-linux-amd64 – move into the software folder
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;
$ mkdir ScPrime – create software directory
$ mv Downloads/ScPrime-v1.6.2-linux-amd64.zip ScPrime/ScPrime-v1.6.0-linux-amd64.zip – move software to created directory
$ unzip ScPrime-v1.6.2-linux-amd64.zip – unzip the software
$ rm -r ScPrime-v1.6.2-linux-amd64.zip – remove .zip-file
$ cd ScPrime/ScPrime-v1.6.2-linux-amd64 – move into the software folder
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 Linux command $ ll , you’ll see the following screen:
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 ./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 /mnt/metadata -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 again.
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 ./spc again, you will see that the status of the wallet is now unlocked.
Now we need to get an address so you or someone else can send SCP to this wallet. Use the command ./spc wallet address to get one.
I sent 200 SCP to the above address. Using the command ./spc wallet, I can check the balance and 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 ./spc wallet transactions command will show you all your transactions from the wallet.
Using the ./spc wallet addressescommand 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
updated 5/9/22 1.04
Copy link