Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

Filter by
Sorted by
Tagged with
0
votes
2answers
1k views

Getting “insufficient funds for gas * price + value” with geth on Ropsten no matter what

I'm having geth 1.7.3 (tried 1.8.x too) running in docker container: --verbosity 4 -rpc --nousb --ipcdisable --rpcaddr "0.0.0.0" --rpccorsdomain "*" --syncmode "fast" --rpcapi="db,personal,eth,net,...
0
votes
1answer
618 views

Web3j directly gets string from contract by eth_call

I just have a simple solidity contract: pragma solidity ^0.4.19; contract SampleContract { string value; function SampleContract() public { value = "hello world"; } ...
0
votes
1answer
579 views

Cannot send ERC20 tokens because user has no ethereum

I have 1 wallet server but have many account address for each user, so when user want to transfer erc-20 token say OMG to another address(user) in the same wallet server, the system said can not ...
1
vote
1answer
2k views

how to get the status of a transaction which is not mined and pending

I used the following code to send a transaction and get transaction status.However, sometimes the transaction is not minded at all. But the transactionReceipt get the same value "NULL" for both of the ...
0
votes
0answers
989 views

web3j Android, “E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!” When try to get balance

My app tries to get the balance of an ethereum address, but when testing, it crashes. I get the error "E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!" in logcat. Using web3 and android studio. Web3j ...
0
votes
0answers
115 views

Smart contracts work when deployed with Remix, but not Web3j

I have a web3j call to a smart contract ecrecover() function and I need to pass the V value. However I'm unsure as to how to convert the V value to a BigInteger. Web3j: aVerifier.verify("Kieran", "...
0
votes
0answers
430 views

How to automatically transfer ETH from my address to another

I want to format or configure my ETH wallet in a way that if any ETH comes into the address, it will automatically be sent to another address. I have the feeling that my private key is being ...
0
votes
0answers
89 views

When exactly do events fire

I have a web3J application that is supposed to deploy a contract (by calling a function on another contract) then listen for the contractCreatedEvent that is fired by the factoryContract and then call ...
0
votes
0answers
207 views

web3.js-1.0.0 General Availability (GA) Date ?

When will web3js 1.0.0 be General Available? i.e., web3 GA date
0
votes
1answer
774 views

Subscribing to event using web3j

I'm trying to subscribe to a smart contract event from my java app using web3j. I deployed my contract to truffle, here it is: pragma solidity ^0.4.24; contract MyContract { string message; ...
1
vote
2answers
1k 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 ...
0
votes
1answer
436 views

Web3j Signature and Solidity Ecrecover

I'm trying to understand how to sign a message in Java and recover the public key in a Solidity smart contract however my public keys don't seem to match. Here's my Java code to generate the ...
0
votes
1answer
52 views

ethereum javascript webpack smart contract

I'm trying to send the value from html dropdown to the smart contract, the value is extracted from the js function but I'm not able to add it to SetVote function, the execution breaks there. Html: &...
0
votes
1answer
155 views

reject transaction in metamask from code after few minutes

Can anyone tell me if it is possible to reject transaction in metamask from javascript or java code after few minutes, if user didn't submit or reject it by himself? The problem is that the user of ...
0
votes
2answers
75 views

How to prevent unwanted parties pushing data to a private chain?

For example, if a private chain genesis is distributed to a group of approved peers, however a peer makes this genesis block publicly available. How can one prevent unwanted users from joining the ...
0
votes
1answer
250 views

incorrect transaction count

I am trying to find the transaction count of an address using ethGetTransactionCount method but it's returning 0 value. What the issue over here. I'm using infura mainnet and web3j in maven /Find the ...
0
votes
1answer
357 views

Error while retrieving transaction count

I am trying to retrieve the total transaction count of an address using java, web3j and Infura as the Ethereum client. My code is as below: EthGetTransactionCount txnCount = web3j....
2
votes
0answers
422 views

JsonParseException while generating java wrapper object with web3j

so a few weeks ago I created a java wrapper object with web3j for a smart contract and was able to work with it with no problems. following exactly what I did a few weeks ago I keep getting a ...
2
votes
2answers
378 views

How do I use filter EVM log events by an indexed field in web3j?

I've looked through the documentation, but there doesn't seem to be this scenario listed. What I want to do is filter the Ethereum event log of a specific contract by an indexed field with Web3j. ...
0
votes
1answer
315 views

Getting exception when trying get balance using web3j

I use code above to get balance using web3j: Web3j web3 = Web3j.build(new HttpService("https://ropsten.etherscan.io/address/0xAccountAddress")); EthGetBalance ethGetBalance = null; try { ...
1
vote
1answer
435 views

How to call a deployed smart contract methods from android

I deployed a smart contract into my private network using truffle framework. After deployed the contract I implemented a client interface using android from android I want to call the methods of ...
0
votes
1answer
532 views

Web3j decode function from TransactionReceipt

I'm connecting to a testnet using a Geth node running version 1.8.8-stable, and also I'm using the web3j lib version 3.4.0. I deployed a Smart Contract and also used the web3j wrapper tools to ...
0
votes
1answer
263 views

Not getting any results from Web3j querying of ERC20 token's balanceOf() function

I am trying to use Web3j to query the balanceOf() function of a standard ERC20 token as shown in the code below: try { String encodedFunction = FunctionEncoder.encode(function); ...
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 ...
0
votes
2answers
379 views

Web3.eth.accounts[0] never updating

I'm trying to use Web3 to access the current account I have selected on Metamask by doing web3.eth.accounts[0] in order to display it on my UI (in VueJS). However web3.eth.accounts[0] always returns ...
2
votes
1answer
45 views

Unable to print event without JSONstringify

I am trying to understand the difference among following cases while printing the event: At web3.js listenToEvent: function(){ Contract.deployed().then(function(instance){ instance....
0
votes
1answer
64 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. ...
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 ...
0
votes
1answer
419 views

How to compute ethereum contract address with java?

I'm looking for the java version of the solution of this question. How is the address of an Ethereum contract computed? Actually I want have a solution of the problem below. I have a master ...
1
vote
1answer
480 views

Access Ethereum smart contract in Java application

I have developed smart contract in solidity using truffle and ganache. Now, I want to access that smart contract using some API. So how to do it ? Should I need to use web3j compulsory or is there any ...
4
votes
1answer
1k views

send() or sendAsync() while using Web3j to call functions

I built a java web application which connects using Web3j with my smart contract deployed on Ropsten Network. My web application provides a control panel to allow the user to send transactions to the ...
0
votes
1answer
197 views

How can I show on web3j a list of all the instructors added on my blockchain?

I need to show on an html a list of all the instructors that are set up on the list pragma solidity ^0.4.18; contract Owned { address owner; function Owned() public { owner = msg.sender; } ...
0
votes
1answer
230 views

How to do asynchronous callback in web3j?

My application is dealing with high speed RPC requests, so it cannot reply on synchronous blocking call to process requests. It wants web3j RPC calls to return tx hash immediately without blocking and ...
1
vote
0answers
238 views

Getting ClassCastException while creating wallet

Always getting this exception when I am creating new wallet file java.lang.ClassCastException org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey cannot be cast to org.bouncycastle.jcajce....
2
votes
1answer
257 views

Why would Ganache behave differently depending on geth, web3j, web3js and web3.py?

I have a smart contract token deployed in a Ganache instance. My dapp written with React and web3.js shows the same 10 accounts for eth.accounts as running the same command in the geth console. If I ...
0
votes
1answer
55 views

I am transfering ethereum but showing 0 value and the transaction is successful

I am using web3j method sendFunds to transfer ether deducting the fee the transaction successful but showing 0 value in etherscan Here is the link
0
votes
1answer
290 views

Web3j send ether transaction pending forever

i'm trying to send ether to a smart contract with a specified amount of gas usage, the transaction sending works fine and it propagates to the network but remains pending forever not being executed as ...
1
vote
1answer
495 views

How to get deposits confirmation

I am using Web3j and I want confirmation for deposits in user wallet. Is it possible if yes how can I do this using Web3j
0
votes
1answer
332 views

Serious problem! web3j-android EckeyPair returning Private Key length of 63 characters, not 64

So this is a pretty huge problem I've run into once before: I'm using web3j-android and I'm going through the process of generating random private keys and public keys using the ECKeyPair class Now ...
2
votes
0answers
1k views

How to integrate smart contracts with android app using web3j

I want to integrate smart contracts with the android app. I wrote a simple smart contract and I want to call that smart contract from android app. For example, in UI part of Android, I put one ...
0
votes
1answer
80 views

Invoke smart contract by address, from another contract

I'm trying out a publisher-subscriber smart contracts in ganache. Both the publisher and subscriber work independently, but when I try to invoke the subscriber from publisher through the contract ...
0
votes
1answer
554 views

Is there a “gas price oracle” method in Web3j?

I read about the Gas Price Oracle in Geth, but I need to use it outside the Geth client. Is there something similar in Web3j? If not can I call the oracle programatically somehow (in Java)?
4
votes
2answers
932 views

Ethereum remix web3 connection problem

I tried to connect to an ethereum node by using remix. It means that I am using http and not https. However, I receive same error message: Not possible to connect to the Web3 provider. Make sure the ...
1
vote
0answers
375 views

How to subscribe to future incoming ERC-20 token events?

I'm using web3j to subscribe to my ERC-20 token transfer events with transferEventObservable: humanStandardToken.transferEventObservable(DefaultBlockParameterName.EARLIEST, DefaultBlockParameterName....
0
votes
1answer
955 views

Generating a BIP-39 compatible Ethereum wallet results in IndexOutOfBoundsException?

Trying to configure android app to use a master seed phrase instead of individual private key generation. Using the new(ish) generatebip39wallet results in an indexoutofboundsexception. Offending ...
0
votes
1answer
618 views

Webj3 erc20 specify nonce for token transfer

How do you specify a nonce when sending erc20 tokens using web3j?
1
vote
0answers
133 views

Can deploy Smart contract from Main thread but not from a class

I have a contract: pragma solidity ^0.4.0; contract qualification { address owner; /* This function is executed at initialization and sets the owner of the contract */ function qualification() { ...
1
vote
0answers
299 views

Get and Set values of Contract remotely via Web3j returns 0 and null

I have my two Quorum nodes setup on two different machines A(X.X.X.1) and B(X.X.X.3) and I am trying to interact with the smart contract from a different machine C(X.X.X.4) via Web3j. Below is the ...
0
votes
2answers
793 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 ...
1
vote
0answers
269 views

String returned from mapping of struct array

I want to store some details from every transaction. These are the struct and the variable: struct MoneyTransfer{ address sender; string comment; uint creationTime; uint quantity; } ...

1 2 3
4
5
7