Skip to content

Running lamassu‐machine on macOS

CrypticaScriptura edited this page Aug 9, 2024 · 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 v22.4.1:

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

Clone lamassu-machine:

git clone https://github.com/lamassu/lamassu-machine.git
cd lamassu-machine
git checkout release-10.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
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": "u1...",
      "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 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.)