chore: use monorepo organization

This commit is contained in:
Rafael Taranto 2025-05-12 10:52:54 +01:00
parent deaf7d6ecc
commit a687827f7e
1099 changed files with 8184 additions and 11535 deletions

View file

@ -1,5 +1,4 @@
./node_modules **/node_modules
./new-lamassu-admin/node_modules
.git .git
.direnv .direnv
.envrc .envrc

11
.gitignore vendored
View file

@ -1,10 +1,9 @@
node_modules **/node_modules
**/.env
.idea/ .idea/
.settings/ .settings/
certs/ packages/server/certs/
tests/stress/machines packages/server/tests/stress/machines
tests/stress/config.json packages/server/tests/stress/config.json
.env

View file

@ -26,8 +26,6 @@ shell.nix script provided, all you need to do to setup the environment is to run
### Install node modules ### Install node modules
Make sure you're running NodeJS 8.3 or higher. Ignore any warnings.
``` ```
npm install npm install
``` ```
@ -35,7 +33,7 @@ npm install
### Generate certificates ### Generate certificates
``` ```
bash tools/cert-gen.sh bash packages/server/tools/cert-gen.sh
``` ```
Notes: Notes:
@ -46,14 +44,13 @@ Notes:
Important: lamassu-migrate currently gripes about a QueryResultError. Ignore this, it works anyway. Important: lamassu-migrate currently gripes about a QueryResultError. Ignore this, it works anyway.
``` ```
node bin/lamassu-migrate node packages/server/bin/lamassu-migrate
``` ```
### Run new-lamassu-admin ### Run new-lamassu-admin
``` ```
cd new-lamassu-admin/ cd packages-admin-ui/
npm install
npm run start npm run start
``` ```
@ -62,7 +59,7 @@ npm run start
In a second terminal window: In a second terminal window:
``` ```
node bin/lamassu-admin-server --dev node packages/server/bin/lamassu-admin-server --dev
``` ```
### Register admin user ### Register admin user
@ -70,7 +67,7 @@ node bin/lamassu-admin-server --dev
In a third terminal window: In a third terminal window:
``` ```
node bin/lamassu-register admin@example.com superuser node packages/server/bin/lamassu-register admin@example.com superuser
``` ```
You'll use this generated URL in the brower in a moment. You'll use this generated URL in the brower in a moment.
@ -86,7 +83,7 @@ Go to all the required, unconfigured red fields and choose some values. Choose m
### Run lamassu-server ### Run lamassu-server
``` ```
node bin/lamassu-server --mockScoring node packages/server/bin/lamassu-server --mockScoring
``` ```
### Add a lamassu-machine ### Add a lamassu-machine
@ -100,18 +97,18 @@ Now continue with lamassu-machine instructions from the ``INSTALL.md`` file in [
To start the Lamassu server run: To start the Lamassu server run:
``` ```
node bin/lamassu-server --mockScoring node packages/server/bin/lamassu-server --mockScoring
``` ```
To start the Lamassu Admin run: To start the Lamassu Admin run:
``` ```
node bin/lamassu-admin-server --dev node packages/server/bin/lamassu-admin-server --dev
``` ```
and and
``` ```
cd new-lamassu-admin/ cd packages/admin-ui/
npm run start npm run start
``` ```

View file

@ -2,7 +2,7 @@
## Preliminaries for Ubuntu 16.04 ## Preliminaries for Ubuntu 16.04
Installation for other distros may be slightly different. This assumes NodeJS 8.3 or higher and npm 5.6 are already installed. All of this is done in the lamassu-server directory. Installation for other distros may be slightly different. This assumes NodeJS 22 or higher is already installed. All of this is done in the lamassu-server directory.
### Packages ### Packages
@ -25,26 +25,11 @@ In ``psql``, run the following and set password to ``postgres123``:
ctrl-d ctrl-d
``` ```
## Preliminaries for MacOS
### Postgres
Use Postgres.app: https://postgresapp.com/
**psql** is automatically installed. You won't need to set up users.
### NodeJS
```
curl -L https://git.io/n-install | bash -s -- -y lts
. ~/.bash_profile
```
## Installation ## Installation
### Install node modules ### Install node modules
Make sure you're running NodeJS 8.3 or higher. Ignore any warnings. Make sure you're running NodeJS 22 or higher. Ignore any warnings.
``` ```
npm install npm install
@ -53,7 +38,7 @@ npm install
### Generate certificates ### Generate certificates
``` ```
bash tools/cert-gen.sh bash packages/server/tools/cert-gen.sh
``` ```
Notes: Notes:
@ -64,14 +49,13 @@ Notes:
Important: lamassu-migrate currently gripes about a QueryResultError. Ignore this, it works anyway. Important: lamassu-migrate currently gripes about a QueryResultError. Ignore this, it works anyway.
``` ```
node bin/lamassu-migrate node packages/server/bin/lamassu-migrate
``` ```
### Run new-lamassu-admin ### Run new-lamassu-admin
``` ```
cd new-lamassu-admin/ cd packages/admin-ui/
npm install
npm run start npm run start
``` ```
@ -80,7 +64,7 @@ npm run start
In a second terminal window: In a second terminal window:
``` ```
node bin/lamassu-admin-server --dev node packages/server/bin/lamassu-admin-server --dev
``` ```
### Register admin user ### Register admin user
@ -88,7 +72,7 @@ node bin/lamassu-admin-server --dev
In a third terminal window: In a third terminal window:
``` ```
node bin/lamassu-register admin@example.com superuser node packages/server/bin/lamassu-register admin@example.com superuser
``` ```
You'll use this generated URL in the brower in a moment. You'll use this generated URL in the brower in a moment.
@ -104,7 +88,7 @@ Go to all the required, unconfigured red fields and choose some values. Choose m
### Run lamassu-server ### Run lamassu-server
``` ```
node bin/lamassu-server --mockScoring node packages/server/bin/lamassu-server --mockScoring
``` ```
### Add a lamassu-machine ### Add a lamassu-machine
@ -115,7 +99,7 @@ Now continue with lamassu-machine instructions from the ``INSTALL.md`` file in [
### Run a local coin node (BTC supported) ### Run a local coin node (BTC supported)
Run `node bin/lamassu-coins` in the project root and select `Bitcoin`. This process will require the existence of certain environment variables that the setup will warn about. Run `node packages/server/bin/lamassu-coins` in the project root and select `Bitcoin`. This process will require the existence of certain environment variables that the setup will warn about.
Once that is done, the node needs to be run in a terminal with the following command `<YOUR_BLOCKCHAIN_DIR_ENV_VAR>/bin/bitcoind -datadir=<YOUR_BLOCKCHAIN_DIR_ENV_VAR>/bitcoin` Once that is done, the node needs to be run in a terminal with the following command `<YOUR_BLOCKCHAIN_DIR_ENV_VAR>/bin/bitcoind -datadir=<YOUR_BLOCKCHAIN_DIR_ENV_VAR>/bitcoin`
@ -125,18 +109,18 @@ Once that is done, the node needs to be run in a terminal with the following com
To start the Lamassu server run: To start the Lamassu server run:
``` ```
node bin/lamassu-server --mockScoring node packages/server/bin/lamassu-server --mockScoring
``` ```
To start the Lamassu Admin run: To start the Lamassu Admin run:
``` ```
node bin/lamassu-admin-server --dev node packages/server/bin/lamassu-admin-server --dev
``` ```
and and
``` ```
cd new-lamassu-admin/ cd packages/admin-ui/
npm run start npm run start
``` ```

View file

@ -1,12 +1,12 @@
FROM node:22-alpine AS build-ui FROM node:22-alpine AS build-ui
RUN apk add --no-cache npm git curl build-base python3 RUN apk add --no-cache npm git curl build-base python3
COPY ["new-lamassu-admin/package.json", "new-lamassu-admin/package-lock.json", "./"] COPY ["packages/admin-ui/package.json", "packages/admin-ui/package-lock.json", "./"]
RUN npm version --allow-same-version --git-tag-version false --commit-hooks false 1.0.0 RUN npm version --allow-same-version --git-tag-version false --commit-hooks false 1.0.0
RUN npm install RUN npm install
COPY new-lamassu-admin/ ./ COPY packages/admin-ui/ ./
RUN npm run build RUN npm run build
FROM ubuntu:20.04 as base FROM ubuntu:20.04 as base
@ -31,11 +31,11 @@ RUN apt-get install nodejs -y -q
WORKDIR lamassu-server WORKDIR lamassu-server
COPY ["package.json", "package-lock.json", "./"] COPY ["packages/server/package.json", "packages/server/package-lock.json", "./"]
RUN npm version --allow-same-version --git-tag-version false --commit-hooks false 1.0.0 RUN npm version --allow-same-version --git-tag-version false --commit-hooks false 1.0.0
RUN npm install --production RUN npm install --production
COPY . ./ COPY ./packages/server/ ./
COPY --from=build-ui /build /lamassu-server/public COPY --from=build-ui /build /lamassu-server/public
RUN cd .. && tar -zcvf lamassu-server.tar.gz ./lamassu-server RUN cd .. && tar -zcvf lamassu-server.tar.gz ./lamassu-server

View file

@ -3,11 +3,11 @@ RUN apk add --no-cache npm git curl build-base net-tools python3 postgresql-dev
WORKDIR /lamassu-server WORKDIR /lamassu-server
COPY ["package.json", "package-lock.json", "./"] COPY ["packages/server/package.json", "packages/server/package-lock.json", "./"]
RUN npm version --allow-same-version --git-tag-version false --commit-hooks false 1.0.0 RUN npm version --allow-same-version --git-tag-version false --commit-hooks false 1.0.0
RUN npm install --production RUN npm install --production
COPY . ./ COPY .packages/server ./
FROM node:22-alpine AS l-s-base FROM node:22-alpine AS l-s-base
@ -30,12 +30,12 @@ RUN apk add --no-cache npm git curl build-base python3
WORKDIR /app WORKDIR /app
COPY ["new-lamassu-admin/package.json", "new-lamassu-admin/package-lock.json", "./"] COPY ["packages/admin-ui/package.json", "packages/admin-ui/package-lock.json", "./"]
RUN npm version --allow-same-version --git-tag-version false --commit-hooks false 1.0.0 RUN npm version --allow-same-version --git-tag-version false --commit-hooks false 1.0.0
RUN npm install RUN npm install
COPY new-lamassu-admin/ ./ COPY packages/admin-ui/ ./
RUN npm run build RUN npm run build
@ -46,4 +46,4 @@ RUN chmod +x /lamassu-server/bin/lamassu-admin-server-entrypoint.sh
EXPOSE 443 EXPOSE 443
ENTRYPOINT [ "/lamassu-server/bin/lamassu-admin-server-entrypoint.sh" ] ENTRYPOINT [ "/lamassu-server/bin/lamassu-admin-server-entrypoint.sh" ]

View file

@ -1,16 +0,0 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=759670
// for the documentation about the jsconfig.json format
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules",
"bower_components",
"jspm_packages",
"tmp",
"temp"
]
}

File diff suppressed because it is too large Load diff

9279
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,156 +1,15 @@
{ {
"name": "lamassu-server", "name": "lamassu-server",
"description": "bitcoin atm client server protocol module", "description": "bitcoin atm client server protocol module",
"keywords": [],
"version": "11.0.0-beta.1", "version": "11.0.0-beta.1",
"license": "./LICENSE", "license": "./LICENSE",
"author": "Lamassu (https://lamassu.is)", "author": "Lamassu (https://lamassu.is)",
"dependencies": {
"@apollo/server": "^4.11.3",
"@bitgo/sdk-api": "1.33.0",
"@bitgo/sdk-coin-bch": "1.5.22",
"@bitgo/sdk-coin-btc": "1.7.22",
"@bitgo/sdk-coin-dash": "1.5.22",
"@bitgo/sdk-coin-ltc": "2.2.22",
"@bitgo/sdk-coin-zec": "1.5.22",
"@ethereumjs/common": "^2.6.4",
"@ethereumjs/tx": "^3.5.1",
"@graphql-tools/merge": "^9.0.22",
"@graphql-tools/schema": "^10.0.21",
"@graphql-tools/utils": "^10.8.4",
"@haensl/subset-sum": "^3.0.5",
"@lamassu/coins": "v1.6.1",
"@simplewebauthn/server": "^3.0.0",
"@vonage/auth": "1.5.0",
"@vonage/server-client": "1.7.0",
"@vonage/sms": "1.7.0",
"@vonage/vetch": "1.5.0",
"argon2": "0.28.2",
"axios": "0.21.1",
"base-x": "3.0.9",
"base64url": "^3.0.1",
"bchaddrjs": "^0.3.0",
"bignumber.js": "9.0.1",
"bip39": "^2.3.1",
"ccxt": "2.9.16",
"compression": "^1.7.4",
"connect-pg-simple": "^6.2.1",
"console-log-level": "^1.4.0",
"cookie-parser": "^1.4.3",
"cors": "^2.8.5",
"dataloader": "^2.0.0",
"date-fns": "^2.26.0",
"date-fns-tz": "^1.1.6",
"dateformat": "^3.0.3",
"dotenv": "^16.0.0",
"elliptic-sdk": "^0.7.2",
"ethereumjs-tx": "^1.3.3",
"ethereumjs-util": "^5.2.0",
"ethereumjs-wallet": "^0.6.3",
"express": "4.17.1",
"express-session": "^1.17.1",
"form-data": "^4.0.0",
"futoin-hkdf": "^1.0.2",
"got": "^7.1.0",
"graphql": "^16.10.0",
"graphql-scalars": "^1.24.1",
"graphql-tag": "^2.12.6",
"graphql-upload": "^17.0.0",
"helmet": "^3.8.1",
"inquirer": "^5.2.0",
"json2csv": "^5.0.3",
"libphonenumber-js": "^1.7.38",
"lodash": "^4.17.10",
"mailgun-js": "^0.21.0",
"make-dir": "^1.0.0",
"mem": "^1.1.0",
"migrate": "^1.6.2",
"minimist": "^1.2.0",
"morgan": "^1.8.2",
"nan": "^2.14.0",
"nano-markdown": "^1.2.0",
"ndjson": "^1.5.0",
"nocache": "^2.1.0",
"node-cache": "^5.1.2",
"otplib": "^12.0.1",
"p-each-series": "^1.0.0",
"p-queue": "^6.6.2",
"p-retry": "^4.4.0",
"pg-native": "^3.0.0",
"pg-promise": "^10.10.2",
"pify": "^3.0.0",
"pretty-ms": "^2.1.0",
"promise-sequential": "^1.1.1",
"queue-promise": "^2.2.1",
"request-promise": "^4.2.6",
"semver": "^7.7.1",
"serve-static": "^1.12.4",
"talisman": "^0.20.0",
"telnyx": "^1.25.5",
"tronweb": "^5.3.0",
"twilio": "^3.6.1",
"uuid": "8.3.2",
"web3": "1.7.1",
"winston": "^2.4.2",
"winston-transport": "^4.3.0",
"xml-stream": "^0.4.5",
"xmlrpc": "^1.3.2",
"yup": "^0.31.1"
},
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/lamassu/lamassu-server.git" "url": "https://github.com/lamassu/lamassu-server.git"
}, },
"bin": { "workspaces": [
"lamassu-server": "./bin/lamassu-server", "packages/server",
"lamassu-migrate": "./bin/lamassu-migrate", "packages/admin-ui"
"lamassu-register": "./bin/lamassu-register", ]
"lamassu-admin-server": "./bin/lamassu-admin-server",
"hkdf": "./bin/hkdf",
"bip39": "./bin/bip39",
"lamassu-backup-pg": "./bin/lamassu-backup-pg",
"lamassu-mnemonic": "./bin/lamassu-mnemonic",
"lamassu-coins": "./bin/lamassu-coins",
"lamassu-ofac-update": "./bin/lamassu-ofac-update",
"lamassu-send-coins": "./bin/lamassu-send-coins",
"lamassu-update-to-mnemonic": "./bin/lamassu-update-to-mnemonic",
"lamassu-btc-bumpfee": "./bin/lamassu-btc-bumpfee",
"lamassu-update-wallet-nodes": "./bin/lamassu-update-wallet-nodes",
"lamassu-configure-frontcamera": "./bin/lamassu-configure-frontcamera",
"lamassu-devices": "./bin/lamassu-devices",
"lamassu-operator": "./bin/lamassu-operator",
"lamassu-coinatmradar": "./bin/lamassu-coinatmradar",
"lamassu-eth-recovery": "./bin/lamassu-eth-recovery",
"lamassu-trx-recovery": "./bin/lamassu-trx-recovery",
"lamassu-update-cassettes": "./bin/lamassu-update-cassettes",
"lamassu-clean-parsed-id": "./bin/lamassu-clean-parsed-id"
},
"scripts": {
"start": "node bin/lamassu-server",
"test": "mocha --recursive tests",
"jtest": "jest --detectOpenHandles",
"build-admin": "npm run build-admin:css && npm run build-admin:main && npm run build-admin:lamassu",
"server": "nodemon bin/lamassu-server --mockScoring --logLevel silly",
"admin-server": "nodemon bin/lamassu-admin-server --dev --logLevel silly",
"watch": "concurrently \"npm:server\" \"npm:admin-server\"",
"stress-test": "cd tests/stress/ && node index.js 50 -v"
},
"nodemonConfig": {
"ignore": [
"new-lamassu-admin/*"
]
},
"devDependencies": {
"concurrently": "^5.3.0",
"jest": "^26.6.3",
"nodemon": "^2.0.6",
"standard": "^12.0.1"
},
"standard": {
"ignore": [
"/lamassu-admin-elm",
"/public",
"/new-lamassu-admin"
]
}
} }

View file

@ -5,6 +5,8 @@
"type": "module", "type": "module",
"dependencies": { "dependencies": {
"@apollo/client": "^3.13.7", "@apollo/client": "^3.13.7",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@lamassu/coins": "v1.6.1", "@lamassu/coins": "v1.6.1",
"@mui/icons-material": "^7.1.0", "@mui/icons-material": "^7.1.0",
"@mui/material": "^7.1.0", "@mui/material": "^7.1.0",

View file

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 160 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Before After
Before After

Some files were not shown because too many files have changed in this diff Show more