This repo contains 4 jvm packages:
- common - utilities for encoding, decoding, and hashing
- crypto - key generation, signing, signature verification, encryption, and decryption
- dids - did generation and resolution
- credentials - creation and verification of verifiable claims
You can add this library to your project using Gradle or Maven. To do so, pull the package from Maven Central.
When pulling from Maven Central, you can pull the entire library or just a single module. Examples of both are shown
below. Please note that you need to add the repositories shown below to your build.gradle.kts
file. This is because
the libraries that we depend on are hosted in separate places.
repositories {
mavenCentral()
maven("https://jitpack.io")
maven("https://repo.danubetech.com/repository/maven-public/")
}
dependencies {
// If you want to pull the entire library
implementation("xyz.block:web5:0.10.0")
// If you want to pull a single module
implementation("xyz.block:web5-common:0.10.0")
implementation("xyz.block:web5-credentials:0.10.0")
implementation("xyz.block:web5-crypto:0.10.0")
implementation("xyz.block:web5-dids:0.10.0")
}
Important
Additional repositories, like https://repo.danubetech.com/repository/maven-public/
, are required for resolving
transitive dependencies.
Examples are hosted in the public documentation for each module, which is hosted in GitHub Pages.
If you want to build an artifact locally, you can do so by running the following command - either at the top level or in any of the subprojects:
./gradlew publishToMavenLocal -PskipSigning=true -Pversion={your-local-version-name}
Install java version 11. If you're installing a higher version, it must be compatible with Gradle 8.2.
If you want to have multiple version of Java installed in your machine, we recommend using jenv.
[!NOTE]: Restart your shell after installation.
This repository uses git submodules. To clone this repo with submodules
git clone --recurse-submodules [email protected]:TBD54566975/web5-kt.git
Or to add submodules after cloning
git submodule update --init
We recommend this config which will only checkout the files relevant to web5-kt
git -C web5-spec sparse-checkout set test-vectors
To build and run test just run:
./gradlew build --console=rich
In order to release to Central Repository, simply cut a new release tag in the Github UI. There is a configured Github
Action that will automatically publish the release to Central Repository. You can cut
the release by going to the create a new releases page. When
creating a new tag, the name should be in the format vX.Y.Z
. Please note that once a release is made, it is immutable
and cannot be deleted.
If you want to do a manual release, you have two options:
- Dispatch the publish workflow workflow from the Github UI. Go to the publish Actions > "Run workflow".
- Setup your local environment to publish to Central Repository. This is more involved. You'll need to:
- Define all the environment variables described in the publish workflow file. You can find the values in the secrets and variable page.
- Run the following command (you can change
samplebranch
to any branch name):./gradlew -Pversion=samplebranch-SNAPSHOT publishToSonatype closeAndReleaseSonatypeStagingRepository
You may need to update the web5-spec
submodule after pulling.
git pull
git submodule update
If you have made changes to the web5-spec
submodule, you should push your changes to the web5-spec
remote as well as pushing changes to web5-kt
.
cd web5-spec
git push
cd ..
git push