SiaPrime Wallet Commands

If you’re comfortable with the command-line, you can interact with SiaPrime in powerful ways. This is a list of all the commands that SiaPrime understands, and a brief description of what they do.

These can be accessed at any time by using spc help.

All commands start with spc and are followed by a flag or a command.

Usage

spc [flags]

spc [command]

 

You can also use the Terminal in SiaPrime-UI. When doing so, you can type commands without adding spc.

Consensus

Print the current state of consensus such as current block, block height, and target.

Usage

spc consensus [flags]

Flags

-h or --help – help for consensus

-v or --verbose – Display full consensus information

Example output

Synced: Yes

Block:      00000000000000009e74c12f68393e108e3d7d2faad15b46c8a76dd42015fb58

Height:     211104

Target:     [0 0 0 0 0 0 0 9 143 142 0 142 95 25 215 124 32 25 172 35 130 182 56 62 38 203 72 1 134 122 250 161]

Difficulty: 1929422247688414200

Gateway

View and manage the gateway’s connected peers.

Usage

spc gateway [flags] or spc gateway [command]

Flags

-h or --help – help for gateway

Example output

Address: 73.195.240.187:9981 (this is the address of your SiaPrime node)

Active peers: 80

Help

Help about any command.

Usage

spc [flags] or spc [command]

Example output

SiaPrime Client v1.3.5.2

Usage:

  spc [flags]

  spc [command]

Available Commands

  consensus   Print the current state of consensus

  gateway     Perform gateway actions

  help        Help about any command

  host        Perform host actions

  hostdb      Interact with the renter's host database.

  miner       Perform miner actions

  renter      Perform renter actions

  stop        Stop the SiaPrime daemon

  update      Update SiaPrime

  utils       various utilities for working with SiaPrime's types

  version     Print version information

  wallet      Perform wallet actions

Host

View or modify host settings.

Usage

spc host [flags] or spc host [command]

Available Commands

  announce    Announce yourself as a host

  config      Modify host settings

  contracts   Show host contracts

  folder      Add, remove, or resize a storage folder

  sector      Add or delete a sector (add not supported)

Flags

-h or --help – help for host

-v or --verbose – Display detailed host info

Hostdb

View the list of active hosts, the list of all hosts, or query specific hosts. If the ‘-v’ flag is set, a list of recent scans will be provided, with the most recent scan on the right. a ‘0’ indicates that the host was offline, and a ‘1′ indicates that the host was online.

Usage

spc hostdb [flags] or spc hostdb [command]

Available Commands

  view        View the full information for a host.

Flags

-h or --help – help for host

-v or --verbose – Display detailed host info

-n, or —numhosts int – Number of hosts to display from the hostdb

Miner

Perform miner actions and view miner status.

Usage

spc miner [flags] or spc miner [command]

Available Commands

  start       Start cpu mining

  stop        Stop mining

Flags

-h or --help – help for miner

Renter

Perform renter actions – upload, download, rename, delete, load, or share files.

Usage

spc renter [flags] or spc renter [command]

Available Commands

  allowance            View the current allowance

  contracts            View the Renter's contracts

  createbackup         Create a backup of the renter's SiaPrime files

  delete               Delete a file

  download             Download a file

  downloads            View the download queue

  export               export renter data to various formats

  list                 List the status of all files

  loadbackup           Load a backup of the renter's SiaPrime files

  prices               Display the price of storage and bandwidth

  recoveryscanprogress Returns the recovery scan progress.

  rename               Rename a file

  setallowance         Set the allowance

  triggerrecoveryscan  Triggers a recovery scan.

  upload               Upload a file or folder

  uploads              View the upload queue

Flags

-h or --help – help for renter

-v or --verbose – Display detailed renter info

Stop

Stop the SiaPrime daemon.

Usage

spc stop [flags]

Flags

-h or --help – help for stop

Update

Check for (and/or download) available updates for SiaPrime.

Usage

spc update [flags] or spc update [command]

Available Commands

  check       Check for available updates

Flags

-h or --help – help for update

Utils

Various utilities for working with SiaPrime’s types. These commands do not require spc.

Usage

spc utils [command]

Available Commands

  bash-completion Creates bash completion file.

  checksig        verify a signature of the specified hash

  decoderawtxn    convert a base64-encoded transaction to JSON

  encoderawtxn    convert a JSON-encoded transaction to base64

  hastings        convert a currency amount to Hastings

  man-generation  Creates unix style manpages.

  sighash         calculate the SigHash of a transaction

  verify-seed     verify seed is formatted correctly

Flags

-h or --help – help for utils

Version

Print version information.

Usage

spc version [flags]

Flags

-h or --help – help for version

Example output

SiaPrime Client

Version 1.3.5.2

Git Revision 15b9779

Build Time  Mon Dec 17 20:54:32 CST 2018

SiaPrime Daemon

Version 1.3.5.2

Git Revision 15b9779

Build Time  Mon Dec 17 20:54:32 CST 2018

Wallet

Perform wallet actions – generate a new address, send coins to another wallet, or view info about the wallet.

Usage

spc wallet [flags] or spc wallet [command]

Available Commands

  address         Get a new wallet address

  addresses       List all addresses

  balance         View wallet balance

  broadcast       Broadcast a transaction

  change-password Change the wallet password

  init            Initialize and encrypt a new wallet

  init-seed       Initialize and encrypt a new wallet using a pre-existing seed

  load            Load a wallet seed, v0.3.3.x wallet, or spcg keyset

  lock            Lock the wallet

  seeds           View information about your seeds

  send            Send either SiaPrimeCoins or SiaPrimeFunds to an address

  sign            Sign a transaction

  sweep           Sweep SiaPrimeCoins and SiaPrimeFunds from a seed.

  transactions    View transactions

  unlock          Unlock the wallet

Flags

-h or --help – help for wallet

Units

The smallest unit of SiaPrimeCoins is the hasting. One SiaPrimeCoin is 10^24 hastings. Other supported units are:

  pS (pico,  10^-12 SCP)

  nS (nano,  10^-9 SCP)

  uS (micro, 10^-6 SCP)

  mS (milli, 10^-3 SCP)

  SC

  KS (kilo, 10^3 SCP)

  MS (mega, 10^6 SCP)

  GS (giga, 10^9 SCP)

  TS (tera, 10^12 SCP)

Global flags

  -a, --addr string            which host/port to communicate with (i.e. the host/port spc is listening on) (default "localhost:9980")

      --apipassword string     the password for the API's http authentication

  -h, --help                   help for spc

  -d, --spc-directory string   location of the SiaPrime directory (default "/Users/username/Library/Application Support/SiaPrime")

      --useragent string       the useragent used by spc to connect to the daemon's API (default "SiaPrime-Agent")a

 

error when calling /wallet/siacoins: unable to fund transaction: wallet has coins spent in incomplete transactions – not enough remaining coins

If you are trying to send 100% of your wallet balance, you should know that the wallet does have a fee built in so you can’t send 100% of the balance in your wallet – you can try sending smaller amounts.

If that does not solve your problem then: Reinitialize the wallet. Please, before doing this, make sure you have your seed words available.. then Go to the terminal tab in the wallet and type: wallet init-seed –force It will prompt you for your seed words – after it loads, try again to send coins at this point.

If you get a message at this point saying “API authentication failed” then go to the about tab and click on Show SiaPrime Data which on Windows will place you on a path like: C:\Users\username\AppData\Roaming\SiaPrime-UI

At this point, close out of the wallet, including right clicking the icon on the task bar and quitting from there and then you want to rename the SiaPrime-UI folder to SiaPrime-UI-backup then open the wallet again.  The wallet will re-sync and you will need to type in your seed words to open the wallet and should now be able to send coins.

Password

SiaPrime allows for local passwords for a seed to be set. By default the password will be the seed. If a custom password is set, it may not be saved through version updates, so try the seed again.

You may notice the seed and password are (by default) identical; this is expected behavior. SiaPrime allows users to create an easy to remember passphrase distinct from the seed, but the seed is the true password and the only way a user can recover a wallet in the case of corruption of wallet loss or on a different installation.

Wallet Re-Initialize (Force rescan)

Occasionally a transaction pertaining to your wallet can be missed. To force a rescan, open the ‘Terminal’ tab of the UI, and use the command ‘wallet init-seed –force’. Use your seed when asked. The rescan will take some time to complete.

Loading a Seed

On a fresh install: open the ‘Wallet’ tab of the UI and select “Load a wallet from a seed”. Enter your seed for both the seed and password fields. Password can be changed afterward via ‘Change Password’ in the ‘Wallet’ tab, but note this password applies only to this specific installation of SiaPrime (and never touches the blockchain).

On an existing install/wallet already loaded: either recover/sweep the seed (see above FAQ), or force the UI to switch primary wallet to new seed by opening the ‘Terminal’ tab and using the command ‘wallet init-seed –force’. As always, keep backups of seeds.

Recover Seed

Recover Seed “sweeps” or transfers all of the balance of the entered seed in to the wallet currently loaded.

Updating SiaPrime

Close SiaPrime completely. Download the latest wallet. Extract the downloaded files in to a new location, or on top of an existing install (when asked to replace or duplicate the files, click replace all).

Moving the Consensus Database or Internal Data Files

1) Run SiaPrime at least once. This will generate the necessary files.

2) Find the files by clicking ‘Show SiaPrime Data’ in the ‘About’ tab of the SiaPrime-UI.

3) Close SiaPrime completely (see below FAQ).

4) Move the ‘siaprime’ folder from this internal data folder to your desired location (ex. D:\)

5) Edit ‘config.json’ from the root of the internal data folder, and change the ‘datadir’ to the new ‘siaprime’ folder location. Leave the remaining handful of files (including ‘config.json’) in their original location.

Backing Up the Wallet and Important Data

The seed is the only way to protect and access your funds. In addition to writing it down, you can view it by clicking ‘Backup Wallet’ in an unlocked wallet.

The software’s internal data files should be backed up regularly if you are hosting or renting storage. The files can be found by clicking ‘Show SiaPrime Data’ in the ‘About’ tab of the SiaPrime-UI.

Closing SiaPrime-UI

Find SiaPrime from the system tray (bottom right of taskbar on Windows), right click and select ‘Quit SiaPrime’.

If you would prefer SiaPrime to close entirely when closing the main window, edit the ‘config.json’ file from the internal data files and change ‘closeToTray’ to false.