Moneroger is a Go library that provides robust process management and coordination for Monero daemons (monerod) and wallet RPC services. It handles process lifecycle, configuration, and health monitoring with proper error handling and graceful shutdown support.
THIS IS NOT A MONERO-WALLET-RPC implementation. It should be combined with one of the extant monero-wallet-rpc implementation, such as monero "github.com/monero-ecosystem/go-monero-rpc-client/wallet"
-
🚀 Automated Process Management
- Start/stop monerod and monero-wallet-rpc processes
- Automatic executable discovery in system PATH
- Health monitoring and port availability checks
- Graceful shutdown handling
-
🔒 Security First
- Automatic secure RPC credential generation
- Proper authentication between components
- Safe process handling and cleanup
-
⚙️ Flexible Configuration
- Support for both mainnet and testnet
- Configurable data directories and ports
- Timeout controls for operations
- Custom RPC credentials
-
🛠️ Developer Friendly
- Structured error handling with context
- Clear component separation
- Comprehensive testing
- Well-documented API
go get github.com/opd-ai/moneroger
Requires Go 1.21 or later.
- Monero daemon (
monerod
) installed and in system PATH - Monero wallet RPC (
monero-wallet-rpc
) installed and in system PATH - Write permissions for data directory
package main
import (
"context"
"log"
"github.com/opd-ai/moneroger/monerod"
"github.com/opd-ai/moneroger/monerowalletrpc"
"github.com/opd-ai/moneroger/util"
)
func main() {
ctx := context.Background()
// Configure services
config := util.Config{
DataDir: "/path/to/monero/data",
WalletFile: "/path/to/wallet.keys",
MoneroPort: 18081,
WalletPort: 18082,
TestNet: false,
}
// Start Monero daemon
daemon, err := monerod.NewMoneroDaemon(ctx, config)
if err != nil {
log.Fatal(err)
}
defer daemon.Shutdown(ctx)
// Start wallet RPC service
wallet, err := monerowalletrpc.NewWalletRPC(ctx, config, daemon)
if err != nil {
log.Fatal(err)
}
defer wallet.Shutdown(ctx)
// Services are now running...
}
type Config struct {
// Base directory for blockchain data and wallet files
DataDir string
// Path to the Monero wallet file (.keys)
WalletFile string
// TCP port for monerod RPC service (default: 18081)
MoneroPort int
// TCP port for wallet RPC service (default: 18082)
WalletPort int
// Run on testnet instead of mainnet
TestNet bool
}
The library provides structured error handling with categorized errors:
switch errors.GetKind(err) {
case errors.KindNetwork:
// Handle network-related errors
case errors.KindProcess:
// Handle process management errors
case errors.KindConfig:
// Handle configuration errors
case errors.KindTimeout:
// Handle timeout errors
case errors.KindSystem:
// Handle system-level errors
}
Run the test suite:
go test ./...
For verbose output:
go test -v ./...
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Run tests and ensure they pass (
go test ./...
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
- Go 1.21+
gofumpt
for code formatting- Access to Monero executables for integration testing
This project is licensed under the MIT License - see the LICENSE file for details.
- Monero Project for the core Monero software
- go-password for secure password generation
This project is under active development. API may change before reaching v1.0.0.