tryin to properly setup monero xmr on express node and server
Budget: $30 – $250 USD
ive setup ./Monerod and got it running, how ever when trying trying to set up rpc and cli, i keep getting daemon errors...
looking for anyone who can help me fix the few glitches im having and a decent quote forthis issue
here is the code i have for the express js
const --- Monero-Ts
// Monero Wallet Creation
try {
// Initialize connection variables
let daemon, walletRpc;
// Connect to Monero Daemon RPC
try {
daemon = await moneroTs.connectToDaemonRpc("http://localhost:28080/monero-gui-v0.18.3.1/monero-x86_64-linux-gnu-v0.18.3.1");
console.log("Successfully connected to Monero Daemon RPC.");
} catch (daemonError) {
console.error('Error connecting to Monero Daemon RPC:', daemonError);
throw daemonError; // Rethrow to be caught by the outer try-catch
}
// Connect to Monero Wallet RPC
try {
walletRpc = await moneroTs.connectToWalletRpc("http://localhost:18081/monero-gui-v*****1/monero-x86_64-linux-gnu-v***", "(monerodusernamewashere)", "(monerodpasswordwashere)");
console.log("Successfully connected to Monero Wallet RPC.");
} catch (walletRpcError) {
console.error('Error connecting to Monero Wallet RPC:', walletRpcError);
throw walletRpcError; // Rethrow to be caught by the outer try-catch
}
// Proceed with wallet creation or opening
let walletExists = false;
try {
await walletRpc.openWallet("xmrwallet", "(passwordwashere)");
walletExists = true;
} catch (e) {
console.log("Wallet does not exist. Creating a new one.");
}
if (!walletExists) {
await walletRpc.createWallet({ path: "xmrwallet", password: "Sysiler4!!" });
}
const xmrPublicAddress = await walletRpc.getPrimaryAddress();
const xmrPrivateViewKey = await walletRpc.getPrivateViewKey();
const xmrPrivateSpendKey = await walletRpc.getPrivateSpendKey();
await walletRpc.close();
data.xmr = { publicAddress: xmrPublicAddress, privateSpendKey: xmrPrivateSpendKey, privateViewKey: xmrPrivateViewKey };
} catch (xmrError) {
console.error('Error during Monero wallet creation:', xmrError);
data.xmr = { error: 'Failed to create Monero wallet', message: xmrError.message };
}
looking for anyone who can help me fix the few glitches im having and a decent quote forthis issue
here is the code i have for the express js
const --- Monero-Ts
// Monero Wallet Creation
try {
// Initialize connection variables
let daemon, walletRpc;
// Connect to Monero Daemon RPC
try {
daemon = await moneroTs.connectToDaemonRpc("http://localhost:28080/monero-gui-v0.18.3.1/monero-x86_64-linux-gnu-v0.18.3.1");
console.log("Successfully connected to Monero Daemon RPC.");
} catch (daemonError) {
console.error('Error connecting to Monero Daemon RPC:', daemonError);
throw daemonError; // Rethrow to be caught by the outer try-catch
}
// Connect to Monero Wallet RPC
try {
walletRpc = await moneroTs.connectToWalletRpc("http://localhost:18081/monero-gui-v*****1/monero-x86_64-linux-gnu-v***", "(monerodusernamewashere)", "(monerodpasswordwashere)");
console.log("Successfully connected to Monero Wallet RPC.");
} catch (walletRpcError) {
console.error('Error connecting to Monero Wallet RPC:', walletRpcError);
throw walletRpcError; // Rethrow to be caught by the outer try-catch
}
// Proceed with wallet creation or opening
let walletExists = false;
try {
await walletRpc.openWallet("xmrwallet", "(passwordwashere)");
walletExists = true;
} catch (e) {
console.log("Wallet does not exist. Creating a new one.");
}
if (!walletExists) {
await walletRpc.createWallet({ path: "xmrwallet", password: "Sysiler4!!" });
}
const xmrPublicAddress = await walletRpc.getPrimaryAddress();
const xmrPrivateViewKey = await walletRpc.getPrivateViewKey();
const xmrPrivateSpendKey = await walletRpc.getPrivateSpendKey();
await walletRpc.close();
data.xmr = { publicAddress: xmrPublicAddress, privateSpendKey: xmrPrivateSpendKey, privateViewKey: xmrPrivateViewKey };
} catch (xmrError) {
console.error('Error during Monero wallet creation:', xmrError);
data.xmr = { error: 'Failed to create Monero wallet', message: xmrError.message };
}