All Projects → ConsensusJ → consensusj

ConsensusJ / consensusj

Licence: Apache-2.0 license
Cryptocurrency components for JVM & Android (JSON client & server support, services, DSL, CLI)

Programming Languages

java
68154 projects - #9 most used programming language
groovy
2714 projects

Projects that are alternatives of or similar to consensusj

laravel-bitcoinrpc
Bitcoin JSON-RPC Service Provider for Laravel.
Stars: ✭ 83 (+9.21%)
Mutual labels:  json-rpc, bitcoinrpc
eat
Json based scenario testing tool(which can have test for functional and non-functional)
Stars: ✭ 41 (-46.05%)
Mutual labels:  functional-testing
Ethereumex
Elixir JSON-RPC client for the Ethereum blockchain
Stars: ✭ 225 (+196.05%)
Mutual labels:  json-rpc
transmission
Go wrapper for the transmission API
Stars: ✭ 34 (-55.26%)
Mutual labels:  json-rpc
Php Bitcoinrpc
Fully unit-tested Bitcoin JSON-RPC client based on GuzzleHttp.
Stars: ✭ 231 (+203.95%)
Mutual labels:  json-rpc
mqtt-json-rpc
JSON-RPC protocol over MQTT communication
Stars: ✭ 31 (-59.21%)
Mutual labels:  json-rpc
Rpc
Simple RPC style APIs with generated clients & servers.
Stars: ✭ 192 (+152.63%)
Mutual labels:  json-rpc
Rockets
REST and websockets C++ library
Stars: ✭ 39 (-48.68%)
Mutual labels:  json-rpc
nestjs-rpc
NestJS Json RPC package
Stars: ✭ 47 (-38.16%)
Mutual labels:  json-rpc
clearth
Test automation tool for Clearing, Settlement and Back-Office Systems
Stars: ✭ 26 (-65.79%)
Mutual labels:  functional-testing
node-mole-rpc
Transport agnostic spec compliant JSON RPC client and server
Stars: ✭ 54 (-28.95%)
Mutual labels:  json-rpc
Brayns
Visualizer for large-scale and interactive ray-tracing of neurons
Stars: ✭ 232 (+205.26%)
Mutual labels:  json-rpc
jr
A tiny Command Line Interface JavaScript Object Notation Remote Procedure Call client
Stars: ✭ 16 (-78.95%)
Mutual labels:  json-rpc
Jquery.terminal
jQuery Terminal Emulator - JavaScript library for creating web-based terminals with custom commands
Stars: ✭ 2,623 (+3351.32%)
Mutual labels:  json-rpc
NarrativeTest.jl
Julia library for functional testing.
Stars: ✭ 18 (-76.32%)
Mutual labels:  functional-testing
Aria2p
Command-line tool and library to interact with an aria2c daemon process with JSON-RPC.
Stars: ✭ 201 (+164.47%)
Mutual labels:  json-rpc
odooly
Python library and CLI to interact with Odoo and OpenERP.
Stars: ✭ 53 (-30.26%)
Mutual labels:  json-rpc
WebApiClient.Extensions
WebApiClient项目的第三方扩展:Autofac、DependencyInjection、HttpClientFactory、SteeltoeOSS.Discovery、MessagePack、Protobuf、Json-Rpc
Stars: ✭ 73 (-3.95%)
Mutual labels:  json-rpc
xmlrpcwsc-dotnet
XML-RPC Web Service Client C# implementation
Stars: ✭ 30 (-60.53%)
Mutual labels:  json-rpc
test-automation-bootstrap
A simple and effective boilerplate repo to quickstart test automation frameworks ✨
Stars: ✭ 42 (-44.74%)
Mutual labels:  functional-testing

ConsensusJ

GitHub Actions Gradle Build 'GitHub Actions GraalVM Builds 'GitHub Actions Bitcoin Core RegTest pipeline

Modular cryptocurrency libraries for Java, JVM languages, and Android.

Features

Core JSON-RPC Features

  • A Java JSON-RPC client that serves as a base class for any cryptocurrency platform that uses JSON-RPC for communication.

  • A Groovy JSON-RPC client that can use dynamic methods for scripting, experimentation and functional tests of any JSON-RPC server.

  • A JSON-RPC command-line client, jsonrpc, for testing and debugging JSON-RPC servers and applications. It can be natively compiled with GraalVM. It can launch, call the server and print output in under 50 milliseconds.

  • consensusj-jsonrpc-daemon - A Micronaut-based JSON-RPC "echo" server. It can be natively compiled using GraalVM.

Bitcoin Features

  • A JSON-RPC Java client for the Bitcoin Core API with strong, static types.

  • JSON library using Jackson to convert between Bitcoin types and JSON

  • jakarta.inject-compatible Bitcoin server components for server-side JSON-RPC.

  • cj-btc-daemon - A Micronaut-based framework for a Java-based implementation of bitcoind. It can be natively compiled using GraalVM.

  • cj-btc-cli - a command line tool and supporting libraries for accessing the JSON-RPC API.

  • A Groovy-language Domain Specific Language for scripting and testing with bitcoinj

  • Functional tests of bitcoind (and bitcoinj-daemon) JSON-RPC services, that run in regression test mode.

JavaMoney and Exchange Support

  • Bitcoin currency provider implementation for JavaMoney.

  • Multi-currency exchange "ticker" implementations using JavaMoney and XChange.

JSON-RPC for Ethereum and Namecoin

  • Proof-of-concept Java JSON-RPC client for Ethereum (ETH)

  • Proof-of-concept Java JSON-RPC client for Namecoin (NMC)

⚠️
Do not use this software with your private keys without doing a rigorous audit of the code first. (Feedback welcome.)
⚠️
The API is not final and prior to a 1.0 release may change without warning. Most of the API changes are fairly manageable though, and we try to deprecate before making significant changes.

Many small modules to help you manage dependencies

This project is a mono-repo with many submodules/components that are published as independent binary libraries. Since it is easy to pull in just the modules you need via Maven coordinates, this allows you to manage your transitive dependencies and build lightweight, fast-starting, applications and servers. Fewer dependencies also helps with natively-compiled, Java Module System-based (including jlink) applications.

Overview

Binaries

Although the API is changing, binary packages are available on GitLab.com. You can download JARs or use the provided Maven coordinates to link to them directly from your pom.xml or build.gradle.

Maven

Add the following to your pom.xml:

<repositories>
  <repository>
    <id>consensusj-gitlab-maven</id>
    <url>https://gitlab.com/api/v4/projects/8482916/packages/maven</url>
  </repository>
</repositories>

Gradle

Add the following to the repositories section of your build.gradle:

    maven { url 'https://gitlab.com/api/v4/projects/8482916/packages/maven' }

API Documentation

We have published preliminary JavaDoc to our GitHub pages site.

Continuous Integration

  • 'GitHub Actions: GitHub Actions Gradle Build 'GitHub Actions GraalVM Builds 'GitHub Actions Bitcoin Core RegTest

  • GitLab CI build: pipeline

Requirements

  • Most modules now require Java 9 or later.

  • bitcoinj-util and bitcoinj-dsl-gvy still work with JDK 8

  • The server and command-line tools/libraries require Java 17 or later.

ConsensusJ Modules

In release v0.6.0 we have completed refactoring all modules into the new org.consensusj package namespace and have assigned Java Module names via the Automatic Module mechanism. This provides a more consistent package structure, easier usage by Java 9+, and a smooth migration to Java Module descriptors.

Table 1. Core JSON-RPC Modules
Name Min JDK Java module name Description

consensusj-jsonrpc

9

org.consensusj.jsonrpc

JSON-RPC client

consensusj-jsonrpc-javanet

11

org.consensusj.jsonrpc.javanet

JSON-RPC client using java.net.http

consensusj-jsonrpc-gvy

9

org.consensusj.jsonrpc.groovy

Groovy JSON-RPC client (dynamic RPC methods)

consensusj-jsonrpc-cli

17

org.consensusj.jsonrpc.cli

JSON-RPC command-line interface (CLI) libraries and tool

consensusj-jsonrpc-daemon

17

n/a

JSON-RPC Sample Server

consensusj-rx-jsonrpc

9

org.consensusj.rx.jsonrpc

RxJava 3 support for JSON-RPC

consensusj-rx-zeromq

9

org.consensusj.rx.zeromq

RxJava 3 ZeroMQ client

Table 2. Bitcoin Modules
Name Min JDK Java module name Description

cj-btc-json

9

org.consensusj.bitcoin.json

Jackson serializers, deserializers & POJOs for Bitcoin JSON-RPC

cj-btc-jsonrpc

9

org.consensusj.bitcoin.jsonrpc

Java JSON-RPC Bitcoin client

cj-btc-jsonrpc-gvy

9

org.consensusj.bitcoin.jsonrpc.groovy

Groovy JSON-RPC Bitcoin client (dynamic RPC methods)

cj-btc-cli

17

org.consensusj.bitcoin.cli

Command-line JSON-RPC client for Bitcoin

cj-btc-daemon

17

n/a

JSON-RPC Bitcoin server daemon prototype, using Micronaut.

cj-btc-services

17

org.consensusj.bitcoin.services

Bitcoin Service-Layer objects - compatible with jakarta.inject (JSR-330)

cj-btc-jsonrpc-integ-test

9

n/a

Bitcoin JSON-RPC integration tests (RegTest)

cj-btc-rx

9

org.consensusj.bitcoin.rx

Reactive interfaces for Bitcoin.

cj-btc-rx-jsonrpc

9

org.consensusj.bitcoin.rx.jsonrpc

RxJava 3 JSON-RPC/ZeroMQ Client for Bitcoin Core

cj-btc-rx-peergroup

9

org.consensusj.bitcoin.rx.peergroup

RxJava 3 JSON-RPC/ZeroMQ Client using bitcoinj PeerGroup

Table 3. bitcoinj Enhancement Modules
Name Min JDK Java module name Description

cj-bitcoinj-dsl-gvy

8

org.consensusj.bitcoinj.dsl.groovy

Groovy DSL support.

cj-bitcoinj-dsl-js

17

org.consensusj.bitcoinj.dsl.js

JavaScript DSL support for Nashorn. Includes JSON-RPC client.

cj-bitcoinj-spock

8

org.consensusj.bitcoinj.spock

Spock tests of bitcoinj classes.

cj-bitcoinj-util

8

org.consensusj.bitcoinj.util

bitcoinj utilities and enhancements. Some will be submitted upstream.

Table 4. JavaMoney and Exchange Rate Support
Name Min JDK Java module name Description

consensusj-currency

9

org.consensusj.currency

JavaMoney Currency Provider(s)

consensusj-exchange

9

org.consensusj.exchange

JavaMoney Exchange Providers. Adapter to use XChange Exchange implementations as JavaMoney `ExchangeRateProvider`s.

Table 5. Miscellaneous Modules
Name Min JDK Java module name Description

consensusj-analytics

9

org.consensusj.analytics

Richlist calculation support

consensusj-decentralizedid

9

org.consensusj.decentralizedid

Preliminary, experimental, W3C DID and BTCR DID Method support

cj-eth-jsonrpc

9

org.consensusj.ethereum.jsonrpc

Java JSON-RPC Ethereum client (proof-of-concept)

cj-nmc-jsonrpc

9

org.consensusj.namecoin.jsonrpc

Java JSON-RPC Namecoin client (proof-of-concept)

consensusj-jsonrpc

Java implementation of a JSON-RPC client. JsonRpcClientHttpUrlConnection can be subclassed or called directly using the send() method and Object parameters.

consensusj-jsonrpc-gvy

Dynamic RPC methods are implemented via the DynamicRPCFallback Groovy trait. DynamicRPCClient can be used to talk to any JSON-RPC server using standard Java types and Jackson JSON conversion.

cj-btc-jsonrpc

Java Bitcoin JSON-RPC client and supporting types, both bitcoinj types and POJOs for Bitcoin Core JSON.

If the RPC procedure takes a Bitcoin address as parameter, then the Java method will take an org.bitcoinj.core.Address. If the RPC returns a transaction, the Java method will return an org.bitcoinj.core.Transaction.

See the JavaDoc for BitcoinClient to see the methods implemented.

cj-btc-jsonrpc-gvy

Subclass of Bitcoin JSON-RPC client with fallback to dynamic methods (using DynamicRPCFallback). This is useful when new methods are added to the server/protocol and static methods and types haven’t been written for them yet.

cj-btc-cli: An Bitcoin RPC command-line client

An alternative implementation of bitcoin-cli in Java. If converted to a fat jar, it is executable with java -jar. The command:

java -jar cj-btc-cli-0.6.4.jar -rpcport=8080 getblockcount

will output:

Connecting to: http://127.0.0.1:8080/
0
ℹ️
Only a few RPCs are currently supported. Pull requests welcome.

For help type:

java -jar bitcoinj-cli-0.6.4.jar -?

or read the manual page.

cj-btc-json

Jackson serializers, deserializers & POJOs used to create and parse JSON by both client and server implementations of Bitcoin JSON-RPC.

cj-btc-services

Service-Layer object(s) that power the Daemon. These objects rely solely on javax.annotation and jakarta.inject for configuration and can be wired with Spring, Micronaut IOC, or Guice.

Built as a fat, executable jar, so it can be run with java -jar.

Experimental Micronaut-based Bitcoin daemon

An experimental port of bitcoinj-daemon to Micronaut.

A starting point for building a complete bitcoind equivalent using bitcoinj. It currently serves a small subset of the Bitcoin RPC API (Bitcoin uses JSON-RPC.)

It builds as a native binary using GraalVM.

cj-bitcoinj-dsl-gvy

Groovy DSL support to write things like:

assert 1.btc == 100_000_000.satoshi
and
assert 100.satoshi == Coin.MICROCOIN

cj-bitcoinj-spock

Spock tests of bitcoinj classes. Initial focus is learning and documentation, not test coverage.

cj-btc-jsonrpc-integ-test: RegTest mode integration tests using JSON-RPC

Bitcoin Core integration test framework and tests (Regression Tests using Spock)

Sample Spock Integration Tests

These sample Spock "feature tests" show the RPC client in action and are from the file BitcoinSpec.groovy.

    def "Use RegTest mode to generate a block upon request"() {
        given: "a certain starting height"
        def startHeight = blockCount

        when: "we generate 1 new block"
        generateBlock()

        then: "the block height is 1 higher"
        blockCount == startHeight + 1
    }

    def "When we send an amount to a newly created address, it arrives"() {
        given: "A new, empty Bitcoin address"
        def destinationAddress = getNewAddress()

        when: "we send it testAmount (from coins mined in RegTest mode)"
        sendToAddress(destinationAddress, testAmount, "comment", "comment-to")

        and: "we generate 1 new block"
        generateBlock()

        then: "the new address has a balance of testAmount"
        testAmount == getReceivedByAddress(destinationAddress)
    }

consensusj-currency

JavaMoney (also known as JSR 354) is the new Java Standard for advanced and flexible currency handling on the Java platform.

JSR 354 provides a portable and extensible framework for handling of Money & Currency. The API models monetary amounts and currencies in a platform independent and portable way, including well defined extension points.
— JavaMoney Web Site

Support for virtual currencies is one of the key design goals in the specification. The consensusj-currency module allows Bitcoin to be used by standard Java APIs in the same ways as fiat currencies.

consensusj-currency contains BitcoinCurrencyProvider which will add "BTC" as a standard currency code to any applications that includes the consensusj-currency JAR in its classpath.

consensusj-exchange

The JavaMoney Reference Implementation (aka "Moneta") contains implementations of ExchangeRateProvider for ECB (European Central Bank) and IMF (International Monetary Fund). There is also U.S. FRB (Federal Reserve Bank) and Yahoo Finance ExchangeRateProvider in the JavaMoney financial library add-on module.

The #consensusj-exchange module includes an adapter class BaseXChangeExchangeRateProvider that adapts implementations of the Exchange interface in the popular and complete XChange library to be used by JavaMoney-compatible applications.

Building and Running

Before running ./gradlew wrapper script you must have JDK 11 installed and your JAVA_HOME set correctly. To build native images you’ll need a GraalVM JDK 11 with the native-image tool installed via gu install native-image.

ℹ️
The first time you run the build all dependency JARS will be downloaded.

Full Build

./gradlew build

Build JSON-RPC CLI tool

To build the CLI executable jar:

./gradlew :consensusj-jsonrpc-cli:nativeCompile

To run it and display a list of command line options:

consensusj-jsonrpc-cli/build/jsonrpc -?

Build Bitcoin CLI tool

To build the CLI executable jar:

./gradlew :cj-btc-cli:nativeCompile

To run it and display a list of command line options:

cj-btc-cli/build/cj-btc-cli -?

Build and Run JSON-RPC Echo daemon

To build and run from Gradle:

./gradlew :consensusj-jsonrpc-daemon:run

To build a native image and run:

./gradlew :consensusj-jsonrpc-daemon:nativeCompile
consensusj-jsonrpc-daemon/build/native/nativeCompile/jsonrpc-echod

Build and Run JSON-RPC Bitcoin daemon

To build and run from Gradle:

./gradlew :cj-btc-daemon:run

To build a native image and run:

./gradlew :cj-btc-daemon:nativeCompile
cj-btc-daemon/build/native/nativeCompile/jbitcoind
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].