Monero Java Library (lite)
This project is a version of monero-java which supports only basic wallet functionality using monero-wallet-rpc.
This project conforms to an API specification intended to be intuitive, robust, and suitable for long-term use in the Monero project.
Main Features
- Manage a Monero wallet using RPC
- Cohesive APIs with rigorous focus on ease-of-use
- Query wallet transactions, transfers, and outputs by their many attributes
- Over 145 passing JUnit test cases
How to Use This Library
For Maven, add to pom.xml:
<dependency>
<groupId>io.github.woodser</groupId>
<artifactId>monero-java-lite</artifactId>
<version>0.2.1</version>
</dependency>
For Gradle, add to build.gradle:
compile 'io.github.woodser:monero-java-lite:0.2.1'
You are now ready to use this library with monero-wallet-rpc.
How to Run Monero RPC
-
Download and extract the latest Monero CLI for your platform.
-
Start Monero daemon locally:
./monerod --stagenet
(or use a remote daemon). -
Create a wallet file if one does not exist.
- Create new / open existing:
./monero-wallet-cli --daemon-address http://localhost:38081 --stagenet
- Restore from mnemonic seed:
./monero-wallet-cli --daemon-address http://localhost:38081 --stagenet --restore-deterministic-wallet
- Create new / open existing:
-
Start monero-wallet-rpc (requires --wallet-dir to run tests):
e.g. For wallet name
test_wallet_1
, userrpc_user
, passwordabc123
, stagenet:./monero-wallet-rpc --daemon-address http://localhost:38081 --stagenet --rpc-bind-port 38083 --rpc-login rpc_user:abc123 --wallet-dir ./
How to Run JUnit Tests
- Clone the Java repository:
git clone --recurse-submodules https://github.com/woodser/monero-java-lite.git
- Install project dependencies:
mvn install
- Run monero-wallet-rpc. See How to Run Monero RPC.
- Configure the appropriate RPC endpoints, authentication, and test wallet in TestUtils.java.
- Run all *.java files in src/main/test as JUnits.
See Also
These libraries conform to the same API specification.
Java reference implementation (full version)
JavaScript reference implementation
License
This project is licensed under MIT.
Donate
Donations are gratefully accepted. Thank you for your support!
46FR1GKVqFNQnDiFkH7AuzbUBrGQwz2VdaXTDD4jcjRE8YkkoTYTmZ2Vohsz9gLSqkj5EM6ai9Q7sBoX4FPPYJdGKQQXPVz