kaspa-wallet
is a command-line tool for managing Kaspa wallets. It allows users to create and manage wallet addresses, check balances, and send transactions on the Kaspa network. This document provides a comprehensive guide on configuring, managing, and interacting with the kaspa-wallet
binary within the GridRustyKaspa project.
- Configuration
- Running Kaspa Wallet
- Interacting with Kaspa Wallet
- Logs and Monitoring
- Troubleshooting
- Appendix
The kaspa-wallet
binary can be configured using command-line arguments or a configuration file.
- rpc: Configuration for the RPC server.
- address: The address of the Kaspa node's RPC server.
- username: Username for RPC authentication.
- password: Password for RPC authentication.
- wallet: Configuration for the wallet.
- data-dir: Directory to store wallet data.
- loglevel: Sets the logging level (
debug
,info
,warn
,error
).
To start kaspa-wallet
, use the following command:
kaspa-wallet --config /path/to/kaspa-wallet-config.yaml
Alternatively, if you are using Zinit for process management, you can start the wallet using the Zinit configuration file (kaspa-wallet.yaml
):
exec: /usr/local/bin/kaspa-wallet --config /etc/kaspa-wallet/kaspa-wallet-config.yaml
log: stdout
Start the service using Zinit:
zinit start kaspa-wallet
To stop kaspa-wallet
, use the following command:
zinit stop kaspa-wallet
To restart kaspa-wallet
, use the following command:
zinit restart kaspa-wallet
kaspa-wallet
provides a command-line interface for managing the wallet. Below are some useful commands:
-
Check version:
kaspa-wallet --version
-
Start in foreground:
kaspa-wallet --config /path/to/kaspa-wallet-config.yaml
-
Display help:
kaspa-wallet --help
-
Create a new wallet:
kaspa-wallet create --data-dir /path/to/wallet/data
-
Check wallet balance:
kaspa-wallet balance --data-dir /path/to/wallet/data
-
Send a transaction:
kaspa-wallet send --to recipientAddress --amount amount --data-dir /path/to/wallet/data
In addition to the CLI, kaspa-wallet
can interact with the Kaspa node via API endpoints. Here are some key endpoints:
-
Get Wallet Info:
curl -u yourusername:yourpassword http://localhost:16110/api/v1/wallet/info
-
Get Transaction History:
curl -u yourusername:yourpassword http://localhost:16110/api/v1/wallet/transactions
-
Send Transaction:
curl -u yourusername:yourpassword -X POST -H "Content-Type: application/json" -d '{"to":"recipientAddress","amount":amount}' http://localhost:16110/api/v1/wallet/send
Refer to the API documentation for a complete list of available endpoints and their usage.
Logs are essential for monitoring the status and activities of the kaspa-wallet
. By default, logs are output to stdout
. You can redirect logs to a file by configuring the log
option in the Zinit configuration file:
log:
path: "/var/log/kaspa-wallet.log"
level: "info"
To view the logs:
tail -f /var/log/kaspa-wallet.log
Here are some common issues and solutions for kaspa-wallet
:
- Wallet not starting: Check the configuration file for errors and ensure all required fields are set correctly.
- Connection issues: Verify network settings and ensure the wallet has access to the Kaspa node's RPC server.
- RPC authentication errors: Ensure the
username
andpassword
in the RPC configuration match those used in your API requests.
-
Check wallet status:
kaspa-wallet status --data-dir /path/to/wallet/data
-
Get wallet address:
kaspa-wallet address --data-dir /path/to/wallet/data
Refer to the kaspa-wallet
documentation for a detailed list of all configuration options and their descriptions.