Skip to content

Commit

Permalink
Flatrate node fee + automated CI/CD workflow for releases (cryptonote…
Browse files Browse the repository at this point in the history
…foundation#35)

*    Support of flat-rate node fee
*    Automated CI/CD workflow for releases
*    Deterministic transaction keys too


* Update core with new keyimages storage and changes in crypto

* Automated CI/CD workflow for releases

* cpack .deb file for ubuntu and pack translations on windows, try to use windeployqt

* Create setup with NSIS for Windows and fix bundle Info.plist for macOS

* Bump core with flat rate node fee

* Add remote node's flat rate fee support with fallback to % fee if node doesn't support flat rate

* Use QT version 5.12.2 instead of 5.14

* Remove debug output, bump copyright year in modified files

* Update translation of strings about node fees

* Fix errors in Korean translation file

* Add functions to get node fee address and amount to INode

* Replace AddressProvider with INode builting functions for getting node's fee and address for fee
  • Loading branch information
aivve authored Mar 18, 2020
1 parent cc7e8ea commit 104292a
Show file tree
Hide file tree
Showing 35 changed files with 1,064 additions and 532 deletions.
228 changes: 228 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
name: Release

on:
push:
tags:
- '*'

jobs:
build-windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@master

- name: Setup MSBuild.exe
uses: warrenbuckley/Setup-MSBuild@v1

- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.12.2'
host: 'windows'
target: 'desktop'
modules: 'qttools5'
install-deps: 'true'

- name: Install NSIS
uses: joncloud/makensis-action@v1
with:
just-include: true

- name: Build
shell: powershell
id: build
env:
BOOST_ROOT: ${{ env.BOOST_ROOT }}
run: |
$build_folder = "build"
$krb_ver = "${{ github.ref }}" -replace '[refs/tags/]'
$release_name = "Karbo-wallet-win64-$krb_ver"
set CMAKE_PREFIX_PATH="$($qt5_cmake)"
$qt5_cmake = "${{ env.Qt5_Dir }}/lib/cmake" -replace '[/]', '\\'
Remove-Item cryptonote -Recurse -ErrorAction Ignore
git clone https://github.com/seredat/karbowanec cryptonote
mkdir "$build_folder"
cd "$build_folder"
Start-Process cmake -ArgumentList "-G ""Visual Studio 16 2019"" -A x64",".." -NoNewWindow -Wait
Start-Process msbuild -ArgumentList "KarbowanecWallet.sln","/p:Configuration=Release" -NoNewWindow -Wait
$build_path = "./$build_folder"
echo "::set-output name=build_path::${build_path}"
echo "::set-output name=release_name::${release_name}"
echo "::set-output name=krb_ver::${krb_ver}"
- name: Pack
shell: powershell
id: pack
env:
VCINSTALLDIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\'
run: |
$build_folder = "${{ steps.build.outputs.build_path }}"
$release_name = "${{ steps.build.outputs.release_name }}"
$release_folder = "Release"
cd "$build_folder"
$krb_ver = "${{ steps.build.outputs.krb_ver }}"
mkdir "$release_folder/$release_name"
mkdir "$release_folder/$release_name/languages"
cp languages/*.qm "$release_folder/$release_name/languages/"
cd "$release_folder"
cp KarbowanecWallet.exe "$release_name/"
cp "../../COPYING" "$release_name/COPYING.txt"
windeployqt --release KarbowanecWallet.exe --dir "$release_name/"
cd ../../
makensis WindowsInstall.nsi
cd "$build_folder/$release_folder"
Compress-Archive -Path "KarbowanecWallet-Setup.exe" -DestinationPath "$release_name.zip"
$sha256 = (Get-FileHash "$release_name.zip").Hash
$asset_path = "./$build_folder/$release_folder/$release_name.zip"
echo "::set-output name=sha256::${sha256}"
echo "::set-output name=release_name::${release_name}.zip"
echo "::set-output name=asset_path::${asset_path}"
echo "::set-output name=krb_ver::${krb_ver}"
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.pack.outputs.asset_path }}
name: Karbo Wallet ${{ steps.pack.outputs.krb_ver }}
body: |
**${{ steps.pack.outputs.release_name }}**
${{ steps.pack.outputs.sha256 }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-macos:
name: macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@master

- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.12.2'
modules: 'qttools5'
install-deps: 'true'

- name: Build
id: build
run: |
build_folder="build/release"
krb_ver=$(echo ${{ github.ref }} | sed 's|refs/tags/||')
release_name="Karbo-wallet-macOS-$krb_ver"
app_name="KarbowanecWallet.app"
lang_folder="/Contents/Resources/languages"
brew install gcc boost@1.60
brew link boost@1.60 --force
rm -rf cryptonote
git clone https://github.com/seredat/karbowanec.git cryptonote
mkdir -p "$build_folder"
cd "$build_folder"
cmake -DCMAKE_C_FLAGS="-mmacosx-version-min=10.12" -DCMAKE_CXX_FLAGS="-mmacosx-version-min=10.12" -D CMAKE_BUILD_TYPE=Release ../..
make
mkdir "$app_name$lang_folder"
cp languages/*.qm "$app_name$lang_folder"
macdeployqt "$app_name"
cpack
mv *.dmg "$release_name".dmg
sha256=$(shasum -a 256 "$release_name".dmg | awk '{ print toupper($1) }')
asset_path="./$build_folder/$release_name.dmg"
echo "::set-output name=sha256::${sha256}"
echo "::set-output name=release_name::${release_name}.zip"
echo "::set-output name=asset_path::${asset_path}"
echo "::set-output name=krb_ver::${krb_ver}"
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.build.outputs.asset_path }}
name: Karbo Wallet ${{ steps.build.outputs.krb_ver }}
body: |
**${{ steps.build.outputs.release_name }}**
${{ steps.build.outputs.sha256 }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-ubuntu16:
name: Ubuntu 16.04
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@master

- name: Build
id: build
run: |
BOOST_ROOT=
sudo apt update -y
sudo apt install -y qt5-default qttools5-dev qttools5-dev-tools libboost-all-dev
build_folder="build/release"
krb_ver=$(echo "$GITHUB_REF" | sed 's|refs/tags/||')
release_name=Karbo-wallet-ubuntu-16.04-"$krb_ver"
app_name="KarbowanecWallet"
rm -rf cryptonote
git clone https://github.com/seredat/karbowanec.git cryptonote
mkdir -p "$build_folder"
cd "$build_folder"
cmake ../..
make
cpack
tar -czf "$release_name".tar.gz *.deb
sha256=$(shasum -a 256 "$release_name".tar.gz | awk '{print toupper($1)}')
asset_path="./$build_folder/$release_name".tar.gz
echo "::set-output name=sha256::${sha256}"
echo "::set-output name=release_name::${release_name}.tar.gz"
echo "::set-output name=asset_path::${asset_path}"
echo "::set-output name=krb_ver::${krb_ver}"
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.build.outputs.asset_path }}
name: Karbo Wallet ${{ steps.build.outputs.krb_ver }}
body: |
**${{ steps.build.outputs.release_name }}**
${{ steps.build.outputs.sha256 }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-ubuntu18:
name: Ubuntu 18.04
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master

- name: Build
id: build
run: |
BOOST_ROOT=
sudo apt update -y
sudo apt install -y qt5-default qttools5-dev qttools5-dev-tools libboost-all-dev
build_folder="build/release"
krb_ver=$(echo "$GITHUB_REF" | sed 's|refs/tags/||')
release_name=Karbo-wallet-ubuntu-18.04-"$krb_ver"
app_name="KarbowanecWallet"
rm -rf cryptonote
git clone https://github.com/seredat/karbowanec.git cryptonote
mkdir -p "$build_folder"
cd "$build_folder"
cmake ../..
make
tar -czf "$release_name".tar.gz "$app_name"
sha256=$(shasum -a 256 "$release_name".tar.gz | awk '{print toupper($1)}')
asset_path="./$build_folder/$release_name".tar.gz
echo "::set-output name=sha256::${sha256}"
echo "::set-output name=release_name::${release_name}.tar.gz"
echo "::set-output name=asset_path::${asset_path}"
echo "::set-output name=krb_ver::${krb_ver}"
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.build.outputs.asset_path }}
name: Karbo Wallet ${{ steps.build.outputs.krb_ver }}
body: |
**${{ steps.build.outputs.release_name }}**
${{ steps.build.outputs.sha256 }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

88 changes: 62 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ set(CRYPTONOTE_SOURCES
cryptonote/src/crypto/chacha8.cpp
cryptonote/src/crypto/crypto-ops-data.c
cryptonote/src/crypto/crypto-ops.c
cryptonote/src/crypto/crypto-util.c
cryptonote/src/crypto/crypto.cpp
cryptonote/src/crypto/groestl.c
cryptonote/src/crypto/hash-extra-blake.c
Expand Down Expand Up @@ -265,9 +266,9 @@ elseif (UNIX)
file(GLOB_RECURSE OBJC_SOURCES src/*.mm)
set(SOURCES ${SOURCES} ${OBJC_SOURCES})
set(PLATFORM_DIR OSX)
set(MACOSX_BUNDLE_INFO_STRING "Karbowanec GUI wallet")
set(MACOSX_BUNDLE_INFO_STRING "Karbowanec GUI Wallet")
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${VERSION_VERSION}.${VERSION_MINOR}.${VERSION_PATCH}")
set(MACOSX_BUNDLE_BUNDLE_NAME "Карбованець")
set(MACOSX_BUNDLE_BUNDLE_NAME "Karbo Wallet")
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${VERSION_VERSION}.${VERSION_MINOR}.${VERSION_PATCH}")
set(MACOSX_BUNDLE_BUNDLE_VERSION "$${VERSION_VERSION}.${VERSION_MINOR}.${VERSION_PATCH}")

Expand Down Expand Up @@ -440,7 +441,11 @@ if (WIN32)
endif ()

if (APPLE)
target_link_libraries(${PROJECT_NAME} Qt5::PrintSupport)
set_target_properties(${PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)

target_link_libraries(${PROJECT_NAME} Qt5::PrintSupport)
elseif (UNIX)
target_link_libraries(${PROJECT_NAME} -lpthread)
elseif (WIN32)
Expand All @@ -454,38 +459,27 @@ qt5_use_modules(${PROJECT_NAME} Widgets Gui Network)
set(CPACK_PACKAGE_NAME ${CN_PROJECT_NAME})
set(CPACK_PACKAGE_VERSION ${CN_VERSION})
set(CPACK_PACKAGE_VENDOR "Karbowanec-project")
set(CPACK_PACKAGE_CONTACT "http://karbowanec.com")
set(CPACK_PACKAGE_CONTACT "https://karbo.org")
set(CPACK_STRIP_FILES ON)
if (APPLE)
set(CPACK_GENERATOR DragNDrop)
install(TARGETS ${PROJECT_NAME} BUNDLE DESTINATION .)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${VERSION_RELEASE}")
set(CPACK_BUNDLE_PLIST ${CMAKE_SOURCE_DIR}/Info.plist)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
install(TARGETS ${PROJECT_NAME} BUNDLE DESTINATION .)
elseif (UNIX)
find_program(RPMBUILD rpmbuild)

install(PROGRAMS build/${PROJECT_NAME} DESTINATION bin
install(PROGRAMS ${CMAKE_BINARY_DIR}/${PROJECT_NAME} DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(FILES src/karbowanecwallet.desktop DESTINATION share/applications)
install(FILES src/images/karbowanez.png DESTINATION share/pixmaps RENAME karbowanec.png)
install(FILES copyright DESTINATION share/doc/karbowanecwallet)
install(DIRECTORY "${CMAKE_BINARY_DIR}/languages" DESTINATION /opt/karbo/ FILES_MATCHING PATTERN "*.qm")

if (NOT RPMBUILD)
set(CPACK_GENERATOR DEB)
set(CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
set(CPACK_SYSTEM_NAME 64-bit)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR} <krbcoin@ukr.net>")
set(CPACK_DEBIAN_PACKAGE_SECTION Office)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Karbowanec KRB wallet
Karbowanec is Ukrainian decentralized, privacy oriented peer-to-peer
cryptocurrency. It is open-source, nobody owns or controls Karbowanec
and everyone can take part.")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_DEBIAN_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${VERSION_RELEASE}${CPACK_SYSTEM_NAME}")
else()
set(CPACK_GENERATOR RPM)
if (RPMBUILD)
set(CPACK_GENERATOR "RPM;DEB")
set(CPACK_SYSTEM_NAME x86_64)
set(CPACK_RPM_PACKAGE_RELEASE ${VERSION_RELEASE})
set(CPACK_RPM_PACKAGE_RELEASE ${CN_VERSION})
set(CPACK_RPM_PACKAGE_LICENSE "MIT")
set(CPACK_RPM_PACKAGE_GROUP Office)
set(CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.3.2, qt5-qtbase-gui >= 5.3.2")
Expand All @@ -494,11 +488,53 @@ set(CPACK_PACKAGE_FILE_NAME "${CPACK_DEBIAN_PACKAGE_NAME}-${CPACK_PACKAGE_VERSIO
Karbowanec is Ukrainian decentrilized, privacy oriented peer-to-peer
cryptocurrency. It is open-source, nobody owns or controls Karbowanec
and everyone can take part.")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${VERSION_RELEASE}${CPACK_SYSTEM_NAME}")
endif ()
else ()
set(CPACK_GENERATOR DEB)
endif ()

set(CPACK_SYSTEM_NAME 64-bit)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR} <krbcoin@ukr.net>")
set(CPACK_DEBIAN_PACKAGE_SECTION Office)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Karbowanec KRB wallet
Karbowanec is Ukrainian decentralized, privacy oriented peer-to-peer
cryptocurrency. It is open-source, nobody owns or controls Karbowanec
and everyone can take part.")

set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}")
elseif (WIN32)
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION .)
set(CPACK_GENERATOR ZIP)
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
include(InstallRequiredSystemLibraries)

set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Karbowanec KRB wallet
Karbowanec is Ukrainian decentralized, privacy oriented peer-to-peer
cryptocurrency. It is open-source, nobody owns or controls Karbowanec
and everyone can take part.")
set (CPACK_PACKAGE_VERSION_MAJOR "1")
set (CPACK_PACKAGE_VERSION_MINOR "4")
set (CPACK_PACKAGE_VERSION_PATCH "1")
set (CPACK_PACKAGE_INSTALL_DIRECTORY "Karbowanec")

# Define components and their display names
set (CPACK_COMPONENTS_ALL applications)
set (CPACK_COMPONENT_APPLICATIONS_DISPLAY_NAME "Karbo wallet")

# Human readable component descriptions
set (CPACK_COMPONENT_APPLICATIONS_DESCRIPTION
"Ukrainian decentralized, privacy oriented peer-to-peer cryptocurrency")

# Define groups
set(CPACK_COMPONENT_APPLICATIONS_GROUP "Runtime")

set(CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION
"Ukrainian decentralized, privacy oriented peer-to-peer cryptocurrency")

# Define NSIS installation types
set(CPACK_ALL_INSTALL_TYPES Full)
set(CPACK_COMPONENT_APPLICATIONS_INSTALL_TYPES Full)

#install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION .)
set(CPACK_GENERATOR NSIS)
endif (APPLE)

include(CPack)
3 changes: 1 addition & 2 deletions COPYING
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Copyright (c) 2011-2015 The Cryptonote developers
Copyright (c) 2012-2016 Bytecoin developers
Copyright (c) 2014-2015 XDN developers
Copyright (c) 2016-2017 The Karbowanec developers
Copyright (c) 2017-2019 The Karbo developers
Copyright (c) 2016-2020 The Karbo developers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 104292a

Please sign in to comment.