Compare commits
37 Commits
v0.28.0
...
release/0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
486abb7cd0 | ||
|
|
21915a1466 | ||
|
|
ee4ec924a1 | ||
|
|
12f8d557ad | ||
|
|
ea0256f470 | ||
|
|
ee56e8f4e1 | ||
|
|
4fb5f970c2 | ||
|
|
279847b024 | ||
|
|
8b66ac96ab | ||
|
|
039b64de5c | ||
|
|
fe7e4e21c0 | ||
|
|
77f89afc68 | ||
|
|
25033f6bd6 | ||
|
|
3cb2c2c394 | ||
|
|
5092987b26 | ||
|
|
aea25dbf21 | ||
|
|
ed67eba910 | ||
|
|
90606b2455 | ||
|
|
49e8fe461e | ||
|
|
de88184b8c | ||
|
|
3be2c0495f | ||
|
|
2c4c64515f | ||
|
|
17323d3184 | ||
|
|
b382511a9e | ||
|
|
d3895441d3 | ||
|
|
269512a673 | ||
|
|
d27206787a | ||
|
|
c1b1fd6f5d | ||
|
|
7062fbd047 | ||
|
|
0e34a6bacf | ||
|
|
89e85a20cf | ||
|
|
d8718c3f05 | ||
|
|
871a06d1ce | ||
|
|
b820d6a2ba | ||
|
|
79d9fa2909 | ||
|
|
a0e0467d39 | ||
|
|
f2296704e6 |
17
.github/ISSUE_TEMPLATE/enhancement_request.md
vendored
Normal file
17
.github/ISSUE_TEMPLATE/enhancement_request.md
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
name: Enhancement request
|
||||||
|
about: Request a new feature or change to an existing feature
|
||||||
|
title: ''
|
||||||
|
labels: 'enhancement'
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the enhancement**
|
||||||
|
<!-- A clear and concise description of what you would like added or changed. -->
|
||||||
|
|
||||||
|
**Use case**
|
||||||
|
<!-- Tell us how you or others will use this new feature or change to an existing feature. -->
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
<!-- Add any other context about the enhancement here. -->
|
||||||
128
.github/ISSUE_TEMPLATE/minor_release.md
vendored
128
.github/ISSUE_TEMPLATE/minor_release.md
vendored
@@ -7,77 +7,79 @@ assignees: ''
|
|||||||
---
|
---
|
||||||
|
|
||||||
## Create a new minor release
|
## Create a new minor release
|
||||||
### _Main Workflow_
|
## Bumping BDK Rust Version
|
||||||
1. - [ ] Open a PR with an update to `Cargo.toml` to the new bdk release candidate and ensure all CI workflows run correctly. Fix errors if necessary.
|
1. - [ ] Open a PR with an update to `Cargo.toml` to the new bdk release candidate and ensure all CI workflows run correctly. Fix errors if necessary.
|
||||||
2. - [ ] Once the new bdk release is out, update the PR to replace the release candidate with the full release and merge.
|
2. - [ ] Once the new bdk release is out, update the PR to replace the release candidate with the full release and merge.
|
||||||
3. - [ ] Update the Android, JVM, Python, and Swift libraries as per the ["**_Sub-Workflows_**" section below](#Sub-Workflows). Open a single PR on master for all of these changes called `Prepare language bindings libraries for 0.X release`
|
|
||||||
18. - [ ] Create a new branch off of `master` called `release/version`
|
### Specific Libraries' Workflows
|
||||||
19. - [ ] Checkout that branch and open a PR to update the Android, JVM, and Python libraries' versions
|
#### _Android_
|
||||||
- [ ] Update bdk-android version from `SNAPSHOT` version to release version
|
3. - [ ] Update the API docs to reflect the changes in the API
|
||||||
- [ ] Update bdk-jvm version from `SNAPSHOT` version to release version
|
4. - [ ] Delete the `target` directory in bdk-ffi and all previous artifacts to make sure you're building the library from scratch.
|
||||||
- [ ] Update bdk-python version from `.dev` version to release version
|
5. - [ ] Build the library and run the tests, and adjust if necessary.
|
||||||
20. - [ ] Merge the PR updating all of the languages to their release versions
|
```sh
|
||||||
21. - [ ] Create the tag and make sure to add the changelog info to the tag (works better if you prepare the tag message on the side in a text editor) and push it to GitHub.
|
# start an emulator prior to running the tests
|
||||||
|
cd ./bdk-android/
|
||||||
|
./gradlew buildAndroidLib
|
||||||
|
./gradlew connectedAndroidTest
|
||||||
|
```
|
||||||
|
6. - [ ] Update the readme if necessary
|
||||||
|
#### _JVM_
|
||||||
|
7. - [ ] Update the API docs to reflect the changes in the API
|
||||||
|
8. - [ ] Delete the `target` directory in bdk-ffi and all previous artifacts to make sure you're building the library from scratch
|
||||||
|
9. - [ ] Build the library and run the tests, and adjust if necessary
|
||||||
|
```sh
|
||||||
|
cd ./bdk-jvm/
|
||||||
|
./gradlew buildJvmLib
|
||||||
|
./gradlew test
|
||||||
|
```
|
||||||
|
10. - [ ] Update the readme if necessary
|
||||||
|
#### _Swift_
|
||||||
|
11. - [ ] Run the tests and adjust if necessary
|
||||||
|
```sh
|
||||||
|
./bdk-swift/build-local-swift.sh
|
||||||
|
cd ./bdk-swift/
|
||||||
|
swift test
|
||||||
|
```
|
||||||
|
12. - [ ] Update the readme if necessary
|
||||||
|
#### _Python_
|
||||||
|
13. - [ ] Delete the `.tox`, `dist`, `build`, and `bdkpython.egg-info` and rust `target` directories to make sure you are building the library from scratch without any caches
|
||||||
|
14. - [ ] Build the library
|
||||||
|
```shell
|
||||||
|
cd ./bdk-python/
|
||||||
|
pip3 install --requirement requirements.txt
|
||||||
|
bash ./generate.sh
|
||||||
|
python3 setup.py --verbose bdist_wheel
|
||||||
|
```
|
||||||
|
15. - [ ] Run the tests and adjust if necessary
|
||||||
|
```shell
|
||||||
|
pip3 install ./dist/bdkpython-<yourversion>-py3-none-any.whl --force-reinstall
|
||||||
|
python -m unittest --verbose tests/test_bdk.py
|
||||||
|
```
|
||||||
|
16. - [ ] Update the readme and `setup.py` if necessary
|
||||||
|
|
||||||
|
### Release Workflow
|
||||||
|
17. - [ ] Update the Android, JVM, Python, and Swift libraries as per the _Specific Libraries' Workflows_ section above. Open a single PR on master for all of these changes called `Prepare language bindings libraries for 0.X release`. See [example PR here](https://github.com/bitcoindevkit/bdk-ffi/pull/315).
|
||||||
|
- [ ] Create a new branch off of `master` called `release/version`
|
||||||
|
18. - [ ] Open a PR to that branch to update the Android, JVM, and Python libraries' versions. See [example PR here](https://github.com/bitcoindevkit/bdk-ffi/pull/316).
|
||||||
|
- [ ] Update bdk-android version from `SNAPSHOT` version to release version
|
||||||
|
- [ ] Update bdk-jvm version from `SNAPSHOT` version to release version
|
||||||
|
- [ ] Update bdk-python version from `.dev` version to release version
|
||||||
|
19. - [ ] Merge the PR updating all the languages to their release versions
|
||||||
|
20. - [ ] Create the tag and make sure to add the changelog info to the tag (works better if you prepare the tag message on the side in a text editor) and push it to GitHub.
|
||||||
```sh
|
```sh
|
||||||
git tag v0.6.0 --sign --edit
|
git tag v0.6.0 --sign --edit
|
||||||
git push upstream v0.6.0
|
git push upstream v0.6.0
|
||||||
```
|
```
|
||||||
22. - [ ] Make release on GitHub (set as pre-release and generate auto release notes between the previous tag and the new one)
|
21. - [ ] Aggregate all the changelog notices from the PRs and add them to the changelog file
|
||||||
23. - [ ] Trigger manual releases for all 4 libraries (for Swift, simply add the version number in the text field when running the workflow manually. Note that the version number must not contain the `v`, i.e. `0.26.0`)
|
22. - [ ] Open a PR on master with the changes to the changelog file and the development versions bump. See [example PR here](https://github.com/bitcoindevkit/bdk-ffi/pull/317).
|
||||||
24. - [ ] Bump the versions on master from `0.9.0-SNAPSHOT` to `0.10.0-SNAPSHOT`, `0.6.0.dev0` to `0.7.0.dev0`
|
23. - [ ] Make release on GitHub (set as pre-release and generate auto release notes between the previous tag and the new one)
|
||||||
25. - [ ] Build and publish API docs for JVM, Android, and Java on the website
|
24. - [ ] Trigger manual releases for all 4 libraries (for Swift, simply add the version number in the text field when running the workflow manually. Note that the version number must not contain the `v`, i.e. `0.26.0`)
|
||||||
|
25. - [ ] Bump the versions on master from `0.9.0-SNAPSHOT` to `0.10.0-SNAPSHOT`, `0.6.0.dev0` to `0.7.0.dev0`
|
||||||
|
26. - [ ] Build and publish API docs for JVM, Android, and Java on the website
|
||||||
```bash!
|
```bash!
|
||||||
./gradlew dokkaHtml # bdk-jvm (Dokka)
|
./gradlew dokkaHtml # bdk-jvm (Dokka)
|
||||||
./gradlew dokkaJavadoc # bdk-jvm (java-style documentation)
|
./gradlew dokkaJavadoc # bdk-jvm (java-style documentation)
|
||||||
./gradlew dokkaHtml # bdk-android (Dokka)
|
./gradlew dokkaHtml # bdk-android (Dokka)
|
||||||
```
|
```
|
||||||
26. - [ ] Tweet about the library
|
27. - [ ] Tweet about the library
|
||||||
27. - [ ] Post in the announcement channel
|
28. - [ ] Post in the announcement channel
|
||||||
|
|
||||||
### _Sub Workflows_
|
|
||||||
#### _Android_
|
|
||||||
4. - [ ] Update the API docs to reflect the changes in the API
|
|
||||||
5. - [ ] Delete the `target` directory in bdk-ffi and all previous artifacts to make sure you're building the library from scratch
|
|
||||||
6. - [ ] Build the library and run the tests, and adjust if necessary.
|
|
||||||
```sh
|
|
||||||
# start an emulator prior to running the tests
|
|
||||||
cd bdk-android
|
|
||||||
./gradlew buildAndroidLib
|
|
||||||
./gradlew connectedAndroidTest
|
|
||||||
```
|
|
||||||
7. - [ ] Update the readme if necessary
|
|
||||||
|
|
||||||
#### _JVM_
|
|
||||||
8. - [ ] Update the API docs to reflect the changes in the API
|
|
||||||
9. - [ ] Delete the `target` directory in bdk-ffi and all previous artifacts to make sure you're building the library from scratch
|
|
||||||
10. - [ ] Build the library and run the tests, and adjust if necessary
|
|
||||||
```sh
|
|
||||||
cd bdk-jvm
|
|
||||||
./gradlew buildJvmLib
|
|
||||||
./gradlew test
|
|
||||||
```
|
|
||||||
11. - [ ] Update the readme if necessary
|
|
||||||
|
|
||||||
#### _Swift_
|
|
||||||
12. - [ ] Run the tests and adjust if necessary
|
|
||||||
```sh
|
|
||||||
./bdk-swift/build-local-swift.sh
|
|
||||||
cd bdk-swift
|
|
||||||
swift test
|
|
||||||
```
|
|
||||||
13. - [ ] Update the readme if necessary
|
|
||||||
|
|
||||||
#### _Python_
|
|
||||||
14. - [ ] Delete the `.tox`, `dist`, `build`, and `bdkpython.egg-info` and rust `target` directories to make sure you are building the library from scratch without any caches
|
|
||||||
15. - [ ] Build the library
|
|
||||||
```shell
|
|
||||||
pip3 install --requirement requirements.txt
|
|
||||||
bash ./generate.sh
|
|
||||||
python3 setup.py --verbose bdist_wheel
|
|
||||||
```
|
|
||||||
16. - [ ] Run the tests and adjust if necessary
|
|
||||||
```shell
|
|
||||||
pip3 install ./dist/bdkpython-<yourversion>-py3-none-any.whl
|
|
||||||
python -m unittest --verbose tests/test_bdk.py
|
|
||||||
```
|
|
||||||
17. - [ ] Update the readme and `setup.py` if necessary
|
|
||||||
|
|||||||
27
.github/ISSUE_TEMPLATE/patch_release.md
vendored
27
.github/ISSUE_TEMPLATE/patch_release.md
vendored
@@ -7,7 +7,6 @@ assignees: ''
|
|||||||
---
|
---
|
||||||
|
|
||||||
# Creating a new patch release
|
# Creating a new patch release
|
||||||
|
|
||||||
## Bumping BDK Rust Version
|
## Bumping BDK Rust Version
|
||||||
1. - [ ] Open a PR with an update to `Cargo.toml` to the new bdk release candidate and ensure all CI workflows run correctly. Fix errors if necessary.
|
1. - [ ] Open a PR with an update to `Cargo.toml` to the new bdk release candidate and ensure all CI workflows run correctly. Fix errors if necessary.
|
||||||
2. - [ ] Once the new bdk release is out, update the PR to replace the release candidate with the full release and merge.
|
2. - [ ] Once the new bdk release is out, update the PR to replace the release candidate with the full release and merge.
|
||||||
@@ -59,26 +58,28 @@ python -m unittest --verbose tests/test_bdk.py
|
|||||||
16. - [ ] Update the readme and `setup.py` if necessary
|
16. - [ ] Update the readme and `setup.py` if necessary
|
||||||
|
|
||||||
### Release Workflow
|
### Release Workflow
|
||||||
17. - [ ] Update the Android, JVM, Python, and Swift libraries as per the _Specific Libraries' Workflows_ section above. Open a single PR on master for all of these changes called `Prepare language bindings libraries for 0.X release`
|
17. - [ ] Update the Android, JVM, Python, and Swift libraries as per the _Specific Libraries' Workflows_ section above. Open a single PR on master for all of these changes called `Prepare language bindings libraries for 0.X release`. See [example PR here](https://github.com/bitcoindevkit/bdk-ffi/pull/315).
|
||||||
- [ ] Create a new branch off of `master` called `release/version`
|
- [ ] Create a new branch off of `master` called `release/version`
|
||||||
18. - [ ] Checkout that branch and open a PR to update the Android, JVM, and Python libraries' versions
|
18. - [ ] Open a PR to that branch to update the Android, JVM, and Python libraries' versions. See [example PR here](https://github.com/bitcoindevkit/bdk-ffi/pull/316).
|
||||||
- [ ] Update bdk-android version from `SNAPSHOT` version to release version
|
- [ ] Update bdk-android version from `SNAPSHOT` version to release version
|
||||||
- [ ] Update bdk-jvm version from `SNAPSHOT` version to release version
|
- [ ] Update bdk-jvm version from `SNAPSHOT` version to release version
|
||||||
- [ ] Update bdk-python version from `.dev` version to release version
|
- [ ] Update bdk-python version from `.dev` version to release version
|
||||||
19. - [ ] Merge the PR updating all of the languages to their release versions
|
19. - [ ] Merge the PR updating all the languages to their release versions
|
||||||
20. - [ ] Create the tag and make sure to add the changelog info to the tag (works better if you prepare the tag message on the side in a text editor) and push it to GitHub.
|
20. - [ ] Create the tag and make sure to add the changelog info to the tag (works better if you prepare the tag message on the side in a text editor) and push it to GitHub.
|
||||||
```sh
|
```sh
|
||||||
git tag v0.6.0 --sign --edit
|
git tag v0.6.0 --sign --edit
|
||||||
git push upstream v0.6.0
|
git push upstream v0.6.0
|
||||||
```
|
```
|
||||||
21. - [ ] Make release on GitHub (set as pre-release and generate auto release notes between the previous tag and the new one)
|
21. - [ ] Aggregate all the changelog notices from the PRs and add them to the changelog file
|
||||||
22. - [ ] Trigger manual releases for all 4 libraries (for Swift, simply add the version number in the text field when running the workflow manually. Note that the version number must not contain the `v`, i.e. `0.26.0`)
|
22. - [ ] Open a PR on master with the changes to the changelog file and the development versions bump. See [example PR here](https://github.com/bitcoindevkit/bdk-ffi/pull/317).
|
||||||
23. - [ ] Bump the versions on master from `0.9.0-SNAPSHOT` to `0.10.0-SNAPSHOT`, `0.6.0.dev0` to `0.7.0.dev0`
|
23. - [ ] Make release on GitHub (set as pre-release and generate auto release notes between the previous tag and the new one)
|
||||||
24. - [ ] Build and publish API docs for JVM, Android, and Java on the website
|
24. - [ ] Trigger manual releases for all 4 libraries (for Swift, simply add the version number in the text field when running the workflow manually. Note that the version number must not contain the `v`, i.e. `0.26.0`)
|
||||||
|
25. - [ ] Bump the versions on master from `0.9.0-SNAPSHOT` to `0.10.0-SNAPSHOT`, `0.6.0.dev0` to `0.7.0.dev0`
|
||||||
|
26. - [ ] Build and publish API docs for JVM, Android, and Java on the website
|
||||||
```bash!
|
```bash!
|
||||||
./gradlew dokkaHtml # bdk-jvm (Dokka)
|
./gradlew dokkaHtml # bdk-jvm (Dokka)
|
||||||
./gradlew dokkaJavadoc # bdk-jvm (java-style documentation)
|
./gradlew dokkaJavadoc # bdk-jvm (java-style documentation)
|
||||||
./gradlew dokkaHtml # bdk-android (Dokka)
|
./gradlew dokkaHtml # bdk-android (Dokka)
|
||||||
```
|
```
|
||||||
25. - [ ] Tweet about the library
|
27. - [ ] Tweet about the library
|
||||||
26. - [ ] Post in the announcement channel
|
28. - [ ] Post in the announcement channel
|
||||||
|
|||||||
107
.github/workflows/publish-jvm.yaml
vendored
107
.github/workflows/publish-jvm.yaml
vendored
@@ -2,14 +2,14 @@ name: Publish bdk-jvm to Maven Central
|
|||||||
on: [workflow_dispatch]
|
on: [workflow_dispatch]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-jvm-macOS-M1-native-lib:
|
build-macOS-native-libs:
|
||||||
name: "Create M1 and x86_64 JVM native binaries"
|
name: "Create M1 and x86_64 native binaries"
|
||||||
runs-on: macos-12
|
runs-on: macos-12
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout publishing branch"
|
- name: "Checkout publishing branch"
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Cache
|
- name: "Cache"
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
./target
|
./target
|
||||||
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
|
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Set up JDK
|
- name: "Set up JDK"
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
@@ -27,45 +27,28 @@ jobs:
|
|||||||
- name: "Set default Rust version to 1.67.0"
|
- name: "Set default Rust version to 1.67.0"
|
||||||
run: rustup default 1.67.0
|
run: rustup default 1.67.0
|
||||||
|
|
||||||
- name: Install aarch64 Rust target
|
- name: "Install aarch64 Rust target"
|
||||||
run: rustup target add aarch64-apple-darwin
|
run: rustup target add aarch64-apple-darwin
|
||||||
|
|
||||||
- name: Build bdk-jvm library
|
- name: "Build bdk-jvm library"
|
||||||
run: |
|
run: |
|
||||||
cd bdk-jvm
|
cd bdk-jvm
|
||||||
./gradlew buildJvmLib
|
./gradlew buildJvmLib
|
||||||
|
|
||||||
# build aarch64 + x86_64 native libraries and upload
|
- name: "Upload macOS native libraries for reuse in publishing job"
|
||||||
- name: Upload macOS native libraries for reuse in publishing job
|
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
# name: no name is required because we upload the entire directory
|
name: artifact-macos
|
||||||
# the default name "artifact" will be used
|
|
||||||
path: /Users/runner/work/bdk-ffi/bdk-ffi/bdk-jvm/lib/src/main/resources/
|
path: /Users/runner/work/bdk-ffi/bdk-ffi/bdk-jvm/lib/src/main/resources/
|
||||||
|
|
||||||
build-jvm-full-library:
|
build-windows-native-lib:
|
||||||
name: Create full bdk-jvm library
|
name: "Create Windows native binaries"
|
||||||
needs: [build-jvm-macOS-M1-native-lib]
|
runs-on: windows-2022
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout publishing branch
|
- name: "Checkout publishing branch"
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Update bdk-ffi git submodule
|
- name: "Set up JDK"
|
||||||
run: |
|
|
||||||
git submodule set-url bdk-ffi https://github.com/bitcoindevkit/bdk-ffi.git
|
|
||||||
git submodule update --init bdk-ffi
|
|
||||||
|
|
||||||
- name: Cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/registry
|
|
||||||
~/.cargo/git
|
|
||||||
./target
|
|
||||||
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Set up JDK
|
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
@@ -74,20 +57,70 @@ jobs:
|
|||||||
- name: "Set default Rust version to 1.67.0"
|
- name: "Set default Rust version to 1.67.0"
|
||||||
run: rustup default 1.67.0
|
run: rustup default 1.67.0
|
||||||
|
|
||||||
- name: Build bdk-jvm library
|
- name: "Install x86_64-pc-windows-msvc Rust target"
|
||||||
|
run: rustup target add x86_64-pc-windows-msvc
|
||||||
|
|
||||||
|
- name: "Build bdk-jvm library"
|
||||||
run: |
|
run: |
|
||||||
cd bdk-jvm
|
cd bdk-jvm
|
||||||
./gradlew buildJvmLib
|
./gradlew buildJvmLib
|
||||||
|
|
||||||
- name: Download macOS native libraries from previous job
|
- name: "Upload Windows native libraries for reuse in publishing job"
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
id: download
|
|
||||||
with:
|
with:
|
||||||
# download the artifact created in the prior job (named "artifact")
|
name: artifact-windows
|
||||||
name: artifact
|
path: D:\a\bdk-ffi\bdk-ffi\bdk-jvm\lib\src\main\resources\
|
||||||
|
|
||||||
|
build-full-library:
|
||||||
|
name: Create full bdk-jvm library
|
||||||
|
needs: [build-macOS-native-libs, build-windows-native-lib]
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- name: "Checkout publishing branch"
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: "Cache"
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/registry
|
||||||
|
~/.cargo/git
|
||||||
|
./target
|
||||||
|
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
|
||||||
|
|
||||||
|
- name: "Set up JDK"
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
distribution: temurin
|
||||||
|
java-version: 11
|
||||||
|
|
||||||
|
- name: "Set default Rust version to 1.67.0"
|
||||||
|
run: rustup default 1.67.0
|
||||||
|
|
||||||
|
- name: "Build bdk-jvm library"
|
||||||
|
run: |
|
||||||
|
cd bdk-jvm
|
||||||
|
./gradlew buildJvmLib
|
||||||
|
|
||||||
|
- name: "Download native binaries from previous jobs"
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: artifact-macos
|
||||||
path: ./bdk-jvm/lib/src/main/resources/
|
path: ./bdk-jvm/lib/src/main/resources/
|
||||||
|
|
||||||
- name: Publish to Maven Central
|
- name: "Download Windows native libraries from previous job"
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: artifact-windows
|
||||||
|
path: ./bdk-jvm/lib/src/main/resources/
|
||||||
|
|
||||||
|
- name: "Upload library code and binaries"
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: artifact-full
|
||||||
|
path: ./bdk-jvm/lib/
|
||||||
|
|
||||||
|
- name: "Publish to Maven Central"
|
||||||
env:
|
env:
|
||||||
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.PGP_KEY_ID }}
|
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.PGP_KEY_ID }}
|
||||||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET_KEY }}
|
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET_KEY }}
|
||||||
|
|||||||
93
.github/workflows/publish-python.yaml
vendored
93
.github/workflows/publish-python.yaml
vendored
@@ -7,7 +7,7 @@ on: [workflow_dispatch]
|
|||||||
# tries to load glibc and fails because it requires a more recent version.
|
# tries to load glibc and fails because it requires a more recent version.
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-manylinux2014-x86_64-wheel:
|
build-manylinux2014-x86_64-wheels:
|
||||||
name: "Build Manylinux 2014 x86_64 wheel"
|
name: "Build Manylinux 2014 x86_64 wheel"
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
defaults:
|
defaults:
|
||||||
@@ -33,26 +33,22 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|
||||||
- name: "Set default Rust version to 1.67.0"
|
- name: "Generate bdk.py and binaries"
|
||||||
run: rustup default 1.67.0
|
run: bash ./scripts/generate-linux.sh
|
||||||
|
|
||||||
- name: "Install requirements"
|
|
||||||
run: ${PYBIN}/pip install -r requirements.txt
|
|
||||||
|
|
||||||
- name: "Generate bdk.py"
|
|
||||||
run: bash generate.sh
|
|
||||||
|
|
||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
run: ${PYBIN}/python setup.py bdist_wheel --verbose
|
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
||||||
|
# see issue #350 for more information
|
||||||
|
run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_17_x86_64 --verbose
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: bdkpython-manylinux2014-x86_64-${{ matrix.python }}
|
name: bdkpython-manylinux2014-x86_64-${{ matrix.python }}
|
||||||
path: /home/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
path: /home/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
||||||
|
|
||||||
build-macos-universal-wheel:
|
build-macos-arm64-wheels:
|
||||||
name: "Build macOS universal wheel"
|
name: "Build macOS arm64 wheel"
|
||||||
runs-on: macos-12
|
runs-on: macos-13
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: bdk-python
|
working-directory: bdk-python
|
||||||
@@ -67,28 +63,63 @@ jobs:
|
|||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
|
- name: "Install Python"
|
||||||
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: "Generate bdk.py"
|
- name: "Generate bdk.py and binaries"
|
||||||
run: |
|
run: bash ./scripts/generate-macos-arm64.sh
|
||||||
python3 --version
|
|
||||||
rustup target add aarch64-apple-darwin
|
|
||||||
pip3 install --user -r requirements.txt
|
|
||||||
bash generate.sh
|
|
||||||
|
|
||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
env:
|
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
||||||
ARCHFLAGS: "-arch x86_64 -arch arm64"
|
# see issue #350 for more information
|
||||||
run: python3 setup.py bdist_wheel --verbose
|
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_arm64 --verbose
|
||||||
|
|
||||||
|
- name: "Upload artifacts"
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: bdkpython-macos-arm64-${{ matrix.python }}
|
||||||
|
path: /Users/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
||||||
|
|
||||||
|
build-macos-x86_64-wheels:
|
||||||
|
name: "Build macOS x86_64 wheel"
|
||||||
|
runs-on: macos-13
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: bdk-python
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python:
|
||||||
|
- "3.8"
|
||||||
|
- "3.9"
|
||||||
|
- "3.10"
|
||||||
|
steps:
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: "Install Python"
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
|
- name: "Generate bdk.py and binaries"
|
||||||
|
run: bash ./scripts/generate-macos-x86_64.sh
|
||||||
|
|
||||||
|
- name: "Build wheel"
|
||||||
|
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
||||||
|
# see issue #350 for more information
|
||||||
|
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_x86_64 --verbose
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: bdkpython-macos-${{ matrix.python }}
|
name: bdkpython-macos-x86_64-${{ matrix.python }}
|
||||||
path: /Users/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
path: /Users/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
||||||
|
|
||||||
build-windows-wheel:
|
build-windows-wheels:
|
||||||
name: "Build Windows wheel"
|
name: "Build Windows wheel"
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
defaults:
|
defaults:
|
||||||
@@ -109,16 +140,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: "Generate bdk.py"
|
- name: "Generate bdk.py and binaries"
|
||||||
run: |
|
run: bash ./scripts/generate-windows.sh
|
||||||
python --version
|
|
||||||
pip install --user -r requirements.txt
|
|
||||||
bash generate.sh
|
|
||||||
|
|
||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
run: python setup.py bdist_wheel --verbose
|
run: python setup.py bdist_wheel --verbose
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- name: "Upload artifacts"
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: bdkpython-win-${{ matrix.python }}
|
name: bdkpython-win-${{ matrix.python }}
|
||||||
path: D:\a\bdk-ffi\bdk-ffi\bdk-python\dist\*.whl
|
path: D:\a\bdk-ffi\bdk-ffi\bdk-python\dist\*.whl
|
||||||
@@ -129,7 +158,7 @@ jobs:
|
|||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: bdk-python
|
working-directory: bdk-python
|
||||||
needs: [build-manylinux2014-x86_64-wheel, build-macos-universal-wheel, build-windows-wheel]
|
needs: [build-manylinux2014-x86_64-wheels, build-macos-arm64-wheels, build-macos-x86_64-wheels, build-windows-wheels]
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|||||||
133
.github/workflows/test-python.yaml
vendored
133
.github/workflows/test-python.yaml
vendored
@@ -16,7 +16,7 @@ on:
|
|||||||
# tries to load glibc and fails because it requires a more recent version.
|
# tries to load glibc and fails because it requires a more recent version.
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-manylinux2014-x86_64-wheel:
|
build-manylinux2014-x86_64-wheels:
|
||||||
name: "Build and test Manylinux 2014 x86_64 wheels"
|
name: "Build and test Manylinux 2014 x86_64 wheels"
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
defaults:
|
defaults:
|
||||||
@@ -42,17 +42,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|
||||||
- name: "Set default Rust version to 1.67.0"
|
- name: "Generate bdk.py and binaries"
|
||||||
run: rustup default 1.67.0
|
run: bash ./scripts/generate-linux.sh
|
||||||
|
|
||||||
- name: "Install requirements"
|
|
||||||
run: ${PYBIN}/pip install -r requirements.txt
|
|
||||||
|
|
||||||
- name: "Generate bdk.py"
|
|
||||||
run: bash generate.sh
|
|
||||||
|
|
||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
run: ${PYBIN}/python setup.py bdist_wheel --verbose
|
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
||||||
|
# see issue #350 for more information
|
||||||
|
run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_17_x86_64 --verbose
|
||||||
|
|
||||||
- name: "Install wheel"
|
- name: "Install wheel"
|
||||||
run: ${PYBIN}/pip install ./dist/*.whl
|
run: ${PYBIN}/pip install ./dist/*.whl
|
||||||
@@ -66,9 +62,9 @@ jobs:
|
|||||||
name: bdkpython-manylinux2014-x86_64-${{ matrix.python }}
|
name: bdkpython-manylinux2014-x86_64-${{ matrix.python }}
|
||||||
path: /home/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
path: /home/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
||||||
|
|
||||||
build-macos-universal-wheel:
|
build-macos-arm64-wheels:
|
||||||
name: "Build and test macOS wheels"
|
name: "Build and test macOS arm64 wheels"
|
||||||
runs-on: macos-12
|
runs-on: macos-13
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: bdk-python
|
working-directory: bdk-python
|
||||||
@@ -79,35 +75,39 @@ jobs:
|
|||||||
- "3.9"
|
- "3.9"
|
||||||
- "3.10"
|
- "3.10"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: "Checkout"
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
- uses: actions/setup-python@v2
|
|
||||||
|
- name: "Install Python"
|
||||||
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: "Generate bdk.py"
|
- name: "Generate bdk.py and binaries"
|
||||||
run: |
|
run: bash ./scripts/generate-macos-arm64.sh
|
||||||
python3 --version
|
|
||||||
rustup target add aarch64-apple-darwin
|
|
||||||
pip3 install --user -r requirements.txt
|
|
||||||
bash generate.sh
|
|
||||||
|
|
||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
env:
|
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
||||||
ARCHFLAGS: "-arch x86_64 -arch arm64"
|
# see issue #350 for more information
|
||||||
run: python3 setup.py bdist_wheel --verbose
|
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_arm64 --verbose
|
||||||
|
|
||||||
- name: "Install wheel"
|
# You can't install the arm64 wheel on the CI, so we skip these steps and simply test that the wheel builds
|
||||||
run: pip3 install ./dist/*.whl
|
# - name: "Install wheel and run tests"
|
||||||
|
# run: |
|
||||||
|
# pip3 install ./dist/*.whl
|
||||||
|
# python3 -m unittest tests/test_bdk.py --verbose
|
||||||
|
|
||||||
- name: "Run tests"
|
- name: "Upload artifact test"
|
||||||
run: python3 -m unittest tests/test_bdk.py --verbose
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: bdkpython-macos-arm64-${{ matrix.python }}
|
||||||
|
path: /Users/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
||||||
|
|
||||||
build-windows-wheel:
|
build-macos-x86_64-wheels:
|
||||||
name: "Build and test Windows wheels"
|
name: "Build and test macOS x86_64 wheels"
|
||||||
runs-on: windows-2022
|
runs-on: macos-13
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: bdk-python
|
working-directory: bdk-python
|
||||||
@@ -126,21 +126,64 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python }}
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
- name: "Generate bdk.py"
|
- name: "Generate bdk.py and binaries"
|
||||||
run: |
|
run: bash ./scripts/generate-macos-x86_64.sh
|
||||||
python --version
|
|
||||||
pip install --user -r requirements.txt
|
- name: "Build wheel"
|
||||||
bash generate.sh
|
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
|
||||||
|
# see issue #350 for more information
|
||||||
|
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_x86_64 --verbose
|
||||||
|
|
||||||
|
- name: "Install wheel"
|
||||||
|
run: pip3 install ./dist/*.whl
|
||||||
|
|
||||||
|
- name: "Run tests"
|
||||||
|
run: python3 -m unittest tests/test_bdk.py --verbose
|
||||||
|
|
||||||
|
- name: "Upload artifact test"
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: bdkpython-macos-x86_64-${{ matrix.python }}
|
||||||
|
path: /Users/runner/work/bdk-ffi/bdk-ffi/bdk-python/dist/*.whl
|
||||||
|
|
||||||
|
build-windows-wheels:
|
||||||
|
name: "Build and test Windows wheels"
|
||||||
|
runs-on: windows-2022
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: bdk-python
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python:
|
||||||
|
- "3.8"
|
||||||
|
- "3.9"
|
||||||
|
- "3.10"
|
||||||
|
steps:
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: "Install Python"
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python }}
|
||||||
|
|
||||||
|
- name: "Generate bdk.py and binaries"
|
||||||
|
run: bash ./scripts/generate-windows.sh
|
||||||
|
|
||||||
- name: "Build wheel"
|
- name: "Build wheel"
|
||||||
run: python setup.py bdist_wheel --verbose
|
run: python setup.py bdist_wheel --verbose
|
||||||
|
|
||||||
# TODO: On Windows the pip install ./dist/*.whl step fails with the following error:
|
- name: "Upload artifact test"
|
||||||
# Run pip install ./dist/*.whl
|
uses: actions/upload-artifact@v2
|
||||||
# WARNING: Requirement './dist/*.whl' looks like a filename, but the file does not exist
|
with:
|
||||||
# ERROR: *.whl is not a valid wheel filename.*.whl is not a valid wheel name
|
name: bdkpython-windows-${{ matrix.python }}
|
||||||
# So we skip the installing and the tests and simply test that the wheel builds
|
path: D:\a\bdk-ffi\bdk-ffi\bdk-python\dist\*.whl
|
||||||
# - name: Install wheel
|
|
||||||
# run: pip install ./dist/*.whl
|
- name: "Install dependencies"
|
||||||
# - name: Run tests
|
run: Get-ChildItem 'D:\a\bdk-ffi\bdk-ffi\bdk-python\dist\*.whl' | ForEach-Object {pip install $_.FullName}
|
||||||
# run: python -m unittest tests/test_bdk.py --verbose
|
shell: powershell
|
||||||
|
|
||||||
|
- name: "Run tests"
|
||||||
|
run: python -m unittest tests/test_bdk.py --verbose
|
||||||
|
|||||||
2
.github/workflows/test-swift.yaml
vendored
2
.github/workflows/test-swift.yaml
vendored
@@ -36,7 +36,7 @@ jobs:
|
|||||||
- name: Build bdk-ffi for aarch64-apple-darwin
|
- name: Build bdk-ffi for aarch64-apple-darwin
|
||||||
run: cargo build --package bdk-ffi --profile release-smaller --target aarch64-apple-darwin
|
run: cargo build --package bdk-ffi --profile release-smaller --target aarch64-apple-darwin
|
||||||
|
|
||||||
- name: Create lipo-ios-sim and lipo-macos
|
- name: Create lipo-macos
|
||||||
run: |
|
run: |
|
||||||
mkdir -p target/lipo-macos/release-smaller
|
mkdir -p target/lipo-macos/release-smaller
|
||||||
lipo target/aarch64-apple-darwin/release-smaller/libbdkffi.a target/x86_64-apple-darwin/release-smaller/libbdkffi.a -create -output target/lipo-macos/release-smaller/libbdkffi.a
|
lipo target/aarch64-apple-darwin/release-smaller/libbdkffi.a target/x86_64-apple-darwin/release-smaller/libbdkffi.a -create -output target/lipo-macos/release-smaller/libbdkffi.a
|
||||||
|
|||||||
40
CHANGELOG.md
40
CHANGELOG.md
@@ -1,14 +1,31 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
All notable changes to this project prior to release **0.9.0** are documented in this file. Future
|
Changelog information can also be found in each release's git tag (which can be viewed with `git tag -ln100 "v*"`), as well as on the [GitHub releases](https://github.com/bitcoindevkit/bdk-ffi/releases) page. See [DEVELOPMENT_CYCLE.md](DEVELOPMENT_CYCLE.md) for more details.
|
||||||
changelog information can be found in each release's git tag and can be viewed with `git tag -ln100 "v*"`.
|
|
||||||
Changelog info is also documented on the [GitHub releases](https://github.com/bitcoindevkit/bdk-ffi/releases)
|
|
||||||
page. See [DEVELOPMENT_CYCLE.md](DEVELOPMENT_CYCLE.md) for more details.
|
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [v0.28.0]
|
||||||
|
- Update BDK to version 0.28.0 [#341]
|
||||||
|
- Drop support of pypy releases of Python libraries [#351]
|
||||||
|
- Drop support for Python 3.6 and 3.7 [#351]
|
||||||
|
- Drop support for very old Linux versions that do not support the manylinux_2_17_x86_64 platform tag [#351]
|
||||||
|
- APIs changed:
|
||||||
|
- Expose Address payload and network properties. [#325]
|
||||||
|
- Add SignOptions to Wallet.sign() params. [#326]
|
||||||
|
- address field on `AddressInfo` type is now of type `Address` [#333]
|
||||||
|
- new PartiallySignedTransaction.json_serialize() function to get JSON serialized value of all PSBT fields. [#334]
|
||||||
|
- Add from_script constructor to `Address` type [#337]
|
||||||
|
|
||||||
|
[#325]: https://github.com/bitcoindevkit/bdk-ffi/pull/325
|
||||||
|
[#326]: https://github.com/bitcoindevkit/bdk-ffi/pull/326
|
||||||
|
[#333]: https://github.com/bitcoindevkit/bdk-ffi/pull/333
|
||||||
|
[#334]: https://github.com/bitcoindevkit/bdk-ffi/pull/334
|
||||||
|
[#337]: https://github.com/bitcoindevkit/bdk-ffi/pull/337
|
||||||
|
[#341]: https://github.com/bitcoindevkit/bdk-ffi/pull/341
|
||||||
|
[#351]: https://github.com/bitcoindevkit/bdk-ffi/pull/351
|
||||||
|
|
||||||
## [v0.27.1]
|
## [v0.27.1]
|
||||||
- Update BDK to latest version 0.27.1 [#312]
|
- Update BDK to version 0.27.1 [#312]
|
||||||
- APIs changed
|
- APIs changed
|
||||||
- `PartiallySignedTransaction.extract_tx()` returns a `Transaction` instead of the transaction bytes. [#296]
|
- `PartiallySignedTransaction.extract_tx()` returns a `Transaction` instead of the transaction bytes. [#296]
|
||||||
- `Blockchain.broadcast()` takes a `Transaction` instead of a `PartiallySignedTransaction`. [#296]
|
- `Blockchain.broadcast()` takes a `Transaction` instead of a `PartiallySignedTransaction`. [#296]
|
||||||
@@ -23,7 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
[#312]: https://github.com/bitcoindevkit/bdk-ffi/pull/312
|
[#312]: https://github.com/bitcoindevkit/bdk-ffi/pull/312
|
||||||
|
|
||||||
## [v0.26.0]
|
## [v0.26.0]
|
||||||
- Update BDK to latest version 0.26.0 [#288]
|
- Update BDK to version 0.26.0 [#288]
|
||||||
- APIs changed
|
- APIs changed
|
||||||
- The descriptor and change_descriptor arguments on the wallet constructor now take a `Descriptor` instead of a `String`. [#260]
|
- The descriptor and change_descriptor arguments on the wallet constructor now take a `Descriptor` instead of a `String`. [#260]
|
||||||
- TxBuilder.drain_to() argument is now `Script` instead of address `String`. [#279]
|
- TxBuilder.drain_to() argument is now `Script` instead of address `String`. [#279]
|
||||||
@@ -46,7 +63,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
[#288]: https://github.com/bitcoindevkit/bdk-ffi/pull/288
|
[#288]: https://github.com/bitcoindevkit/bdk-ffi/pull/288
|
||||||
|
|
||||||
## [v0.25.0]
|
## [v0.25.0]
|
||||||
- Update BDK to latest version 0.25.0 [#272]
|
- Update BDK to version 0.25.0 [#272]
|
||||||
- APIs Added:
|
- APIs Added:
|
||||||
- from_string() constructors now available on DescriptorSecretKey and DescriptorPublicKey [#247]
|
- from_string() constructors now available on DescriptorSecretKey and DescriptorPublicKey [#247]
|
||||||
|
|
||||||
@@ -54,7 +71,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
[#272]: https://github.com/bitcoindevkit/bdk-ffi/pull/272
|
[#272]: https://github.com/bitcoindevkit/bdk-ffi/pull/272
|
||||||
|
|
||||||
## [v0.11.0]
|
## [v0.11.0]
|
||||||
- Update BDK to latest version 0.24.0 [#221]
|
- Update BDK to version 0.24.0 [#221]
|
||||||
- APIs changed
|
- APIs changed
|
||||||
- The constructor on the DescriptorSecretKey type now takes a Mnemonic instead of a String.
|
- The constructor on the DescriptorSecretKey type now takes a Mnemonic instead of a String.
|
||||||
- APIs added
|
- APIs added
|
||||||
@@ -70,7 +87,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
[#221]: https://github.com/bitcoindevkit/bdk-ffi/pull/221
|
[#221]: https://github.com/bitcoindevkit/bdk-ffi/pull/221
|
||||||
|
|
||||||
## [v0.10.0]
|
## [v0.10.0]
|
||||||
- Update BDK to latest version 0.23.0 [#204]
|
- Update BDK to version 0.23.0 [#204]
|
||||||
- Update uniffi-rs to latest version 0.21.0 [#216]
|
- Update uniffi-rs to latest version 0.21.0 [#216]
|
||||||
- Breaking Changes
|
- Breaking Changes
|
||||||
- Changed `TxBuilder.finish()` to return new `TxBuilderResult` [#209]
|
- Changed `TxBuilder.finish()` to return new `TxBuilderResult` [#209]
|
||||||
@@ -103,7 +120,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- APIs Added [#154]
|
- APIs Added [#154]
|
||||||
- `generate_mnemonic()`, returns string mnemonic
|
- `generate_mnemonic()`, returns string mnemonic
|
||||||
- `interface DescriptorSecretKey`
|
- `interface DescriptorSecretKey`
|
||||||
- `new(Network, string_mnenoinc, password)`, contructs DescriptorSecretKey
|
- `new(Network, string_mnenoinc, password)`, constructs DescriptorSecretKey
|
||||||
- `derive(DerivationPath)`, derives and returns child DescriptorSecretKey
|
- `derive(DerivationPath)`, derives and returns child DescriptorSecretKey
|
||||||
- `extend(DerivationPath)`, extends and returns DescriptorSecretKey
|
- `extend(DerivationPath)`, extends and returns DescriptorSecretKey
|
||||||
- `as_public()`, returns DescriptorSecretKey as DescriptorPublicKey
|
- `as_public()`, returns DescriptorSecretKey as DescriptorPublicKey
|
||||||
@@ -183,8 +200,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
[BIP 0174]:https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#encoding
|
[BIP 0174]:https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#encoding
|
||||||
|
|
||||||
## [v0.2.0]
|
[v0.28.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.27.1...v0.28.0
|
||||||
|
|
||||||
[v0.27.1]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.26.0...v0.27.1
|
[v0.27.1]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.26.0...v0.27.1
|
||||||
[v0.26.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.25.0...v0.26.0
|
[v0.26.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.25.0...v0.26.0
|
||||||
[v0.25.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.11.0...v0.25.0
|
[v0.25.0]: https://github.com/bitcoindevkit/bdk-ffi/compare/v0.11.0...v0.25.0
|
||||||
|
|||||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -147,7 +147,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bdk-ffi"
|
name = "bdk-ffi"
|
||||||
version = "0.28.0"
|
version = "0.29.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"assert_matches",
|
"assert_matches",
|
||||||
"bdk",
|
"bdk",
|
||||||
|
|||||||
@@ -489,6 +489,9 @@ class Wallet(
|
|||||||
*/
|
*/
|
||||||
fun getInternalAddress(addressIndex: AddressIndex): AddressInfo {}
|
fun getInternalAddress(addressIndex: AddressIndex): AddressInfo {}
|
||||||
|
|
||||||
|
/** Return whether or not a script is part of this wallet (either internal or external). */
|
||||||
|
fun isMine(script: Script): Boolean {}
|
||||||
|
|
||||||
/** Return the wallet's balance, across different categories. See [Balance] for the categories. Note that this method only operates on the internal database, which first needs to be [Wallet.sync] manually. */
|
/** Return the wallet's balance, across different categories. See [Balance] for the categories. Note that this method only operates on the internal database, which first needs to be [Wallet.sync] manually. */
|
||||||
fun getBalance(): Balance {}
|
fun getBalance(): Balance {}
|
||||||
|
|
||||||
@@ -826,7 +829,10 @@ data class TxBuilderResult (
|
|||||||
/**
|
/**
|
||||||
* A bitcoin script.
|
* A bitcoin script.
|
||||||
*/
|
*/
|
||||||
class Script(rawOutputScript: List<UByte>)
|
class Script(rawOutputScript: List<UByte>) {
|
||||||
|
/** Return the script as bytes. */
|
||||||
|
fun toBytes(): List<UByte> {}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A bitcoin address.
|
* A bitcoin address.
|
||||||
|
|||||||
@@ -54,19 +54,23 @@ _Note that Kotlin version `1.6.10` or later is required to build the library._
|
|||||||
```shell
|
```shell
|
||||||
git clone https://github.com/bitcoindevkit/bdk-ffi
|
git clone https://github.com/bitcoindevkit/bdk-ffi
|
||||||
```
|
```
|
||||||
2. Follow the "General" bdk-ffi ["Getting Started (Developer)"] instructions.
|
2. Follow the "General" bdk-ffi ["Getting Started (Developer)"] instructions.
|
||||||
3. If building on macOS install required intel and m1 jvm targets
|
3. Install Rust (note that we are currently building using Rust 1.67.0):
|
||||||
|
```shell
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||||
|
rustup default 1.67.0
|
||||||
|
```
|
||||||
4. Install required targets
|
4. Install required targets
|
||||||
```sh
|
```sh
|
||||||
rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi
|
rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi
|
||||||
```
|
```
|
||||||
5. Install Android SDK and Build-Tools for API level 30+
|
5. Install Android SDK and Build-Tools for API level 30+
|
||||||
6. Setup `$ANDROID_SDK_ROOT` and `$ANDROID_NDK_ROOT` path variables (which are required by the
|
6. Setup `$ANDROID_SDK_ROOT` and `$ANDROID_NDK_ROOT` path variables (which are required by the
|
||||||
build tool), for example (NDK major version 21 is required):
|
build tool), for example (note that currently, NDK version 21.4.7075529 is required):
|
||||||
```shell
|
```shell
|
||||||
export ANDROID_SDK_ROOT=~/Android/Sdk
|
export ANDROID_SDK_ROOT=~/Android/Sdk
|
||||||
export ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/21.<NDK_VERSION>
|
export ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/21.4.7075529
|
||||||
```
|
```
|
||||||
7. Build kotlin bindings
|
7. Build kotlin bindings
|
||||||
```sh
|
```sh
|
||||||
# build Android library
|
# build Android library
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ org.gradle.jvmargs=-Xmx1536m
|
|||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
libraryVersion=0.28.0
|
libraryVersion=0.29.0
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "bdk-ffi"
|
name = "bdk-ffi"
|
||||||
version = "0.28.0"
|
version = "0.29.0"
|
||||||
authors = ["Steve Myers <steve@notmandatory.org>", "Sudarsan Balaji <sudarsan.balaji@artfuldev.com>"]
|
authors = ["Steve Myers <steve@notmandatory.org>", "Sudarsan Balaji <sudarsan.balaji@artfuldev.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
crate-type = ["lib", "staticlib", "cdylib"]
|
crate-type = ["lib", "staticlib", "cdylib"]
|
||||||
#crate-type = ["staticlib", "cdylib"]
|
|
||||||
#crate-type = ["cdylib"]
|
|
||||||
name = "bdkffi"
|
name = "bdkffi"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
|
|||||||
@@ -221,28 +221,31 @@ interface Wallet {
|
|||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
constructor(Descriptor descriptor, Descriptor? change_descriptor, Network network, DatabaseConfig database_config);
|
constructor(Descriptor descriptor, Descriptor? change_descriptor, Network network, DatabaseConfig database_config);
|
||||||
|
|
||||||
|
Network network();
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
AddressInfo get_address(AddressIndex address_index);
|
AddressInfo get_address(AddressIndex address_index);
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
AddressInfo get_internal_address(AddressIndex address_index);
|
AddressInfo get_internal_address(AddressIndex address_index);
|
||||||
|
|
||||||
|
[Throws=BdkError]
|
||||||
|
boolean is_mine(Script script);
|
||||||
|
|
||||||
|
[Throws=BdkError]
|
||||||
|
sequence<LocalUtxo> list_unspent();
|
||||||
|
|
||||||
|
[Throws=BdkError]
|
||||||
|
sequence<TransactionDetails> list_transactions(boolean include_raw);
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
Balance get_balance();
|
Balance get_balance();
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
boolean sign([ByRef] PartiallySignedTransaction psbt, SignOptions? sign_options);
|
boolean sign([ByRef] PartiallySignedTransaction psbt, SignOptions? sign_options);
|
||||||
|
|
||||||
[Throws=BdkError]
|
|
||||||
sequence<TransactionDetails> list_transactions(boolean include_raw);
|
|
||||||
|
|
||||||
Network network();
|
|
||||||
|
|
||||||
[Throws=BdkError]
|
[Throws=BdkError]
|
||||||
void sync([ByRef] Blockchain blockchain, Progress? progress);
|
void sync([ByRef] Blockchain blockchain, Progress? progress);
|
||||||
|
|
||||||
[Throws=BdkError]
|
|
||||||
sequence<LocalUtxo> list_unspent();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
interface FeeRate {
|
interface FeeRate {
|
||||||
@@ -493,4 +496,6 @@ enum WitnessVersion {
|
|||||||
|
|
||||||
interface Script {
|
interface Script {
|
||||||
constructor(sequence<u8> raw_output_script);
|
constructor(sequence<u8> raw_output_script);
|
||||||
|
|
||||||
|
sequence<u8> to_bytes();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -438,6 +438,10 @@ impl Script {
|
|||||||
let script: BdkScript = BdkScript::from(raw_output_script);
|
let script: BdkScript = BdkScript::from(raw_output_script);
|
||||||
Script { script }
|
Script { script }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn to_bytes(&self) -> Vec<u8> {
|
||||||
|
self.script.to_bytes()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<BdkScript> for Script {
|
impl From<BdkScript> for Script {
|
||||||
|
|||||||
@@ -65,6 +65,11 @@ impl Wallet {
|
|||||||
self.get_wallet().network()
|
self.get_wallet().network()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Return whether or not a script is part of this wallet (either internal or external).
|
||||||
|
pub(crate) fn is_mine(&self, script: Arc<Script>) -> Result<bool, BdkError> {
|
||||||
|
self.get_wallet().is_mine(&script.script)
|
||||||
|
}
|
||||||
|
|
||||||
/// Sync the internal database with the blockchain.
|
/// Sync the internal database with the blockchain.
|
||||||
pub(crate) fn sync(
|
pub(crate) fn sync(
|
||||||
&self,
|
&self,
|
||||||
@@ -560,9 +565,13 @@ impl BumpFeeTxBuilder {
|
|||||||
mod test {
|
mod test {
|
||||||
use crate::database::DatabaseConfig;
|
use crate::database::DatabaseConfig;
|
||||||
use crate::descriptor::Descriptor;
|
use crate::descriptor::Descriptor;
|
||||||
|
use crate::keys::{DescriptorSecretKey, Mnemonic};
|
||||||
use crate::wallet::{AddressIndex, TxBuilder, Wallet};
|
use crate::wallet::{AddressIndex, TxBuilder, Wallet};
|
||||||
|
use crate::Script;
|
||||||
|
use assert_matches::assert_matches;
|
||||||
use bdk::bitcoin::{Address, Network};
|
use bdk::bitcoin::{Address, Network};
|
||||||
use bdk::wallet::get_funded_wallet;
|
use bdk::wallet::get_funded_wallet;
|
||||||
|
use bdk::KeychainKind;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
||||||
@@ -802,4 +811,47 @@ mod test {
|
|||||||
"bcrt1qaux734vuhykww9632v8cmdnk7z2mw5lsf74v6k"
|
"bcrt1qaux734vuhykww9632v8cmdnk7z2mw5lsf74v6k"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_is_mine() {
|
||||||
|
// is_mine should return true for addresses generated by the wallet
|
||||||
|
let mnemonic: Mnemonic = Mnemonic::from_string("chaos fabric time speed sponsor all flat solution wisdom trophy crack object robot pave observe combine where aware bench orient secret primary cable detect".to_string()).unwrap();
|
||||||
|
let secret_key: DescriptorSecretKey =
|
||||||
|
DescriptorSecretKey::new(Network::Testnet, Arc::new(mnemonic), None);
|
||||||
|
let descriptor: Descriptor = Descriptor::new_bip84(
|
||||||
|
Arc::new(secret_key),
|
||||||
|
KeychainKind::External,
|
||||||
|
Network::Testnet,
|
||||||
|
);
|
||||||
|
let wallet: Wallet = Wallet::new(
|
||||||
|
Arc::new(descriptor),
|
||||||
|
None,
|
||||||
|
Network::Testnet,
|
||||||
|
DatabaseConfig::Memory,
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let address = wallet.get_address(AddressIndex::New).unwrap();
|
||||||
|
let script: Arc<Script> = address.address.script_pubkey();
|
||||||
|
|
||||||
|
let is_mine_1: bool = wallet.is_mine(script).unwrap();
|
||||||
|
assert!(is_mine_1);
|
||||||
|
|
||||||
|
// is_mine returns false when provided a script that is not in the wallet
|
||||||
|
let other_wpkh = "wpkh(tprv8hwWMmPE4BVNxGdVt3HhEERZhondQvodUY7Ajyseyhudr4WabJqWKWLr4Wi2r26CDaNCQhhxEftEaNzz7dPGhWuKFU4VULesmhEfZYyBXdE/0/*)";
|
||||||
|
let other_descriptor = Descriptor::new(other_wpkh.to_string(), Network::Testnet).unwrap();
|
||||||
|
|
||||||
|
let other_wallet = Wallet::new(
|
||||||
|
Arc::new(other_descriptor),
|
||||||
|
None,
|
||||||
|
Network::Testnet,
|
||||||
|
DatabaseConfig::Memory,
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let other_address = other_wallet.get_address(AddressIndex::New).unwrap();
|
||||||
|
let other_script: Arc<Script> = other_address.address.script_pubkey();
|
||||||
|
let is_mine_2: bool = wallet.is_mine(other_script).unwrap();
|
||||||
|
assert_matches!(is_mine_2, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# bdk-android
|
# bdk-jvm
|
||||||
This project builds a .jar package for the JVM platform that provide Kotlin language bindings for the [`bdk`] library. The Kotlin language bindings are created by the `bdk-ffi` project which is included in the root of this repository.
|
This project builds a .jar package for the JVM platform that provide Kotlin language bindings for the [`bdk`] library. The Kotlin language bindings are created by the `bdk-ffi` project which is included in the root of this repository.
|
||||||
|
|
||||||
## How to Use
|
## How to Use
|
||||||
@@ -43,27 +43,34 @@ dependencies {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Example Projects
|
## Example Projects
|
||||||
* [Tatooine Faucet](https://github.com/thunderbiscuit/tatooine)
|
* [Tatooine Faucet](https://github.com/thunderbiscuit/tatooine)
|
||||||
|
|
||||||
## How to build
|
## How to build
|
||||||
_Note that Kotlin version `1.6.10` or later is required to build the library._
|
_Note that Kotlin version `1.6.10` or later is required to build the library._
|
||||||
|
1. Install JDK 11. It must be version 11 (not 17), otherwise it won't build. For example, with SDKMAN!:
|
||||||
1. Clone this repository.
|
```shell
|
||||||
|
curl -s "https://get.sdkman.io" | bash
|
||||||
|
source "$HOME/.sdkman/bin/sdkman-init.sh"
|
||||||
|
sdk install java 11.0.19-tem
|
||||||
|
```
|
||||||
|
2. Install Rust (note that we are currently building using Rust 1.67.0):
|
||||||
|
```shell
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||||
|
rustup default 1.67.0
|
||||||
|
```
|
||||||
|
3. Clone this repository.
|
||||||
```shell
|
```shell
|
||||||
git clone https://github.com/bitcoindevkit/bdk-ffi
|
git clone https://github.com/bitcoindevkit/bdk-ffi
|
||||||
```
|
```
|
||||||
2. Follow the "General" bdk-ffi ["Getting Started (Developer)"] instructions.
|
4. If building on macOS install required intel and m1 jvm targets
|
||||||
3. If building on macOS install required intel and m1 jvm targets
|
|
||||||
```sh
|
```sh
|
||||||
rustup target add x86_64-apple-darwin aarch64-apple-darwin
|
rustup target add x86_64-apple-darwin aarch64-apple-darwin
|
||||||
```
|
```
|
||||||
4. Build kotlin bindings
|
5. Build kotlin bindings
|
||||||
```sh
|
```sh
|
||||||
# build JVM library
|
./gradlew buildJvmLib
|
||||||
./gradlew buildJvmLib
|
```
|
||||||
```
|
|
||||||
|
|
||||||
## How to publish to your local Maven repo
|
## How to publish to your local Maven repo
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
org.gradle.jvmargs=-Xmx1536m
|
org.gradle.jvmargs=-Xmx1536m
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
libraryVersion=0.28.0
|
libraryVersion=0.29.2
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_11
|
||||||
withSourcesJar()
|
withSourcesJar()
|
||||||
withJavadocJar()
|
withJavadocJar()
|
||||||
}
|
}
|
||||||
@@ -107,4 +107,8 @@ signing {
|
|||||||
// binaries before running the tests
|
// binaries before running the tests
|
||||||
tasks.withType<KotlinCompile> {
|
tasks.withType<KotlinCompile> {
|
||||||
dependsOn("buildJvmLib")
|
dependsOn("buildJvmLib")
|
||||||
|
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "11"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,13 @@ package org.bitcoindevkit.plugins
|
|||||||
val operatingSystem: OS = when {
|
val operatingSystem: OS = when {
|
||||||
System.getProperty("os.name").contains("mac", ignoreCase = true) -> OS.MAC
|
System.getProperty("os.name").contains("mac", ignoreCase = true) -> OS.MAC
|
||||||
System.getProperty("os.name").contains("linux", ignoreCase = true) -> OS.LINUX
|
System.getProperty("os.name").contains("linux", ignoreCase = true) -> OS.LINUX
|
||||||
|
System.getProperty("os.name").contains("windows", ignoreCase = true) -> OS.WINDOWS
|
||||||
else -> OS.OTHER
|
else -> OS.OTHER
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class OS {
|
enum class OS {
|
||||||
MAC,
|
MAC,
|
||||||
LINUX,
|
LINUX,
|
||||||
|
WINDOWS,
|
||||||
OTHER,
|
OTHER,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,13 +27,20 @@ internal class UniFfiJvmPlugin : Plugin<Project> {
|
|||||||
val cargoArgs: List<String> = listOf("build", "--profile", "release-smaller", "--target", "aarch64-apple-darwin")
|
val cargoArgs: List<String> = listOf("build", "--profile", "release-smaller", "--target", "aarch64-apple-darwin")
|
||||||
args(cargoArgs)
|
args(cargoArgs)
|
||||||
}
|
}
|
||||||
} else if(operatingSystem == OS.LINUX) {
|
} else if (operatingSystem == OS.LINUX) {
|
||||||
exec {
|
exec {
|
||||||
workingDir("${project.projectDir}/../../bdk-ffi")
|
workingDir("${project.projectDir}/../../bdk-ffi")
|
||||||
executable("cargo")
|
executable("cargo")
|
||||||
val cargoArgs: List<String> = listOf("build", "--profile", "release-smaller", "--target", "x86_64-unknown-linux-gnu")
|
val cargoArgs: List<String> = listOf("build", "--profile", "release-smaller", "--target", "x86_64-unknown-linux-gnu")
|
||||||
args(cargoArgs)
|
args(cargoArgs)
|
||||||
}
|
}
|
||||||
|
} else if (operatingSystem == OS.WINDOWS) {
|
||||||
|
exec {
|
||||||
|
workingDir("${project.projectDir}/../../bdk-ffi")
|
||||||
|
executable("cargo")
|
||||||
|
val cargoArgs: List<String> = listOf("build", "--profile", "release-smaller", "--target", "x86_64-pc-windows-msvc")
|
||||||
|
args(cargoArgs)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,13 +77,25 @@ internal class UniFfiJvmPlugin : Plugin<Project> {
|
|||||||
ext = "so"
|
ext = "so"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
} else if (operatingSystem == OS.WINDOWS) {
|
||||||
|
libsToCopy.add(
|
||||||
|
CopyMetadata(
|
||||||
|
targetDir = "x86_64-pc-windows-msvc",
|
||||||
|
resDir = "win32-x86-64",
|
||||||
|
ext = "dll"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
val libName = when (operatingSystem) {
|
||||||
|
OS.WINDOWS -> "bdkffi"
|
||||||
|
else -> "libbdkffi"
|
||||||
}
|
}
|
||||||
|
|
||||||
libsToCopy.forEach {
|
libsToCopy.forEach {
|
||||||
doFirst {
|
doFirst {
|
||||||
copy {
|
copy {
|
||||||
with(it) {
|
with(it) {
|
||||||
from("${project.projectDir}/../../target/${this.targetDir}/release-smaller/libbdkffi.${this.ext}")
|
from("${project.projectDir}/../../target/${this.targetDir}/release-smaller/${libName}.${this.ext}")
|
||||||
into("${project.projectDir}/../../bdk-jvm/lib/src/main/resources/${this.resDir}/")
|
into("${project.projectDir}/../../bdk-jvm/lib/src/main/resources/${this.resDir}/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
include ./src/bdkpython/libbdkffi.dylib
|
include ./src/bdkpython/libbdkffi.dylib
|
||||||
include ./src/bdkpython/libbdkffi.so
|
include ./src/bdkpython/libbdkffi.so
|
||||||
|
include ./src/bdkpython/bdkffi.dll
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ pip install bdkpython
|
|||||||
## Run the tests
|
## Run the tests
|
||||||
```shell
|
```shell
|
||||||
pip install --requirement requirements.txt
|
pip install --requirement requirements.txt
|
||||||
bash ./generate.sh
|
bash ./scripts/generate-linux.sh # here you should run the script appropriate for your platform
|
||||||
python setup.py bdist_wheel --verbose
|
python setup.py bdist_wheel --verbose
|
||||||
pip install ./dist/bdkpython-<yourversion>-py3-none-any.whl --force-reinstall
|
pip install ./dist/bdkpython-<yourversion>.whl --force-reinstall
|
||||||
python -m unittest --verbose tests/test_bdk.py
|
python -m unittest --verbose tests/test_bdk.py
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -23,26 +23,14 @@ python -m unittest --verbose tests/test_bdk.py
|
|||||||
# Install dependencies
|
# Install dependencies
|
||||||
pip install --requirement requirements.txt
|
pip install --requirement requirements.txt
|
||||||
|
|
||||||
# Generate the bindings
|
# Generate the bindings (use the script appropriate for your platform)
|
||||||
bash generate.sh
|
bash ./scripts/generate-linux.sh
|
||||||
|
|
||||||
# Build the wheel
|
# Build the wheel
|
||||||
python setup.py --verbose bdist_wheel
|
python setup.py --verbose bdist_wheel
|
||||||
```
|
```
|
||||||
|
|
||||||
## Run tox to build and test locally
|
|
||||||
```shell
|
|
||||||
# install dev requirements
|
|
||||||
pip install --requirement requirements-dev.txt
|
|
||||||
|
|
||||||
# build bindings glue code (located at ./src/bdkpython/bdk.py)
|
|
||||||
source ./generate.sh
|
|
||||||
|
|
||||||
# build and test
|
|
||||||
tox -vv
|
|
||||||
```
|
|
||||||
|
|
||||||
## Install locally
|
## Install locally
|
||||||
```shell
|
```shell
|
||||||
pip install ./dist/bdkpython-<yourversion>-py3-none-any.whl
|
pip install ./dist/bdkpython-<yourversion>.whl
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
OS=$(uname -s)
|
|
||||||
|
|
||||||
echo "Generating bdk.py..."
|
|
||||||
cd ../bdk-ffi/
|
|
||||||
cargo run --bin uniffi-bindgen generate src/bdk.udl --language python --out-dir ../bdk-python/src/bdkpython/ --no-format
|
|
||||||
|
|
||||||
echo "Generating native binaries..."
|
|
||||||
cargo build --profile release-smaller
|
|
||||||
case $OS in
|
|
||||||
"Darwin")
|
|
||||||
echo "Copying macOS libbdkffi.dylib..."
|
|
||||||
cp ../target/release-smaller/libbdkffi.dylib ../bdk-python/src/bdkpython/libbdkffi.dylib
|
|
||||||
;;
|
|
||||||
"Linux")
|
|
||||||
echo "Copying linux libbdkffi.so..."
|
|
||||||
cp ../target/release-smaller/libbdkffi.so ../bdk-python/src/bdkpython/libbdkffi.so
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
cd ../bdk-python/
|
|
||||||
|
|
||||||
echo "All done!"
|
|
||||||
18
bdk-python/scripts/generate-linux.sh
Normal file
18
bdk-python/scripts/generate-linux.sh
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
${PYBIN}/python --version
|
||||||
|
${PYBIN}/pip install -r requirements.txt
|
||||||
|
|
||||||
|
echo "Generating bdk.py..."
|
||||||
|
cd ../bdk-ffi/
|
||||||
|
cargo run --bin uniffi-bindgen generate src/bdk.udl --language python --out-dir ../bdk-python/src/bdkpython/ --no-format
|
||||||
|
|
||||||
|
echo "Generating native binaries..."
|
||||||
|
rustup default 1.67.0
|
||||||
|
cargo build --profile release-smaller
|
||||||
|
|
||||||
|
echo "Copying linux libbdkffi.so..."
|
||||||
|
cp ../target/release-smaller/libbdkffi.so ../bdk-python/src/bdkpython/libbdkffi.so
|
||||||
|
|
||||||
|
echo "All done!"
|
||||||
19
bdk-python/scripts/generate-macos-arm64.sh
Normal file
19
bdk-python/scripts/generate-macos-arm64.sh
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
python3 --version
|
||||||
|
pip install --user -r requirements.txt
|
||||||
|
|
||||||
|
echo "Generating bdk.py..."
|
||||||
|
cd ../bdk-ffi/
|
||||||
|
cargo run --bin uniffi-bindgen generate src/bdk.udl --language python --out-dir ../bdk-python/src/bdkpython/ --no-format
|
||||||
|
|
||||||
|
echo "Generating native binaries..."
|
||||||
|
rustup default 1.67.0
|
||||||
|
rustup target add aarch64-apple-darwin
|
||||||
|
cargo build --profile release-smaller --target aarch64-apple-darwin
|
||||||
|
|
||||||
|
echo "Copying libraries libbdkffi.dylib..."
|
||||||
|
cp ../target/aarch64-apple-darwin/release-smaller/libbdkffi.dylib ../bdk-python/src/bdkpython/libbdkffi.dylib
|
||||||
|
|
||||||
|
echo "All done!"
|
||||||
18
bdk-python/scripts/generate-macos-x86_64.sh
Normal file
18
bdk-python/scripts/generate-macos-x86_64.sh
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
python3 --version
|
||||||
|
pip install --user -r requirements.txt
|
||||||
|
|
||||||
|
echo "Generating bdk.py..."
|
||||||
|
cd ../bdk-ffi/
|
||||||
|
cargo run --bin uniffi-bindgen generate src/bdk.udl --language python --out-dir ../bdk-python/src/bdkpython/ --no-format
|
||||||
|
|
||||||
|
echo "Generating native binaries..."
|
||||||
|
rustup target add x86_64-apple-darwin
|
||||||
|
cargo build --profile release-smaller --target x86_64-apple-darwin
|
||||||
|
|
||||||
|
echo "Copying libraries libbdkffi.dylib..."
|
||||||
|
cp ../target/x86_64-apple-darwin/release-smaller/libbdkffi.dylib ../bdk-python/src/bdkpython/libbdkffi.dylib
|
||||||
|
|
||||||
|
echo "All done!"
|
||||||
19
bdk-python/scripts/generate-windows.sh
Normal file
19
bdk-python/scripts/generate-windows.sh
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
python3 --version
|
||||||
|
pip install --user -r requirements.txt
|
||||||
|
|
||||||
|
echo "Generating bdk.py..."
|
||||||
|
cd ../bdk-ffi/
|
||||||
|
cargo run --bin uniffi-bindgen generate src/bdk.udl --language python --out-dir ../bdk-python/src/bdkpython/ --no-format
|
||||||
|
|
||||||
|
echo "Generating native binaries..."
|
||||||
|
rustup default 1.67.0
|
||||||
|
rustup target add x86_64-pc-windows-msvc
|
||||||
|
cargo build --profile release-smaller --target x86_64-pc-windows-msvc
|
||||||
|
|
||||||
|
echo "Copying libraries bdkffi.dll..."
|
||||||
|
cp ../target/x86_64-pc-windows-msvc/release-smaller/bdkffi.dll ../bdk-python/src/bdkpython/bdkffi.dll
|
||||||
|
|
||||||
|
echo "All done!"
|
||||||
@@ -51,7 +51,7 @@ print(f"Wallet balance is: {balance.total}")
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="bdkpython",
|
name="bdkpython",
|
||||||
version="0.28.0",
|
version="0.29.1",
|
||||||
description="The Python language bindings for the Bitcoin Development Kit",
|
description="The Python language bindings for the Bitcoin Development Kit",
|
||||||
long_description=LONG_DESCRIPTION,
|
long_description=LONG_DESCRIPTION,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
@@ -62,4 +62,7 @@ setup(
|
|||||||
url="https://github.com/bitcoindevkit/bdk-ffi",
|
url="https://github.com/bitcoindevkit/bdk-ffi",
|
||||||
author="Alekos Filini <alekos.filini@gmail.com>, Steve Myers <steve@notmandatory.org>",
|
author="Alekos Filini <alekos.filini@gmail.com>, Steve Myers <steve@notmandatory.org>",
|
||||||
license="MIT or Apache 2.0",
|
license="MIT or Apache 2.0",
|
||||||
|
# This is required to ensure the library name includes the python version, abi, and platform tags
|
||||||
|
# See issue #350 for more information
|
||||||
|
has_ext_modules=lambda: True,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ let package = Package(
|
|||||||
.binaryTarget(name: "bdkFFI", path: "./bdkFFI.xcframework"),
|
.binaryTarget(name: "bdkFFI", path: "./bdkFFI.xcframework"),
|
||||||
.target(
|
.target(
|
||||||
name: "BitcoinDevKit",
|
name: "BitcoinDevKit",
|
||||||
dependencies: ["bdkFFI"]),
|
dependencies: ["bdkFFI"],
|
||||||
|
swiftSettings: [.unsafeFlags(["-suppress-warnings"])]
|
||||||
|
),
|
||||||
.testTarget(
|
.testTarget(
|
||||||
name: "BitcoinDevKitTests",
|
name: "BitcoinDevKitTests",
|
||||||
dependencies: ["BitcoinDevKit"]),
|
dependencies: ["BitcoinDevKit"]),
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
#
|
#
|
||||||
# Run the script from the repo root directory, ie: ./bdk-swift/build-local-swift.sh
|
# Run the script from the repo root directory, ie: ./bdk-swift/build-local-swift.sh
|
||||||
|
|
||||||
rustup install nightly-x86_64-apple-darwin
|
rustup install nightly-2023-04-10
|
||||||
rustup component add rust-src --toolchain nightly-x86_64-apple-darwin
|
rustup component add rust-src --toolchain nightly-2023-04-10
|
||||||
rustup target add aarch64-apple-ios x86_64-apple-ios
|
rustup target add aarch64-apple-ios x86_64-apple-ios
|
||||||
rustup target add aarch64-apple-ios-sim --toolchain nightly
|
rustup target add aarch64-apple-ios-sim --toolchain nightly-2023-04-10
|
||||||
rustup target add aarch64-apple-darwin x86_64-apple-darwin
|
rustup target add aarch64-apple-darwin x86_64-apple-darwin
|
||||||
|
|
||||||
pushd bdk-ffi
|
pushd bdk-ffi
|
||||||
@@ -20,10 +20,10 @@ cargo build --package bdk-ffi --profile release-smaller --target x86_64-apple-da
|
|||||||
cargo build --package bdk-ffi --profile release-smaller --target aarch64-apple-darwin
|
cargo build --package bdk-ffi --profile release-smaller --target aarch64-apple-darwin
|
||||||
cargo build --package bdk-ffi --profile release-smaller --target x86_64-apple-ios
|
cargo build --package bdk-ffi --profile release-smaller --target x86_64-apple-ios
|
||||||
cargo build --package bdk-ffi --profile release-smaller --target aarch64-apple-ios
|
cargo build --package bdk-ffi --profile release-smaller --target aarch64-apple-ios
|
||||||
cargo +nightly build --package bdk-ffi --release -Z build-std --target aarch64-apple-ios-sim
|
cargo +nightly-2023-04-10 build --package bdk-ffi --profile release-smaller --target aarch64-apple-ios-sim
|
||||||
|
|
||||||
mkdir -p target/lipo-ios-sim/release-smaller
|
mkdir -p target/lipo-ios-sim/release-smaller
|
||||||
lipo target/aarch64-apple-ios-sim/release/libbdkffi.a target/x86_64-apple-ios/release-smaller/libbdkffi.a -create -output target/lipo-ios-sim/release-smaller/libbdkffi.a
|
lipo target/aarch64-apple-ios-sim/release-smaller/libbdkffi.a target/x86_64-apple-ios/release-smaller/libbdkffi.a -create -output target/lipo-ios-sim/release-smaller/libbdkffi.a
|
||||||
mkdir -p target/lipo-macos/release-smaller
|
mkdir -p target/lipo-macos/release-smaller
|
||||||
lipo target/aarch64-apple-darwin/release-smaller/libbdkffi.a target/x86_64-apple-darwin/release-smaller/libbdkffi.a -create -output target/lipo-macos/release-smaller/libbdkffi.a
|
lipo target/aarch64-apple-darwin/release-smaller/libbdkffi.a target/x86_64-apple-darwin/release-smaller/libbdkffi.a -create -output target/lipo-macos/release-smaller/libbdkffi.a
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user