Skip to content

Latest commit

 

History

History
85 lines (67 loc) · 2.07 KB

File metadata and controls

85 lines (67 loc) · 2.07 KB

Getting Started

Navigation: Docs index · API how-to · Streaming subscriptions · API reference · Codebase overview

Prerequisites

  • Maven
  • Java 21+

Building from Source

git clone https://github.com/tcheeric/nostr-java.git
cd nostr-java
mvn clean install

Using Maven

Artifacts are published to https://maven.398ja.xyz/releases (and snapshots to https://maven.398ja.xyz/snapshots).

Use the BOM to align versions and omit per-module versions:

<repositories>
  <repository>
    <id>nostr-java</id>
    <url>https://maven.398ja.xyz/releases</url>
  </repository>
</repositories>

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>xyz.tcheeric</groupId>
      <artifactId>nostr-java-bom</artifactId>
      <version><!-- X.Y.Z --></version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
 </dependencyManagement>

<dependencies>
  <!-- Pull in everything (client transitively includes identity, event, core) -->
  <dependency>
    <groupId>xyz.tcheeric</groupId>
    <artifactId>nostr-java-client</artifactId>
  </dependency>
</dependencies>

Or pick only the modules you need:

<dependencies>
  <!-- Just events and signing (no WebSocket client) -->
  <dependency>
    <groupId>xyz.tcheeric</groupId>
    <artifactId>nostr-java-identity</artifactId>
  </dependency>

  <!-- Just the event model (no signing, no client) -->
  <dependency>
    <groupId>xyz.tcheeric</groupId>
    <artifactId>nostr-java-event</artifactId>
  </dependency>
</dependencies>

Check the releases page for the latest BOM and module versions: https://github.com/tcheeric/nostr-java/releases

Using Gradle

repositories {
    maven { url 'https://maven.398ja.xyz/releases' }
}

dependencies {
    implementation platform('xyz.tcheeric:nostr-java-bom:X.Y.Z')
    implementation 'xyz.tcheeric:nostr-java-client'
}

Replace X.Y.Z with the latest version from the releases page.