Questions tagged [java]

Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible.

Filter by
Sorted by
Tagged with
1
vote
0answers
15 views

Error processing transaction request: Number can only safely store up to 53 bits

I have the following code (in clojure): 212 (def CGP 213 (reify ContractGasProvider 214 (getGasPrice [_ contract-func] (BigInteger. "1")) 215 (getGasLimit [_ contract-func] (...
0
votes
1answer
23 views

transactions signed always reverted

I don't know how to send a signed transaction against a method payable in Ganache, can someone help me??? When I call the method in Remix it works fine but from Java I get the Hash of the transaction ...
1
vote
0answers
55 views

Encoding ABI function signature in Java using web3j?

Is there a generic way to simply take an ABI function, something like: { "name":"foo", "inputs":{ "interalType":"uint256", "...
0
votes
1answer
25 views

How to access already deployed Smart Contract using Java?

I would like to get information about token. For example total supply and so on. For this I need the contract. However what is the way to actually load it/access it from Java? Checking examples in ...
1
vote
0answers
27 views

How do I get the transfer/transaction history of an erc20 token using web3j givin an address

I am not sure how to view the the txhistory of an erc20 token for a specific address. I use a java token wrapper for my erc20 toke as below: public class ERC20 extends Contract { public static final ...
1
vote
1answer
144 views

How to specify Solidity version in web3j?

I have a simple java maven project whose pom.xml looks like: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" ...
0
votes
1answer
70 views

Execution Reverted Details

I am writing code in Java and trying to calculated potential gas units, for a function call on my methods. I am trying to do so by using infura as a provider for my web3 Instance, and then created a ...
1
vote
1answer
709 views

How to use Web3j call Multicall Contract?

I need to use Multi Call contract to merge multiple calls,Its address on the mainnet is 0x2cc8688C5f75E365aaEEb4ea8D6a480405A48D2A contract Multicall { struct Call { address target; bytes ...
1
vote
2answers
67 views

TransactionException: Cannot unmarshal invalid hex string when deploying contract in web3j

I have a java server that uses web3j library with geth as the provider. When I tried to deploy my contract on my private test net. I got this error: org.web3j.protocol.exceptions.TransactionException: ...
1
vote
1answer
112 views

web3j command-line does not recognize flags

I am trying to run the command such as web3j solidity generate -b SimpleBank/SimpleBank.bin -a SimpleBank/SimpleBank.abi -o ~/IdeaProjects/quiknode/src/main/java/ -p com.simplebank Found here: https:/...
1
vote
1answer
33 views

Unable to executive function of smart contract on android studio java file

I am trying to execute some functions of my deployed contract in Android Studio through a Java file. I have generated Java Wrapper files. However, when I run Android Studio, there is no data added to ...
0
votes
0answers
93 views

Cannot generate java wrapper class from contract

currently I am trying to generate a java wrapper contract from my smart contract. The command I use is as seen below : web3j truffle generate --javaTypes C:\Users\name\Documents\test\...
0
votes
0answers
118 views

Verifying ethereum message signatures with java

I am using web3j to verify message signatures but there are some false negative results. For example this signature should be right, but it seems like the address could not be recovered: final ...
1
vote
0answers
62 views

Ethereum account for HD Wallet key generated with xpub key only using bitcoinj

Accordingly to the BIP32/BIP44 specification recommendations I generating HD Wallet addresses using bitcoinj library (DeterministicKey instances) with the path like M/44'/60'/0'/0/0 using xpub key ...
0
votes
0answers
181 views

Listen to latest event emitted by smart contract with web3j API in JAVA

I'm having a smart contract: pragma solidity ^0.4.21; contract NodeServie{ event triggerEvent(address indexed _sender, string randomStr); function callEventFunc(string str) public{ ...
0
votes
0answers
17 views

Downloading Epirus and Java In Git Bash Terminal - Error Message “Unable to Access Jar File” (I'm Using Windows 7)

I tried downloading the web3j/epirus command line tool as stated on your website: https://github.com/syscoin/sysethereum-contracts But I keep getting the error message 'Unable to access jar file' It ...
0
votes
1answer
657 views

Attempting to transfer erc20 token, but keep encountering insufficient funds for gas * price + value

I'm attempting to transfer an erc20 token, but keep running into insufficiant funds for gas * price + value, regardles of how much eth I have, I also have an estimate function which returns a value ...
0
votes
1answer
43 views

How to reliably send transaction via web3j while connection is poor?

I use Transfer.sendFunds(Web3j, Credentials, BigDecimal, Convert.Unit) to transfer money. Usually I convert it to flowable. Flowable/RemoteCall completes when transaction is included in block (...
0
votes
0answers
46 views

Ethereum address(generated) and ecrecover computed address is not matching

I created the Ethereum address by following the below steps . 1. Generated a public key(ECDSAsecp256k1) from HSM. 2. Generated a Keeccak256 hash of Q point of ECPublicKeyParameters ...
0
votes
0answers
34 views

where to host my Java web app to fully decentralised?

I need a idea to host my webapp to be on some secure distributed network. my client doesn't want to deployed on aws or gcp. he wants it to be on decentralised network p2p. Your suggestion and advice ...
0
votes
0answers
14 views

org.web3j 4.5.18 ethGetBalance get stuck

I'm using the following simple code in order to obtain the wallet balance: Credentials credentials = Credentials.create(privateKey); web3.ethGetBalance(credentials.getAddress(), ...
0
votes
1answer
136 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
0answers
506 views

How to get Ethereum transaction list by address in java web3j quickly?

Im trying to fetch transaction logs from ganache using web3j library to send it as an api ,is there any way where i can get all transactions from ganache quickly? @GetMapping("/test") public List&...
0
votes
1answer
220 views

How to use gas price for faster transaction in erc20 transafer event?

I'm trying to provide a customised gas price for faster transaction ,how can achieve that ? Web3j web3 = Web3j.build(new HttpService("http://")); ERC20 javaToken = ERC20.load(contractAddress,...
1
vote
0answers
185 views

Not able to decode the input data from transaction using web3j (Java)

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 ...
1
vote
1answer
413 views

How to decode InputValue of ethereum using java web3j

**I'm trying to decode the inputValue of an transaction using web3j without using any contract abi and wrapper class,Im loading the contract using its contract address ,is there any way/inbuilt ...
1
vote
2answers
457 views

Unable to invoke smart contract function from Web3j contract wrapper

I've been learning about interacting with smart contracts through Android and the Web3j framework but have run into an issue. I'm trying to mint an ERC721 token and send it to an address but it doesn'...
1
vote
1answer
49 views

how can i fetch all the tokens from ethereum network to my wallet ?using web3js(nodejs) or web3j(java)?

I'm trying to fetch all the available tokens from ethereum network into my android wallet but could not able to find an suitable solution other than web scrapping
1
vote
0answers
123 views

Curl Request Java - How To

I am looking to use some of the management admin API's found here: https://github.com/ethereum/go-ethereum/wiki/Management-APIs but unfortunately, the web3j library does not support the calls that I ...
0
votes
1answer
397 views

Not able to generate java wrapper class from solidity smart contract using truffle

I'm trying to generate java wrapper class of solidity smart contract using truffle but not getting wrapperclass.java file Here is an command which i've used to generate abi/Json of that contract ...
2
votes
1answer
1k views

How estimate GAS from a contract call with Web3j

I'm trying to estimate gas cost of a contract call, i need to send a string to a contract, but i need to see if i overtook the GAS limit. I'm trying like this: Transaction t = Transaction....
0
votes
1answer
127 views

Listen to Ethereum transactions

I need to listen ethereum transactions for current count of addresses using web3j. I know that I can use subscribe to get transactions, but how can I add some filter to listen a certain number of ...
1
vote
1answer
70 views

Cryptocurrency payments in Centralized Architecture

I'm new to cryptocurrency, so not sure if I'm asking the right question on this... I want to develop a game with traditional centralized client/server architecture, probably java application server, ...
1
vote
0answers
131 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 ...
2
votes
1answer
247 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); ...
1
vote
1answer
173 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 ...
1
vote
0answers
392 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, ...
0
votes
1answer
356 views

Can't connect Android app to Ganache using retrofit

I'm have deployed contracts on ethereum blockchain. I have ganache running on server I'm tring to connect to it from android with this code: private BlockChainService() { Retrofit retrofit =...
0
votes
0answers
106 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
868 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 ...
1
vote
1answer
51 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
379 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 ...
1
vote
1answer
453 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
1answer
2k 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 ....
1
vote
2answers
257 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 ...
3
votes
1answer
418 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
1answer
738 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
0answers
65 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 ò  à                          ...
1
vote
1answer
290 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 = ...
1
vote
0answers
529 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()....