-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How consume values of contract ? #83
Comments
Yes, it's possible. web3 can be linked with Harmony JSON-RPC endpoint which is bind to port |
i am working with Harmony and with the example in Ethereumj EventListenerSample.java i whant to get the values with web3js in the contract deployed. but the value in the log of Harmony is Empty.
this is my code in web3js
i used the console in Chrome this is the metod "inc" this is the methos "get" where we can see that the value is 0 and this is because the transaction send the value empty. then the image of log from Harmony some idea of what I can do ? thanks |
@1jose234 value is amount of ethereum you send with this tx, as it's just contract call and you are not sending anything, value is empty. Contract call is encoded in data field. 0 encoded is the same as nothing == empty. |
Transaction value is the amount of ethereum (in wei) you send with transaction.
Do I understand your question correctly? Or I am answering wrong thing? |
@zilm13 clear but I think my problem is one of definition ... its correct ? with this mode, is not necesary use web3 true ? analyzing my question arose other... in the application I need to consult a transaction history, is this possible? |
You could use web3j to be not tied to EthereumJ and change your peer to any other in case of issues. So you could have more diversity with such approach. But I don't know how to decode
you will not have fast transaction details for your dapp from any kind of ethereum peer. It's better to add listener for any new imported block, filter transactions that interact with your contract, decode its input and store in separate db. Otherwise you may need to replay all blocks from current to contract deployment. |
i tried to work with web3j but finally i need that the Dapps will be create with different language and not only Java. In Java i want to create only the blockchain. so i need consume RPC with web3js but i can't set value to variable and update the value. |
Actually, there is no way to create Dapps with Java. What variable are you referring to? If it's a Dapp variable then it could be set only via a call message sent to the contract, you must send an Ethereum transaction. To read the value stored in the contract |
@mkalinin i have done the calls with web3js using the documentation, i can get the value of the method get. the log of Harmony |
Yep, that way it sends a Tx with call message as I mentioned above. I see that |
@mkalinin i tested setting the nonce but don't update the value and now dont create the hash
i think that could be the account, because in harmony i use the account number 2
|
What is the balance of |
Hi
I have a private Net in Ethereumj, in this net i deployed a smart contract, so i need from other Web System done in JSF show values processed in the smart contract.
I saw that with web3 its posible do with the net Ethereum for example Testnet.
With etherumj is posible to do ? for example Harmony ?
i want to do this example with EthereumJ https://medium.com/@mvmurthy/full-stack-hello-world-voting-ethereum-dapp-tutorial-part-2-30b3d335aa1f
The text was updated successfully, but these errors were encountered: