Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

Filter by
Sorted by
Tagged with
0
votes
1answer
351 views

web3j.ethSendRawTransaction wait until the transaction is successfully mined - Web3j

Im trying to send 0 ether to the same account with Web3j, however when i run this code it give me directly the transaction hash, even if the transaction has not been mined yet and still pending. I can'...
0
votes
1answer
295 views

Send function transaction to existing smart contract using web3j

I've been exploring web3j and got the credentials working so I'm able to send transactions from an ethereum address. Now I want to send a transaction to an already existing smart contract and use a ...
0
votes
1answer
410 views

Port number for connecting web3 to mainnet using Geth

I am trying to connect web3j object to the mainnet using geth. I can't use infura because i am working with replay transaction observable function which doesn't work with infura. To connect with the ...
0
votes
1answer
67 views

java.lang.RuntimeException: Error processing transaction request: insufficient funds for gas * price + value when deploying smart contracts

I am trying to deploy smart contract using web3j. My code is as follows: @RequestMapping("/") public String index() throws Exception { Web3j web3j = Web3j.build(new HttpService("https://...
0
votes
1answer
91 views

LoadCredentials function returns file not found exception

I am using the following code to deploy my contract: @RequestMapping("/") public String index() throws Exception { Web3j web3j = Web3j.build(new HttpService("https://rinkeby.infura.io/v3/...
0
votes
1answer
468 views

Failed to connect to localhost/0:0:0:0:0:0:0:1:8545

When I am doing one transaction with the help of Java web3j library, it's not connecting to localhost(my private network). And giving this error. package com.kaushik.blockchain; import java.math....
0
votes
1answer
381 views

How to generate ERC-20/xxx token addresses?

How to generate ERC-20/xxx token addresses, from which I can receive/send corresponding tokens? How can I do this using web3j?
0
votes
1answer
257 views

How to get contract creator using web3j?

How can I get the address of the creator of a contract using web3j? Is it possible to get the first transaction of a contract and assume that the "from" field is the contract creator? If so, how can I ...
0
votes
1answer
296 views

java.lang.RuntimeException: Error processing transaction request: insufficient funds for gas * price + value when invoking smart contract function

using web3j for loading a contract which is deployed on the private network following this tutorial https://web3j.readthedocs.io/en/latest/smart_contracts.html#constant-methods smart contract ...
0
votes
0answers
25 views

Storing generated accounts. Security

I originally built a system that had a front end where users simply entered some details and a password which then generated them a wallet and emailed it to them. My aim was that the user could then ...
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
558 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
0answers
938 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
110 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
388 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
87 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
206 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
411 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
150 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
1answer
331 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....
0
votes
1answer
299 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 { ...
0
votes
1answer
500 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
243 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
1answer
193 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
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
288 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 ...
0
votes
1answer
909 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
2answers
690 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 ...
0
votes
1answer
442 views

How is it possible that Web3j is send Transaction over Infura.io?

Infura can't unlock Accounts over JSON RPC/web3.js infura FAQ. How is it possible that Web3j can send Transaction over Infura.io? Web3js uses also JSON RPC to communicate with the Blockchain. So ...
0
votes
1answer
603 views

Web3j - Transfer.sendFunds wait forever

After struggling with issue from Geth (then I decided to use Geth 1.8.2, magically it solve the problem). I found 2 approaches to send ether : The First approach are the codes following ...
0
votes
1answer
305 views

Interacting with the smart contract from Java application (We3j)

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 ...
0
votes
1answer
359 views

How to list all recipts in a block using web3js?

I'm trying to list all transactions and their receipts from given block. Transactions get be included in the result of GetBlockByNumber function but I have found no option to include receipts. I can ...
0
votes
1answer
231 views

Correct way to easily call function with web3j from deployed contract

I am trying to call a function from a modified ERC20 contract and I can't manage to make it work. I am doing this with web3j from Android. I can connect to Infura. The contract is already deployed on ...
0
votes
1answer
345 views

Not able to convert and access Tuples of bytes array and convert to string in Java using web3j

I am new to the development of smart contract using web3j. I am facing issue, while converting Bytes32[] returned from wrapper of contract(.sol) method to array. I have contract as: pragma solidity ...
0
votes
0answers
349 views

Why do I always get 'private key length is invalid' when launching testrpc from java with predefined accounts?

Im trying to deploy testrpc from java with two accounts starting with funds, and I keep getting an error saying "private key length is invalid" from testrpc. Below is my code: private static final ...
0
votes
0answers
278 views

cannot deploy a contract with web3j

I am able to generate the contract just fine, and able to create a wallet, but when I try to deploy the contract on testrpc, I always get an exception saying I dont have enough funds. How can you ...
0
votes
0answers
251 views

Subscription stop after only a few blocks in Web3j

I am using the following code to catch and receive new transactions: DefaultBlockParameter startingBlock = DefaultBlockParameter.valueOf(lastActionedBlockNumber.add(BigInteger.ONE)); ...
0
votes
2answers
451 views

How to use balanceOf function with Web3j for an android app

I am trying to use the balanceOf function after the generation of our smart contract (pakoin) function wrappers in Java with Web3j. Despite trying different ways, I get plenty of errors and I don't ...
0
votes
2answers
1k views

Android webj3 “insufficient funds for gas * price + value” exception

I'm trying to send ether in my Android app between 2 addresses which were opened using Metamask.io There is a balance of 2 ethers in "from" account. Here the code Web3j web3 = Web3jFactory....
0
votes
1answer
1k views

Unable to retrieve value from Web3j sendFunds Future

I have been trying to send funds from one ethereum account to another using web3j to test that it works on Android. I am using an Infura cloud instance. First, it appears I need to send it async ...
0
votes
1answer
1k views

How to speed-up Geth transactions in private blockchain?

I'm testing Ethereum smart contracts with web3j and Geth. Geth is running with scripts like that: PASSFILE=/var/folders/_l/kl9pdj2x50v7416j8htb6w740000gn/T/pwd6597172766860806720.tmp DATADIR=/var/...
0
votes
1answer
397 views

Getting exception with web3j new transaction listener code

I am using web3j to receive all new transactions as they are added to the blockchain. I am using private blockchain. Here is my code: web3j.transactionObservable().subscribe(tx -> { ...
0
votes
2answers
239 views

Smart Contract with web3j - Stored SHA hash returned is not the same as input

I have a contract that stores sha-256 hashes of documents (stored as bytes32). I also have a method to retrieve a hash that is mapped to a unique id for the document. However, when I retrieve and ...
0
votes
2answers
361 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 ...
0
votes
1answer
306 views

calling method using web3j returns null

while calling an contract method using web3j returns null.Deployed in Remix ,getting response and deployed in geth console ,got response.
-5
votes
1answer
110 views

Need help integrating ERC20 on Exchange [closed]

Pardon my ignorance, as I have very less knowledge of ERC20 and Ethereum. I am part of an exchange development and we have successfully integrated coins but when it came to ERC20 tokens, we are ...