Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.celeduc:ipfs-api-kotlin:0.9999999'
}
dependencies {
implementation("com.github.celeduc:ipfs-api-kotlin:0.9999999")
}
<dependency>
<groupId>com.github.celeduc</groupId>
<artifactId>ipfs-api-kotlin</artifactId>
<version>0.9999999</version>
</dependency>
libraryDependencies += "com.github.celeduc" % "ipfs-api-kotlin" % "0.9999999"
:dependencies [[com.github.celeduc/ipfs-api-kotlin "0.9999999"]]
You can get the artifact via jitpack - here you see how to use with gradle - for other build systems have a look here
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile 'com.github.ligi:ipfs-api-kotlin:$current_version'
}
val multihash = IPFS().add.string("test-string").Hash
###get a string
val content = IPFS().get.cat(multihash)
###get commit from version
val commit = IPFS().info.version().Commit
you can also use it from java - but it is more verbose:
final String multihash = new IPFS().getAdd().string("test-string").getHash();
Please send a message or even PR if you write/find an app that also uses this library.
We depend on okhttp and moshi which play well together with okio
MIT