I have many questions about the workflow ( sequence ) of interacting with the smart contract from Java application, so I will first explain what I have done and then put my questions, and if something wrong in my understanding please let me know.
1- I have written smart contract 2- Use truffle to get the smart contract java wrapper.(contract.java) 3- Use testrpc to test the contract
I have 2 class uses testrpc accounts (credentials) to interact with the smart contract and call its functions
Each class (node1.java, node2.java) call a function in the smart contract called (send) to send their data to the chain.
I have added an event which trigger if the 2 nodes have sent there data
What I don't understand is, how I can let the java code ( Let say MainProgram.class) always check for that event. Because I need to check if both nodes send their data, then I will call another function to analyse this data.
How I can manage, control and check what transactions have been done or not, I mean how I can use the events in java code and let the code run forever and check if the this event happen, do action.
Hope I can explain what I need clearly
Thank you in advance.