Skip to content

Commit

Permalink
update to v0.3.0 (#24)
Browse files Browse the repository at this point in the history
update from cryptogarageinc v0.3.8
  • Loading branch information
k-matsuzawa authored Mar 29, 2021
1 parent c2a774d commit 063b76b
Show file tree
Hide file tree
Showing 89 changed files with 15,130 additions and 2,506 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/check_pre-merge_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-10.15, macos-11.0]
os: [macos-10.15]
# os: [macos-10.15, macos-11.0]

steps:
- uses: actions/checkout@v2
Expand Down
38 changes: 37 additions & 1 deletion .github/workflows/check_pre-merge_sprint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-10.15, macos-11.0]
os: [macos-10.15]
# os: [macos-10.15, macos-11.0]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -104,6 +105,41 @@ jobs:
name: output-lcov-cfdcore-${{ matrix.os }}
path: ./build/lcov_cfdcore_output.zip

ubuntu-valgrind:
name: valgrind-ubuntu
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04]
shared: [on]

steps:
- uses: actions/checkout@v2
- name: dump version
run: |
cmake --version
gcc --version
- name: ubuntu-apt-install
run: |
cat /etc/os-release
sudo apt-get update
sudo apt-get install -y valgrind
- name: cmake-build
run: |
cmake --version
cmake -S . -B build -G "Unix Makefiles"
cmake -DENABLE_SHARED=${{ matrix.shared }} -DCMAKE_BUILD_TYPE=Debug -DTARGET_RPATH=./build/Debug --build build
cmake --build build --config Debug --parallel 4
- name: valgrind
run: |
# --valgrind-stacksize=1048576 --num-callers=12
valgrind -v --tool=memcheck --leak-check=full --valgrind-stacksize=10485760 --log-file=./valgrind.log --time-stamp=yes ./build/Debug/cfdcore_test
- name: upload coverage
uses: actions/upload-artifact@v1
with:
name: valgrind-log
path: ./valgrind.log

doxygen-ubuntu:
name: doxygen-check
runs-on: ubuntu-18.04
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/code_scanner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ on:
- '**.h'
- '**/code_scanner.yml'
- '**/external_project_local_setting.config'
pull_request:
branches:
- master
- develop
- features/sprint*

jobs:
analyze-CodeQL:
Expand Down
73 changes: 59 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,53 @@
# Crypto Finance Development Kit Core (CFD-CORE)

core moduels for cfd libraries

<!-- TODO: Write Summary and Overview
Core library for cfd libraries.

## Overview

-->
This library is development kit for crypto finance application.
Useful when developing applications for cryptocurrencies.

### Target Network

- Bitcoin
- Liquid Network

### Support function by cfd-core

- Bitcoin
- Bitcoin Script (builder, viewer)
- Transaction
- PSBT (v0)
- ECDSA Pubkey/Privkey (TweakAdd/Mul, Negate, Sign, Verify)
- BIP32, BIP39
- Output Descriptor (contains miniscript parser)
- Schnorr/Taproot
- Bitcoin Address (Segwit-v0, Segwit-v1, P2PKH/P2SH)
- Liquid Network
- Confidential Transaction
- Blind, Unblind
- Issuance, Reissuance
- PegIn, PegOut
- Confidential Address

### Libraries for each language

- C++ : cfd-core
- Core library. Definition base class.
- C/C++ : cfd
- Extend the cfd-core library. Defines the C language API and extension classes.
- Libraries to link cfd library:
- JavaScript : cfd-js
- WebAssembly : cfd-js-wasm
- Python : cfd-python
- C# : cfd-csharp
- Go : cfd-go
- Rust : cfd-rust

## Dependencies

- C/C++ Compiler
  - can compile c++11
- can compile c++11
- CMake (3.14.3 or higher)
- When using npm scripts and cmake-js
- node.js (stable version)
Expand All @@ -21,6 +57,7 @@ core moduels for cfd libraries
### Windows

download and install files.

- [CMake](https://cmake.org/) (3.14.3 or higher)
- Compiler or development environment (One of the following)
- MSVC
Expand Down Expand Up @@ -55,7 +92,7 @@ apt-get install -y build-essential cmake python nodejs
```

cmake version 3.14.2 or lower, download from website and install cmake.
(https://cmake.org/download/)
(<https://cmake.org/download/>)

---

Expand Down Expand Up @@ -88,7 +125,7 @@ cmake -D ENABLE_SHARED=1 -DCMAKE_BUILD_TYPE=Release --build build
cmake --build build
```

**CMake options**
### CMake options

- `-DENABLE_ELEMENTS`: Enable functionalies for elements sidechain. [ON/OFF] (default:ON)
- `-DENABLE_SHARED`: Enable building a shared library. [ON/OFF] (default:OFF)
Expand Down Expand Up @@ -118,6 +155,7 @@ npm cmake_make_install
```

cmake version is 3.15 or higher:

```Shell
npm cmake_install
(Enter the password when prompted to use the sudo command.)
Expand All @@ -135,6 +173,7 @@ cd build && sudo ninja install
cmake version is 3.15 or higher: `cmake --install build`

### uninstall

```Shell
(uninstall by using makefile)
cd build && sudo make uninstall
Expand Down Expand Up @@ -167,6 +206,7 @@ npm run ctest
### using library

- [libwally-core](https://github.com/cryptogarageinc/libwally-core/tree/cfd-develop) (forked from [ElementsProject/libwally-core](https://github.com/ElementsProject/libwally-core))
- [secp256k1-zkp](https://github.com/cryptogarageinc/secp256k1-zkp/tree/cfd-develop) (forked from [ElementsProject/secp256k1-zkp](https://github.com/ElementsProject/secp256k1-zkp))
- [univalue](https://github.com/jgarzik/univalue) (for JSON encoding and decoding)
- [googletest](https://github.com/google/googletest) (for testing)

Expand Down Expand Up @@ -199,26 +239,29 @@ npm run ctest

## Note

### Git connection:
### Git connection

Git repository connections default to HTTPS.
However, depending on the connection settings of GitHub, you may only be able to connect via SSH.
As a countermeasure, forcibly establish SSH connection by setting `CFD_CMAKE_GIT_SSH=1` in the environment variable.

- Windows: (On the command line. Or set from the system setting screen.)
```

```Bat
set CFD_CMAKE_GIT_SSH=1
```

- MacOS & Linux(Ubuntu):
```

```Shell
export CFD_CMAKE_GIT_SSH=1
```

### Ignore git update for CMake External Project:
### Ignore git update for CMake External Project

Depending on your git environment, you may get the following error when checking out external:
```

```Shell
Performing update step for 'libwally-core-download'
Current branch cmake_build is up to date.
No stash entries found.
Expand All @@ -237,11 +280,13 @@ This phenomenon is due to the `git update` related command.
Please set an environment variable that skips update processing.

- Windows: (On the command line. Or set from the system setting screen.)
```

```Bat
set CFD_CMAKE_GIT_SKIP_UPDATE=1
```

- MacOS & Linux(Ubuntu):
```

```Shell
export CFD_CMAKE_GIT_SKIP_UPDATE=1
```
1 change: 1 addition & 0 deletions cmake/CfdCommonOption.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ endif()
option(ENABLE_ELEMENTS "enable elements code (ON or OFF. default:ON)" ON)
option(ENABLE_TESTS "enable code tests (ON or OFF. default:ON)" ON)
option(ENABLE_EMSCRIPTEN "enable EMSCRIPTEN (ON or OFF. default:OFF)" OFF)
option(STD_CPP_VERSION "c++ version (11/14/17. default:11)" "11")

# use "cmake -DCMAKE_BUILD_TYPE=Debug" or "cmake-js -D"
# option(ENABLE_DEBUG "enable debugging (ON or OFF. default:OFF)" OFF)
Expand Down
3 changes: 2 additions & 1 deletion cmake/CfdWallyOption.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ option(ENABLE_JS_WRAPPER "enable the Javascript interface wrappers (ON or OFF. d
else()
set(ENABLE_JS_WRAPPER OFF)
endif()
set(GENERATE_WALLY ON)
option(GENERATE_WALLY "generate the wally.xxx library (ON or OFF. default:ON)" ON)
option(EXCLUDE_WALLYCORE_LIB "exclude wallycore lib (ON or OFF. default:OFF)" OFF)
5 changes: 5 additions & 0 deletions cmake/Cpp11Setting.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ if(${USE_EMSCRIPTEN})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s DISABLE_EXCEPTION_CATCHING=0")
endif()

if(${STD_CPP_VERSION})
set(CMAKE_CXX_STANDARD ${STD_CPP_VERSION})
message(STATUS "[STD_CPP_VERSION] ${STD_CPP_VERSION}")
else()
set(CMAKE_CXX_STANDARD 11)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
2 changes: 1 addition & 1 deletion external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if(LIBWALLY_TARGET_VERSION)
set(LIBWALLY_TARGET_TAG ${LIBWALLY_TARGET_VERSION})
message(STATUS "[external project local] libwally-core target=${LIBWALLY_TARGET_VERSION}")
else()
set(LIBWALLY_TARGET_TAG refs/tags/cfd-0.2.4)
set(LIBWALLY_TARGET_TAG refs/tags/cfd-0.3.4)
endif()

if(${USE_GIT_SSH})
Expand Down
2 changes: 2 additions & 0 deletions include/cfdcore/Makefile.srclist
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ CFDCORE_PKGINCLUDE_FILES = \
cfdcore_key.h \
cfdcore_script.h \
cfdcore_descriptor.h \
cfdcore_psbt.h \
cfdcore_exception.h \
cfdcore_iterator.h \
cfdcore_logger_interface.h \
cfdcore_schnorrsig.h \
cfdcore_ecdsa_adaptor.h \
cfdcore_taproot.h \
$(CFDCORE_ELEMENTS_PKGINCLUDE_FILES)

Loading

0 comments on commit 063b76b

Please sign in to comment.