Skip to content

Commit

Permalink
Initial commit of stable version 1.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
terry1ee authored Apr 21, 2024
2 parents fe74382 + 60daa91 commit 835acbd
Show file tree
Hide file tree
Showing 64 changed files with 20,031 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.gradle
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

# Ignore Gradle build output directory
build

# Binary Dynamic Library Files
*.so
*.dylib

# Resource files left in the cache and build directories
.cache
abel4j/src/main/resources/native
abel4j/bin/
abel4j-demo/bin/
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
CACHE_DIR=.cache
LIBABELSDK_DIST_URL=https://github.com/pqabelian/abelian-sdk-go-lib/releases/download/v1.0.0/libabelsdk-1.0.0.tar.gz
LIBABELSDK_DIST_NAME=libabelsdk-1.0.0
LIBABELSDK_DIST_FILE=$(LIBABELSDK_DIST_NAME).tar.gz
RESOURCES_DIR=abel4j/src/main/resources
RESOURCES_NATIVE_DIR=$(RESOURCES_DIR)/native

build: build-resources
./gradlew build

clean:
./gradlew clean

clean-all: clean clean-resources

build-resources: $(RESOURCES_NATIVE_DIR)

clean-resources:
rm -rf $(RESOURCES_NATIVE_DIR)

$(CACHE_DIR):
mkdir -p $@

$(CACHE_DIR)/$(LIBABELSDK_DIST_FILE): | $(CACHE_DIR)
curl -L $(LIBABELSDK_DIST_URL) -o $(CACHE_DIR)/$(LIBABELSDK_DIST_FILE)

$(RESOURCES_NATIVE_DIR): $(CACHE_DIR)/$(LIBABELSDK_DIST_FILE)
@if [ ! -d $(RESOURCES_NATIVE_DIR) ]; then \
echo "Extracting libabelsdk to $(RESOURCES_NATIVE_DIR) ..."; \
rm -rf $(RESOURCES_NATIVE_DIR) $(RESOURCES_NATIVE_DIR); \
tar -C $(CACHE_DIR) -xzf $(CACHE_DIR)/$(LIBABELSDK_DIST_FILE); \
mv $(CACHE_DIR)/$(LIBABELSDK_DIST_NAME) $(RESOURCES_NATIVE_DIR); \
fi

demo:
./gradlew run --args="Crypto"

demo-debug:
./gradlew runDebug --args="Crypto"
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# The Java SDK for the Abelian Blockchain

The Abelian Java SDK is a library that allows developers to interact with the Abelian blockchain. It provides a simple way to connect to the Abelian network, query the state of the blockchain, decode privacy-proteced data of managed accounts, and send transactions.

## 1. System requirements
The Abelian Java SDK supports the following platforms:
- Linux x86
- Linux arm64
- MacOS x86
- MacOS arm64 (Apple Silicon)

The system requirements are as follows:
- Java 8 or later
- OpenSSL 1.1.1 or later (on Linux only)

On macOS x86/arm86 platforms, the SDK only requires Java 8 or later. On Linux platforms, the SDK also requires OpenSSL 3 or later to be installed.

## 2. Getting started with the SDK demo

Before using the SDK in your own project, you can try the SDK demos to get a sense of how the SDK works. The SDK demos is packed as a standalone package containing all jar dependencies. You can download the demos package `abel4j-demo-x.y.z.zip` from the [release page](../../releases) of this repository.

Please refer to the the document [*Understanding the Abelian Java SDK by Demos*](abel4j-demo/README.md) for more details.

## 3. Using the SDK in your project

To use the Abelian Java SDK in your project, you need to add the single JAR file `abel4j-x.y.z.jar` along with the required dependencies to your project. The SDK JAR file can be either downloaded from the [release page](../../releases) or built from the source code.

The SDK requires the following dependencies:
- `net.java.dev.jna:jna:5.13.0`
- `com.google.protobuf:protobuf-java:3.21.12`
- `org.apache.httpcomponents.client5:httpclient5-fluent:5.2.1`
- `com.fasterxml.jackson.core:jackson-databind:2.14.2`
- `org.slf4j:slf4j-api:2.0.6`
- `org.slf4j:slf4j-simple:2.0.6`

## 4. Building the SDK from source code

To build the SDK from source code, simply run `make` in the root directory of the repository. The distribution packages will be created in the `abel4j-demo/build` directory. To clean up the build, run `make clean`.
Loading

0 comments on commit 835acbd

Please sign in to comment.