Skip to content

Commit fe0c36b

Browse files
authored
update to v0.3.0 (#17)
update from cryptogarageinc v0.3.1
1 parent 50f5565 commit fe0c36b

30 files changed

+3192
-172
lines changed

.github/workflows/check_pre-merge.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ jobs:
1818
runs-on: ${{ matrix.os }}
1919
strategy:
2020
matrix:
21-
os: [macos-10.15, macos-11.0, windows-2019, ubuntu-20.04, ubuntu-18.04]
21+
# os: [macos-10.15, macos-11.0, windows-2019, ubuntu-20.04, ubuntu-18.04]
22+
os: [macos-10.15, windows-2019, ubuntu-20.04, ubuntu-18.04]
2223

2324
steps:
2425
- name: setup dotnet

.github/workflows/create_release-and-upload.yml

+54-20
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ on:
55
tags:
66
- 'v*'
77

8-
env:
9-
XCODE_VERSION: 11.5
10-
DOTNET_VERSION: 3.1.200
11-
128
jobs:
139
create_releases:
1410
name: create-releases
@@ -49,12 +45,24 @@ jobs:
4945
name: upload-object-win
5046
needs: create_releases
5147
runs-on: windows-2019
48+
strategy:
49+
matrix:
50+
dotnet_target: [3.1, 5.0]
51+
include:
52+
- dotnet_target: 3.1
53+
dotnet_version: 3.1.407
54+
framework: netstandard2.1
55+
script_suffix: _core3
56+
- dotnet_target: 5.0
57+
dotnet_version: 5.0.201
58+
framework: net5.0
59+
script_suffix:
5260

5361
steps:
5462
- name: setup dotnet
5563
uses: actions/setup-dotnet@v1
5664
with:
57-
dotnet-version: ${{ env.DOTNET_VERSION }}
65+
dotnet-version: ${{ matrix.dotnet_version }}
5866
- name: checkout
5967
uses: actions/checkout@v2
6068
- name: output url
@@ -71,14 +79,14 @@ jobs:
7179
shell: bash
7280
- name: cmake-build
7381
run: |
74-
.\tools\build_core3.bat
75-
.\tools\test_core3.bat
82+
.\tools\build${{matrix.script_suffix}}.bat
83+
.\tools\test${{matrix.script_suffix}}.bat
7684
timeout-minutes: 20
7785
- name: cmake-install
7886
shell: cmd
7987
run: |
8088
mkdir dist
81-
COPY /Y /B dotnet_project\CfdCsharpProject\bin\Release\netstandard2.1\cfdcs.* dist
89+
COPY /Y /B dotnet_project\CfdCsharpProject\bin\Release\${{matrix.framework}}\cfdcs.* dist
8290
COPY /Y /B build\Release\* dist
8391
- name: create archive file
8492
run: |
@@ -96,7 +104,7 @@ jobs:
96104
with:
97105
upload_url: ${{ steps.get_url.outputs.upload_url }}
98106
asset_path: ./cfd.zip
99-
asset_name: cfdcs-${{ steps.get_version.outputs.VERSION }}-win-dotnet${{env.DOTNET_VERSION}}-msvc2019-x86_64.zip
107+
asset_name: cfdcs-${{ steps.get_version.outputs.VERSION }}-win-dotnet${{matrix.dotnet_version}}-msvc2019-x86_64.zip
100108
asset_content_type: application/zip
101109

102110
upload-object-ubuntu:
@@ -106,28 +114,38 @@ jobs:
106114
strategy:
107115
matrix:
108116
os: [ubuntu-18.04, ubuntu-20.04]
117+
dotnet_target: [3.1, 5.0]
118+
include:
119+
- dotnet_target: 3.1
120+
dotnet_version: 3.1.407
121+
framework: netstandard2.1
122+
script_suffix: _core3
123+
- dotnet_target: 5.0
124+
dotnet_version: 5.0.201
125+
framework: net5.0
126+
script_suffix:
109127

110128
steps:
111129
- name: setup dotnet
112130
uses: actions/setup-dotnet@v1
113131
with:
114-
dotnet-version: ${{ env.DOTNET_VERSION }}
132+
dotnet-version: ${{ matrix.dotnet_version }}
115133
- name: checkout
116134
uses: actions/checkout@v1
117135
- name: Get the version
118136
id: get_version
119137
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
120138
- name: cmake-build
121139
run: |
122-
./tools/build_core3.sh
140+
./tools/build${{matrix.script_suffix}}.sh
123141
- name: test
124142
run: |
125-
./tools/test_core3.sh
143+
./tools/test${{matrix.script_suffix}}.sh
126144
- name: create archive file
127145
run: |
128146
mkdir dist
129147
cp -rp build/Release/* dist
130-
cp -rp dotnet_project/CfdCsharpProject/bin/Release/netstandard2.1/cfdcs.* dist
148+
cp -rp dotnet_project/CfdCsharpProject/bin/Release/${{matrix.framework}}/cfdcs.* dist
131149
cd dist
132150
zip -r cfd.zip .
133151
echo "---- dump zip file ----"
@@ -142,39 +160,55 @@ jobs:
142160
with:
143161
upload_url: ${{ steps.get_url.outputs.upload_url }}
144162
asset_path: ./dist/cfd.zip
145-
asset_name: cfdcs-${{ steps.get_version.outputs.VERSION }}-${{ matrix.os }}-dotnet${{env.DOTNET_VERSION}}-gcc-x86_64.zip
163+
asset_name: cfdcs-${{ steps.get_version.outputs.VERSION }}-${{ matrix.os }}-dotnet${{matrix.dotnet_version}}-gcc-x86_64.zip
146164
asset_content_type: application/zip
147165

148166
upload-object-macos:
149167
name: upload-object-macos
150168
needs: create_releases
151169
runs-on: macos-10.15
170+
strategy:
171+
matrix:
172+
xcode_version: [11.7, 12.4]
173+
dotnet_target: [3.1, 5.0]
174+
exclude:
175+
- xcode_version: 12.4
176+
dotnet_target: 3.1
177+
include:
178+
- dotnet_target: 3.1
179+
dotnet_version: 3.1.407
180+
framework: netstandard2.1
181+
script_suffix: _core3
182+
- dotnet_target: 5.0
183+
dotnet_version: 5.0.201
184+
framework: net5.0
185+
script_suffix:
152186

153187
steps:
154188
- name: setup dotnet
155189
uses: actions/setup-dotnet@v1
156190
with:
157-
dotnet-version: ${{ env.DOTNET_VERSION }}
191+
dotnet-version: ${{ matrix.dotnet_version }}
158192
- name: checkout
159193
uses: actions/checkout@v1
160194
- name: Get the version
161195
id: get_version
162196
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
163197
- name: Select Xcode version
164-
run: sudo xcode-select -s '/Applications/Xcode_${{env.XCODE_VERSION}}.app/Contents/Developer'
198+
run: sudo xcode-select -s '/Applications/Xcode_${{matrix.xcode_version}}.app/Contents/Developer'
165199
- name: Show Xcode version
166200
run: xcodebuild -version
167201
- name: cmake-build
168202
run: |
169-
./tools/build_core3.sh
203+
./tools/build${{matrix.script_suffix}}.sh
170204
- name: test
171205
run: |
172-
./tools/test_core3.sh
206+
./tools/test${{matrix.script_suffix}}.sh
173207
- name: create archive file
174208
run: |
175209
mkdir dist
176210
cp -rp build/Release/* dist
177-
cp -rp dotnet_project/CfdCsharpProject/bin/Release/netstandard2.1/cfdcs.* dist
211+
cp -rp dotnet_project/CfdCsharpProject/bin/Release/${{matrix.framework}}/cfdcs.* dist
178212
cd dist
179213
zip -r cfd.zip .
180214
echo "---- dump zip file ----"
@@ -189,6 +223,6 @@ jobs:
189223
with:
190224
upload_url: ${{ steps.get_url.outputs.upload_url }}
191225
asset_path: ./dist/cfd.zip
192-
asset_name: cfdcs-${{ steps.get_version.outputs.VERSION }}-macos-dotnet${{env.DOTNET_VERSION}}-xcode${{env.XCODE_VERSION}}-gcc-x86_64.zip
226+
asset_name: cfdcs-${{ steps.get_version.outputs.VERSION }}-macos-dotnet${{matrix.dotnet_version}}-xcode${{matrix.xcode_version}}-x86_64.zip
193227
asset_content_type: application/zip
194228

CMakeLists.txt

+9-40
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,17 @@ set(PACKAGE_VERSION 1.0.0)
66
####################
77
# options
88
####################
9-
# use "cmake -DCMAKE_BUILD_TYPE=Debug" or "cmake-js -D"
10-
# option(ENABLE_DEBUG "enable debugging (ON or OFF. default:OFF)" OFF)
11-
option(ENABLE_TESTS "enable code tests (ON or OFF. default:ON)" ON)
12-
option(ENABLE_SHARED "enable shared library (ON or OFF. default:ON)" ON)
13-
option(ENABLE_ELEMENTS "enable elements code (ON or OFF. default:ON)" ON)
9+
include(./cmake/CfdCommonOption.cmake)
10+
include(./cmake/CfdWallyOption.cmake)
11+
12+
option(CFD_SHARED "force shared build (ON or OFF. default:OFF)" OFF)
1413
option(ENABLE_CAPI "enable c-api (ON or OFF. default:ON)" ON)
15-
option(ENABLE_CSHARP "enable csharp build for .NET Framework (ON or OFF. default:OFF)" OFF)
14+
option(ENABLE_JSONAPI "enable json-api (ON or OFF. default:ON)" ON)
1615

17-
if(NOT WIN32)
18-
#option(TARGET_RPATH "target rpath list (separator is ';') (default:)" "")
19-
set(TARGET_RPATH "" CACHE STRING "target rpath list (separator is ';') (default:)")
20-
option(ENABLE_COVERAGE "enable code coverage (ON or OFF. default:OFF)" OFF)
21-
else()
22-
set(TARGET_RPATH "")
23-
set(ENABLE_COVERAGE FALSE)
24-
endif()
16+
option(ENABLE_CSHARP "enable csharp build for .NET Framework (ON or OFF. default:OFF)" OFF)
2517

26-
set(ENABLE_SHARED ON CACHE BOOL "" FORCE)
27-
set(ENABLE_ELEMENTS ON CACHE BOOL "" FORCE)
28-
set(ENABLE_CAPI ON CACHE BOOL "" FORCE)
18+
set(GENERATE_WALLY ON CACHE BOOL "" FORCE)
19+
set(EXCLUDE_WALLYCORE_LIB ON CACHE BOOL "" FORCE)
2920

3021
if(NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])")
3122
set(ENABLE_CSHARP OFF CACHE BOOL "" FORCE)
@@ -34,29 +25,7 @@ endif()
3425
####################
3526
# common setting
3627
####################
37-
set(WORK_WINDOWS_BINARY_DIR_NAME $<IF:$<CONFIG:Debug>,Debug,Release>)
38-
if(NOT CFD_OBJ_BINARY_DIR)
39-
set(CFD_OBJ_BINARY_DIR ${CMAKE_BINARY_DIR}/${WORK_WINDOWS_BINARY_DIR_NAME})
40-
set(CFD_ROOT_BINARY_DIR ${CMAKE_BINARY_DIR})
41-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CFD_OBJ_BINARY_DIR})
42-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CFD_OBJ_BINARY_DIR}) # for linux
43-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CFD_OBJ_BINARY_DIR})
44-
endif()
45-
46-
47-
####################
48-
# function
49-
####################
50-
function(transform_makefile_srclist INPUT_FILE OUTPUT_FILE)
51-
file(READ ${INPUT_FILE} MAKEFILE_INC_TEXT)
52-
53-
string(REGEX REPLACE "\\\\\n" "@@@@LF@@@@" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
54-
string(REGEX REPLACE "([a-zA-Z_][a-zA-Z0-9_]*)[\t ]*=[\t ]*([^\n]*)" "SET(\\1 \\2)" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
55-
string(REPLACE "@@@@LF@@@@" "\n" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
56-
string(REGEX REPLACE "\\$\\(([a-zA-Z_][a-zA-Z0-9_]*)\\)" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
57-
string(REGEX REPLACE "@([a-zA-Z_][a-zA-Z0-9_]*)@" "\${\\1}" MAKEFILE_INC_TEXT ${MAKEFILE_INC_TEXT})
58-
file(WRITE ${OUTPUT_FILE} ${MAKEFILE_INC_TEXT})
59-
endfunction()
28+
include(./cmake/CfdCommonSetting.cmake)
6029

6130

6231
####################

README.md

+45-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,50 @@
11
# Crypto Finance Development Kit for C# (CFD-CSHARP)
22

3-
<!-- TODO: Write Summary and Overview
3+
CFD library for C#.
44

55
## Overview
66

7-
-->
7+
This library is development kit for crypto finance application.
8+
Useful when developing applications for cryptocurrencies.
9+
10+
### Target Network
11+
12+
- Bitcoin
13+
- Liquid Network
14+
15+
### Support function by cfd
16+
17+
- Bitcoin
18+
- Bitcoin Script (builder, viewer)
19+
- Transaction
20+
- Create, Parse, Decode
21+
- Simple pubkey-hash sign / verify
22+
- Estimate Fee
23+
- Coin Selection (FundRawTransaction)
24+
- ECDSA Pubkey/Privkey (TweakAdd/Mul, Negate, Sign, Verify)
25+
- BIP32, BIP39
26+
- Output Descriptor (contains miniscript parser)
27+
- Schnorr/Taproot
28+
- Bitcoin Address (Segwit-v0, Segwit-v1, P2PKH/P2SH)
29+
- Liquid Network
30+
- Confidential Transaction
31+
- Blind, Unblind
32+
- Reissuance
33+
- Confidential Address
34+
35+
### Libraries for each language
36+
37+
- C# : cfd-csharp
38+
- C/C++ : cfd
39+
- Extend the cfd-core library. Defines the C language API and extension classes.
40+
- C++ : cfd-core
41+
- Core library. Definition base class.
42+
- other language:
43+
- JavaScript : cfd-js
44+
- WebAssembly : cfd-js-wasm
45+
- Python : cfd-python
46+
- Go : cfd-go
47+
- Rust : cfd-rust
848

949
## Dependencies
1050

@@ -67,14 +107,14 @@ cmake version 3.14.2 or lower, download from website and install cmake.
67107
.\tools\build.bat
68108
```
69109

70-
- (.NET Core only)
110+
- (.NET only)
71111
```Cmd
72112
.\tools\build_core3.bat
73113
```
74114

75115
### Linux & MacOSX
76116

77-
- .NET Core 3.x
117+
- .NET 5.x
78118
```Shell
79119
# configure & build
80120
./tools/build.sh
@@ -93,7 +133,7 @@ cmake version 3.14.2 or lower, download from website and install cmake.
93133

94134
- Linux & MacOSX
95135
```Shell
96-
echo ".NET Core 3.x"
136+
echo ".NET 5.x"
97137
./tools/test.sh
98138
```
99139

0 commit comments

Comments
 (0)