Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ALL-9118 - Upgrade Node, NPM and other libraries #110

Merged
merged 29 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e60a5df
ALL-9118 - Upgrade Node, NPM and other libraries
isra67 Oct 16, 2024
2d00ede
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Nov 20, 2024
01f4974
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Nov 20, 2024
9120af4
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Nov 20, 2024
219b2d1
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Nov 21, 2024
2a8e834
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Nov 21, 2024
b4a7f77
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Nov 21, 2024
ead6d36
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Nov 21, 2024
3ad68bd
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Nov 21, 2024
af9fef5
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Nov 21, 2024
2640bc3
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Nov 21, 2024
4071f27
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Nov 21, 2024
cdd0876
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Nov 21, 2024
a69e932
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Nov 21, 2024
5d674db
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Dec 19, 2024
4cd3717
Merge branch 'master' into feature/update-outdated-packages
martintatum Dec 19, 2024
1242f2a
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Dec 19, 2024
4f0d6cd
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Dec 19, 2024
0530f9a
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Dec 19, 2024
f1ab918
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Dec 19, 2024
d02f245
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Dec 20, 2024
2529d93
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Dec 20, 2024
d10344b
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Dec 20, 2024
c4e23e6
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Dec 20, 2024
f942333
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Jan 6, 2025
c0fbbf7
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Jan 6, 2025
1ed5fdc
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Jan 6, 2025
8cc4cd7
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Jan 6, 2025
63778f7
ALL-9118 - Upgrade Node, NPM and other libraries
martintatum Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .eslintrc

This file was deleted.

29 changes: 24 additions & 5 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,36 @@ on:
- master
jobs:
build:
name: 🏗️ Install and build
runs-on: ubuntu-latest
name: Build and Test
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '18.20.5'

- run: yarn install

- run: yarn lint

- run: yarn build

- run: yarn test

- run: npx github-actions-ctrf summary ctrf/ctrf-report.json --pull-request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docker-build:
name: Build Docker Image
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: build image
run: docker build . --file Dockerfile -t ${{secrets.DOCKER_USER}}/tatum-kms:latest -t "${{secrets.DOCKER_USER}}/tatum-kms:$(cat ./package.json | jq -r ".version")"

- name: smoke test image
run: docker run -i ${{secrets.DOCKER_USER}}/tatum-kms:latest --help

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ lerna-debug.log*
# Tests
/coverage
/.nyc_output
/ctrf

# IDEs and editors
/.idea
Expand Down
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## [8.0.0] - January 2025

### Updated

- Dependency libraries updated to the latest versions

### Changed

- parameter `env-file` renamed to `envFile`
- parameter `api-key` renamed to `apiKey`

### Added

- GitHub Actions pipeline revisited
- basic smoke tests added

## [7.0.7] - December 2024

### Added

- Reporting feature

## [7.0.6] - May 2024

### Updated

- Dependency libraries updated to the latest versions
- Fixed documentation links and dependencies

## [7.0.3] - April 2024

### Changed

- Fix Solana transaction not confirmed - fix for docker image
- Print result as json for generateManagedPrivateKeyBatch (#100)
- export wallets always export default path (#79)
24 changes: 13 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
FROM node:18-alpine3.16 AS builder
FROM node:18.20.5-alpine3.20 AS builder

# Create app directory

WORKDIR /usr/src/app
WORKDIR /opt/app

RUN apk --virtual build-dependencies add \
git libtool curl jq py3-configobj py3-pip py3-setuptools python3 python3-dev g++ make libusb-dev eudev-dev linux-headers && ln -sf python3 /usr/bin/python

RUN ln -s /lib/arm-linux-gnueabihf/libusb-1.0.so.0 libusb-1.0.dll
git libtool curl jq py3-configobj py3-pip py3-setuptools python3 python3-dev \
g++ make libusb-dev eudev-dev linux-headers \
&& ln -sf python3 /usr/bin/python \
&& ln -s /lib/arm-linux-gnueabihf/libusb-1.0.so.0 libusb-1.0.dll

COPY package*.json ./
COPY yarn.lock ./

# Installing dependencies
RUN yarn cache clean
RUN yarn install --frozen-lockfile --unsafe-perm
RUN yarn add usb
RUN yarn cache clean \
&& yarn install --frozen-lockfile --unsafe-perm --ignore-scripts \
&& yarn add usb
# Copying files from current directory

COPY . .

# Create build and link

RUN yarn build

ENTRYPOINT ["node", "/usr/src/app/dist/index.js"]
# Switch to the non-root user
USER node

ENTRYPOINT ["node", "/opt/app/dist/index.js"]

CMD ["daemon"]
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ TATUM_KMS_DEBUG_MODE=true/false/1/0
yarn global add @tatumio/tatum-kms
```
1. Use ```.env``` file to configure Tatum KMS
1. via ```--env-file=/path/to/.env```
1. via ```--envFile=/path/to/.env```
```
tatum-kms --env-file=/path/to/.env getaddress 11111111-1111-1111-1111-111111111111 0
tatum-kms --envFile=/path/to/.env getaddress 11111111-1111-1111-1111-111111111111 0
```
1. via environment variables directly
```
Expand All @@ -164,7 +164,7 @@ TATUM_KMS_DEBUG_MODE=true/false/1/0
tatum-kms --help
```

>**IMPORTANT!** NodeJS >=14 and npm@6 are required. KMS does **not** work on npm@7.
>**IMPORTANT!** NodeJS >=18.0 are required. KMS does **not** work on older versions.

### Install KMS via Docker
1. Pull the `tatum-kms` image:
Expand All @@ -175,7 +175,7 @@ TATUM_KMS_DEBUG_MODE=true/false/1/0
```
cd $HOME
```
1. Use pre-created ```.env``` file to configure Tatum KMS via ```--env-file .env```:
1. Use pre-created ```.env``` file to configure Tatum KMS via ```--envFile .env```:
1. Map the Docker volume to the local storage (your home folder).

For more details, refer to the [Docker user documentation](https://docs.docker.com/storage/volumes/).
Expand All @@ -184,9 +184,9 @@ TATUM_KMS_DEBUG_MODE=true/false/1/0

To interactively communicate with KMS and run various [KMS commands](#kms-commands), use the `docker run` command:
```
docker run -it --env-file .env -v $HOME:/root/.tatumrc tatumio/tatum-kms --help
docker run -it --env-file .env -v $HOME:/root/.tatumrc tatumio/tatum-kms generatemanagedwallet BTC
docker run -it --env-file .env -v $HOME:/root/.tatumrc tatumio/tatum-kms storemanagedprivatekey BTC
docker run -it --envFile .env -v $HOME:/root/.tatumrc tatumio/tatum-kms --help
docker run -it --envFile .env -v $HOME:/root/.tatumrc tatumio/tatum-kms generatemanagedwallet BTC
docker run -it --envFile .env -v $HOME:/root/.tatumrc tatumio/tatum-kms storemanagedprivatekey BTC
```

>**NOTE:** You can shorten the command syntax and use it as follows:
Expand Down Expand Up @@ -223,7 +223,7 @@ tatum-kms daemon
```
or
```
docker run -d --env-file .env -v $HOME:/root/.tatumrc tatumio/tatum-kms daemon
docker run -d --envFile .env -v $HOME:/root/.tatumrc tatumio/tatum-kms daemon
```
When KMS runs as a daemon, it periodically checks for any new pending transactions to sign.

Expand Down
14 changes: 14 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.recommended,
{
rules: {
'@typescript-eslint/no-explicit-any': 'off'
}
}
);
13 changes: 13 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default {
preset: 'ts-jest',
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'js'],
transform: {
'^.+\\.ts$': 'ts-jest',
},
testMatch: ['**/tests/**/*.test.ts'],
reporters: [
'default',
['jest-ctrf-json-reporter', {}],
],
};
67 changes: 44 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
{
"name": "@tatumio/tatum-kms",
"version": "7.0.8",
"version": "8.0.0",
"description": "Tatum KMS - Key Management System for Tatum-powered apps.",
"main": "dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"engines": {
"node": ">=18.x"
},
"tsup": {
"entry": [
"src/index.ts"
],
"sourcemap": false,
"clean": true,
"format": [
"esm"
]
},
"scripts": {
"build": "tsc",
"lint": "eslint . --ext .ts",
"run-daemon-testnet": "node dist/index.js daemon --testnet --api-key=YOUR_API_KEY --chain=ADA",
"start": "yarn build && node dist/index.js"
"build": "tsup",
"lint": "eslint .",
"test": "jest",
"run-daemon-testnet": "yarn start daemon --testnet --apiKey=YOUR_API_KEY --chain=ADA",
"start": "node --experimental-modules dist/index.js"
},
"files": [
"dist/"
Expand All @@ -38,33 +50,42 @@
"url": "https://github.com/tatumio/tatum-kms/issues"
},
"homepage": "https://github.com/tatumio/tatum-kms#readme",
"resolutions": {
"minimatch@*": "^9.0.5"
},
"dependencies": {
"@aws-sdk/client-secrets-manager": "^3.445.0",
"@tatumio/cardano": "^2.2.72",
"@tatumio/celo": "^2.2.72",
"@tatumio/solana": "^2.2.72",
"@aws-sdk/client-secrets-manager": "^3.669.0",
"@tatumio/cardano": "^2.2.86",
"@tatumio/celo": "^2.2.86",
"@tatumio/solana": "^2.2.86",
"@tatumio/tatum": "^1.37.50",
"@tatumio/tatum-kcs": "^2.0.0-alpha.113",
"@tatumio/tron": "^2.2.72",
"@tatumio/xlm": "^2.2.72",
"@tatumio/xrp": "^2.2.72",
"@tatumio/tron": "^2.2.86",
"@tatumio/xlm": "^2.2.86",
"@tatumio/xrp": "^2.2.86",
"agentkeepalive": "^4.5.0",
"axios": "^1.7.9",
"crypto-js": "^4.2.0",
"dotenv": "^16.3.1",
"dotenv": "^16.4.7",
"lodash": "^4.17.21",
"meow": "^7.0.1",
"meow": "^13.2.0",
"readline-sync": "^1.4.10",
"reflect-metadata": "^0.1.13",
"semver": "^7.5.4",
"uuid": "^9.0.1"
"semver": "^7.6.3",
"uuid": "^11.0.4"
},
"devDependencies": {
"@types/jest": "^29.5.14",
"@types/node": "^22.7.5",
"@types/readline-sync": "^1.4.7",
"@types/semver": "^7.5.5",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"eslint": "^8.53.0",
"rimraf": "^5.0.5",
"typescript": "^5.2.2"
"@types/semver": "^7.5.8",
"@typescript-eslint/eslint-plugin": "8.19.0",
"@typescript-eslint/parser": "8.19.0",
"eslint": "^9.12.0",
"jest": "^29.7.0",
"jest-ctrf-json-reporter": "^0.0.9",
"ts-jest": "^29.2.5",
"tsup": "^8.3.5",
"typescript": "^5.6.3",
"typescript-eslint": "^8.15.0"
}
}
Loading