Skip to content

Commit

Permalink
Merge branch 'merge-master-staging-ln' into staging-ln
Browse files Browse the repository at this point in the history
  • Loading branch information
Beerosagos committed Nov 12, 2024
2 parents 5c517a1 + ff4022a commit 10f8102
Show file tree
Hide file tree
Showing 207 changed files with 3,986 additions and 3,067 deletions.
81 changes: 74 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ env:
# https://docs.github.com/en/packages/guides/pushing-and-pulling-docker-images
#
# Keep this in sync with default in scripts/github-ci.sh.
CI_IMAGE: ghcr.io/bitboxswiss/bitbox-wallet-app-ci:24
CI_IMAGE: ghcr.io/bitboxswiss/bitbox-wallet-app-ci:25
GITHUB_BUILD_DIR: ${{github.workspace}}

jobs:
Expand All @@ -44,6 +44,8 @@ jobs:
OS_NAME: linux
android:
runs-on: ubuntu-22.04
outputs:
artifact-url: ${{ steps.upload.outputs.artifact-url }}
steps:
- name: Clone the repo
uses: actions/checkout@v4
Expand All @@ -59,12 +61,18 @@ jobs:
env:
OS_NAME: linux
- name: Upload APK
id: upload
uses: actions/upload-artifact@v4
with:
path: frontends/android/BitBoxApp/app/build/outputs/apk/debug/app-debug.apk
name: BitBoxApp-android-${{github.sha}}.apk
if-no-files-found: error
qt-linux:
runs-on: ubuntu-22.04
outputs:
artifact-url-ai: ${{ steps.upload-ai.outputs.artifact-url }}
artifact-url-deb: ${{ steps.upload-deb.outputs.artifact-url }}
artifact-url-rpm: ${{ steps.upload-rpm.outputs.artifact-url }}
steps:
- name: Clone the repo
uses: actions/checkout@v4
Expand All @@ -75,22 +83,30 @@ jobs:
env:
OS_NAME: linux
- name: Upload AppImage
id: upload-ai
uses: actions/upload-artifact@v4
with:
path: frontends/qt/build/linux/BitBoxApp-*.AppImage
name: BitBoxApp-linux-${{github.sha}}.AppImage
if-no-files-found: error
- name: Upload deb
id: upload-deb
uses: actions/upload-artifact@v4
with:
path: frontends/qt/build/linux/bitbox_*.deb
name: BitBoxApp-linux-${{github.sha}}.deb
if-no-files-found: error
- name: Upload rpm
id: upload-rpm
uses: actions/upload-artifact@v4
with:
path: frontends/qt/build/linux/bitbox-*.rpm
name: BitBoxApp-linux-${{github.sha}}.rpm
if-no-files-found: error
macos:
runs-on: macos-12
runs-on: macos-13
outputs:
artifact-url: ${{ steps.upload.outputs.artifact-url }}
steps:
- name: Clone the repo
uses: actions/checkout@v4
Expand All @@ -99,11 +115,25 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version: 1.23.x
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Qt
# Qt modules: Not sure why we need qtpositioning - app compilation fails without. Maybe the webengine depends on it.
# qtpositioning depends on qtserialport.
# qtwebchannel is for the JS/backend bridge.
# qtwebengine is for rendering the frontend.
run: |
pip install aqtinstall
aqt install-qt mac desktop 6.2.4 --modules qtpositioning qtserialport qtwebchannel qtwebengine --outputdir ~/Qt
echo "$HOME/Qt/6.2.4/macos/bin" >> $GITHUB_PATH
echo "$HOME/Qt/6.2.4/macos/libexec" >> $GITHUB_PATH
- name: Build macOS app
run: >
./scripts/github-ci.sh qt-osx;
Expand All @@ -115,10 +145,12 @@ jobs:
ditto -c -k --keepParent BitBox.app ${{github.workspace}}/BitBoxApp-macos.zip;
popd;
- name: Upload app
id: upload
uses: actions/upload-artifact@v4
with:
path: BitBoxApp-macos.zip
name: BitBoxApp-macos-${{github.sha}}.zip
if-no-files-found: error
ios:
runs-on: macos-14
env:
Expand All @@ -145,11 +177,46 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install Qt
run: |
brew install qt@5
echo "/opt/homebrew/opt/qt@5/bin" >> $GITHUB_PATH
- name: Build iOS app
run: |
make gomobileinit
(cd $GOPATH/$GO_SRC_DIR; make ios)
report-artifacts:
needs: [android, qt-linux, macos]
runs-on: ubuntu-22.04
if: ${{ !cancelled() && github.event_name == 'push' }}
steps:
- name: Clone the repo
uses: actions/checkout@v4
- name: Create vars
id: vars
run: |
echo "git_sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Message for success
uses: mattermost/action-mattermost-notify@master
continue-on-error: true
if: job.status == 'success'
with:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }}
PAYLOAD: |-
{
"channel": "eng-artifacts",
"text": "**New artifacts built**\n([${{ github.ref_name }}](https://github.com/${{ github.repository }}/tree/${{ github.ref_name }}), [${{ steps.vars.outputs.git_sha_short }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}), [artifacts](https://github.com/${{ github.repository }}/actions/runs/${{github.run_id}}#artifacts))\n* Android - [APK](${{needs.android.outputs.artifact-url}})\n* Linux - [AppImage](${{needs.qt-linux.outputs.artifact-url-ai}}), [DEB](${{needs.qt-linux.outputs.artifact-url-deb}}), [RPM](${{needs.qt-linux.outputs.artifact-url-rpm}})\n* MacOS - [Zip](${{needs.macos.outputs.artifact-url}})",
"icon_emoji": "white_check_mark",
"props": {"card": "Repository: [${{ github.repository }}](https://github.com/${{ github.repository }})"}
}
- name: Message for failure
uses: mattermost/action-mattermost-notify@master
continue-on-error: true
if: job.status == 'failure'
with:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MM_WEBHOOK_URL }}
PAYLOAD: |-
{
"channel": "eng-build-failures",
"text": "**Oh no! [${{ steps.vars.outputs.git_sha_short }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) failed to build.**\nSee [run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) form more details.",
"icon_emoji": "warning",
"props": {"card": "Repository: [${{ github.repository }}](https://github.com/${{ github.repository }})\n\nbranch: [${{ github.ref_name }}](https://github.com/${{ github.repository }}/tree/${{ github.ref_name }})\n\ncommit: [${{ steps.vars.outputs.git_sha_short }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})"}
}
23 changes: 0 additions & 23 deletions .github/workflows/trivy.yml

This file was deleted.

5 changes: 3 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# options for analysis running
run:
go: "1.22"
go: "1.23"

# default concurrency is a available CPU number
concurrency: 4
Expand All @@ -23,7 +23,7 @@ run:
# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
formats:
formats:
- format: colored-line-number
path: stdout

Expand Down Expand Up @@ -120,6 +120,7 @@ linters:
- gosmopolitan
# TODO: enable this after merge https://github.com/karalabe/hid/pull/52
- gomoddirectives
- predeclared
disable-all: false

issues:
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
# Changelog

## Unreleased

# 4.46.0
- Android: enable export logs feature
- Label UTXOs that were created as change, as such, in coin control
- Remove support for deprecated the Ethereum Goerli network
- Revamp transaction history in account overview to improve legibility
- Fix qrscanner when rotating the device or resizing the window
- macOS: create a universal build that runs natively on arm64 and amd64
- Show fiat amount at the time of the transaction in transaction history
- Add BTC Direct private trading desk information
- Android: fix stuck back button after closing a dialog
- Fix authentication view glitch at startup

# 4.45.0
- Bundle BitBox02 firmware version v9.21.0
- Bitcoin: add support for sending to silent payment (BIP-352) addresses
- Prevent macOS from going to sleep on long running interactions with the BitBox

## 4.44.1
- Minor UI bugfixes

## 4.44.0
- Bundle BitBox02 firmware version v9.20.0
- Add support for selling bitcoin in-app via Pocket
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
# limitations under the License.
FROM thyrlian/android-sdk:4.0 as android

FROM shiftcrypto/qt5:4
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND noninteractive

# Android
COPY --from=android /opt/android-sdk /opt/android-sdk
Expand All @@ -28,6 +30,6 @@ ENV PATH $GOROOT/bin:$GOPATH/bin:$PATH
ADD Makefile /tmp/
RUN make -C /tmp/ envinit

ENV PATH /opt/qt5/bin:$PATH
ENV PATH /opt/qt6/6.2.4/gcc_64/bin:/opt/qt6/6.2.4/gcc_64/libexec:$PATH

CMD ["bash"]
9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ catch:
@echo "Choose a make target."
envinit:
# Keep golangci-lint version in sync with what's in .github/workflows/ci.yml.
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(GOPATH)/bin v1.59.0
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.61.0
go install github.com/vektra/mockery/v2@latest
go install github.com/matryer/moq@latest
go install golang.org/x/tools/cmd/goimports@latest
Expand All @@ -30,13 +30,6 @@ gomobileinit:
# TODO: replace with go install golang.org/x/mobile/cmd/gomobile@latest once https://github.com/golang/mobile/pull/105 is merged.
git clone https://github.com/BitBoxSwiss/mobile.git /tmp/mobile && cd /tmp/mobile/cmd/gomobile && go install .
gomobile init
# Initializiation on MacOS
# - run make from $GOPATH/src/github.com/BitBoxSwiss/bitbox-wallet-app
# - additional dependencies: Qt 5.15 & Xcode command line tools
# - add to $PATH: /usr/local/opt/go@1.22/bin
osx-init:
./scripts/osx-brew.sh
$(MAKE) envinit
servewallet:
go run -mod=vendor ./cmd/servewallet
servewallet-mainnet:
Expand Down
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Please see the [contribution guidelines](CONTRIBUTING.md).
The wallet UI is a [React](https://reactjs.org/) single page webapp. It sources its data from the
backend written in Go.

The Desktop app is a C++ Qt5 program containing only a `WebEngineView`, displaying the UI.
The Desktop app is a C++ Qt program containing only a `WebEngineView`, displaying the UI.

Static assets are sourced from a Qt rcc file, and the dynamic data is bridged from Go with
WebChannels.
Expand All @@ -35,7 +35,7 @@ XCode project.
backend. Manages addresses, outputs, tx creation, and everything else that a wallet needs to do.
- `backend/`: The library that ties it all together. Uses the above packages to create a wallet
talking Electrum using the BitBox for signing, and serve a high level HTTP API to control it.
- `frontends/qt/`: the C++/Qt5 app which builds the wallet app for the desktop.
- `frontends/qt/`: the C++/Qt app which builds the wallet app for the desktop.
- `frontends/android/`: Android target
- `frontends/web/`: home of the React UI.

Expand All @@ -47,20 +47,12 @@ The below instructions assume a unix environment.

To build the app or run the development workflow, the following dependencies need to be installed:

- [Go](https://golang.org/doc/install) version 1.22
- [Go](https://golang.org/doc/install) version 1.23
- [Node.js](https://nodejs.org/) version 20.x
- [NPM](https://docs.npmjs.com/about-npm-versions) version 10.x or newer
- [Qt5](https://www.qt.io) version 5.15.2
- [Qt](https://www.qt.io) version 6.2.4
- install Qt for your platform, including the WebEngine component

#### Environment variables

Make sure the environment variables for qt, go and node are set, see also [docs/BUILD.md](./docs/BUILD.md) for platform specific instructions

To initialize the build environment and install the required go utilities (linters, ...), call
* `make envinit`, or
* on MacOS `make osx-init`

## Build the BitBoxApp

Clone this repository using `git clone --recursive`.
Expand All @@ -85,6 +77,8 @@ full node.

### Local development

Run `make envinit` to fetch golangci-lint and some other devtools.

Run `make servewallet` and `make webdev` in seperate terminals.

Before the first use of `make webdev`, you also need to run `make buildweb`, to install the dev
Expand Down Expand Up @@ -189,8 +183,6 @@ Get Bitcoin Testnet coins here: https://coinfaucet.eu/en/btc-testnet/

Get Litecoin Testnet coins here: https://tltc.bitaps.com/

Get Ethereum Goerli coins here: https://goerlifaucet.com/

Get Ethereum Sepolia coins here: https://faucet.sepolia.dev/

In case any of the Ethereum faucets are not working, you can try others from here: https://faucetlink.to (some require account creation)
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ image: Visual Studio 2019
environment:
nodejs_version: "20"
matrix:
- QT: C:\Qt\5.15.2\msvc2019_64
- QT: C:\Qt\6.2\msvc2019_64
# As installed by `choco`
GOROOT: C:\Program Files\Go
GOPATH: C:\gopath\
Expand All @@ -19,12 +19,12 @@ matrix:
fast_finish: true

before_build:
- set PATH=%QT5%\bin;C:\Qt\Tools\QtCreator\bin\;%GOROOT%\bin;C:\gopath\bin\;C:\Qt\5.15.2\msvc2019_64\bin\;C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;C:\MinGW\bin;%PATH%
- set PATH=C:\Qt\Tools\QtCreator\bin\;%GOROOT%\bin;C:\gopath\bin\;C:\Qt\6.2\msvc2019_64\bin\;C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;C:\MinGW\bin;%PATH%
- set MINGW_BIN=/c/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin

build_script:
- echo on
- choco install go --version=1.22.6
- choco install go --version=1.23.2
- go version
- go env
- choco install make
Expand Down
Loading

0 comments on commit 10f8102

Please sign in to comment.