Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including
Stack Overflow
, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Monero Stack Exchange is a question and answer site for developers and users of the secure, private and untraceable cryptocurrency Monero. It only takes a minute to sign up.
Sign up to join this community
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
try {
//connect to daemon
let daemon = await monerojs.connectToDaemonRpc("http://localhost:28081", "pinkumonero", "1234");
let height = await daemon.getHeight();
console.log("Height is:", height);
const response = axios.post("http://localhost:28082",
publicKey,
headers: {
'Content-Type': 'application/json'
}).then((responseData) => {
dataFetched = responseData.data;
console.log("Result of fetching balance", dataFetched);
res.status(200).json({ Balance: dataFetched });
} catch (err) {
console.log("Error in fetching balance of XMR", err);
res.status(500).json({ StatusCode: "0", Message: "Error in XMR balance fetching", error: err.message })
–
Thanks for contributing an answer to Monero Stack Exchange!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.