Skip to content
Matthew Layton edited this page Aug 3, 2022 · 2 revisions

Introduction

Welcome to the ONIXLabs Corda Identity Framework. This framework provides a powerful and comprehensive API surface for building highly scalable, interoperable, digital and decentralized identities for individuals, organisations and assets on Corda. Additionally and perhaps more importantly, this framework represents a protocol for interoperable data exchange between different Corda applications.

Local Setup & Build

Prerequisites

As the ONIXLabs Corda Identity Framework is build using Corda 4.x, you will need to ensure that your machine is running Java/JDK 8. You will also need to ensure that you have at most IntelliJ 2021.1.3 installed. This is because Corda 4.x is built using Kotlin 1.2.71, and that version of IntelliJ is the last one that property supports Kotlin 1.2.x with intellisense / code completion.

The ONIXLabs Corda Identity Framework has a dependency on onixlabs-corda-core, but it should fetch those dependencies for you. They're stored using GitHub's Maven repository. To gain access to them, you'll need to add some credentials to your machine.

If you're using Linux or MacOS, the file you need is ~/.gradle/gradle.properties (I'm not sure where the equivalent is on Windows). In that file you need to add the following credentials to allow IntelliJ to correctly resolve the dependencies:

gpr.user=YOUR_GITHUB_USERNAME
gpr.key=YOUR_GITHUB_PERSONAL_ACCESS_TOKEN

Replace YOUR_* with actual values.

Clone

Clone the repository

git clone https://github.com/onix-labs/onixlabs-corda-identity-framework.git

Build & Run

To build from the command line, cd into the project directory and run

./gradlew clean build

You can also open the project in IntelliJ and build it there. This will also give you access to test configurations for the contract, workflow and sample app tests.

Using the Identity Framework

Note that the current version 4.0.1 targets Corda 4.9 so your application will need to be running at least Corda 4.9 for this to work!

If you're building a Corda application, and you want to use features from the ONIXLabs Corda Identity Framework, you will need to obtain all of the dependencies from GitHub's Maven repository. Assuming you have followed the steps (above) to obtain the dependencies, you should be able to add the following to your project's global build.gradle file.

Global Build.Gradle

buildscript {
    ext {

        ...

        onixlabs_group = 'io.onixlabs'
        onixlabs_corda_core_release_version = '4.0.0'
        onixlabs_corda_idfx_release_version = '4.0.0'

        ...

    }

    ...

    subprojects {
        mavenLocal()
        mavenCentral()
        maven { url "https://jitpack.io" }
        maven { url "$corda_artifactory_url/corda-releases" }
        maven { url "$corda_artifactory_url/corda-dependencies" }
        maven { url "https://repo.gradle.org/gradle/libs-releases" }
        maven {
            name = "GitHubPackages-onixlabs-corda-core"
            url = uri("https://maven.pkg.github.com/onix-labs/onixlabs-corda-core")
            credentials {
                username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
                password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
            }
        }
        maven {
            name = "GitHubPackages-onixlabs-corda-identity-framework"
            url = uri("https://maven.pkg.github.com/onix-labs/onixlabs-corda-identity-framework")
            credentials {
                username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_USERNAME")
                password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
            }
        }
    }
}

For each sub-project (for example, contracts and workflows) you can add the following dependencies to the sub-project build.gradle file:

Contracts Build.Gradle

dependencies {
    cordapp "$onixlabs_group:onixlabs-corda-core-contract:$onixlabs_corda_core_release_version"
    cordapp "$onixlabs_group:onixlabs-corda-identity-framework-contract:$onixlabs_corda_idfx_release_version"
}

...

Workflows Build.Gradle

dependencies {
    cordapp "$onixlabs_group:onixlabs-corda-core-workflow:$onixlabs_corda_core_release_version"
    cordapp "$onixlabs_group:onixlabs-corda-identity-framework-workflow:$onixlabs_corda_idfx_release_version"
}

...