The Indy SDK has been deprecated in favor of the Indy and Aries shared libraries. Please use the following libraries and projects to replace your use of the Indy SDK.
A module for interacting with the Indy Node ledger.
A secure (encrypted at rest) storage and a key management service suitable for use with Hyperledger Aries agents and possibly other digital trust agents. Askar is a replacement implementation (with lessons learned!) of the indy-wallet part of the Hyperledger Indy SDK. Askar has been demonstrated to be more performant and stable than the Indy SDK when under comparable load.
Rust library and reference implementation of the Anoncreds V1.0 specification. Supporting ledger agnostic anoncreds.
The a feature parity replacement for the indy-cli
from the indy-sdk
.
React Native Indy SDK wrapper.
with npm:
$ npm install indy-sdk-react-native --save
with Yarn:
$ yarn add indy-sdk-react-native
Link (for React Native lower than 0.60)
$ react-native link indy-sdk-react-native
See https://github.com/TimoGlastra/ExampleRnIndySDK for an example android react native project that follows this tutorial.
Make sure there is a min. SDK version setup in android/build.gradle
:
buildscript {
ext {
...
minSdkVersion = 21
...
}
}
Add Sovrin Maven repository into android/build.gradle
:
allprojects {
repositories {
...
maven {
url 'https://repo.sovrin.org/repository/maven-public'
}
...
}
}
Download Android .aar
library from Release 0.2.2 android-indy-sdk-release-device-1.15.0.aar and copy it into android/app/libs
.
Add .aar
to array of file dependencies and JNA library to android/app/build.gradle
:
dependencies {
// ...
implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
implementation 'net.java.dev.jna:jna:5.6.0'
// ...
}
I also needed to the gradle file android/app/build.gradle
the following because I was getting duplicated class error:
android {
// ...
packagingOptions {
pickFirst '**/lib/arm64-v8a/libc++_shared.so'
pickFirst '**/lib/arm64-v8a/libfbjni.so'
pickFirst '**/lib/armeabi-v7a/libc++_shared.so'
pickFirst '**/lib/armeabi-v7a/libfbjni.so'
pickFirst '**/lib/x86/libc++_shared.so'
pickFirst '**/lib/x86/libfbjni.so'
pickFirst '**/lib/x86_64/libc++_shared.so'
pickFirst '**/lib/x86_64/libfbjni.so'
}
}
Add the following to MainActivity.java
:
//...
import android.os.Bundle;
import android.system.ErrnoException;
import android.system.Os;
public class MainActivity extends ReactActivity {
//...
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
Os.setenv("EXTERNAL_STORAGE", getExternalFilesDir(null).getAbsolutePath(), true);
} catch (ErrnoException e) {
e.printStackTrace();
}
}
}
Hermes is required in order to perform ledger operations using the Indy SDK.
For more info, see this Indy-SDK issue.
Hermes is enabled by default
Add or adjust the following in the android/app/build.gradle
to:
project.ext.react = [
enableHermes: true, // clean and rebuild if changing
]
Hermes is not required for older versions of React Native
- Add the following lines to the start of your Podfile (
ios/Podfile
).
If a custom source
is defined we also need to define the default source (which is implicit if no source is specified), explicitly:
source 'https://github.com/hyperledger/indy-sdk-react-native'
source 'https://cdn.cocoapods.org'
- Install the Latest CocoaPods dependencies:
cd ios
pod install
pod update Indy
-
Configure Bitcode to
no
in both the project and targets -
Set
Build Libraries for Distribution
toyes
in both the project and targets
This is required due to mismatching Swift versions between the Indy SDK and the application, as described in this Stackoverflow Answer
- iOS Simulators are currently not supported and should be disabled
import indy from 'indy-sdk-react-native'
await indy.createWallet({ id: 'wallet-123' }, { key: 'key' })
You can see example project here https://github.com/jakubkoci/UseReactNativeIndySdk/. It currently shows only usage on Android.
I found an error with permission while calling createWallet
when I was testing this package:
2020-01-27 16:25:02.300 9955-10044/com.usereactnativeindysdk E/log_panics: thread 'unnamed' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }': libcore/result.rs:945
Modify onCreate
method in MainActivity
of your project where you want to use this library in a following way:
public class MainActivity extends ReactActivity {
...
@Override
protected void onCreate(Bundle savedInstanceState) {
...
File externalFilesDir = getExternalFilesDir(null);
String path = externalFilesDir.getAbsolutePath();
System.out.println("externalFilesDir=" + path);
try {
Os.setenv("EXTERNAL_STORAGE", path, true);
} catch (ErrnoException e) {
e.printStackTrace();
}
...
}
...
}
This should resolve the issue with permissions.