Skip to content

Commit

Permalink
update to v0.3.0 (#7)
Browse files Browse the repository at this point in the history
update from cryptogarageinc v0.3.1
  • Loading branch information
k-matsuzawa authored Mar 30, 2021
1 parent 24a9865 commit 721d2fe
Show file tree
Hide file tree
Showing 24 changed files with 3,130 additions and 523 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/create_release-and-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ jobs:
name: upload-object-alpine
needs: create_releases
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
alpine: ['3.10', '3.12', '3.13']

steps:
- name: checkout
Expand All @@ -180,10 +184,21 @@ jobs:
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: list
run: ls -a $GITHUB_WORKSPACE
- name: docker setup
- name: docker setup 3.10
if: matrix.alpine == '3.10'
uses: docker://alpine:3.10
with:
entrypoint: /github/workspace/.github/workflows/docker/alpine_build_entrypoint.sh
- name: docker setup 3.12
if: matrix.alpine == '3.12'
uses: docker://alpine:3.12
with:
entrypoint: /github/workspace/.github/workflows/docker/alpine_build_entrypoint.sh
- name: docker setup 3.13
if: matrix.alpine == '3.13'
uses: docker://alpine:3.13
with:
entrypoint: /github/workspace/.github/workflows/docker/alpine_build_entrypoint.sh
- name: create archive file
run: |
echo "---- dump output data ----"
Expand Down Expand Up @@ -211,7 +226,7 @@ jobs:
with:
upload_url: ${{ steps.get_url.outputs.upload_url }}
asset_path: /tmp/cfd/cfd.zip
asset_name: cfd-sys-${{ steps.get_version.outputs.VERSION }}-alpine_x86_64.zip
asset_name: cfd-sys-${{ steps.get_version.outputs.VERSION }}-alpine${{ matrix.alpine }}_x86_64.zip
asset_content_type: application/zip

upload-object-macos:
Expand All @@ -221,7 +236,7 @@ jobs:
strategy:
fail-fast: false
matrix:
xcode: [10.3, 11.6]
xcode: [10.3, 11.7, 12.4]
shared: [on, off]
include:
- shared: on
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cfd-rust"
version = "0.2.2"
version = "0.3.0"
license = "MIT"
readme = "README.md"
keywords = ["build-dependencies"]
Expand All @@ -15,12 +15,12 @@ name = "cfd_rust"
path = "src/lib.rs"

[dependencies]
libc = "0.2.74"
libc = "0.2.83"
hex = "0.4.2"
cfd_sys = { path = "./cfd-sys" }

[dev-dependencies]
sha2 = "0.9.1"
sha2 = "0.9.2"

[[example]]
name = "create_pubkey_address"
Expand Down
85 changes: 70 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,62 @@
# Crypto Finance Development Kit for Rust (CFD-RUST)

CFD library for Rust.

## 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

- Bitcoin
- Bitcoin Script (builder, viewer)
- Transaction
- Create, Parse, Decode
- Simple pubkey-hash sign / verify
- Estimate Fee
- Coin Selection (FundRawTransaction)
- 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
- Reissuance
- Confidential Address

### Libraries for each language

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

## Dependencies

- Rust
- C/C++ Compiler
  - can compile c++11
- CMake (3.14.3 or higher)

### Windows
### Windows

download and install files.

- [Rustup](https://rustup.rs/)
- [CMake](https://cmake.org/) (3.14.3 or higher)
- MSVC
Expand Down Expand Up @@ -38,7 +85,7 @@ curl https://sh.rustup.rs -sSf | sh (select is 1)
```

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

---

Expand All @@ -58,17 +105,19 @@ Using pkg-config, build is quickly.

```Shell
# The described version is an example. If you use it, please rewrite it to an appropriate version.
wget https://github.com/cryptogarageinc/cfd-rust/releases/download/v0.0.1/cfd-sys-v0.0.1-osx-xcode9.4-static_x86_64.zip
wget https://github.com/p2pderivatives/cfd-rust/releases/download/v0.3.0/cfd-sys-v0.3.0-osx-xcode12.4-static-x86_64.zip

# decompress
sudo unzip -d / cfd-sys-v0.0.1-osx-xcode9.4-static_x86_64.zip
sudo unzip -d / cfd-sys-v0.3.0-osx-xcode12.4-static-x86_64.zip
# build
cargo build
```

### Prepare cfd native library from releases asset (Windows)

Using cmake find_package.
1. get releases asset. (ex. https://github.com/cryptogarageinc/cfd/releases/download/v0.1.12/cfd-v0.1.12-win-vs2019-x86_64.zip )

1. get releases asset. (ex. [https://github.com/p2pderivatives/cfd-rust/releases/download/v0.3.0/cfd-sys-v0.3.0-win-vs2019-x86_64.zip](https://github.com/p2pderivatives/cfd-rust/releases/download/v0.3.0/cfd-sys-v0.3.0-win-vs2019-x86_64.zip) )
2. Expand to PATH

---
Expand All @@ -77,13 +126,13 @@ Using cmake find_package.

### Test

```
```shell
cargo test
```

### Example

```
```shell
cargo run --example create_pubkey_address
```

Expand All @@ -109,7 +158,8 @@ cargo run --example create_pubkey_address
### document tool

- cargo
```

```shell
cargo doc
```

Expand All @@ -123,26 +173,29 @@ cargo run --example create_pubkey_address

## 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:
```

```log
Performing update step for 'libwally-core-download'
Current branch cmake_build is up to date.
No stash entries found.
Expand All @@ -161,11 +214,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
```
8 changes: 4 additions & 4 deletions cfd-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cfd_sys"
version = "0.2.2"
version = "0.3.0"
license = "MIT"
readme = "../README.md"
keywords = ["build-dependencies"]
Expand All @@ -17,11 +17,11 @@ features = [ "serde" ]
all-features = true

[dependencies]
libc = "0.2.74"
libc = "0.2.83"

[build-dependencies]
cmake = "0.1.44"
pkg-config = "0.3.18"
cmake = "0.1.45"
pkg-config = "0.3.19"

[features]
# When building from source, enable building optimized assembly routines. As
Expand Down
1 change: 1 addition & 0 deletions cfd-sys/cfd-cmake/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 cfd-sys/cfd-cmake/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 cfd-sys/cfd-cmake/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 cfd-sys/cfd-cmake/external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if(CFD_TARGET_VERSION)
set(CFD_TARGET_TAG ${CFD_TARGET_VERSION})
message(STATUS "[external project local] cfd target=${CFD_TARGET_VERSION}")
else()
set(CFD_TARGET_TAG v0.2.2)
set(CFD_TARGET_TAG v0.3.0)
endif()
if(CFD_TARGET_URL)
set(CFD_TARGET_REP ${CFD_TARGET_URL})
Expand Down
Loading

0 comments on commit 721d2fe

Please sign in to comment.