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”
go get github.com/opd-ai/moneroger
Requires Go 1.21 or later.
monerod
) installed and in system PATHmonero-wallet-rpc
) installed and in system PATHpackage 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 ./...
git checkout -b feature/amazing-feature
)go test ./...
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)gofumpt
for code formattingThis project is licensed under the MIT License - see the LICENSE file for details.
This project is under active development. API may change before reaching v1.0.0.