- Rust: https://www.rust-lang.org/tools/install
- Just: https://just.systems/man/en/ (install with
cargo install just
) - When building for Android:
- NDK v26
- Set the
ANDROID_SDK_ROOT
env variable (ex. Linux:~/Android/Sdk
, macOS:~/Library/Android/sdk
) - Set the
ANDROID_NDK_HOME
env variable (ex. Linux:~/Android/Sdk/ndk/<version>
, macOS:~/Library/Android/sdk/ndk/<version>
)
On first usage you will need to run:
just init
For most users, we recommend using our official Python package: nostr-protocol
If you want to compile from source or need more options, read on.
just python
For most users, we recommend using our official Kotlin package: org.rust-nostr:nostr.
If you want to compile from source or need more options, read on.
This command will build libraries for different platforms in target/
folder and copy them to ffi/kotlin/jniLibs
.
In addition it will generate Kotlin bindings in ffi/kotlin/nostr
.
just kotlin
This command will build an AAR file in ffi/android/lib-release.aar
:
just bindings-android
See Add your AAR or JAR as a dependency in Android's docs for more information on how to integrate such an archive into your project.
For most users, we recommend using our official Swift package: rust-nostr/nostr-swift.
If you want to compile from source or need more options, read on.
These commands will build libraries for different architectures in ../../target/
and generate Swift bindings as well as Swift module artifacts in ffi/swift-ios/
and ffi/swift-darwin/
respectively:
just swift-ios
just swift-darwin
This command will produce a fully configured Swift Package in bindings-swift/
.
See Adding package dependencies to your app in Apple's docs for more information on how to integrate such a package into your project.
just bindings-swift
This project is distributed under the MIT software license - see the LICENSE file for details