Skip to content

Commit 330579f

Browse files
authored
Merge pull request #94 from tnull/2023-01-update-readme
Update README for 0.0.113
2 parents 4077653 + 2baf2e0 commit 330579f

File tree

1 file changed

+12
-29
lines changed

1 file changed

+12
-29
lines changed

README.md

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Automatic Swift bindings generation for [`rust-lightning`](https://github.com/li
77
### Swift Package Manager
88
To install using Swift Package Manager, add the following line to the depedencies array of your `Package.swift`:
99
```
10-
.package(url: "https://github.com/lightningdevkit/ldk-swift/", exact: "0.0.110")
10+
.package(url: "https://github.com/lightningdevkit/ldk-swift/", exact: "0.0.113")
1111
```
1212
Be sure to also include "LightningDevKit" into your packages target like so:
1313

@@ -36,9 +36,10 @@ from scratch.
3636
### Prerequisites
3737

3838
- A machine running macOS
39-
- [Xcode 13.2.1](https://xcodereleases.com/) or lower (this is because there is a bug with `cc` that prevents it from compiling for Mac Catalyst targets with clang 13)
39+
- [Xcode](https://xcodereleases.com/)
4040
- [Python3](https://programwithus.com/learn/python/install-python3-mac)
4141
- [Rust](https://www.rust-lang.org/tools/install)
42+
- [NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
4243
- [GNU sed](https://formulae.brew.sh/formula/gnu-sed) (optional, but will cut your compile times significantly!)
4344

4445
For Rust specifically, there are a couple additional requirements that can be installed once the Rust toolchain
@@ -57,13 +58,13 @@ In order to generate these bindings from scratch, you will need to clone two dep
5758
**[rust-lightning](https://github.com/lightningdevkit/rust-lightning)**, (a specific branch built for bindings compatibility):
5859

5960
```shell
60-
git clone --branch 2022-10-112-java-bindings https://github.com/TheBlueMatt/rust-lightning /path/to/rust-lightning
61+
git clone --branch 2022-12-0.0.113-java-bindings https://github.com/TheBlueMatt/rust-lightning /path/to/rust-lightning
6162
```
6263

6364
**[ldk-c-bindings](https://github.com/lightningdevkit/ldk-c-bindings)**:
6465

6566
```shell
66-
git clone --branch v0.0.112.0 https://github.com/lightningdevkit/ldk-c-bindings /path/to/ldk-c-bindings
67+
git clone --branch v0.0.113.1 https://github.com/lightningdevkit/ldk-c-bindings /path/to/ldk-c-bindings
6768
```
6869

6970
Take note of where you clone these directories, it's best you save the absolute path somewhere handy for the rest of the remaining steps.
@@ -94,11 +95,11 @@ folder due to the previous `genbindings.sh` step. As Docker won't have access to
9495
replace those lines with the following:
9596

9697
```yaml
97-
lightning = { git = "https://github.com/thebluematt/rust-lightning", branch = "2022-07-109-java-bindings", default-features = false }
98-
lightning-persister = { git = "https://github.com/thebluematt/rust-lightning", branch = "2022-07-109-java-bindings", default-features = false }
99-
lightning-invoice = { git = "https://github.com/thebluematt/rust-lightning", branch = "2022-07-109-java-bindings", default-features = false }
100-
lightning-background-processor = { git = "https://github.com/thebluematt/rust-lightning", branch = "2022-07-109-java-bindings", default-features = false }
101-
lightning-rapid-gossip-sync = { git = "https://github.com/thebluematt/rust-lightning", branch = "2022-07-109-java-bindings", default-features = false }
98+
lightning = { git = "https://github.com/thebluematt/rust-lightning", branch = "2022-12-0.0.113-java-bindings", default-features = false }
99+
lightning-persister = { git = "https://github.com/thebluematt/rust-lightning", branch = "2022-12-0.0.113-java-bindings", default-features = false }
100+
lightning-invoice = { git = "https://github.com/thebluematt/rust-lightning", branch = "2022-12-0.0.113-java-bindings", default-features = false }
101+
lightning-background-processor = { git = "https://github.com/thebluematt/rust-lightning", branch = "2022-12-0.0.113-java-bindings", default-features = false }
102+
lightning-rapid-gossip-sync = { git = "https://github.com/thebluematt/rust-lightning", branch = "2022-12-0.0.113-java-bindings", default-features = false }
102103
```
103104

104105
You will note that the revision is unspecified and is currently just placeholder `xxx`s. To obtain the revision,
@@ -119,29 +120,11 @@ To generate the Swift files, navigate to the `ldk-swift` repository and run the
119120

120121
```shell
121122
export LDK_SWIFT_GENERATOR_INPUT_HEADER_PATH="/path/to/ldk-c-bindings/lightning-c-bindings/include/lightning.h"
122-
python3 ./
123+
npm i && npm run tsc && node ./src/index.mjs
123124
```
124125

125126
Now, the contents of `./ci/LDKSwift/Sources/LDKSwift/bindings` will have been completely regenerated.
126127

127-
### Preparing the correct Xcode version
128-
129-
To make sure the next two steps work correctly, you need to verify that you're using Xcode 13.2.1.
130-
If you have a later version, you can download the correct version from here: https://xcodereleases.com/
131-
132-
The direct download link is
133-
134-
https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_13.2.1/Xcode_13.2.1.xip
135-
136-
You may be asked to log in to your Apple developer account.
137-
138-
After downloading the correct Xcode version and copying it to Applications, you might also need to run
139-
the following command with root privileges:
140-
141-
```shell
142-
sudo xcode-select -s /Applications/Xcode\ 13.2.1.app/Contents/Developer/
143-
```
144-
145128
#### Updating Swift files in Xcode project
146129

147130
To make sure the correct bindings files are referenced in the project, open `./xcode/LDKFramework/LDK.xcodeproj`.
@@ -162,7 +145,7 @@ Finally, make sure you leave the "Copy items if needed" box unchecked, and pick
162145

163146
### Building requisite binaries
164147

165-
Navigate (`cd`) to the `./src/scripts` folder, and run the following Python script:
148+
Navigate (`cd`) to the `./scripts` folder, and run the following Python script:
166149

167150
```shell
168151
python3 ./build_bulk_libldks.py /path/to/ldk-c-bindings

0 commit comments

Comments
 (0)