Skip to content

Commit

Permalink
Merge pull request #10 from Jwyman328/linux-builds
Browse files Browse the repository at this point in the history
0.8.0
  • Loading branch information
Jwyman328 authored Sep 22, 2024
2 parents eed0b83 + f05c7d6 commit bbf4224
Show file tree
Hide file tree
Showing 41 changed files with 227 additions and 75 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.8.0
- Linux builds and small dynamic style improvements
- logout dropdown button

# 0.7.0
- Add consolidation mode.

Expand Down
90 changes: 90 additions & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,93 @@
- brew install libusb
- would this be a dependency of the app then?
- what if a user didn't have this installed on macos





# build for linux
- $ npx electron-builder --linux
- I added a section to my package.json build section
"linux": {
"target": [
"AppImage",
"deb",
"rpm"
],
"icon": "path/to/icon.png"
}

- right now do I run the electron-builder command?
- the postinstall command runs it. do I run the postinstall command?
- well right now I am running sudo npm run package
- it runs electron-builder build command.
- basically I need to run a linux vm on my machine
- https://www.reddit.com/r/MacOS/comments/1808wf6/whats_everyones_favorite_vm_software_for_mseries/
- VMware Player Fusion
- UTM
- VirtualBox
- VirtualBuddy
- running on mac got this error
- to build rpm, executable rpmbuild is required, please install: brew install rpm

- when I create linux builds I should publich both .deb and .rpm files.



- vmware was impossible to find
- I had to make an account with broadcom,
- then download it form here https://support.broadcom.com/group/ecx/productfiles?subFamily=VMware%20Fusion&displayGroup=VMware%20Fusion%2013%20Pro%20for%20Personal%20Use&release=13.6&os=&servicePk=522387&language=EN
- https://www.reddit.com/r/vmware/comments/1cma01o/anyone_looking_for_vmware_fusion_player_for_mac/?share_id=tgi0pGYH6Hmp2gy2-dv-d&utm_content=2&utm_medium=ios_app&utm_name=ioscss&utm_source=share&utm_term=1
- https://support.broadcom.com/group/ecx/productdownloads?subfamily=VMware%20Fusion
- I downloaded this image with a UI for the OS https://ubuntu.com/download/desktop/thank-you?version=24.04.1&architecture=amd64&lts=true

The linux system that I build the app with does not have to be the one that I test it on.
- I should test it on multiple other systems anyways


- setting up a new linux system
- install git
- install neovim
- import my neovim config
- cd ~/.config
- git clone https://github.com/Jwyman328/nvim.git
- install python3
- install pip3
- install virtualenv
- install pyenv
- sudo apt install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm \
libncurses5-dev libncursesw5-dev xz-utils tk-dev \
libffi-dev liblzma-dev python3-openssl git
- curl https://pyenv.run | bash
- pyenv install 3.10.1
- pyenv global 3.10.1
- make sure you reload the bash shell
- source ~/.bashrc
- check current python version for 3.10.1
- $python3 --version
- article that helped get my python3 version to be the pyenv version
- https://medium.com/@aashari/easy-to-follow-guide-of-how-to-install-pyenv-on-ubuntu-a3730af8d7f0
- echo -e 'export PYENV_ROOT="$HOME/.pyenv"\nexport PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
- echo -e 'eval "$(pyenv init --path)"\neval "$(pyenv init -)"' >> ~/.bashrc
- exec "$SHELL"
- install npm and nvm
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
- nvm install 20.11.0
- make sure the environment.sh file is using python version 3.10.1 to create the virtual env
- pyenv virtualenv 3.10.1 venv
- npm start issues
- sudo chown root:root /home/jwyman/Documents/programming/LiveWallet/node_modules/electron/dis/chrome-sandbox
- sudo chmod 4755 /home/jwyman/Documents/programming/LiveWallet/node_modules/electron/dist/chrome-sandbox
- now running npm start works.


- install docker
- https://docs.docker.com/desktop/install/linux/ubuntu/
- turns out docker doesn't work on the latest ubuntu version I am using.
- how to get copy and pasting from host to vm in VMware
- https://www.youtube.com/watch?v=E6ZBSIZXF9E&ab_channel=RogerPerkin
- $ 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
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# TODO frontend
- write test for calling logout on home screen.
- better control where wallets are saved and imported from so it is less random. like how sparrow does it
- add a banner for showing that a specific wallet is loaded
- redesign (meet with bitcoin design foundation)
Expand Down
Binary file added assets/256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/icons/48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion backend/environment.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Check if the virtual environment directory exists
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
virtualenv venv
pyenv virtualenv 3.10.1 venv
else
echo "Virtual environment already exists."
fi
Expand Down
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.7.0
version = 0.8.0

[options]
packages = src
Expand Down
2 changes: 1 addition & 1 deletion backend/src/controllers/balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from dependency_injector.wiring import inject, Provide
from src.containers.service_container import ServiceContainer
import structlog
from src.types import GetBalanceResponseDto, SimpleErrorResponse
from src.my_types import GetBalanceResponseDto, SimpleErrorResponse

LOGGER = structlog.get_logger()

Expand Down
2 changes: 1 addition & 1 deletion backend/src/controllers/fees.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from src.containers.service_container import ServiceContainer
from src.services import FeeService
from src.api.fees import FeeEstimates
from src.types import GetCurrentFeesResponseDto, SimpleErrorResponse
from src.my_types import GetCurrentFeesResponseDto, SimpleErrorResponse
import structlog

LOGGER = structlog.get_logger()
Expand Down
2 changes: 1 addition & 1 deletion backend/src/controllers/hardware_wallets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
HardwareWalletDetails,
HardwareWalletService,
)
from src.types.controller_types.generic_response_types import ValidationErrorResponse
from src.my_types.controller_types.generic_response_types import ValidationErrorResponse

hardware_wallet_api = Blueprint(
"hardware_wallet", __name__, url_prefix="/hardware-wallets"
Expand Down
4 changes: 2 additions & 2 deletions backend/src/controllers/utxos.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
import json
from pydantic import ValidationError

from src.types import (
from src.my_types import (
GetUtxosRequestDto,
GetUtxosResponseDto,
GetUtxosErrorResponseDto,
GetAllUtxosResponseDto,
)
from src.types.controller_types.generic_response_types import SimpleErrorResponse
from src.my_types.controller_types.generic_response_types import SimpleErrorResponse

utxo_page = Blueprint("get_utxos", __name__, url_prefix="/utxos")

Expand Down
4 changes: 2 additions & 2 deletions backend/src/controllers/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
import structlog

from src.testbridge.ngiri import randomly_fund_mock_wallet
from src.types import ScriptType
from src.my_types import ScriptType
from src.services import WalletService
from src.containers.service_container import ServiceContainer

from pydantic import BaseModel, ValidationError, field_validator

from src.types.controller_types.generic_response_types import (
from src.my_types.controller_types.generic_response_types import (
ValidationErrorResponse,
SimpleErrorResponse,
)
Expand Down
17 changes: 17 additions & 0 deletions backend/src/my_types/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from src.my_types.script_types import ScriptType
from src.my_types.wallet import WalletDetails, FeeDetails
from src.my_types.controller_types.utxos_dtos import (
GetUtxosRequestDto,
TransactionDto,
GetUtxosResponseDto,
GetUtxosErrorResponseDto,
GetAllUtxosResponseDto,
)

from src.my_types.controller_types.fees_dtos import GetCurrentFeesResponseDto

from src.my_types.controller_types.balance_dtos import GetBalanceResponseDto
from src.my_types.controller_types.generic_response_types import (
SimpleErrorResponse,
ValidationErrorResponse,
)
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion backend/src/services/wallet/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from src.database import DB
from src.models.wallet import Wallet
from src.types import (
from src.my_types import (
ScriptType,
FeeDetails,
GetUtxosRequestDto,
Expand Down
4 changes: 2 additions & 2 deletions backend/src/tests/controller_tests/test_utxos_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from unittest.mock import MagicMock, Mock
from src.app import AppCreator
from src.services.wallet.wallet import GetFeeEstimateForUtxoResponseType, WalletService
from src.types import FeeDetails
from src.types import GetUtxosRequestDto
from src.my_types import FeeDetails
from src.my_types import GetUtxosRequestDto
from src.tests.mocks import local_utxo_mock
from bdkpython import bdk
import json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from src.app import AppCreator
import json

from src.types.script_types import ScriptType
from src.my_types.script_types import ScriptType


class TestWalletController(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion backend/src/tests/mocks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from src.types import (
from src.my_types import (
FeeDetails,
)
import bdkpython as bdk
Expand Down
6 changes: 3 additions & 3 deletions backend/src/tests/service_tests/test_wallet_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
BuildTransactionResponseType,
)
import bdkpython as bdk
from src.types import (
from src.my_types import (
FeeDetails,
)
from src.types import GetUtxosRequestDto
from src.types.script_types import ScriptType
from src.my_types import GetUtxosRequestDto
from src.my_types.script_types import ScriptType
from src.tests.mocks import local_utxo_mock, transaction_details_mock
from typing import cast

Expand Down
17 changes: 0 additions & 17 deletions backend/src/types/__init__.py

This file was deleted.

3 changes: 2 additions & 1 deletion package-lock.json

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

30 changes: 22 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "livewallet",
"description": "An application to understand the health of your Bitcoin wallet.",
"keywords": [
"utxo",
Expand All @@ -13,15 +14,11 @@
"url": "git+https://github.com/Jwyman328/utxo_fee_estimation_fe_electron_app.git"
},
"license": "MIT",
"author": {
"name": "dev",
"email": "",
"url": "https://github.com/Jwyman328/utxo_fee_estimation_fe_electron_app"
},
"author": "Barney Rubble <b@rubble.com> (http://barnyrubble.tumblr.com/)",
"contributors": [
{
"name": "me",
"email": "me",
"email": "myfakeemail@gmail.com",
"url": "https://github.com/Jwyman328"
}
],
Expand All @@ -34,6 +31,8 @@
"postinstall": "ts-node .erb/scripts/check-native-dep.js && electron-builder install-app-deps && npm run build:dll",
"lint": "cross-env NODE_ENV=development eslint . --ext .js,.jsx,.ts,.tsx",
"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",
"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 @@ -236,9 +235,24 @@
},
"linux": {
"target": [
"AppImage"
{
"target": "deb",
"arch": [
"x64",
"arm64"
]
},
{
"target": "AppImage",
"arch": [
"x64",
"arm64"
]
}
],
"category": "Development"
"icon": "resources/assets/icons",
"category": "Development",
"maintainer": "Barney Rubble <b@rubble.com>"
},
"directories": {
"app": "release/app",
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.7.0",
"version": "0.8.0",
"description": "An application to understand the health of your Bitcoin wallet.",
"license": "MIT",
"author": {
Expand Down
17 changes: 14 additions & 3 deletions scripts/package_app.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
cd backend
cd ../backend
source environment.sh


bash build_executable.sh
cd ..

cp -R backend/dist/* ./assets/
# Define the command to run
npm_command="run package"

sudo npm run package
# Check the operating system
if [[ "$(uname)" == "Darwin" ]]; then
# macOS detected
echo "Running on macOS. Using sudo for npm package."
sudo npm $npm_command:mac
else
# Non-macOS detected
echo "Not running on macOS. Running npm package without sudo."
npm $npm_command:linux
fi

# also notarize the macOs app via additional commandline tools
# For more details view notes # notarizing macOs app
Loading

0 comments on commit bbf4224

Please sign in to comment.