Questions tagged [web3j]
Lightweight Java and Android library for integration with Ethereum clients
31
questions
2
votes
2answers
964 views
invalid opcode “0x1c” during smart contract method execution
I have written a smart contract to test event from java project using web3j
I have prepared the web3j wrapper java class using solc compiler version
"0.5.7+commit.6da8b019.Linux.g++"
I am using a ...
11
votes
5answers
18k views
why did it returned null after call miner.start()
> miner.start()
> null
before it , I had created a account like this .
user1 = eth.accounts[0]
"0xb62f0bae52d153365661c4e23ab1d594484e9bef"
2
votes
1answer
956 views
Should I use Infura with Web3j for Event filter?
I'm using Web3j with Infura for smart contract deployment, calling contract method and transactions. Now I want to use Filter contract event from log. Should I use Infura for this? Is Web3j filter ...
4
votes
2answers
5k views
Send Custom ERC20 Tokens from one Address to another
How to send custom ERC20 tokens from one wallet to another, if i want to send EBTC/ECASH custom ERC20 tokens.
I wrote a method that can send the ether from one account to another, how could i do the ...
2
votes
2answers
6k views
Generate private key and address using web3j
How can i generate private key and address using web3j instead of creating keystore json file
8
votes
2answers
4k views
Web3j listening to events
I'm tinkering with web3j and most of the things that I want to do succeed, however I seem to not be able to listen to events.
I've extended the ballot.sol contract you get with remix by adding an ...
7
votes
2answers
8k views
How to create accounts and also retrieving the ether balance with web3j in a java file?
I do not see anything in creating accounts and retrieving ether balance in web3j's documentation, I wonder if it is possible.
0
votes
4answers
1k views
web3j-android error: static interface method calls are not supported at language level 1.7
I get this error
static interface method calls are not supported at language level 1.7
when having
Web3j web3j = Web3j.build(new HttpService(url));
documentation here says for Android you should ...
5
votes
3answers
2k views
A problem with filters and events (web3j/TestRPC). SOS! ;)
Help me, please, with this little simple task! I cannot solve this problem for several days. SOS! ;)
I'm trying to write a program for filtering events via web3j. I copied to start (for the test) from ...
1
vote
5answers
2k views
How to invoke functions of Smart Contract from Android phone?
I deployed a smart contract with solidity along with a GUI by Javascript and HTML. This project works well on my computer.
Now I want to invoke functions of Smart Contract from Android phone.
Is ...
1
vote
1answer
702 views
Web3j how to get event args when parsing logs?
I'm trying to get an event args in web3j version 4.0.1.
I use the simple syntax which is explained in the docs. I'm getting the log object but there is no args property or such thing in it.
Here is my ...
2
votes
2answers
3k views
Web3j: “Intrinsic gas too low” error when deploying contract in Ethereum from Java
I am a new to Ethereum and Blockchain, I have been trying execution of Contracts using Metamask and Remix using Chrome browser for sometime.
I am trying to deploy the same contract from Java using ...
9
votes
3answers
3k views
Deploy contract on EthereumJS TestRPC
Following https://medium.com/@mvmurthy/full-stack-hello-world-voting-ethereum-dapp-tutorial-part-1-40d2d0d807c2
I've tried to create an instance of a contract using:
VotingContract = web3.eth....
7
votes
1answer
877 views
Deploy contract in web3j quorum problem
I'm trying to deploy a smart contract (7 nodes sample from Quorum) using web3j.
It fails at get() to get the contract wrapper object. If I check the logs, a new transaction will show up, but if I call ...
5
votes
1answer
4k views
Convert String to Bytes32 in web3j?
public String solFunction(String str) {
byte[] byteValue = DatatypeConverter.parseHexBinary(str);
Bytes32 strInBytes = new Bytes32(byteValue);
try {
Uint256 value = contract....
1
vote
3answers
2k views
How to make transaction using private key and address using web3j
I have a private key and address . Is it possible to make transaction with these parameter using web3j.
6
votes
1answer
3k views
Solidity ecrecover and web3j Sign.signMessage() are not compatible, is it?
Using Web3j to sign and verify a message is fine but when I use the signature generated by Web3j to verify using ecrecover in solidity it doesnot seem to work correctly. The signer address is ...
5
votes
3answers
2k views
How to catch solidity contract revert message using web3j
Is there any way to catch solidity revert message like Remix Javascript VM in web3j
Revert message(Remix)
transact to Erecruitment.issueNewAdmitCard errored: VM error: revert.
revert The ...
3
votes
1answer
1k views
Function of smart contract returns 0 from Web3j
please help me in this problem.
I am successful to compile and deploy my smart contract using web3j on testrpc. But When I call the function that returns uint in this contract from web3j, I always ...
2
votes
1answer
1k views
How could I send transactions continuously by Web3j generated wrapper
I wrote a smart contract and deployed on my private Quorum. I use Web3j to generate java wrapper to call ABIs. For example,
// here is a smart contract function
function getMoney() external payable
...
2
votes
1answer
1k views
How can I get the TxReceipt of a transaction with web3j?
How can I get the status of a transaction through the TxHash with web3j.
I tried it like this:
public int getEstado(String trx) {
try {
JSONObject json = readJsonFromUrl("https://api....
1
vote
2answers
2k views
How to get public key from private key in Web3j
I am developing Dapp by web3j and I attempt to convert private key to public key. I found this question this question that provides a way converting private key to public key in class ECKey, but I ...
3
votes
1answer
482 views
Ethereum - how to get merkle proof
I'm trying to figure out the check of existence and the immutability of the transaction in the Ethereum block, but I do not know how to get mercle branch. With the help of web3j I can get the block ...
3
votes
1answer
4k views
web3.eth.getBalance returns me the strange values ?
i am trying to get the balance of a wallet, the method is working but the returned result is a json object - { c:(2) [484895,26495000000000],e:19, s: 1}.
In which the value - 484895 corresponds to ...
1
vote
1answer
638 views
problem when deploy smart contract in Quorum using web3j
I'm using web3J when i try to deploy contract i get
Error processing transaction request: Non-200 status code: &{Status:400 Bad Request StatusCode:400 Proto:HTTP/1.1 ProtoMajor:1 ProtoMinor:1 ...
1
vote
2answers
2k views
Creating an account using web3js or web3j
I am trying to create account on ethereum private network using web3js from front end.
I have written the below lines in my js file. The createAccount() gets called from an HTML page
web3 = new Web3(...
1
vote
1answer
804 views
Event watcher gives [object Object] in Geth console
I compiled a contract source below:
pragma solidity ^0.4.0;
////////////////////////////////////////////////////////////
// This is an example contract hacked together at a meetup.
// It is by far ...
0
votes
1answer
88 views
How to return the change to the sender?
In this answer, @pabloruiz55 provides the following code for sending ether.
SmartContract.sol
function transferToOwner() payable returns (bool) {
//Sender should forward at least 1 ether.
...
0
votes
1answer
144 views
How does Ethereum Smart Contract work on Mobile Client
I want to deploy a smart contract on server and interact with it using mobile client. I'm not familiar with how does that work but after some research, I found something like below:
If we compare ...
0
votes
1answer
115 views
Not able to add 'replayPastTransactionsFlowable' transaction logs result into an collection List object using Web3j java?
I'm trying to create an api where i have to provide transaction logs in json objects but im unable to add result of replayPastTransactionsFlowable
into an collection object
@GetMapping("/test")
...
0
votes
2answers
1k views
A bit confused. How do I send ether using Web3j to an address (Android)
EDIT: I am using android platform
I think I'm a bit confused conceptually. I would appreciate it if someone could answer these few questions for me as I'm trying to make an app so that I can be ...