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 [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.

0
votes
1answer
34 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(...
0
votes
0answers
30 views

Generate derivated address from xpub

I managed to get Bitcoin addresses from xpub using bitcoinj with this code : DeterministicKey hd = DeterministicKey.deserializeB58("xpub...", MainNetParams.get()); DeterministicHierarchy hi = new ...
0
votes
0answers
16 views

In ethereumj, why the signature use loop to get v?

In the java version of Ethereum, I see the signature code as follows: public ECDSASignature sign(byte[] messageHash) { ECDSASignature sig = doSign(messageHash); // Now we have to work ...
1
vote
1answer
81 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
37 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 ...
1
vote
1answer
53 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
48 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
18 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
1answer
38 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
66 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
83 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
104 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....
1
vote
1answer
32 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
58 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] }) ...
0
votes
1answer
151 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
56 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....
2
votes
1answer
72 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; ...
1
vote
0answers
39 views

How to write a mock method for getting ether balance using Web3j Api. I am trying to mock Web3j and callig EthGetBalance method but I am getting Null

public static BigInteger OriginalMethod(){ // connect to node Web3j web3 = Web3j.build(new HttpService()); // defaults to http://localhost:8545/ // send asynchronous requests to get balance ...
0
votes
1answer
103 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 ...
0
votes
1answer
134 views

Could not resolve placeholder 'XXXX' in value “YYY”

I am unable to read my application.properties file.Here is my code for application.properties: eth.network.url="https://rinkeby.infura.io/v3/9ea96ecdf13c4756a99c19f4f34e679e"; WORKING_DIRECTORY= "~/...
1
vote
1answer
36 views

Web3j and Transaction with null receiver

I am trying to get the list of all transactions using the method web3j.catchUpToLatestAndSubscribeToNewTransactionsObservable but a lot of them have a null receiver (Transaction.to). Using etherscan....
1
vote
1answer
87 views

Input byte array must be in range 0 < M <= 32 and length must match type-web3j

I have created an api to addCandidates. But when i run the api i get error: Input byte array must be in range 0 < M <= 32 and length must match type My codesnippet for addCandidates is: @...
0
votes
1answer
57 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
139 views

Compatibility between Solidity language and Web3j library

What is the compatibility between solidity and web3j. I don't find any resource about it. Suppose if I generate my java wrapper class of smart contract written in Solidity ^0.4.17 version and taking ...
2
votes
2answers
50 views

How to get biggest holders for specific token?

I am trying to get a descending list of biggest token holders like is displayed on etherscan. I could not locate an api to do this. I looked at EtherScan and EthPlorers api but did not see anything ...
4
votes
2answers
98 views

personalUnlockAccount.accountUnlocked() giving NullPointerException even if correct passphrase has been inserted

When I trying to unlock the account with personalUnlockAccount.accountUnlocked() method of PersonalUnlockAccount class of web3j library, it's giving NullPointerException even if I am entering right ...
1
vote
0answers
18 views

necessity of mining while doing transaction [duplicate]

While doing any transaction in private network, is it necessary for one node to keep on mining?. I was trying to implement to deploy smart contract and transact in ethereum private network with the ...
0
votes
1answer
238 views

Getting contract binary using web3j

I'm using web3J library in my java app. I got an address of a deployed contract and would like to get it's binary or abi from the blockchain using my java app, how can I do that?
0
votes
0answers
24 views

deploying an oracle using web3j

I want to use web3j in order to deploy an oracle (smart contract using OraclizeApi) and I don't know how to do it. normally for a simple smart contract we compile the .sol using solc and then generate ...
0
votes
1answer
279 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
0answers
28 views

Changing block reward in Ethereum's Java Protocol

I'm new to Ethereum and just messing around with the code on my free time. I heard that the current block reward is 3ETH, and I want to change it just for fun. In the end, I managed to find a line in ...
0
votes
1answer
192 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
212 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 ...
0
votes
1answer
199 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
5answers
854 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
0answers
179 views

WEB3J error: cannot find symbol import org.web3j.protocol.Web3j

The following code compiles in Java but gives: error: cannot find symbol import org.web3j.protocol.Web3j; and other import related errors on runtime. I'm new to the Java environment (using VS ...
0
votes
1answer
199 views

how to call java method via solidity contract

I have my solidity contract //solidity contract pragma solidity ^0.4.7; contract SimpleStorage { uint public storedData; function SimpleStorage(uint initialValue) { ...
0
votes
1answer
287 views

Build Java based application which act as front end and ethereum smart contract as back end

I have developed one app in ethereum which contains smart contract, js and html (for web app). I have developed it using truffle, ganache and solidity. I am accessing it in html and call the ...
0
votes
1answer
230 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
0answers
40 views

Running Go Ethereum on Java Web Apps

i have done implementing go ethereum smart contract through command line. Now i want my java web apps interacting with my smart contract. My idea is to use "Runtime" in java so i can execute the ...
0
votes
0answers
31 views

RxJava reduce function called in transactionObservable in etherum

I was going through events in solidity and how to catch them in my web3J (web3 java), my requirement was to get all the latest transaction that is being added in the blocks, for that from the ...
0
votes
0answers
258 views

Sending A Transaction Async | Cannot Resolve Method 'executeTransactionAsync' | Android Studio | Java

When calling the executeTransactionAsync method, part of web3.abi.datatypes.Function, I get an error saying the method can not be found. If I remove the Async so the method is executeTransaction, I ...
2
votes
2answers
1k views

Ethereum HD wallet library for Java

Is there any Ethereum HD wallet java library? I find a popular java library on Github, web3j, which doesn't support HD wallet yet.
1
vote
0answers
112 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() { ...
0
votes
1answer
392 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
0answers
342 views

How to create an android wallet for Ethereum

There's a project that I would like to implement that would require me to implement a simple Ethereum wallet client for Android. I would like to know the basic building blocks for making such an ...
0
votes
1answer
252 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 ...
1
vote
3answers
547 views

How to access ethereum smart contract(already deployed) in a Java application via its address using web3j?

I have an existing Smart contract address,abi,binary code. I need to access it from a Java application.Is it possible to do this without creating a java wrapper class?
1
vote
2answers
1k views

How to make transaction using private key and address using web3j

I have a private key and address . Is it possible to make transaction with these parameter using web3j.
2
votes
1answer
4k views

Generate private key and address using web3j

How can i generate private key and address using web3j instead of creating keystore json file