Skip to content

Running lamassu‐machine on macOS

CrypticaScriptura edited this page Jul 18, 2023 · 4 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

In the terminal, as normal user install node.js v8.17.0:

curl -L https://git.io/n-install | bash -s -- -y 8.17.0
. ~/.bash_profile

Clone lamassu-machine:

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

Installing dependencies and lamassu-machine

Edit package.json to remove the optionalDependencies section, then Ctrl+X to exit nano, press Y to save the changes, and enter:

nano package.json

Next, do:

npm install
mv licenses.sample.json licenses.json
mv device_config.sample.json device_config.json

You'll want use of the mouse in addition to touch, by default we disable the cursor in the machine UI. Edit the following two files to remove their lines containing cursor: none; (one instance in each, found within the first 15 lines).

nano ui/css/main.scss
nano ui/css/buttons.scss

Then, build the local UI files with:

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. On that page, open Chromium's devtools, click Console, and find the value for TOTEM.

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

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

Within macOS, open the following URL in a browser (Brave, Chromium), pointing to the correct user directory:

lamassu-machine/ui/start.html

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