Skip to content

Commit

Permalink
Merge pull request #89 from DeckerSU/static-dev
Browse files Browse the repository at this point in the history
Merge branch 'static-dev' into static
  • Loading branch information
DeckerSU authored Nov 24, 2024
2 parents b75c2a8 + 9aff510 commit e1f803e
Show file tree
Hide file tree
Showing 55 changed files with 3,146 additions and 2,398 deletions.
8 changes: 5 additions & 3 deletions .github/actions/build-project-docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ build_windows=true
build_macos=true
download_and_check_macos_sdk() {
url="https://bitcoincore.org/depends-sources/sdks/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz"
output_file="Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz"
expected_checksum="be17f48fd0b08fb4dcd229f55a6ae48d9f781d210839b4ea313ef17dd12d6ea5"
url="https://download.kmd.sh/depends-sources/Xcode-13.2.1-13C100-extracted-SDK-with-libcxx-headers.tar.gz"
output_file="Xcode-13.2.1-13C100-extracted-SDK-with-libcxx-headers.tar.gz"
expected_checksum="3d200832a74bc7401160043c92f68b11fcedba2d01353b5ab204f9e6a65653d1"
# Check if file exists
if [[ -f "$output_file" ]]; then
Expand Down Expand Up @@ -179,6 +179,8 @@ if true; then
if [[ "${delete_linux_depends}" = true ]]; then
rm -rf ${WORKSPACE}/depends/built/x86_64-unknown-linux-gnu
rm -rf ${WORKSPACE}/depends/x86_64-unknown-linux-gnu
rm -rf ${WORKSPACE}/depends/built/x86_64-pc-linux-gnu
rm -rf ${WORKSPACE}/depends/x86_64-pc-linux-gnu
fi
# delete possible artefacts from previous build(s)
delete_artefacts focal
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@ jobs:
# we don't want use strategy / matrix here, bcz in this case matrix will be used
# for entire job and docker containet will be rebuild several times
- name: Archive artifacts (Linux)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: komodoocean-linux-${{ steps.set_variables_step.outputs.sha_short }}
path: |
./releases/focal
- name: Archive artifacts (Windows)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: komodoocean-windows-${{ steps.set_variables_step.outputs.sha_short }}
path: |
./releases/windows
- name: Archive artifacts (MacOS)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: komodoocean-macos-${{ steps.set_variables_step.outputs.sha_short }}
path: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,5 @@ src/qt/komodo-qt
src/qt/*_7776
src/*_7776
*_7776
releases/
releases/
depends/aarch64-linux-gnu
24 changes: 15 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,44 @@
# limitations under the License.

# Build:
# docker build -f Dockerfile -t komodoocean .
# docker build -f Dockerfile -t deckersu/komodoocean .

# Prepare data directory and config file:
# mkdir -p ./komodo-data/.komodo && RANDPASS=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w16 | head -n1) && echo -e "txindex=1\nrpcuser=komodo\nrpcpassword=${RANDPASS}\nrpcallowip=127.0.0.1\nrpcbind=127.0.0.1\nserver=1" > ./komodo-data/.komodo/komodo.conf
# docker run --rm -v "$(pwd)/komodo-data:/data" ubuntu:18.04 bash -c 'chown -R nobody:nogroup /data'

# Run:
# docker run -d --rm -p 7770:7770 -v "$(pwd)/komodo-data:/data" komodoocean -printtoconsole=1
# docker run -d --rm -p 7770:7770 -v "$(pwd)/komodo-data:/data" deckersu/komodoocean -printtoconsole=1

# Run AC (for example VOTE2024):
# mkdir -p ./VOTE2024/.komodo
# docker run --rm -v "$(pwd)/VOTE2024:/data" ubuntu:18.04 bash -c 'chown -R nobody:nogroup /data'
# docker run -d --rm -v "$(pwd)/VOTE2024:/data" komodoocean -printtoconsole=1 -ac_name=VOTE2024 -ac_public=1 -ac_supply=149826699 -ac_staked=10 -addnode=65.21.52.18
# docker run -d --rm -v "$(pwd)/VOTE2024:/data" deckersu/komodoocean -printtoconsole=1 -ac_name=VOTE2024 -ac_public=1 -ac_supply=149826699 -ac_staked=10 -addnode=65.21.52.18

# Access the container after it's already running:
# docker ps --filter ancestor=komodoocean # find the id / name of container
# docker ps --filter ancestor=deckersu/komodoocean # find the id / name of container
# docker exec -it container_id_or_name /bin/bash # run bash inside the container
# docker exec -it container_id_or_name /app/komodo-cli getinfo # run RPC getinfo

# Run container with current user UID:GID:
# mkdir -p ./komodo-data/.komodo && RANDPASS=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w16 | head -n1) && echo -e "txindex=1\nrpcuser=komodo\nrpcpassword=${RANDPASS}\nrpcallowip=127.0.0.1\nrpcbind=127.0.0.1\nserver=1" > ./komodo-data/.komodo/komodo.conf
# docker run --rm -d --user $(id -u):$(id -g) -e HOME=/data -v "$(pwd)/komodo-data:/data" komodoocean -no-ownership-check -printtoconsole
# docker run --rm -d --user $(id -u):$(id -g) -e HOME=/data -v "$(pwd)/komodo-data:/data" deckersu/komodoocean -no-ownership-check -printtoconsole

# Run AC with current user UID:GID:
# mkdir -p ./VOTE2024/.komodo # pay attention that existance of .komodo folder is important (!)
# docker run --rm -d --user $(id -u):$(id -g) -e HOME=/data -v "$(pwd)/VOTE2024:/data" komodoocean -no-ownership-check -printtoconsole -ac_name=VOTE2024 -ac_public=1 -ac_supply=149826699 -ac_staked=10 -addnode=65.21.52.182
# docker run --rm -d --user $(id -u):$(id -g) -e HOME=/data -v "$(pwd)/VOTE2024:/data" deckersu/komodoocean -no-ownership-check -printtoconsole -ac_name=VOTE2024 -ac_public=1 -ac_supply=149826699 -ac_staked=10 -addnode=65.21.52.182

# Build and Push the Multiplatform Image:
# docker buildx build --platform linux/amd64,linux/arm64 -t deckersu/komodoocean:latest --push .

## Build komodod
FROM ubuntu:20.04 as komodod-builder
LABEL maintainer="DeckerSU <[email protected]>"

SHELL ["/bin/bash", "-c"]

# Latest release komodo 0.8.2-beta1
ARG KOMODO_COMMITTISH=v0.8.2-beta1-sign
# Latest release komodo v0.9.0-beta2
ARG KOMODO_COMMITTISH=v0.9.0-beta2
ARG IS_RELEASE=false
# DeckerSU <[email protected]> https://keys.openpgp.org/vks/v1/by-fingerprint/FD9A772C7300F4C894D1A819FE50480862E6451C
ARG KOMODOD_MAINTAINER_KEYS="FD9A772C7300F4C894D1A819FE50480862E6451C"
Expand All @@ -57,8 +60,11 @@ RUN set -euxo pipefail \
&& apt-get -y --no-install-recommends dist-upgrade \
&& apt-get -y --no-install-recommends install autoconf automake \
bsdmainutils build-essential ca-certificates cmake curl dirmngr fakeroot \
git g++-multilib gnupg2 libc6-dev libgomp1 libtool m4 ncurses-dev \
git g++ gnupg2 libc6-dev libgomp1 libtool m4 ncurses-dev \
pkg-config python3 zlib1g-dev \
&& for file in /usr/bin/aarch64-linux-gnu-*; do \
ln -s "$file" "/usr/bin/$(basename "$file" | sed 's/aarch64-linux-gnu-/aarch64-unknown-linux-gnu-/')" || true; \
done \
&& git clone https://github.com/DeckerSU/KomodoOcean.git \
&& cd /KomodoOcean && git checkout "${KOMODO_COMMITTISH}" \
&& if [ "$IS_RELEASE" = "true" ]; then \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.focal.ci
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM ubuntu:20.04
# Run interactive session in build environment:
# docker run -u $(id -u ${USER}):$(id -g ${USER}) -v $PWD:$PWD -w $PWD -e HOME=/root -it ocean_focal_builder
# Run build itself:
# delete ./built/x86_64-unknown-linux-gnu before build (!) other version of linux, then do:
# delete ./built/x86_64-unknown-linux-gnu and/or x86_64-pc-linux-gnu before build (!) other version of linux, then do:
# ./zcutil/clean-help-dev.sh ; make clean ; zcutil/build.sh -j$(nproc --all)
#
# docker run -u $(id -u ${USER}):$(id -g ${USER}) -v $PWD:$PWD -w $PWD -e HOME=/root ocean_focal_builder /bin/bash -c "./zcutil/clean-help-dev.sh ; make clean ; zcutil/build.sh -j$(nproc --all)"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.xenial.ci
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM ubuntu:16.04
# Run interactive session in build environment:
# docker run -u $(id -u ${USER}):$(id -g ${USER}) -v $PWD:$PWD -w $PWD -e HOME=/root -it ocean_xenial_builder
# Run build itself:
# delete ./built/x86_64-unknown-linux-gnu before build (!) other version of linux, then do:
# delete ./built/x86_64-unknown-linux-gnu and/or x86_64-pc-linux-gnu before build (!) other version of linux, then do:
# ./zcutil/clean-help-dev.sh ; make clean ; zcutil/build.sh -j$(nproc --all)
#
# docker run -u $(id -u ${USER}):$(id -g ${USER}) -v $PWD:$PWD -w $PWD -e HOME=/root ocean_xenial_builder /bin/bash -c "./zcutil/clean-help-dev.sh ; make clean ; zcutil/build.sh -j$(nproc --all)"
Expand Down
32 changes: 16 additions & 16 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ baseline_filtered.info: baseline.info
else
baseline_filtered.info: baseline.info
$(LCOV) -r $< "/usr/include/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/*.h" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/boost/*" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/gmock/*" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/gtest/*" \
"$(abs_builddir)/src/gtest/*" \
"$(abs_builddir)/src/test/*" \
"$(abs_builddir)/src/wallet/gtest/*" \
Expand All @@ -247,10 +247,10 @@ leveldb_baseline_filtered.info: leveldb_baseline.info
else
leveldb_baseline_filtered.info: leveldb_baseline.info
$(LCOV) -r $< "/usr/include/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/*.h" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/boost/*" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/gmock/*" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/gtest/*" \
"$(abs_builddir)/src/gtest/*" \
"$(abs_builddir)/src/test/*" \
"$(abs_builddir)/src/wallet/gtest/*" \
Expand Down Expand Up @@ -282,10 +282,10 @@ test_komodo_filtered.info: test_komodo.info
else
test_komodo_filtered.info: test_komodo.info
$(LCOV) -r $< "/usr/include/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/*.h" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/boost/*" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/gmock/*" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/gtest/*" \
"$(abs_builddir)/src/gtest/*" \
"$(abs_builddir)/src/test/*" \
"$(abs_builddir)/src/wallet/gtest/*" \
Expand Down Expand Up @@ -315,10 +315,10 @@ block_test_filtered.info: block_test.info
else
block_test_filtered.info: block_test.info
$(LCOV) -r $< "/usr/include/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
"$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/*.h" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/boost/*" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/gmock/*" \
"$(abs_builddir)/depends/x86_64-pc-linux-gnu/include/gtest/*" \
"$(abs_builddir)/src/gtest/*" \
"$(abs_builddir)/src/test/*" \
"$(abs_builddir)/src/wallet/gtest/*" \
Expand Down
65 changes: 48 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,67 @@

![](./doc/images/komodo-qt-promo-2020-01.jpg)

Komodo-Qt (KomodoOcean) is a world-first Qt native wallet for KMD ([Komodo](https://komodoplatform.com/)) and smartchains (assetchains). It's available for three OS platforms - Windows, Linux, MacOS.
## Overview ##

Use the default `static` branch and following scripts to build:
KomodoOcean, also known as Komodo-QT, is the first native graphical wallet for the Komodo ecosystem, which includes the KMD coin and its assetchains (ACs). Built with the Qt framework, it offers an easy-to-use interface for managing Komodo assets. With KomodoOcean, users can send and receive KMD and interact with assetchains (ACs), view their transaction history, and access various features of the [Komodo Platform](https://komodoplatform.com/).

- Linux: `build.sh` (native build)
- Windows: `build-win.sh` (cross-compilation for Win)
- MacOS: `build-mac-cross.sh` (cross-compilation for OSX)
- MacOS: `build-mac.sh` (native build)
While the Komodo assetchains provide advanced privacy features, the main KMD coin does not include these privacy options. KomodoOcean stands out as a pioneering Qt-based wallet for a ZCash fork, especially since ZCash itself still does not have a native Qt wallet.

KomodoOcean is available on three OS platforms: `Windows`, `Linux`, and `macOS`.

Use the default `static` branch and the following scripts in `./zcutil` to build, depending on your target platform and architecture:

- **Linux**:
- `build.sh`: Native build for Linux.
- `build-no-qt.sh`: Native build for Linux, but without Qt (produces a daemon-only version).
- `build-aarch64-cross.sh`: Cross-compilation for ARM (aarch64) on Linux.

- **Windows**:
- `build-win.sh`: Cross-compilation for Windows from a Linux environment.

- **MacOS**:
- `build-mac.sh`: Native build for macOS (x86_64). Use on Intel-based Macs or run with `arch -x86_64 /bin/zsh` on Apple Silicon Macs.
- `build-mac-cross.sh`: Cross-compilation for macOS (x86_64) from a Linux environment; produces `Mach-O 64-bit x86_64 executable` binaries.
- `build-mac-arm.sh`: Native build for macOS aarch64. Use this on Apple Silicon Macs to produce `Mach-O 64-bit executable arm64` binaries.
- `build-mac-arm-cross.sh`: Cross-compilation for macOS aarch64 from a Linux environment.

Or use the `static-experimental` branch to access the latest `nightly` features.

**Note**: Cross-compiled `arm64` Darwin (macOS) binaries do not include a digital signature by default. To use these binaries on macOS, they must be [signed](https://github.com/DeckerSU/KomodoOcean/wiki/F.A.Q.#q-the-zsh-killed-message-appears-on-macos-when-running-a-aarch64-apple-darwin-cross-compiled-binary) before execution. Failure to sign these binaries may result in issues with macOS security settings, preventing them from running properly.

Please note that the parent repository [ip-gpu/KomodoOcean](https://github.com/ip-gpu/KomodoOcean) is no longer maintained!

Visit `#🤝│general-support` or `#wallet-ocean-qt` channel in [Komodo Discord](https://komodoplatform.com/discord) for more information.

## How to build? ##

#### Linux

The following packages are needed:
```shell
#The following packages are needed:
sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python bison zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl
sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python3 bison zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl
```

Build:
```shell
git clone https://github.com/DeckerSU/KomodoOcean --branch static --single-branch
cd komodo
cd KomodoOcean
./zcutil/fetch-params.sh
# -j8 = using 8 threads for the compilation - replace 8 with number of threads you want to use
./zcutil/build-linux.sh -j8
#This can take some time.
```
This can take some time.

#### Linux (aarch64)

Install the Cross-Compilation Toolchain:

```shell
sudo apt install g++-aarch64-linux-gnu
aarch64-linux-gnu-g++ --version # verify the installation
```
Build:
```shell
./zcutil/build-aarch64-cross.sh -j8
```

#### OSX (Cross-compile)
Expand All @@ -43,9 +77,7 @@ sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemag
# sudo apt-get install libstdc++-$(g++ -dumpversion)-dev # in the event of errors occurring while building native_libtapi
```

Place prepared SDK file `Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz` in repo root, use `build-mac-cross.sh` script to build.

As an alternative you can download this file from [bitcoincore.org](https://bitcoincore.org/depends-sources/sdks/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz).
Place prepared SDK file `Xcode-13.2.1-13C100-extracted-SDK-with-libcxx-headers.tar.gz` in repo root, use `build-mac-cross.sh` script to build.

#### OSX (Native)
Ensure you have [brew](https://brew.sh) and Command Line Tools installed.
Expand All @@ -59,7 +91,6 @@ brew update
brew upgrade
brew tap discoteq/discoteq; brew install flock
brew install autoconf autogen automake
# brew install gcc@6
brew install binutils
brew install protobuf
brew install coreutils
Expand All @@ -71,8 +102,8 @@ cd komodo
./zcutil/fetch-params.sh
# -j8 = using 8 threads for the compilation - replace 8 with number of threads you want to use
./zcutil/build-mac.sh -j8
# This can take some time.
```
This can take some time.

macOS 12 (Monterrey) have incompatible version of Xcode `14.2` (Build version 14C18), to build on Monterrey you'll need to install the older version `13.2.1` using the following steps:

Expand All @@ -87,7 +118,7 @@ sudo xcode-select -switch /Applications/Xcode_13.2.1.app
xcodebuild -version
```

#### Windows
#### Windows (Cross-compile)
Use a debian cross-compilation setup with mingw for windows and run:
```shell
sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl cmake mingw-w64
Expand Down
10 changes: 7 additions & 3 deletions build_releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ if [[ $build_xenial == true && $build_focal == true ]]; then
fi

download_and_check_macos_sdk() {
url="https://bitcoincore.org/depends-sources/sdks/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz"
output_file="Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz"
expected_checksum="be17f48fd0b08fb4dcd229f55a6ae48d9f781d210839b4ea313ef17dd12d6ea5"
url="https://download.kmd.sh/depends-sources/Xcode-13.2.1-13C100-extracted-SDK-with-libcxx-headers.tar.gz"
output_file="Xcode-13.2.1-13C100-extracted-SDK-with-libcxx-headers.tar.gz"
expected_checksum="3d200832a74bc7401160043c92f68b11fcedba2d01353b5ab204f9e6a65653d1"

# Check if file exists
if [[ -f "$output_file" ]]; then
Expand Down Expand Up @@ -174,6 +174,8 @@ if [[ "${build_xenial}" = "true" ]]; then
if [[ "${delete_linux_depends}" = true ]]; then
rm -rf ${WORKSPACE}/depends/built/x86_64-unknown-linux-gnu
rm -rf ${WORKSPACE}/depends/x86_64-unknown-linux-gnu
rm -rf ${WORKSPACE}/depends/built/x86_64-pc-linux-gnu
rm -rf ${WORKSPACE}/depends/x86_64-pc-linux-gnu
fi
# delete possible artefacts from previous build(s)
delete_artefacts xenial
Expand All @@ -191,6 +193,8 @@ if [[ "${build_focal}" = "true" ]]; then
if [[ "${delete_linux_depends}" = true ]]; then
rm -rf ${WORKSPACE}/depends/built/x86_64-unknown-linux-gnu
rm -rf ${WORKSPACE}/depends/x86_64-unknown-linux-gnu
rm -rf ${WORKSPACE}/depends/built/x86_64-pc-linux-gnu
rm -rf ${WORKSPACE}/depends/x86_64-pc-linux-gnu
fi
# delete possible artefacts from previous build(s)
delete_artefacts focal
Expand Down
Loading

0 comments on commit e1f803e

Please sign in to comment.