Skip to content

Running lamassu‐machine on Ubuntu

CrypticaScriptura edited this page Dec 15, 2023 · 5 revisions

Note: Lamassu provides support to machine operators for the installation of our software on supported environments. We do not offer assistance for installation of the lamassu-machine or lamassu-server software on local environments, or for their custom development. The notes below are provided as a courtesy and do not come with support.


Pre-reqs

As normal user begin by updating and installing dependencies:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update && sudo apt upgrade -y
sudo apt install -y git nodejs npm ruby libjpeg-dev libpng-dev curl build-essential libssl-dev

Next, install node v8.17.0:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
nvm install 8.17.0

Clone lamassu-machine:

git clone https://github.com/lamassu/lamassu-machine.git
cd lamassu-machine
git checkout release-8.1

Installing dependencies and lamassu-machine

Remove the optionalDependencies section, then save:

nano package.json

Next, do:

npm install
bash ./setup.sh
npm run build

Add crypto addresses for the mockCam

Since we'll be mocking out the camera, we'll want to pre-load crypto addresses (that you own) to be automatically scanned in lieu of a QR code.

Run nano device_config.json and add the following block within brain (containing whichever coins you plan to test with):

{
  "brain": {
    "freeMemRatio": 0.01,
    "powerStatus": null,
    "dataPath": "data",
    "wifiConfigPath": null,
    "mockCryptoQR": {
      "BTC": "bc1...",
      "ETH": "0x...",
      "ZEC": "t...",
      "DASH": "X...",
      "LTC": "ltc1...",
      "BCH": "bitcoincash:q..."
    },
    "mockCameraImage": "mock_data/compliance/license.jpg"
  },
[...]

Running the mockBillValidator

Open a second Terminal, one which will remain open and running to control virtual bill inserts. Do:

cd lamassu-machine
node bin/fake-bills.js

After running lamassu-machine and pairing in the next steps, you can use this window to virtually insert bills when you're on the appropriate bill accepting screens. Typing 5 and hitting Enter will insert a 5 denomination note in your currency, for example.

Running

Set up your server and admin if you haven't already done so.

Click '+ Add Machine' in the admin, name the machine, and generate a QR code. Decode the QR code with an app or your browser's dev tools.

Then, in the main Terminal, run the following. Replace totem with that which you obtained from the admin's QR code, also contained within single quotes:

node bin/lamassu-machine --mockBillValidator --mockBillDispenser --mockCam --mockPair 'totem'

Open the following file in a browser (Brave or Chromium), pointing to the correct user directory:

lamassu-machine/ui/start.html?debug=dev

Click 'INIT', then 'Pair'. (Pairing totems expire after an hour, so generate a new one if it's been some time between steps.)