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: 5 months ago
JSON representation
Client for the Monero P2P daemon and wallet daemons
- Host: GitHub
- URL: https://github.com/lageto-net/monero-rpc
- Owner: lageto-net
- License: apache-2.0
- Created: 2021-07-11T17:28:55.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T12:02:19.000Z (over 3 years ago)
- Last Synced: 2025-07-07T17:56:26.942Z (12 months ago)
- Topics: java, monero, rpc
- Language: Java
- Homepage:
- Size: 224 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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.