diff --git a/CHANGELOG.md b/CHANGELOG.md index 62b35a27..16629032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.9.0 +- Build for redhat linux distributions, and windows. +- bugfixes + # 0.8.0 - Linux builds and small dynamic style improvements - logout dropdown button diff --git a/NOTES.md b/NOTES.md index 11b2ac57..ed99c5fa 100644 --- a/NOTES.md +++ b/NOTES.md @@ -143,3 +143,38 @@ The linux system that I build the app with does not have to be the one that I te - $ sudo apt-get install open-vm-tools-desktop -y - to build the production app via $ npm run package - you must first install rpm $ sudo apt-get install rpm + + + - Fixing the issue where ubuntu would freeze on refetch. + - this was most likely do to not having enough disk space. + - a temporary fix is + - https://askubuntu.com/questions/1387469/boot-hangs-when-starting-gdm-service + - a permenant solution was to increase disk space. + - disk space can not just be allocated to the disk but must then be distributed to the file system. + - $lsblk + - this will check the current disk space + - resize the partition + - sudo apt update + - sudo apt install cloud-guest-utils + - one of the two commands below + - sudo growpart /dev/sda 1 + - sudo growpart /dev/sda 2 + - resize the file system + - sudo resize2fs /dev/sda1 + - verify the changes + - df -h + - an alternative way is to do this is to use parted. + - $ sudo parted /dev/sda + - $ print + - $ resizepart 2 100% + - $ exit + - sudo resize2fs /dev/sda2 + - df -h + + +# build for windows + - use wine on ubuntu to build the windows executable. + - wine download steps https://gitlab.winehq.org/wine/wine/-/wikis/Debian-Ubuntu + - helpful walk through https://www.makeworld.space/2021/10/linux-wine-pyinstaller.html + - after the exe is built you can build with electron-builder targeting the windows build. + diff --git a/TODO.md b/TODO.md index fcc9a498..b559da59 100644 --- a/TODO.md +++ b/TODO.md @@ -13,18 +13,14 @@ - Also set the default custom fee rate to the current rate # TODOs build -- reduce startup time. +- write scripts to help update the versions in the website page. +- reduce startup time on macOS. - use a random port to run the backend on -- build for not just macOS? - - https://github.com/pyinstaller/pyinstaller/wiki/FAQ#features - - "Since pyinstaller is not a cross-compiler (which means with pyinstaller you cannot create an executable for any other system than the one you are on), you will have to look for other tools." - - use wine? - Analyze the build size and try to make it smaller - e2e tests # Feature Ideas -- consolidation recommendation support. - utxo cost breakdown. - individual non wallet fee estimation. - additional hardware wallet support diff --git a/assets/icon.ico b/assets/icon.ico deleted file mode 100644 index cd8a93a3..00000000 Binary files a/assets/icon.ico and /dev/null differ diff --git a/backend/build_windows_executable.sh b/backend/build_windows_executable.sh new file mode 100644 index 00000000..7d02a01c --- /dev/null +++ b/backend/build_windows_executable.sh @@ -0,0 +1,16 @@ +# Check if Wine is installed +if command -v wine &> /dev/null; then + echo "Wine is installed. Running Python script with Wine." + + # pyinstaller needs to be installed in order to run this command and build the executable + # This command will result in an executable placed in assets/ directory + # --add-binary="./libusb-1.0.dylib:." is needed because libusb is a macos dependency for using the hwi hardware wallet library, without it macos will not be able to successfully communicate to devices over usb. + wine C:/Python310/python.exe -m pip install pyinstaller + ENVIRONMENT="NOT_ANYTHING" wine C:/Python310/Scripts/pyinstaller.exe -F --distpath=../assets --noconfirm --windowed --hidden-import "configparser" --hidden-import "six" --collect-submodules "bdkpython" --collect-binaries "bdkpython" --add-binary="./libusb-1.0.dylib:." --collect-submodules "hwi" --collect-binaries "hwi" --hidden-import "dependency_injector.errors" --hidden-import "hwilib.devices.trezor" --hidden-import "hwilib.devices.ledger" --hidden-import "hwilib.devices.keepkey" --hidden-import "hwilib.devices.digitalbitbox" --hidden-import "hwilib.devices.coldcard" --hidden-import "hwilib.devices.bitbox02" --hidden-import "hwilib.devices.jade" "src/app.py" +else + echo "Wine is not installed. not building for windows, exiting." + exit 1 # Exit with a non-zero status +fi + + + diff --git a/backend/setup.cfg b/backend/setup.cfg index 0c840bb2..3eab7ee4 100644 --- a/backend/setup.cfg +++ b/backend/setup.cfg @@ -2,7 +2,7 @@ [metadata] name = local_family_wallet -version = 0.8.0 +version = 0.9.0 [options] packages = src diff --git a/package-lock.json b/package-lock.json index 19d214f1..991a01eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,8 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-query": "^3.39.3", - "react-router-dom": "^6.16.0" + "react-router-dom": "^6.16.0", + "tree-kill": "^1.2.2" }, "devDependencies": { "@electron/notarize": "^2.3.1", @@ -19317,7 +19318,6 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", - "dev": true, "bin": { "tree-kill": "cli.js" } diff --git a/package.json b/package.json index 124c7752..ad4bcccb 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "package": "ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --publish never && npm run build:dll", "package:mac": "ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --publish never --mac && npm run build:dll", "package:linux": "ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --publish never --linux && npm run build:dll", + "package:windows": "ts-node ./.erb/scripts/clean.js dist && npm run build && electron-builder build --publish never --windows && npm run build:dll", "rebuild": "electron-rebuild --parallel --types prod,dev,optional --module-dir release/app", "start": "ts-node ./.erb/scripts/check-port-in-use.js && npm run start:renderer", "start:main": "cross-env NODE_ENV=development electronmon -r ts-node/register/transpile-only .", @@ -111,7 +112,8 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-query": "^3.39.3", - "react-router-dom": "^6.16.0" + "react-router-dom": "^6.16.0", + "tree-kill": "^1.2.2" }, "devDependencies": { "@electron/notarize": "^2.3.1", @@ -242,6 +244,13 @@ "arm64" ] }, + { + "target": "rpm", + "arch": [ + "x64", + "arm64" + ] + }, { "target": "AppImage", "arch": [ @@ -250,7 +259,7 @@ ] } ], - "icon": "resources/assets/icons", + "icon": "resources/assets/icons/256x256.png", "category": "Development", "maintainer": "Barney Rubble " }, diff --git a/release/app/package-lock.json b/release/app/package-lock.json index 11737b22..cb9bb651 100644 --- a/release/app/package-lock.json +++ b/release/app/package-lock.json @@ -1,12 +1,12 @@ { "name": "LiveWallet", - "version": "0.8.0", + "version": "0.9.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "LiveWallet", - "version": "0.8.0", + "version": "0.9.0", "hasInstallScript": true, "license": "MIT" } diff --git a/release/app/package.json b/release/app/package.json index 110b8fba..c11fda48 100644 --- a/release/app/package.json +++ b/release/app/package.json @@ -1,6 +1,6 @@ { "name": "LiveWallet", - "version": "0.8.0", + "version": "0.9.0", "description": "An application to understand the health of your Bitcoin wallet.", "license": "MIT", "author": { diff --git a/scripts/package_app.sh b/scripts/package_app.sh index 8839e768..2a932e89 100644 --- a/scripts/package_app.sh +++ b/scripts/package_app.sh @@ -2,14 +2,23 @@ cd ../backend source environment.sh -bash build_executable.sh +## Check if the first argument is 'windows' +if [ "$1" == "windows" ]; then + bash build_windows_executable.sh +else + bash build_executable.sh +fi + cd .. # Define the command to run npm_command="run package" # Check the operating system -if [[ "$(uname)" == "Darwin" ]]; then +if [[ "$1" == "windows" ]]; then + echo "Detected Windows variable. Running npm package for Windows." + npm $npm_command:windows +elif [[ "$(uname)" == "Darwin" ]]; then # macOS detected echo "Running on macOS. Using sudo for npm package." sudo npm $npm_command:mac @@ -19,5 +28,5 @@ else npm $npm_command:linux fi -# also notarize the macOs app via additional commandline tools +# also notarize the macOs app builds via additional commandline tools # For more details view notes # notarizing macOs app diff --git a/scripts/update_app_version.sh b/scripts/update_app_version.sh index ec54579d..34a4d114 100644 --- a/scripts/update_app_version.sh +++ b/scripts/update_app_version.sh @@ -2,7 +2,7 @@ # This script will update the app version number in all locations, add to the CHANGELOG and then create a new release build. # example usage -# $ bash update_app_version.sh "1.2.0" "I am adding another item to the change log" +# $ bash update_app_version.sh "1.2.0" "I am adding another item to the change log" "windows" # Function to install jq install_jq() { @@ -31,21 +31,24 @@ if ! command -v jq &> /dev/null; then fi # Check if the correct number of arguments are passed -if [ "$#" -ne 2 ]; then - echo "Usage: $0 " +if [ "$#" -ne 3 ]; then + echo "Usage: $0 " exit 1 fi # Assign the new version from the command line argument NEW_VERSION="$1" CHANGELOG_ENTRY="$2" +OS_TYPE="$3" # Define the path to your package-lock.json file -PACKAGE_LOCK_PATH="./release/app/package-lock.json" -PACKAGE_PATH="./release/app/package.json" -SETUP_CFG_PATH="./backend/setup.cfg" -CHANGELOG_PATH="./CHANGELOG.md" -TEMP_CHANGELOG_PATH="./temp_changelog.md" +PACKAGE_LOCK_PATH="../release/app/package-lock.json" +PACKAGE_PATH="../release/app/package.json" +SETUP_CFG_PATH="../backend/setup.cfg" +CHANGELOG_PATH="../CHANGELOG.md" +TEMP_CHANGELOG_PATH="../temp_changelog.md" + +pwd # Verify that the file exists if [ ! -f "$PACKAGE_LOCK_PATH" ]; then @@ -106,5 +109,5 @@ echo "Version updated to $NEW_VERSION in $PACKAGE_LOCK_PATH and $PACKAGE_PATH an echo "Creating new release build for $NEW_VERSION" -bash ./scripts/package_app.sh +bash ./package_app.sh $OS_TYPE diff --git a/src/app/pages/WalletSignIn.test.tsx b/src/app/pages/WalletSignIn.test.tsx index 7d2744f4..861051ee 100644 --- a/src/app/pages/WalletSignIn.test.tsx +++ b/src/app/pages/WalletSignIn.test.tsx @@ -445,7 +445,7 @@ describe('WalletSignIn', () => { expect(mockElectron.ipcRenderer.sendMessage).toHaveBeenCalledWith( 'current-route', - '/signin', + Pages.SIGN_IN ); expect(mockElectron.ipcRenderer.on).toHaveBeenCalledWith( diff --git a/src/app/pages/WalletSignIn.tsx b/src/app/pages/WalletSignIn.tsx index 4b4da0ad..9cfa22c2 100644 --- a/src/app/pages/WalletSignIn.tsx +++ b/src/app/pages/WalletSignIn.tsx @@ -546,7 +546,7 @@ export const WalletSignIn = () => { // @ts-ignore window.electron.ipcRenderer.on('json-wallet', handleImportedWallet); - window.electron.ipcRenderer.sendMessage('current-route', '/signin'); + window.electron.ipcRenderer.sendMessage('current-route', Pages.SIGN_IN); }, []); const createKeyInformationTabs = () => { diff --git a/src/main/main.ts b/src/main/main.ts index c99dcbf8..5ca9960b 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -227,8 +227,6 @@ const createWindow = async () => { height: 900, minHeight: 874, minWidth: 824, - // TODO add logic to detect linux? - // test build on mac to see if this still shows icons icon: path.join(__dirname, 'resources/assets/icons'), title: 'UXTO Fee Estimator', webPreferences: { @@ -284,7 +282,12 @@ app.on('window-all-closed', () => { app.on('before-quit', () => { if (backendProcess) { console.log('killing backend process'); - backendProcess.kill(); + if (process.platform === 'win32') { + const kill = require("tree-kill") + kill(backendProcess.pid, "SIGTERM") + } else { + backendProcess.kill(); + } } });