Questions tagged [web3j]

Lightweight Java and Android library for integration with Ethereum clients

Filter by
Sorted by
Tagged with
2
votes
2answers
145 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....
2
votes
1answer
257 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 ...
2
votes
1answer
271 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; ...
2
votes
2answers
803 views

Out Of Memory exception when using web3j in Android

I'm trying to integrate web3j in an android application. But the library gives an Out Of Memory exception when loading the wallet file: Credentials credentials = WalletUtils.loadCredentials("password"...
2
votes
2answers
2k views

Deploy smart contracts using web3j java library

I am using web3j java library to deploy a smart contract. // I am encoding the constructor parameters here -- 2 & 3, 10 & 20 String encodedConstructor = FunctionEncoder....
2
votes
1answer
1k views

Insufficient funds error on deploying smart contract

I am writing a Java program to deploy a smart contract. I have created the Java Wrapper class. This is the essence of the code. static final BigInteger GAS_PRICE = BigInteger.valueOf(20_000_000_000L)...
2
votes
0answers
390 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 ...
2
votes
2answers
364 views

How do I use filter EVM log events by an indexed field in web3j?

I've looked through the documentation, but there doesn't seem to be this scenario listed. What I want to do is filter the Ethereum event log of a specific contract by an indexed field with Web3j. ...
2
votes
1answer
43 views

Unable to print event without JSONstringify

I am trying to understand the difference among following cases while printing the event: At web3.js listenToEvent: function(){ Contract.deployed().then(function(instance){ instance....
2
votes
1answer
251 views

Why would Ganache behave differently depending on geth, web3j, web3js and web3.py?

I have a smart contract token deployed in a Ganache instance. My dapp written with React and web3.js shows the same 10 accounts for eth.accounts as running the same command in the geth console. If I ...
2
votes
0answers
1k views

How to integrate smart contracts with android app using web3j

I want to integrate smart contracts with the android app. I wrote a simple smart contract and I want to call that smart contract from android app. For example, in UI part of Android, I put one ...
2
votes
0answers
383 views

Noob having trouble connecting to the Infura Mainnet

I've been attempting to run a script from my terminal, and have been getting this error: Error: CONNECTION ERROR: Couldn't connect to node https://mainnet.infura.io. I've installed Web3j on my ...
2
votes
0answers
288 views

web3j make raw call to deployed contract which checks transaction sender

I have deployed contract to rinkeby. Contract method refuses any call except a call from contract owner (aka contract deployer). I can't use Java bindings. I'm trying to use Function API but it ...
2
votes
1answer
2k views

eth_sendRawTransaction:invalid argument 0: json: cannot unmarshal non-string into Go value of type hexutil.Bytes

I call the eth_sign to get signature of RawTransaction, then call eth_sendRawTransaction,but got the error "{"jsonrpc":"2.0","id":1,"error":{"code":-32602,"message":"invalid argument 0: json: ...
2
votes
1answer
301 views

How to do batch transaction in Ethereum using web3j

I want to do batch transaction using the web3j,So how can I do it? Is there any way or feature web3J provides
1
vote
5answers
1k 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 ...
1
vote
2answers
1k views

How to get public key from private key in Web3j

I am developing Dapp by web3j and I attempt to convert private key to public key. I found this question this question that provides a way converting private key to public key in class ECKey, but I ...
1
vote
2answers
2k views

Using Web3j to load a smart contract, how do i specify my credentials?

I am using the Web3j library to generate a Java wrapper for my solidity contract, i have already deployed the contract to the blockchain and it has been mined, i now want to load the contract in java ...
1
vote
3answers
359 views

From a traditional web based application how can I able to call ethereum network node?

Let's say there is a web application running on server 12.34.45.45 ip. Peer A open this web application in his own browser.Now how he will be able to connect a ethereum node where peer B is running....
1
vote
2answers
254 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
368 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
484 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
85 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
3answers
439 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
1k views

How to extract token transfer data from Transaction? (Web3j)

I'm new to ethereum and I would like to confirm a few things about Transaction. I've transferred tokens and I would like to extract method, address transferred to and amount from Transaction(org....
1
vote
2answers
556 views

What is the “right” way to send Ether to multiple addresses?

I have seen this discussed here but didn't get a satisfactory answer. What is the recommended way to send ether to multiple recipients? One way that I have thought of is follows: Deploy a smart ...
1
vote
2answers
669 views

Get input data from specific transaction

I have a contract. I store data in ethereum using contract. Is it possible, to work with contract in git-like way. For example, i have a list of previous transaction hashes. Can i fetch data from any ...
1
vote
1answer
1k views

How to store user private keys and details

I am creating an android DApp and have used go-ethereum to create wallets for users when they create an account. This stores the private key on their device. I want to also keep all of their details ...
1
vote
1answer
705 views

Event watcher gives [object Object] in Geth console

I compiled a contract source below: pragma solidity ^0.4.0; //////////////////////////////////////////////////////////// // This is an example contract hacked together at a meetup. // It is by far ...
1
vote
1answer
37 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 ...
1
vote
2answers
182 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) { ...
1
vote
1answer
461 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
321 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 ...
1
vote
3answers
546 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, ...
1
vote
1answer
365 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 ...
1
vote
1answer
615 views

How get Ethereum address using phrase only in Android

I want to get Etherum address and private key by adding Phrase (or Password) everytime. I tried by following many gihub code.It gives different private key everytime. In Web3j, I found it is based on ...
1
vote
1answer
454 views

Access Ethereum smart contract in Java application

I have developed smart contract in solidity using truffle and ganache. Now, I want to access that smart contract using some API. So how to do it ? Should I need to use web3j compulsory or is there any ...
1
vote
2answers
714 views

Deriving the v value from an ECDSA signature without web3j

I am currently signing with a the ECDSASignature spec in java however I noticed that getting a v value from the signature is a custom spec for ethereum. My code: public static void main(String[] ...
1
vote
2answers
1k views

Why is my web3j wrapper failing to generate?

I've created a smart contract in solidity which I've compiled with solc into a .bin & a .abi file. However, when I run the generator on the .abi and .bin files it returns a JSONParseException ...
1
vote
2answers
2k views

Creating an account using web3js or web3j

I am trying to create account on ethereum private network using web3js from front end. I have written the below lines in my js file. The createAccount() gets called from an HTML page web3 = new Web3(...
1
vote
1answer
50 views

raw transactions to send ERC20 token fails on private network(POA)

I am trying to transfer ERC20 tokens on private ethereum network(POA) Transaction flow: raw tx object creation on backend. { "gasLimit": 37000, "gasPrice": 4000000000, "...
1
vote
1answer
44 views

Unable to load smart contract using web3j on android

What I'my trying to do is to load already deployed smart contract and interact with it. The problem is that after my credentials are being created properly, the error is being catched but the message ...
1
vote
1answer
177 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"); ...
1
vote
1answer
55 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
210 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 -...
1
vote
1answer
291 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(...
1
vote
1answer
115 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
1answer
79 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
213 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. ...
1
vote
1answer
114 views

Value returned by a getter from smart contract instead of uint : org.web3j.protocol.core.RemoteCall@5104cf00 - spring boot - web3j

pragma solidity ^0.4.18; contract MyDeal { /// The seller's address address public owner; /// The buyer's address part on this contract address public buyerAddr; /// The Buyer struct ...