Hi @sanji94m
Those guys on stackoverflow are such assholes sometime …
As someone told you in your stackoverflow post, transaction are not returning values.
You need to declare an event and to call it in your function
event MyNumber(uint256 nbr);
function randomnumber() returns (bool) {
// ...
MyNumber(nbr);
return true;
}
Can you link your solidity code here ?
Use the balise Preformatted text to display your code correctly
To catch it i usually use once, you can look at this simple example from the doc.
https://web3js.readthedocs.io/en/v1.2.0/callbacks-promises-events.html#callbacks-promises-events
In which course are you stuck ? Because i didn’t see any of your answers from the course in the forum, have you done the eth 101 and 201 courses ?
Catching events is being used mainly during the project 1 or 2 of the eth 201 course.
Maybe do the course one by one before trying more advanced stuff