Graph-Sdk is a utility to read and modify social graphs defined by DSNP protocol and stored on Frequency blockchain.
This repository contains the following modules
- Core :
DSNP
compatible social graph implementation in Rust - Config : All supported environments and their configuration details
- Bridge : Graph SDK bridges for other languages
- Java: Java and Android wrappers around graph sdk.
-
Install Rust using the official instructions.
-
Check out this repository
-
rust-toolchain.toml
specifies the standard toolchain to use. If you haverustup
installed, it will automatically install the correct toolchain when you run any cargo command. -
Running following command will try to build the core library.
make build
-
To build and install the JNI bridge run
make build-jni
-
To test Java and JNI bridge run
make test-jni
When modifying any of the protobuf definitions, it is important to perform the following steps to ensure proper serialization and deserialization between JNI and Rust types.
make build-protos
- If protobuf is not installed run
make install-protos
-
To build and install the FFI bridge run
make bindgen
-
To test FFI bridge run
make test-ffi
- FFI tests have a dependency on
libsodium-dev
and expect it to be installed
apt-get install -y libsodium-dev
- FFI tests have a dependency on
Here are a few examples of how to use this library: