kczulko / graph-sdk

SDK to interact with public and private graphs

Home Page:https://libertydsnp.github.io/graph-sdk/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Release Issues

Graph-Sdk is a utility to read and modify social graphs defined by DSNP protocol and stored on Frequency blockchain.

Overview

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
    • jni : JNI bridge for JVM languages
    • ffi : FFI bridge for languages such as C/C++ and Swift
  • Java: Java and Android wrappers around graph sdk.

Build

  1. Install Rust using the official instructions.

  2. Check out this repository

  3. rust-toolchain.toml specifies the standard toolchain to use. If you have rustup installed, it will automatically install the correct toolchain when you run any cargo command.

  4. Running following command will try to build the core library.

    make build

Build and test JNI

  • To build and install the JNI bridge run

    make build-jni
  • To test Java and JNI bridge run

    make test-jni

Protobuf code generation

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

Build and test FFI

  • 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

Examples

Here are a few examples of how to use this library:

About

SDK to interact with public and private graphs

https://libertydsnp.github.io/graph-sdk/

License:Apache License 2.0


Languages

Language:Rust 82.2%Language:Java 7.9%Language:C++ 4.2%Language:TypeScript 3.9%Language:Kotlin 0.9%Language:Makefile 0.7%Language:JavaScript 0.2%Language:Shell 0.1%