Skip to content

Commit

Permalink
Merge pull request #11 from Jwyman328/0.9.0
Browse files Browse the repository at this point in the history
0.9.0
  • Loading branch information
Jwyman328 authored Sep 29, 2024
2 parents bbf4224 + 9e22b4a commit f76a5ac
Show file tree
Hide file tree
Showing 15 changed files with 106 additions and 31 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
35 changes: 35 additions & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

8 changes: 2 additions & 6 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file removed assets/icon.ico
Binary file not shown.
16 changes: 16 additions & 0 deletions backend/build_windows_executable.sh
Original file line number Diff line number Diff line change
@@ -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



2 changes: 1 addition & 1 deletion backend/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[metadata]
name = local_family_wallet
version = 0.8.0
version = 0.9.0

[options]
packages = src
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 .",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -242,6 +244,13 @@
"arm64"
]
},
{
"target": "rpm",
"arch": [
"x64",
"arm64"
]
},
{
"target": "AppImage",
"arch": [
Expand All @@ -250,7 +259,7 @@
]
}
],
"icon": "resources/assets/icons",
"icon": "resources/assets/icons/256x256.png",
"category": "Development",
"maintainer": "Barney Rubble <b@rubble.com>"
},
Expand Down
4 changes: 2 additions & 2 deletions release/app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion release/app/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
15 changes: 12 additions & 3 deletions scripts/package_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
21 changes: 12 additions & 9 deletions scripts/update_app_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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 <new_version> <changelog_entry>"
if [ "$#" -ne 3 ]; then
echo "Usage: $0 <new_version> <changelog_entry> <os_type>"
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
Expand Down Expand Up @@ -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

2 changes: 1 addition & 1 deletion src/app/pages/WalletSignIn.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ describe('WalletSignIn', () => {

expect(mockElectron.ipcRenderer.sendMessage).toHaveBeenCalledWith(
'current-route',
'/signin',
Pages.SIGN_IN
);

expect(mockElectron.ipcRenderer.on).toHaveBeenCalledWith(
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/WalletSignIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
9 changes: 6 additions & 3 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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();
}
}
});

Expand Down

0 comments on commit f76a5ac

Please sign in to comment.