ScPrime Command-Line Interface (CLI) Setup
This document will walk you though setting up the ScPrime Command-Line Interface or CLI for Windows. 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 from here.
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'.
Let’s fire up the daemon. As shown above you will need to open a Command Prompt window, navigate to the folder you put spd.exe and spc.exe 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 need to be aware of where you are keeping your metadata. If there is a sure way to corrupt your host'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 c:\users\(username)\appdata\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, even a Windows Update download might be enough to fill your drive temporarily and prevent the host 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. To do this, swap out the default location above, with where you would like your metadata to be stored instead (see example below).
spd.exe -d d:\meta -M gctwh
The ScPrime Daemon is now running. Leave this window open.
Now you will need to open a second Command Prompt window and navigate to your folder with spc.exe 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 1000 SCP to the above address. Using the command spc wallet, I can check the balance and see 1000 SCP has arrived. The CLI shows balances in kilos (KS) and hastings (H) instead of SCP. We are interested in the 'Confirmed Balance' which is in kilos. A kilo is 10 SCP to the power of 3 (1 KS = 1000 SCP).
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 above the command was 'spc wallet send scprimecoins 999SCP 556b32e0cf3658c30eac96bbabceeb3098f9b12ae7dbce3e1931905f3e0df37807ff18cb9b'.
The spc wallet transactions command will show you all your transactions from the wallet.
Using the spc wallet addresses 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 1000 SCP, when he entered that address into the network explorer, he would only see the 1000 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.
Setting System Path (optional)
If you plan to use the CLI wallet often, it may be a good idea to set some system paths up so you don't have to navigate to your ScPrime directory every time you want to access the software. This will allow you to input spd and spc from any directory.
Pathing works differently within each OS. We will add Mac and Linux instructions soon as well. For Windows, you will want to search for ‘environmental variables’ and open ‘Edit the system environmental variables’.
Now click on Environment Variables
Select the ‘Path’ variable and click on Edit.
Click on New and then Browse. You will want to navigate to the directory discussed above using the Windows Explorer.
Once you see the path to your spd and spc files in the list, click OK. Your path is all set.
Last modified 13d ago
Copy link