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

0
votes
1answer
18 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
36 views

Build web3j to connect to blockchain

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
21 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
29 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
36 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
25 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
29 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
40 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
43 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
27 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
26 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
23 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
62 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
42 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
29 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
30 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
0
votes
1answer
35 views

How to Serialize/Deserialize array of bytes?

I'm writing a smart contract and inevitably need to have arrays of bytes as input and output of functions. In remix arrays work just fine but with web3j and web3js there are several issues with arrays ...
0
votes
1answer
41 views

How to apply EthFilter to specific address?

In web3.js, we can apply event filter something like below: this.event = this.Contract.events.MyEvent({ filter: { address: "0xAccountAddress" }, }) In Web3J, it is translated to EthFilter ...
0
votes
1answer
63 views

Contract.methods.transfer is a not a function error using web3

Running something simple as this: Contract = new web3.eth.Contract(this.contractABI, this.contractAddress) Contract.methods.transfer(toAccount.address, transfferAmount).encodeABI() Gives me ...
0
votes
0answers
16 views

How to do decoding with web3j?

I am looking for how to decode the input data of a transaction and what I have obtained up to now is in utf-8 and it gives me this data: "Ã;` Q ò  à                          ...
0
votes
0answers
21 views

Anyone with knowledge in org.web3j.abi.Type Decoder?

I am trying to decode a String with this code that I found but I have not been able to do it. String to = inputdata.substring(10, 74); String value = inputdata.substring(74, 138); Method refMethod = ...
0
votes
0answers
45 views

How to decode the input data in java?

I receive the input data as the image shows. And when I try to decode it with the method: String inputdata = null; Optional<Transaction> tx = web3.ethGetTransactionByHash(txHash).send()....
1
vote
1answer
50 views

Get the input data of a transaction with web3j

How can I retrieve transaction details (including the input data) from a txHash using Web3j? I tried the following method: public void buscarHhash(Web3j web3, String txHash) throws IOException { ...
1
vote
1answer
61 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....
0
votes
1answer
39 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 ...
1
vote
1answer
25 views

How to get the txHash of a transaction?

I have this method where I make a transaction to the network rinkeby, but to know how I can get the hash of the transaction made. I am using java with web3j, in addition to using infura to connect to ...
1
vote
2answers
47 views

Pass specific address in Web3J send method

How to pass specific address in send method in Web3J? For example, using web3 javascript library, we can pass from address like below. contract.someMethod().send({ from: this.props.accounts[0] }) ...
1
vote
1answer
58 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 ...
0
votes
0answers
18 views

Is still the solidity can not handle prime256v1 operations [duplicate]

I would like to use prime256v1 instead of secp256k1 because prime256v1 is more secures,so can I do that and implement the operations of Blind ECDSA operation verification in solidity? I mean I want ...
0
votes
2answers
94 views

How to install web3j command line to generate smart contract wrapper

I am trying to generate a simple smart contract wrapper using solc and web3j in ubuntu. I have downloaded the source as defined in https://docs.web3j.io/command_line.html Release package can be ...
0
votes
2answers
45 views

transactionHash returned null sometimes when trying to transfer funds using web3j (random behaviour)

I am transferring funds using web3j. However, I was getting transactionHash as null. I checked various posts and found that this issue exist when gas price or gas is bad. I increased both the values, ...
3
votes
1answer
58 views

how to use web3j over infura to find exact gas price used for a successful transaction

my goal is to compute the cost of gas for a successful tx. I get a callback when a transaction succeeds and i retrieve gasUsed with transactionReceipt.getGasUsed(). Now I need to know the exact gas ...
0
votes
1answer
103 views

how to deploy a smart contract in ethereum using web3j

i am following this tutorial tutorial under the section Working with smart contracts with Java smart contract wrappers i followed the same steps but i am getting RunTimeException here is the full ...
1
vote
0answers
49 views

[RuntimeException: java.lang.NoSuchMethodException: SmartContract using web3j

I am following this tutorial for deployment of contract https://www.youtube.com/watch?v=ibAh04Csp0M&index=33&list=PL16WqdAj66SCOdL6XIFbke-XQg2GW_Avg but i am getting [RuntimeException: java....
0
votes
3answers
24 views

Transfer ETH using third party

I want to transfer ETH from an individual address to another address. So is there any API provider who can send ETH from single Address to another address. Also If I setup Web3 in windows machine ...
1
vote
1answer
93 views

Not able to decode the input data from transaction using web3j

I am creating transactions using web3j and passing some private data in that transaction. The transaction is also getting mined . I have subscribed to the mined blocks, where I am fetching the ...
0
votes
1answer
75 views

java.lang.ClassCastException: org.bouncycastle to error while creating wallet using web3j

I am using web3j to create account. String walletFileName = WalletUtils.generateFullNewWalletFile(" <password>",new File("some/path")); But getting this error: java.lang.ClassCastException: ...
1
vote
3answers
77 views

How to check if geth node is running ,from web3j code

I am connecting to Geth using Web3j plugin. web3j = Web3j.build(new HttpService("http://<ip>:<port>")); // defaults to http://localhost:8545/ However, if the Geth node is not started, ...
2
votes
1answer
108 views

How to call geth mining through java code manually ?

I am using web3j and Geth and created a private network. However, I want to do the mining manually whenever required, since don't want to jam the server when I am in the development phase. For that, I ...
1
vote
2answers
84 views

web3j: EthSendTransaction.sendTransaction() is throwing “Error processing transaction request: Invalid params: invalid format”

I am trying to send a transaction to an address: 0xDD210......... using the EthSendTransaction.sendTransaction() method from the org.web3j.protocol.core.methods.response.EthSendTransaction library. ...
2
votes
2answers
120 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 ...
1
vote
1answer
72 views

web3j event listening on android project

I trying to listen events from smart contract but my code isn't working. what's the problem? Event event = droneChain.UPDATEMISSIONSTATE_EVENT; String encodedEventSignature = EventEncoder.encode(...
2
votes
1answer
52 views

How Can I call contract's function from Java?

There is BizzleTokenSale contract. pragma solidity ^0.4.2; import "./BizzleToken.sol"; contract BizzleTokenSale { address admin; BizzleToken public tokenContract; uint256 public tokenPrice; ...
0
votes
1answer
122 views

how to get latest block number using web3j java APIs

I ask the network for current balance of the address i want to keep track. after that i want to detect/listen incoming deposits starting at the latest block number at the start of my program/server. ...
1
vote
3answers
99 views

How can i read symbol and name of the token in transaction?

How can i read symbol and name of the token in transaction? I tried to decode input data from transaction, but it wasn't success. the latest Web3j does not have toAscii method in java. Should i use ...
1
vote
1answer
122 views

Creating wallets with Web3j

I generate a code to create wallets for a private chain made with ethereum. String password = unlockAccountParameter.getPass(); ECKeyPair keyPair = Keys.createEcKeyPair(); WalletFile ...
0
votes
1answer
153 views

Create account with web3j

Im trying to create a account using the web3j library. But i can´t find the method that create accounts. My idea is to make this judgment but not in the Geth console, but yes in the Java application ...
0
votes
1answer
81 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
90 views

retry mechanism for transactions in web3j

In my Java-web-application I have (with one click) to send about 120 transactions after each other from the same address to the same smartcontract. My question: is there any java libraries or ...
-5
votes
1answer
50 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 ...