Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lageto-net/monero-rpc

Client for the Monero P2P daemon and wallet daemons
https://github.com/lageto-net/monero-rpc

java monero rpc

Last synced: about 1 month ago
JSON representation

Client for the Monero P2P daemon and wallet daemons

Awesome Lists containing this project

README

        

# monero-rpc

A library for Java developers to interface with the Monero P2P daemon and wallet daemon with their RPC protocols. Created and open sourced by the [Lageto mining pool](https://www.lageto.net).

## Getting monero-rpc

monero-rpc is distributed via Maven Central. Regular snapshot releases are also frequently published to the Maven Central snapshots repository.

See below for various build tool snippets.

##### Maven

```xml

net.lageto.monero
rpc
0.3.0

```

##### Gradle

```groovy
implementation 'net.lageto.monero:rpc:0.3.0'
```

## Spring Boot Starter

A Spring Boot starter is available to automatically configure RPC clients in Spring Applications.

Add the dependency:

```

net.lageto.monero
rpc-spring-boot-starter
0.3.0

```

URIs can then be configured in `application.properties`:

```
monero.rpc.daemon=http://localhost:18081/json_rpc
monero.rpc.wallet=http://localhost:18083/json_rpc
```

`DaemonRpcClient` and `WalletRpcClient` beans are then created.

## Example Usage

```java
// Create an instance.
var daemon = DaemonRpcClient.newInstance(URI.create("http://localhost:18081/json_rpc"));

// Perform blocking calls.
long height = daemon.getBlockCount() - 1;
System.out.println(daemon.getBlockHeaderAsync(height));

// Perform async calls.
daemon.getBlockCountAsync()
.thenApply(count -> count - 1)
.thenCompose(daemon::getBlockHeaderAsync)
.thenAccept(System.out::println);
```

## License

Released under the terms of version 2 of the Apache License.
See https://www.apache.org/licenses/LICENSE-2.0.txt for more info.