Here is my code:
const Monero = require('monerojs');
var daemonRPC = new Monero.daemonRPC({ autoconnect: true })
.then((daemon) => {
daemonRPC = daemon; // Store daemon interface in global variable
const walletRPC = new Monero.walletRPC() // Connect with defaults
.then(wallet => {
walletRPC = wallet;
walletRPC.create_wallet('monero_test_wallet', '')
.then(new_wallet => {
walletRPC.open_wallet('monero_test_wallet', '')
.then(wallet => {
walletRPC.getaddress()
.then(balance => {
console.log(balance);
})
.catch(err => {
console.error(err);
});
})
.catch(err => {
console.error(err);
});
})
.catch(err => {
console.error(err);
});
});
})
.catch(err => {
throw new Error(err);
});
And my error:
(node:8373) UnhandledPromiseRejectionWarning: Failed to autoconnect to wallet
(node:8373) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:8373) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I'm a newbie, so help would really be appreciated. Thank you so much in advance!
2019-05-30 20:14:58.356 0x7fffab02d380 ERROR wallet.wallet2 src/wallet/wallet2.cpp:2540 Blocks start before blockchain offset: 0 1775600 2019-05-30 20:14:58.415 0x7fffab02d380 ERROR wallet.wallet2 src/wallet/wallet2.cpp:2059 !m_blockchain.is_in_bounds(current_index). THROW EXCEPTION: error::out_of_hashchain_bounds_error 2019-05-30 20:14:59.469 0x7fffab02d380 ERROR wallet.wallet2 src/wallet/wallet2.cpp:2720 m_blockchain.size() != stop_height. THROW EXCEPTION: error::wallet_internal_error
– Confused ArchMonero Dev May 30 '19 at 20:16monero-wallet-rpc --rpc-bind-port 28083 --disable-rpc-login --wallet-dir /some/path
if you want to start it without a wallet. – jtgrassie May 30 '19 at 20:24/some/path
be? (I'm sorry I really don't know what I'm doing) – Confused ArchMonero Dev May 30 '19 at 20:38019-05-30 20:55:09.820 [RPC0] ERROR wallet.wallet2 src/wallet/wallet2.cpp:4585 !is_keys_file_locked(). THROW EXCEPTION: error::wallet_internal_error
– Confused ArchMonero Dev May 30 '19 at 20:55/some/path
needs to be a directory on your system that will be used when you create a wallet. It must exist and be writable. – jtgrassie May 30 '19 at 21:29