This project provides Java interfaces for a Monero wallet and daemon.
The interfaces rely on running instances of Monero Wallet RPC and Monero Daemon 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. This is only necessary one time.
- 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 /Applications/monero-v0.13.0.2 --log-level 4
-
Download the latest Java code from this GitHub repository:
- Create a directory to hold project assets:
mkdir monero_wallet_java && cd monero_wallet_java
- Check out the code:
git clone https://github.com/monero-ecosystem/monero-java-rpc.git
- Optionally import the Java projects into an IDE like Eclipse (.project is included)
- Create a directory to hold project assets:
-
To run tests, configure the default wallet for running JUnit tests within TestUtils.java. The RPC domains, ports, and authentication credentials can be configured.
-
Run JUnits under src/test/java to verify the setup. Note that
TestMoneroWalletSends.java
requires sufficient funds to be available in the wallet to test sending payments (hence why stagenet mode is recommended, so it's not real XMR).
The main interfaces are MoneroWallet.java and MoneroDaemon.java.
Javadoc is provided in the doc folder (best viewed opening doc/index.html in a browser).
This project is licensed under Apache 2.0 and MIT.