Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

1
vote
0answers
26 views

Using web3j with infura returns null

I've used web3.js to handle my contracts, and it worked very well. But web3j is pretty hard for me since the beginning. I'm using android studio, infura, web3j. Since I don't know very much about ...
0
votes
1answer
29 views

How do we communicate with contract functionality which is deployed in public test network using web3j [on hold]

I would like to write a wepapp for security token contract which is deployed in public Ropsten Test Network using web3j. Need some idea. Thanks in Advance
0
votes
1answer
33 views

How to use eth_newFilter to get pending incoming transactions to a contract?

I'm trying to get pending transactions to a certain contract using Infura. Is it possible to do that using eth_newFilter? Since apparently these filters only "trigger" from contract events, does that ...
1
vote
0answers
22 views

Extra mining fees added in etherbase account

1st scenario - I have set miner.setEtherbase(eth.accounts[1]) and gasPrize is 0. 1 coin Transaction - And done transaction from 0th account to one random account. I expect 0 mining fees will add ...
1
vote
1answer
21 views

Can I send data (e.g. text) in a Transaction with Web3J?

I need to send a transaction from an account to another one via Web3J that includes not only the value field but also the data field (in particular, I need to send text). Is it possible?
0
votes
1answer
24 views

How to create a wallet file for existing account&

I found this way of creating a new ethereum account with web3j.But what if i want to create a wallet file for already registered account?i need this because most of the web3j functions require a ...
1
vote
0answers
16 views

Trouble with personalUnlockAccount,web3j

I am creating android dapp for votings I am trying to check if user's credentials are right,so i use object of PersonalUnlockAccount class and function accountUnlocked().So the problem is that when i ...
0
votes
1answer
12 views

org.web3j.protocol.exceptions.TransactionException: Transaction receipt was not generated after 600 seconds for transaction

I am sending a transaction through this code public String transferEthByPk(String amount, String toAddress, String privateKey, Web3j web3j) { BigDecimal value = new BigDecimal(amount); ...
0
votes
0answers
14 views

Java class generated with web3j has a “deploy” method wherein initialWeiValue, initialSupply have to be both specified. Isn't it the same amount?

Method in the java class generated by web3j is like this: public static RemoteCall<Crowdfunding> deploy(Web3j web3j, Credentials credentials, BigInteger gasPrice, BigInteger gasLimit, ...
0
votes
0answers
10 views

Read contract value from Android

I have deployed successfully a smartcontract onto Rinkeby at the address : 0x69cfa9009Bf2c7a9945a4f8b381db21b26b662d7 It is a tutorial smartcontract that enables an election between 2 candidate. I ...
0
votes
0answers
20 views

Get Array from a call in Web3j

I have a solidity function that returns an array. I'm trying to read the values inside this array from web3j but it gives me stage results. My solidity function function getAllSubTokenByTokenID(...
0
votes
2answers
21 views

How to find out if a wallet (an address) contains a token from a contract using web3js?

Is this possible with and without knowing the private key of the wallet.
0
votes
0answers
18 views

How to set an array of struct in the function param

this is the function : function setListObjects(ContractObject[] memory ContractObjects)public{ delete objects; ContractObject memory newObject; for (uint i = 0; i < ContractObjects....
0
votes
1answer
34 views

Transaction no confirmed and JUnit test assert fail

I have some JUnit test that assert some values returned from the blockchain deployed smart-contract. But the assert return me a error because the assertEqual call is done when the transaction has not ...
0
votes
0answers
46 views

Web3J Websocket Connection Closes

While using Web3j websocket connection faced connection closed issue. After some time the connection was established and served few requests abruptly the connection closes. Request you to share the ...
0
votes
1answer
65 views

Quorum deploy with Web3j timeout

SCENARIO: I have the following code: final String hostUrl = this.deployerProperties.getProperty("quorum.host.url"); final String hostPort = this.deployerProperties.getProperty("quorum.host.port"); ...
0
votes
1answer
25 views

Could someone explain to me the use of the FastRawTransactionManager class?

int pollingInterval = 3000; FastRawTransactionManager fastRawTxMgr = new FastRawTransactionManager(web3j, credentials, new PollingTransactionReceiptProcessor(web3j, pollingInterval, 40)); From what I ...
0
votes
0answers
52 views

Transaction receipt was not generated after 600 seconds for transaction:

I am sending a transaction through this code: txhash = careercertificate .createCertificate(id, fecha, nombre, rutalumno, instituto, rutinstituto, titulo, totalhash, ...
1
vote
1answer
45 views

Sending private key to server side

I am trying to build new Dapp application for our startup by using web3j , I am facing an issue with signing the transaction from server side , because i need to know the private key for the client (...
1
vote
1answer
108 views

Empty value (0x) returned from contract web3j

I'm trying to deploy a very simple contract on Windows 10, using Web3j 4.2.0. I've created an account using Mist. I've set up one local ethereum node (using geth) on my machine and I'm able to deploy ...
0
votes
1answer
48 views

Load smart contracts in Java application without having the java wrapper class for Web3j (only the address of the contract)

I use web3j to interact with my local Ethereum node (created with geth), and I was wondering how should I handle smart contracts created at runtime. I know that in order to deploy a smart contract ...
0
votes
0answers
20 views

Send ether from one wallet to another

I have two metamask accounts and what I want to do is send ether between those accounts. For the interaction between those accounts, use infura, I give the address of both accounts but in the end the ...
1
vote
1answer
122 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 ...
0
votes
0answers
30 views

Invalid OPCode on passing address parameter through Java wrapper on smart contract using Ganache

I have been facing this issue for some time and I realized there must be a problem with Ganache or maybe someone has any idea why it doesn't work. I have created a very simple contract as below, it ...
1
vote
2answers
70 views

Offline transaction signing with web3j?

I'd like to generate and sign a transaction offline and then send that transaction with a different account. I've found a few web3js sources and I've read the web3 documentation, but I haven't found ...
0
votes
1answer
90 views

What's problem about “gas required exceeds allowance or always failing transaction”

I translate smart contract into Java with solc and web3j, but I meet the probelm "gas required exceeds allowance or always failing transaction". This is my smart contract. It is work when I use ...
1
vote
1answer
27 views

Is it worthwhile to store my supply chain product data on the blockchain using a smart contract? [closed]

I'm currently developing an android app that uses the Web3j framework (Java) to interact with my private Ethereum blockchain (running on Ganache). The app is a supply chain tool that will let users ...
0
votes
2answers
70 views

Unable to make a transaction with Data using Java api ethSendRawTransaction

I am trying to make a transaction between two different accounts using Java. It works perfectly fine as long as I am not using "Data" parameter. My intent is not to call a smart contract but to make ...
0
votes
0answers
86 views

web3j.ethCall returns null when retrieven contract variable

Environment: Geth node Geth/v1.9.0-unstable/windows-amd64/go1.12 Commands used to start the node to mine: geth --datadir "." --networkid 101 -verbosity 6 --port 30301 --rpcport 8101 --nodiscover -...
0
votes
0answers
21 views

ERC-20 TransferFrom function exceeds GasLimit calling from other conract

I have the following error. Imagine that I have contract A, B(ERC20 implementation contract), C, D and E. They are inherit in that order. Testing the functionallity works fine in remix. But when I try ...
0
votes
0answers
10 views

Catching FilterException web3j

I'm using web3j to subscribe for transactions: Flowable<Transaction> observable = web3.replayPastAndFutureTransactionsFlowable(startBlockParameter); Scheduler ...
1
vote
2answers
96 views

Get function returned 2 values in Web3j

I wrapped a smart-contract generated in remix into a Java Project. Im trying to get the two values that return me this function. function getValues(address _a) external returns(bool, uint32) { ...
0
votes
1answer
166 views

org.web3j.tx.exceptions.ContractCallException: Empty value (0x) returned from contract

Problem: org.web3j.tx.exceptions.ContractCallException: Empty value (0x) returned from contract The code is as follows.... My java: String owner = managedWalletLookup.getOwner(contractAddress).send(...
2
votes
2answers
88 views

Too low nonce error with web3j and rinkeby

All of sudden my application on testnet has stopped working due to low nonce error. No change in source code. My app connects to the network via infura. Any ideas what could be wrong here. java.lang....
0
votes
1answer
54 views

how to find if a Tx hash is in pending state in ethereum mainnet after web3j fastTxMgr timeout

I am using QueuingTransactionReceiptProcessor() with callback accept(). DEFAULT_POLLING_ATTEMPTS_PER_TX_HASH is 10 and POLLING_FREQUENCY is 15000. That gives nearly 3 min wait for network to ...
0
votes
0answers
56 views

Build web3j to connect to blockchain [duplicate]

Can't connect to the Ethereum blockchain with web3j 4 for Android Kotlin. Worked in the previous version of web3j. fun web3(): Web3j = Web3jFactory.build(HttpService("http://192.168.38.148:7545")) ...
0
votes
0answers
56 views

Subscribe to changes in contract balance (Web3j)

Using web3j I would like to subscribe to changes in a contract balance i.e deposits and withdraws. I would like to base this subscription over transactions (and not events) since the contract does ...
0
votes
1answer
99 views

Quorum node address

In the Node class of the Quorum Web3j. The String address what is? package org.web3j.quorum; import java.util.List; /** * Quorum node configuration class. */ public class Node { private final ...
0
votes
0answers
149 views

Error: replacement transaction underpriced web 3j

I am registering a batch of 500 transactions in a java application with web3j and after a while it gives me this error: java.lang.RuntimeException: Error processing transaction request: replacement ...
0
votes
1answer
94 views

Where is the ethLogObservable method in Web3j?

I can´t find where is the Web3j ethLogObservable method. I can´t find in GitHub repo
0
votes
1answer
88 views

Recover solidity funcion event in web3j

EthFilter filter = new EthFilter(DefaultBlockParameterName.EARLIEST, DefaultBlockParameterName.LATEST, userContract.getContractAddress().substring(2)); I am trying to recover the event response that ...
1
vote
1answer
163 views

Error processing transaction request: sender doesn't have enough funds to send tx

In a Java project im testing the web3j library. there I have a method that generate a new account to the blockchain public String url = "http://localhost:7545/"; public Admin admin = Admin.build(new ...
1
vote
1answer
194 views

How to change the nonce between transactions in web3j?

I have this line of code where it registers a transaction in blockchain. And I wanted to know how I can make the nonce different between the transactions? txhash = careercertificate ....
0
votes
1answer
92 views

Error generating new account with Web3j

Im using the Web3j library to make transactions with my blockchain (Ganache). I have a method that instantiate a Web3j object and im trying to generate a new account with the given String url = "...
1
vote
2answers
55 views

java.lang.RuntimeException: Error processing transaction request: replacement transaction underpriced Output from Server

I am generating transactions in a contract I deployed in the Rinkeby network and the first 300 or 400 transactions had no errors and I received the txHash, but when I continued I got this following ...
0
votes
1answer
61 views

Calling a contract's function with input parameters and passing ether from Geth/Web3

I have deployed a smart contract which basically splits the incoming funds to the specified addresses based on the entered ratio parameter. Please find the code below: pragma solidity ^0.4.23; ...
0
votes
0answers
234 views

Quorum & web3j: Transaction has failed with status: 0x0. Gas used: 0. (not-enough gas?)

I'm doing some play & test with Quorum. I'm using example 7nodes with docker. The network is up and my simple smart contract is deployed with a set and a get function. When I call the set function ...
0
votes
1answer
143 views

ethLogFlowable: how to get event args?

I am using ethLogFlowable to subscribe to an event and read the args of the event, in my case an address and a uint256 value. I have followed this answer stackExchangeLink, but I am always getting ...
1
vote
1answer
146 views

What does the get Status () method return with a pending state transaction?

If a transaction has a successful state it returns 0x1 but if the transaction has a failed state it returns 0x0. My questions is, what to return when the transaction has a pending status? public ...
0
votes
0answers
145 views

Can anyone help me to access my eth account in metamask using infura in android

My question is about accessing my eth account in metamask using infura in android