Below is a comprehensive guide to Komodo's basic cli parameters:

Video Guide: https://www.youtube.com/watch?v=h7mE0r4HMx0


Note: There is a known issue building the linux wallet at the moment. You will encounter a 404 error when downloading libzsnark. Please wait for a fix.


Requirements to Install Komodo on Linux

Currently, you will need:

  • Linux (easiest with a Debian-based distribution)
  • 64-bit
  • 4GB of free memory



Get Started

Log in as the user to your system, and issue these commands to make sure your Linux machine is up to date.


sudo apt-get update

sudo apt-get upgrade



Press 'Y' when it asks to upgrade stuff



Install the dependency packages:


sudo apt-get install build-essential pkg-config libc6-dev m4 \
g++-multilib autoconf libtool ncurses-dev unzip git python \
zlib1g-dev wget bsdmainutils automake libboost-all-dev \
libssl-dev libprotobuf-dev protobuf-compiler libqt4-dev \
libqrencode-dev libdb++-dev ntp ntpdate vim software-properties-common \
curl libcurl4-gnutls-dev cmake clang



Note that some Linux machines are now providing nanomsg package version 1.0. If it is available via package manager, you can install it from there. Else, you should use github repo of nanomsg and compile it yourself.


For Ubuntu 14.04 you need to install it yourself


cd /tmp
wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz -O nanomsg-1.0.0.tar.gz
tar -xzvf nanomsg-1.0.0.tar.gz
cd nanomsg-1.0.0
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
cmake --build .
sudo cmake --build . --target install
sudo ldconfig


Or the following for 16.04

git clone https://github.com/nanomsg/nanomsg
cd nanomsg
cmake .
make
sudo make install
sudo ldconfig



This takes some time depending your internet connection. Let it run in the background.Now it is time to install Komodo. Follow each line step by step and ignore the "libgmp headers missing" at some point!


Installing Komodo


cd ~
git clone https://github.com/jl777/komodo
cd komodo
git checkout beta
./zcutil/fetch-params.sh



-j8 uses 8 threads - replace 8 with number of threads you want to use or nproc variable


./zcutil/build.sh -j$(nproc)


This can take some time.

When it is finished, let's create komodo.conf


cd ~
mkdir .komodo
cd .komodo
nano komodo.conf



Add the following lines to the komodo.conf file (replace rpcuser and rpcpassword)

rpcuser=bitcoinrpc
rpcpassword=password
txindex=1
bind=127.0.0.1
rpcbind=127.0.0.1


  • Press CTRL+O to save the changes.
  • Press CTRL+X to exit nano editor.


Now you can start komodod daemon to sync with the network


cd ~
cd komodo
./src/komodod -addnode=78.47.196.146 -daemon



You might see some outputs in terminal where you started komodod daemon. So, open a new tab or new terminal window and go to Komodo data directory to see updated logs of Komodo:


cd ~/.komodo/
tail -f debug.log


After tail command it will start showing logs update to you as it syncs with the network. If you want to terminate this command just press CTRL+C.

In another terminal window you can go to Komodo source directory and use komodo-cli command to check the latest update info. like:


cd ~/komodo/src/
./komodo-cli getinfo



This will show you latest info of blockchain and wallet like this:


{
    "version" : 1000550,
    "protocolversion" : 170002,
    "KMDversion" : "0.1.0",
    "notarized" : 186670,
    "notarizedhash" : "000000308845da840ab9af6c1e09dc02f3118683df065b5ec00b05c9bd58cdae",
    "notarizedtxid" : "6723a10ef4fceab230d4245305d1ed2a916e435abb83269c20daad9bbefd3f0e",
    "notarizedtxid_height" : "mempool",
    "notarized_confirms" : 0,
    "walletversion" : 60000,
    "balance" : 0,
    "interest" : 0,
    "blocks" : 186773,
    "longestchain" : 308867,
    "timeoffset" : 0,
    "tiptime" : 1486411069,
    "connections" : 8,
    "proxy" : "",
    "difficulty" : 1624278.62879530,
    "testnet" : false,
    "keypoololdest" : 1482746526,
    "keypoolsize" : 101,
    "paytxfee" : 0.00000000,
    "relayfee" : 0.00001000,
    "errors" : ""
}


in this output when you see "blocks" and "longestchain" values showing same, your wallet is in full sync.

Updating Komodo installation to latest version

If you had already installed Komodo from it's source code on your machine, and need to update to latest version just do these commands


cd ~/komodo/src/
git checkout beta
git pull
make -j$(nproc)



if you get any error executing make command, then do these commands:


cd ~/komodo/
git checkout beta
git pull
./zcutil/build.sh -j$(nproc)



build.sh method will take longer as compare to make command. make command should work every time for you, butin case it doesn't just use build.sh method.

IMPORTANT: Backup your wallet

We can not stress enough to take a backup of your wallet.dat file time to time. Here's the reason why:

  • When you send some funds from an address, sometimes the funds used from the unspent transaction outputs (utxo) leaves a change behind. This change doesn't go back to the same address the funds sent from. This change goes to a new address. And this new address is stored in the wallet.dat file located in Komodo data directory on your machine.
  • Sometime your wallet.dat file may got corrupted. It's always good to have backup handy.

If you are not sure when to take backup of your wallet.dat file, just take backup of it according to how often your use. If you use it regularly, then just take a backup of your wallet.dat file at then end of day. If not so often then maybe twice a week or depending on your use adjust your time period of taking backup.

You can find your wallet.dat file under linux at ~/.komodo/wallet.dat.

To backup you can take a copy of this file and make archive of it.


# To copy
cp -av ~/.komodo/wallet.dat ~/wallet.dat

# To rename file
mv ~/wallet.dat ~/wallet_backup_DATE_HERE.dat

# example
mv ~/wallet.dat ~/wallet_backup_21May2017.dat

# To make archive
tar -czvf ~/wallet_backup_21May2017.dat.tgz ~/wallet_backup_21May2017.dat


All commands must have `./komodo-cli` in front of it.
Example: `desktop@pty:~/komodo/src$ ./komodo-cli getinfo`



10 Main Commands

  1. `./komodo-cli getinfo` Checking current block and balance information
  2. `./komodo-cli getnewaddress ( "account" )` Create new Komodo address
  3. `./komodo-cli backupwallet "destination"` Save your wallet.dat to particular destination
  4. `./komodo-cli dumpprivkey "Komodoaddress"` Dump privatekey
  5. `./komodo-cli listaddressgroupings` List all group of addresses with common ownership and inputs
  6. `./komodo-cli importprivkey "Komodoprivkey"` Import your Komodo privatekey
  7. `./komodo-cli getbestblockhash` Get the latest block hash
  8. `./komodo-cli sendtoaddress "komodo address" "0.01" ` Send Transaction to address 
  9. `./komodo-cli help` See all commands
  10. `./komodo-cli stop` Stop komodod

           (Example: ./komodo-cli sendtoaddress Rxxxxxxxxxxxxx 100)


All Commands by Section

== Blockchain ==
getbestblockhash
getblock "hash|height" ( verbose )
getblockchaininfo
getblockcount
getblockhash index
getblockheader "hash" ( verbose )
getchaintips
getdifficulty
getmempoolinfo
getrawmempool ( verbose )
gettxout "txid" n ( includemempool )
gettxoutproof ["txid",...] ( blockhash )
gettxoutsetinfo
kvsearch key
kvupdate key value flags/passphrase
minerids needs height
notaries height
paxpending needs no args
paxprice "base" "rel" height
paxprices "base" "rel" maxsamples
verifychain ( checklevel numblocks )
verifytxoutproof "proof"

== Control ==
getinfo
help ( "command" )
stop

== Generating ==
generate numblocks
getgenerate
setgenerate generate ( genproclimit )

== Mining ==
getblocksubsidy height
getblocktemplate ( "jsonrequestobject" )
getlocalsolps
getmininginfo
getnetworkhashps ( blocks height )
getnetworksolps ( blocks height )
prioritisetransaction <txid> <priority delta> <fee delta>
submitblock "hexdata" ( "jsonparametersobject" )

== Network ==
addnode "node" "add|remove|onetry"
clearbanned
disconnectnode "node"
getaddednodeinfo dns ( "node" )
getconnectioncount
getnettotals
getnetworkinfo
getpeerinfo
listbanned
ping
setban "ip(/netmask)" "add|remove" (bantime) (absolute)

== Rawtransactions ==
createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,...}
decoderawtransaction "hexstring"
decodescript "hex"
fundrawtransaction "hexstring"
getrawtransaction "txid" ( verbose )
sendrawtransaction "hexstring" ( allowhighfees )
signrawtransaction "hexstring" ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype )

== Util ==
createmultisig nrequired ["key",...]
estimatefee nblocks
estimatepriority nblocks
jumblr_deposit "depositaddress"
jumblr_secret "secretaddress"
validateaddress "bitcoinaddress"
verifymessage "bitcoinaddress" "signature" "message"
z_validateaddress "zaddr"

== Wallet ==
addmultisigaddress nrequired ["key",...] ( "account" )
backupwallet "destination"
dumpprivkey "zcashaddress"
dumpwallet "filename"
encryptwallet "passphrase"
getaccount "zcashaddress"
getaccountaddress "account"
getaddressesbyaccount "account"
getbalance ( "account" minconf includeWatchonly )
getnewaddress ( "account" )
getrawchangeaddress
getreceivedbyaccount "account" ( minconf )
getreceivedbyaddress "zcashaddress" ( minconf )
gettransaction "txid" ( includeWatchonly )
getunconfirmedbalance
getwalletinfo
importaddress "address" ( "label" rescan )
importprivkey "zcashprivkey" ( "label" rescan )
importwallet "filename"
keypoolrefill ( newsize )
listaccounts ( minconf includeWatchonly)
listaddressgroupings
listlockunspent
listreceivedbyaccount ( minconf includeempty includeWatchonly)
listreceivedbyaddress ( minconf includeempty includeWatchonly)
listsinceblock ( "blockhash" target-confirmations includeWatchonly)
listtransactions ( "account" count from includeWatchonly)
listunspent ( minconf maxconf  ["address",...] )
lockunspent unlock [{"txid":"txid","vout":n},...]
move "fromaccount" "toaccount" amount ( minconf "comment" )
paxdeposit address fiatoshis base
sendfrom "fromaccount" "tozcashaddress" amount ( minconf "comment" "comment-to" )
sendmany "fromaccount" {"address":amount,...} ( minconf "comment" ["address",...] )
sendtoaddress "zcashaddress" amount ( "comment" "comment-to" subtractfeefromamount )
setaccount "zcashaddress" "account"
settxfee amount
signmessage "zcashaddress" "message"
z_exportkey "zaddr"
z_exportwallet "filename"
z_getbalance "address" ( minconf )
z_getnewaddress
z_getoperationresult (["operationid", ... ])
z_getoperationstatus (["operationid", ... ])
z_gettotalbalance ( minconf )
z_importkey "zkey" ( rescan startHeight )
z_importwallet "filename"
z_listaddresses
z_listoperationids
z_listreceivedbyaddress "address" ( minconf )
z_sendmany "fromaddress" [{"address":... ,"amount":...},...] ( minconf ) ( fee )
zcbenchmark benchmarktype samplecount
zcrawjoinsplit rawtx inputs outputs vpub_old vpub_new
zcrawkeygen
zcrawreceive zcsecretkey encryptednote
zcsamplejoinsplit