Stack Exchange Network

Stack Exchange network consists of 174 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
0answers
10 views

web3j-quorum error “The constructor ClientTransactionManager(Quorum, String, List<String>) is undefined”

I'm trying to deploy a smart contract (7 nodes sample from Quorum) using web3j quorum.but it is giving me following errors error 1 : The constructor ClientTransactionManager(Quorum, String, List) ...
0
votes
0answers
32 views

quick web3j transactions to the same destination address results in “replacement transaction underpriced” [duplicate]

I have a situation where every few hours (3hrs), I send ethers from N different accounts to a single account (call it 'dest'). Every few hours (5hrs), I send ethers from 'dest' to M different accounts....
0
votes
0answers
14 views

Guys i am having trouble on showing my transaction details from my contracts.And my for loop is also not executing in app.js file [on hold]

pragma solidity^0.4.19; contract Banking { struct Applicants { uint id; bytes32 name; int date; bytes32 fatherName; bytes32 ...
1
vote
3answers
24 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
31 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
34 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
1answer
54 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
0answers
25 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
31 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
0answers
15 views

Problem in returning bytes32 array from ethereum contract through web3J library

pragma solidity ^0.4.23; contract Customers { struct Customer { bytes32 SSN; bytes32 name; } address[] private customerAddress; mapping(address => Customer) customerMap; function ...
0
votes
1answer
45 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
52 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
39 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
50 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
37 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
54 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
0answers
9 views

How to add web3j android lib as .jar file?

While making some changes to web3j library following this thread, I couldn't find a feasible way to add the modified lib to my project. As web3j doesn't have any main grade file, I had to create jar ...
-5
votes
1answer
40 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 ...
0
votes
1answer
55 views

Converting int to default block parameter

I am using Infura and web3j to query the Ethereum blockchain. My aim is to get information about certain blocks so i'm using the function web3.eth.getBlockByNumber, however it gives me incompatible ...
0
votes
1answer
29 views

Send function transaction to existing smart contract using web3j

I've been exploring web3j and got the credentials working so I'm able to send transactions from an ethereum address. Now I want to send a transaction to an already existing smart contract and use a ...
0
votes
1answer
36 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
0answers
66 views

How to encode tuple as input parameter to function using web3j

I am attempting to call a solidity function that looks something like the following: function fillOrder( Order memory order, uint256 takerAssetFillAmount, bytes memory signature ) Using ...
0
votes
1answer
82 views

Port number for connecting web3 to mainnet using Geth

I am trying to connect web3j object to the mainnet using geth. I can't use infura because i am working with replay transaction observable function which doesn't work with infura. To connect with the ...
1
vote
1answer
42 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
29 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
27 views

LoadCredentials function returns file not found exception

I am using the following code to deploy my contract: @RequestMapping("/") public String index() throws Exception { Web3j web3j = Web3j.build(new HttpService("https://rinkeby.infura.io/v3/...
0
votes
1answer
66 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 ...
3
votes
0answers
307 views

how to use Web3j library for android

hi guys i am confuse about the web3j library for android i search about this but i did not get any materiel about this (https://github.com/web3j/web3j). this is lib for using ether node on java and ...
2
votes
2answers
74 views

How do I update data for project using blockchain (Ethereum)?

I am very new to creating blockchain dapps, so some guidance would be appreciated. I am conceptualizing how to approach creating a private blockchain so that users can communicate about the status of ...
4
votes
2answers
72 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
1answer
35 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 ...
2
votes
1answer
115 views

I am using web3j and geth. How to create default accounts with some ether allocation to it?

I need a default account with huge ether allocation. This I need to set up manually in genesis.json Hereafter,all accounts need to be created dynamically in java, and they should also be given some ...
1
vote
0answers
210 views

How to use mnemonic to recovery my ethereum wallet

I use web3j to create my ethereum wallet.the Code just like down import org.web3j.crypto.Bip39Wallet; import org.web3j.crypto.Credentials; import org.web3j.crypto.ECKeyPair; import org.web3j.crypto....
1
vote
0answers
46 views

Web3j no transaction pooling with REST

I have setup an application with jhisper gateway with one microservice in REST linked to Web3j. Idea is when you store an object in the database, you notarize it in a private ethereum blockchain. So, ...
0
votes
0answers
30 views

Web3 injection on java

I would like to make a script a run it on a server, not web, so I would like to make web3 injection not from metamask! is it possible? java would be fine
1
vote
0answers
17 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
143 views

Failed to connect to localhost/0:0:0:0:0:0:0:1:8545

When I am doing one transaction with the help of Java web3j library, it's not connecting to localhost(my private network). And giving this error. package com.kaushik.blockchain; import java.math....
1
vote
0answers
35 views

Web3J - Creation of Light Wallet takes too long

I am creating the wallet in my Android app, using the library Web3j: https://web3j.io/ See the code: String seed = UUID.randomUUID().toString(); ECKeyPair exKey = Keys.createEcKeyPair(); WalletFile ...
0
votes
1answer
153 views

How to generate ERC-20/xxx token addresses?

How to generate ERC-20/xxx token addresses, from which I can receive/send corresponding tokens? How can I do this using web3j?
1
vote
1answer
29 views

Contract NOT created when using “new” on testnet

I've got a contract which one of his functions creates a new contract in the following manner: (Solidity) function createCarrier() public { P2Carrier newCarrier = new P2Carrier(msg.sender); ...
1
vote
1answer
284 views

How do I get the raw private key from a WalletFile object?

How can I get the raw private key from a WalletFile object? Here is how I am creating the wallet. String seed = UUID.randomUUID().toString(); ECKeyPair exKey = Keys.createEcKeyPair(); BigInteger ...
0
votes
1answer
78 views

How to get contract creator using web3j?

How can I get the address of the creator of a contract using web3j? Is it possible to get the first transaction of a contract and assume that the "from" field is the contract creator? If so, how can I ...
2
votes
0answers
164 views

Recover address from signature using web3j

I have signed a data string using the following code snippet in web3js var data = "hello world"; web3.personal.sign(web3.fromUtf8(data), web3.eth.accounts[0], function(error, result) { if (!...
1
vote
1answer
173 views

web3j transactions with value

I'm using web3j to analyze transactions. How can I get transactions of a specific contract (assuming I got it's address) in some time frame (or blocks interval) and how can I know if ERC20 tokens were ...
1
vote
1answer
221 views

How to create wallet with web3j and web3swift like with web3js web3.eth.accounts.create(); function?

With web3js v1.0.0 you can create accounts with web3.eth.accounts.create(); and access the public address and private key with newWallet.address and newWallet.privateKey. How can you do this with ...
1
vote
0answers
61 views

Filtering blocks on basis of transaction logs in web3j

I want to filter blocks on the basis of a log present inside transactions. How can I do that? I don't have any contract address and want to filter all the blocks generated by all the contracts. ...
0
votes
1answer
120 views

java.lang.RuntimeException: Error processing transaction request: insufficient funds for gas * price + value when invoking smart contract function

using web3j for loading a contract which is deployed on the private network following this tutorial https://web3j.readthedocs.io/en/latest/smart_contracts.html#constant-methods smart contract ...
0
votes
0answers
22 views

contract deployment using web3j throws insufficient funds for gas * price + value exception [duplicate]

following this tutorial https://github.com/web3j/web3j started the geth client as a private network here is the contract code pragma solidity ^0.4.10; contract Counter { uint256 counter =0; ...
1
vote
1answer
195 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 ...
0
votes
0answers
47 views

java.lang.RuntimeException: java.lang.RuntimeException: Error processing transaction request: insufficient funds for gas * price + value

I am getting java.lang.RuntimeException: java.lang.RuntimeException: Error processing transaction request: insufficient funds for gas * price + value exception here is my code BigInteger ...