Rescan can take a long time to finish if you have thousands of transactions in your wallet. This is the case mostly for Komodo Notary Nodes. Notary Nodes are making transactions every seconds and wallet.dat size builds up over the time. It can grow couple of GB in an entire season. To maintain performance Notary Node operators resets wallet or uses cleanwallettransaction
RPC call which cleans up transactions for them.
This guide is aimed at Notary Node operators who wish to salvage or retrieve funds from their wallet without rescanning the full blockchain. Also can be used for other users who does not wish to spend time with rescanning. The guide works for transparent R address on Komodo or on any other Smart Chains (SC) except PIRATE as this chain uses private address only by default. I will be showing example of how to do it for Komodo.
This method uses an Insight explorer to fetch all transaction contains to the given address inside the script while filtering out unspent txs and matching vouts based on the filter from the script. You can customize the script to not use any vouts of any size.
Important Notes:
- You can create the raw transaction in any computer with internet connection using the output from the script.
- You need to have your private key imported to sign the transaction (not needed if you are using your NN which already has the key).
- You can also use offline computer to sign the transaction.
- If you are using a computer and want to import the key, make sure to set rescan to false. Otherwise, the daemon will start rescanning the entire blockchain. (i.e.:
./komodo-cli importprivkey Uxxxxxxxxxxxxx "" false
) replaceUxxxxxxxxxxxxx
with your actual private key which is otherwise known as WIF (Wallet Import Format) key. - For broadcasting the signed transaction HEX, you can use the daemon from your NN. If you are using an offline computer, you can use an insight based explorer to broadcast the tx.
The script
Thanks to IT Expert DeckerSU for this awesome script. You can get the script from here and customize it to your need – https://github.com/DeckerSU/komodo_scripts/blob/master/sendfromaddress.sh
How to use this script?
- Change the
FROM_ADDRESS
and the address in the last line to where you want to send - Issue the script which will generate output to
createrawtransaction
- Then, use
komodo-cli
and paste the output fully from above - Then, use
komodo-cli signrawtransaction
with the output fromcreaterawtransaction
call - Then, use
komodo-cli sendrawtransaction
with the signed hex or broadcast the hex using an explorer which supports broadcasting
Example of using the script including output
My script for this is called sendmined.sh
and here is a full screenshot of all the steps I’ve taken to recover my KMD which were not visible to getinfo
or getbalance
call.
This was the resulting transaction ID 18bde489c2f20bb711b3cef07da758e7e764e6ab3f26ed1c91e916def85709ee
And, we are done spending funds without rescanning a blockchain. If you want to do this with your Smart Chain you just need to change the URL of insight explorer for your coin. (Note: You can’t use it with PIRATE or any shielded address)
If you find this article helpful please show us some love by sharing it with your friends in need. You can support us by donating any KMD or Smart Chain at this address RG839yyK53NSJMsVURNZm95YkVpjYxNoob
. Thank you!