This guide will walk you through the steps required to download and set up the LockTrip testnet wallet for the Raspbian operating system (Raspberry Pi). It also includes useful information on how to set up a basic firewall, keep your Pi up-to-date, and how to backup the Pi itself. Please use the comment box at the end of the guide if you have any questions, comments or suggestions. Also, don’t forget to sign-up to the LockTrip Marketplace and start saving on your travel!
The guide assumes you already have Raspbian up and running on your Raspberry Pi, with an internet connection. If you do not, follow the instructions here.
The Raspbian shortcut bar is located at the top left corner of the desktop.
From left: Applications Menu; Chromium Web Browser; File Manager; Terminal window
First, back up your wallet.dat if you want to keep it. Delete the data from previous testnets (0.16.1 and earlier), including the “locktrip-0.xx.x” folder and the “.locktrip” folder. (This may help remove some issues with the blockchain data etc. It’s not mandatory if your wallet was running fine already.)
Open Chromium and download the latest ARM version (locktrip-0.16.2-arm-linux-gnueabihf.tar.gz) of the testnet wallet from the LockTrip GitHub.
Once the download has finished, open File Manager and move the file from the “/home/pi/Downloads” folder to the “/home/pi/Programs” folder. If you don’t have a Programs folder, please create one. Now right-click the file and click “Extract Here”. The images below show the old wallet version, yours should be “0.16.2”.
A new folder named “locktrip-0.16.2” will appear. Inside that folder there is a “bin” folder. In the “bin” folder are four files. The two we will use are called “locktripd” and “locktrip-cli”. These files cannot be opened by clicking on them; we need to use Terminal.
You can delete the downloaded .gz file if you want to, it’s no longer needed.
Open a Terminal window and navigate to the “bin” folder by typing the following command and pressing enter.
Tip: pressing the “tab” key while typing a folder name will autocomplete the folder name.
Once you are in the “bin” folder, use the following command to start the LockTrip wallet in testnet mode:
./locktripd -daemon -testnet
Congratulations, the LockTrip testnet wallet is now running! It may look like nothing is happening, but it’s there running in the background.
A new folder called “.locktrip” will also have been created in the “/home/pi” directory. If you can’t see it, you will need to show hidden files (in the “View” menu). This is where the blockchain data and your wallet file are stored. You can back up and move your wallet to another system simply by copying the wallet.dat file to a usb disk.
In order to send commands to the wallet, we need to use the locktrip-cli file. Let’s start by retrieving the information about your wallet. Type the following into Terminal and hit enter:
./locktrip-cli -testnet getwalletinfo
The important parts to note here are “balance” and “stake”. These will update when you have coins in your wallet.
Now is a good time to familiarise yourself with encrypting your wallet. This adds an extra layer of security by setting a wallet passphrase, which will be required to unlock your wallet. Thus, even if someone gets a hold of your wallet file, they will not be able to control it. You can skip this step for now, if you want to. But it’s a much better idea to set it up and become comfortable using it now, before transferring funds to your wallet.
To encrypt your wallet, use the following command:
./locktrip-cli -testnet encryptwallet yourpassword
I used “testpassword” for my passphrase. You should use a strong passphrase for your wallet. Make sure you do not forget your passphrase. You won’t be able to access your coins without it.
Encrypting your wallet will stop the server. Restart it before continuing:
./locktripd -daemon -testnet
Now, when you use the getwalletinfo command, there will be an extra value listed:
This means that your wallet is currently locked, and no funds can be sent from your wallet.
Use the following command to unlock your wallet:
./locktrip-cli -testnet walletpassphrase yourpassword 300
Here, 300 is the number of seconds you want to unlock your wallet for. It will lock automatically after the time is up. If you use the getwalletinfo command again, you’ll see a number next to “unlocked_until”. This number represents a date and time in the future.
While unlocked, you are able to send funds from your wallet and your wallet will also stake its coins. It’s possible to unlock your wallet only for staking; this will be described further below.
Now let’s send some coins to the wallet. (Follow Step 5.1 below if you wish to use a pre-existing wallet.)
If you wish to further secure your Raspberry Pi before sending coins to it, follow Step 5.2 below. Yes, this is just the testnet, but why not learn how to do it now, in preparation for mainnet!
First, you need to get a new address. Use the following command:
./locktrip-cli -testnet getnewaddress
Your new address will be displayed on the next line. You can now send coins to your wallet using this address. Do not send real LOC tokens to this wallet. Load up the LockTrip testnet faucet and send some testnet coins to your new address, or send some from another testnet wallet.
Use the getwalletinfo command again to show your wallet info. (Hint: hit the up arrow on your keyboard to load previously-used commands into the Terminal window)
If your balance still displays 0, this is because your transaction has not yet been confirmed, or because your wallet is still syncing with the blockchain. You can check which block your wallet is currently synced up to by using the following command:
./locktrip-cli -testnet getinfo
The number next to “blocks” is the block your wallet is currently synced up to. Once your wallet reaches the block containing your transaction, the amount will be accurately reflected in your wallet. All block and transaction information is available on the LockTrip Testnet Explorer. You can search for your transaction with its transaction ID or by entering your wallet address.
For unencrypted wallets, staking is enabled by default and will commence once your coins have been in your wallet for 1500 blocks. Again, this information can be confirmed using the testnet explorer. You can also check if your coins are staked using this command:
./locktrip-cli -testnet getstakinginfo
Your staking weight (number of LOC staked) will be shown next to the “weight” label. You will need to subtract eight zeros to get the actual number.
If you encrypted your wallet in Step 4, you can unlock your wallet only for staking using the following command:
./locktrip-cli -testnet walletpassphrase yourpassword 999999999 true
You can enter any number of seconds; 999999999 seconds equates to almost 32 years.
After entering your wallet passphrase into the terminal, it will be stored in the command line history (accessible by pressing the keyboard up-arrow). If somebody were to access your Pi somehow, they could see your passphrase. To be extra safe, you can delete the command history using the following command:
To send coins to another wallet, use the command below. (If you encrypted your wallet, you will have to unlock it first.)
./locktrip-cli -testnet sendtoaddress address amount
Once sent, a transaction ID will be shown below your command. You can copy and paste this into the LockTrip Testnet Explorer to see the transaction information.
That’s all for this setup guide! There’s many more commands available for your wallet. You can see the full list by using the following command:
./locktrip-cli -testnet help
I’ve also put some extra instructions below, regarding keeping your Pi up-to-date, etc. This is recommended for security.
Again, feel free to ask any questions in the comments section below!
Enjoy, and thank you for supporting LockTrip!
(Step 5.1) Using a pre-existing wallet
First, stop the daemon using the following command:
./locktrip-cli -testnet stop
Now, replace the wallet.dat file found in the “/home/pi/.locktrip/testnet4/” folder with your pre-existing wallet. Start the daemon again. Initially the balance will show 0. You need to wait for the wallet to rescan.
(Step 5.2) Further securing your Raspberry Pi
One of the easiest ways to add extra security to your Raspberry Pi is by locking it down using Uncomplicated Firewall (UFW). Enter the following command to install it:
sudo apt install ufw
You can start and stop the firewall using the following commands:
sudo ufw enable
sudo ufw disable
Now, enter the following command to deny all incoming requests:
sudo ufw default deny incoming
The LockTrip testnet wallet uses tcp port 1337, so we need to allow this port:
sudo ufw allow 1337/tcp
Your firewall setup is now complete!
You can check your firewall status and its rules using this command:
sudo ufw status
If you had the firewall set up for the previous wallet port (1338), you can now delete the rule for TCP port 1338 that we created:
sudo ufw delete allow 1338/tcp
Keeping your Pi up-to-date
It’s also wise to keep your Pi up-to-date. This will make sure it has the latest security fixes, etc. Simply run these commands:
sudo apt-get update
This will update your system’s package list.
sudo apt-get dist-upgrade
And this one will upgrade all your installed packages to their latest versions. Your kernel and firmware will also be updated via these commands. It’s possible to schedule these commands to run regularly; you can find plenty of guides online if you wish to do this!
Back-up your Pi
You can create an image of your entire SD card easily using freely available tools. This not only backs up your wallet, but also all of the work you have done on your Pi up to now (firewall settings, etc.). Mac users can use the Disk Utility application included in MacOS. Windows users can utilize Win32 Disk Imager. Both of these applications allow you to restore the image to an SD card. Here’s a nice guide with all the details you need!