Last active
August 19, 2021 09:05
Revisions
-
notmandatory revised this gist
Aug 19, 2021 . 1 changed file with 10 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,8 +3,16 @@ ## Build LDK C bindings 1. Clone `rust-lightning` git repo2. 2. Install `clang-12` and set it as the default version linux [Ubuntu install](https://apt.llvm.org/) and set it as the [default version](http://manpages.ubuntu.com/manpages/focal/en/man1/update-alternatives.1.html) macos ``` brew install llvm ``` 4. Install rust-src linux ``` @@ -22,9 +30,6 @@ 5. Check `genbindings.out` for any warning or error messages ## Build LDK java bindings 1. Install open JDK 11 and maven -
notmandatory revised this gist
Aug 19, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,7 @@ 1. Clone `rust-lightning` git repo2. 2. [Install `clang-12`] and set it as the [default version] 3. Install rust-src linux ``` rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu -
notmandatory revised this gist
Aug 19, 2021 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,9 +5,15 @@ 1. Clone `rust-lightning` git repo2. 2. [Install `clang-12`] and set it as the [default version] 3. Install rust-src linux ``` rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu ``` macos ``` rustup component add rust-src --toolchain nightly-x86_64-apple-darwin ``` 4. Run script to build bindings ``` ./genbindings.sh ../rust-lightning true >& genbindings.out -
notmandatory revised this gist
Jul 9, 2021 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,8 +10,10 @@ ``` 4. Run script to build bindings ``` ./genbindings.sh ../rust-lightning true >& genbindings.out ``` 5. Check `genbindings.out` for any warning or error messages [Install `clang-12`]: https://apt.llvm.org/ [default version]: http://manpages.ubuntu.com/manpages/focal/en/man1/update-alternatives.1.html -
notmandatory revised this gist
Jul 9, 2021 . 1 changed file with 8 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,12 +4,14 @@ 1. Clone `rust-lightning` git repo2. 2. [Install `clang-12`] and set it as the [default version] 3. Install rust-src ``` rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu ``` 4. Run script to build bindings ``` ./genbindings.sh ../rust-lightning true ``` [Install `clang-12`]: https://apt.llvm.org/ [default version]: http://manpages.ubuntu.com/manpages/focal/en/man1/update-alternatives.1.html -
notmandatory revised this gist
Jul 7, 2021 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,15 +2,19 @@ ## Build LDK C bindings 1. Clone `rust-lightning` git repo2. 2. [Install `clang-12`] and set it as the [default version] 3. Run script to build bindings ``` ./genbindings.sh ../rust-lightning true ``` [Install `clang-12`]: https://apt.llvm.org/ [default version]: http://manpages.ubuntu.com/manpages/focal/en/man1/update-alternatives.1.html ## Build LDK java bindings 1. Install open JDK 11 and maven ```shell -
notmandatory revised this gist
Jul 6, 2021 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,15 @@ # How-to build LDK java bindings ## Build LDK C bindings ### Clone `rust-lightning` git repo ### Run script to build bindings ``` ./genbindings.sh ../rust-lightning true ``` ## Build java bindings from pre-built JNI lib 1. Install open JDK 11 and maven -
notmandatory revised this gist
Apr 21, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ cd ldk-garbagecollected export LD_LIBRARY_PATH=. mvn test ``` **All good, test passes.** ## Build JNI lib -
notmandatory revised this gist
Apr 21, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ cd ldk-garbagecollected export LD_LIBRARY_PATH=. mvn test ``` ** All good, test passes. ** ## Build JNI lib -
notmandatory revised this gist
Apr 21, 2021 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -56,6 +56,9 @@ cargo install cbindgen g++ valgrind ``` This is where I'm stuck.. with error: ```shell + clang++ -Wall -Wno-nullability-completeness -pthread -std=c++11 -flto -O2 demo.cpp target/release/libldk.a -ldl /usr/bin/ld: error: LLVM gold plugin has failed to create LTO module: Invalid record clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` -
notmandatory revised this gist
Apr 21, 2021 . 1 changed file with 11 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,18 +8,18 @@ sudo apt update sudo apt install openjdk-11-jdk maven ``` 2. Clone `ldk-garbagecollected` repo ```shell git clone [email protected]:lightningdevkit/ldk-garbagecollected.git cd ldk-garbagecollected ``` 3. Run java tests ```shell export LD_LIBRARY_PATH=. mvn test ``` ** OK good test passes. ** ## Build JNI lib @@ -28,19 +28,18 @@ mvn test rustup default 1.51.0 ``` 2. Clone Matt's `rust-lightning` repo ```shell git clone https://git.bitcoin.ninja/rust-lightning cd rust-lightning git checkout 2021-03-java-bindings-base cd .. ``` 3. Clone `ldk-c-bindings` repo ```shell git clone git@github.com:lightningdevkit/ldk-c-bindings.git cd ldk-c-bindings ``` 4. Install tools @@ -54,4 +53,9 @@ cargo install cbindgen g++ valgrind 5. Generate bindings ```shell ./genbindings.sh ../rust-lightning true ``` This is where I'm stuck.. with error: ``` ``` -
notmandatory revised this gist
Apr 21, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export LD_LIBRARY_PATH=. mvn test ``` ## Build JNI lib 1. Set rust toolchain ```shell -
notmandatory revised this gist
Apr 21, 2021 . 1 changed file with 36 additions and 18 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,39 +1,57 @@ # How-to build LDK java bindings ## Build java bindings from pre-built JNI lib 1. Install open JDK 11 and maven ```shell sudo apt update sudo apt install openjdk-11-jdk maven ``` 2. Clone ldk-garbagecollected repo ```shell git clone [email protected]:notmandatory/ldk-garbagecollected.git cd ldk-garbagecollected git remote add upstream [email protected]:lightningdevkit/ldk-garbagecollected.git ``` 3. Run java tests ```shell export LD_LIBRARY_PATH=. mvn test ``` ## Build C FFI bindings lib 1. Set rust toolchain ```shell rustup default 1.51.0 ``` 2. Clone Matt's rust-lightning repo ```shell git clone https://git.bitcoin.ninja/rust-lightning cd rust-lightning git checkout 2021-03-java-bindings-base cd .. ``` 3. Clone ldk-c-bindings repo ```shell git clone https://github.com/notmandatory/ldk-c-bindings cd ldk-c-bindings git remote add upstream [email protected]:lightningdevkit/ldk-c-bindings.git ``` 4. Install tools ```shell rustup target add wasm32-wasi # clang 10.0.1, gcc 9.3.0, g++ 9.3.0, valgrind 3.15.0 cargo install cbindgen g++ valgrind ``` 5. Generate bindings ```shell ./genbindings.sh ../rust-lightning true ``` -
notmandatory revised this gist
Apr 21, 2021 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,19 @@ # Steps to build ldk java bindings ### Set rust toolchain ```shell rustup default 1.51.0 ``` ### Clone Matt's rust-lightning repo ```shell git clone https://git.bitcoin.ninja/rust-lightning cd rust-lightning git checkout 2021-03-java-bindings-base cd .. ``` ### Clone ldk-c-bindings repo git clone https://github.com/notmandatory/ldk-c-bindings cd ldk-c-bindings git remote add upstream [email protected]:lightningdevkit/ldk-c-bindings.git -
notmandatory revised this gist
Apr 21, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Steps to build ldk java bindings ### set rust toolchain rustup default 1.51.0 # clone Matt's rust-lightning repo -
notmandatory renamed this gist
Apr 21, 2021 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,4 @@ ## Steps to build ldk java bindings # set rust toolchain rustup default 1.51.0 @@ -18,11 +14,15 @@ git clone https://github.com/notmandatory/ldk-c-bindings cd ldk-c-bindings git remote add upstream [email protected]:lightningdevkit/ldk-c-bindings.git rustup target add wasm32-wasi # clang 10.0.1, gcc 9.3.0, g++ 9.3.0, valgrind 3.15.0 cargo install cbindgen g++ valgrind ./genbindings.sh ../rust-lightning true ---- # install open jdk 11 and maven sudo apt update sudo apt install openjdk-11-jdk maven # clone ldk-garbagecollected repo -
notmandatory revised this gist
Apr 21, 2021 . 1 changed file with 16 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ Steps to build ldk java bindings # install c++ (9.3.0) clang (10.0.1) # sudo apt update # sudo apt install build-essential clang-12 clang-tools-12 # set rust toolchain rustup default 1.51.0 @@ -13,18 +13,23 @@ cd rust-lightning git checkout 2021-03-java-bindings-base cd .. # clone ldk-c-bindings repo git clone https://github.com/notmandatory/ldk-c-bindings cd ldk-c-bindings git remote add upstream [email protected]:lightningdevkit/ldk-c-bindings.git # TODO genbindings.sh ---- # install open jdk 11 and maven sudo apt install openjdk-11-jdk maven # clone ldk-garbagecollected repo git clone [email protected]:notmandatory/ldk-garbagecollected.git cd ldk-garbagecollected git remote add upstream [email protected]:lightningdevkit/ldk-garbagecollected.git # run java tests export LD_LIBRARY_PATH=/home/steve/git/ldk/ldk-garbagecollected mvn test -
notmandatory revised this gist
Apr 20, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ Steps to build ldk java bindings # install c++ (9.3.0) clang (10.0.1) sudo apt update sudo apt install llvm build-essential clang clang-tools -
notmandatory revised this gist
Apr 20, 2021 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,12 @@ Steps to build ldk java bindings # install c++ sudo apt update sudo apt install llvm build-essential clang clang-tools # set rust toolchain rustup default 1.51.0 # clone Matt's rust-lightning repo git clone https://git.bitcoin.ninja/rust-lightning cd rust-lightning @@ -17,13 +24,6 @@ git clone https://github.com/notmandatory/ldk-c-bindings cd ldk-c-bindings git remote add upstream [email protected]:lightningdevkit/ldk-c-bindings.git # generate bindings export LD_LIBRARY_PATH=../ldk-garbagecollected ./genbindings.sh ../rust-lightning false -
notmandatory revised this gist
Apr 20, 2021 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ Steps to build ldk java bindings # clone Matt's rust-lightning repo git clone https://git.bitcoin.ninja/rust-lightning cd rust-lightning -
notmandatory created this gist
Apr 20, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ # in ./ldk directory # clone Matt's rust-lightning repo git clone https://git.bitcoin.ninja/rust-lightning cd rust-lightning git checkout 2021-03-java-bindings-base cd .. # clone ldk-garbagecollected repo git clone [email protected]:notmandatory/ldk-garbagecollected.git cd ldk-garbagecollected git remote add upstream [email protected]:lightningdevkit/ldk-garbagecollected.git cd .. # clone ldk-c-bindings repo git clone https://github.com/notmandatory/ldk-c-bindings cd ldk-c-bindings git remote add upstream [email protected]:lightningdevkit/ldk-c-bindings.git # install c++ sudo apt update sudo apt install llvm build-essential clang clang-tools # set rust toolchain rustup default 1.51.0 # generate bindings export LD_LIBRARY_PATH=../ldk-garbagecollected ./genbindings.sh ../rust-lightning false