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
1answer
30 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
0answers
10 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
0answers
6 views

This static method of interface Web3j can only be accessed as Web3j.build

I'm trying to create a web3j instance with the following code: Web3j web3j = Web3j.build(new HttpService()); But Eclipse gives me this message: "Unresolved compilation problem: This static method of ...
0
votes
0answers
18 views

Convert RemoteCall<BigInteger> to Integer in java

I am trying to return an output in integer format but I am unable to do so. here is my code: @GetMapping("/totalVotesFor") @ResponseBody public int totalVotesFor(@RequestParam("electionName") String ...
0
votes
1answer
16 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= "~/...
0
votes
0answers
10 views

web3.js How can I know is any transaction erc20 transfer or not

in web3.js or geth rpc, Is there anyway to understand a transaction is erc20 transfer or not?
1
vote
0answers
38 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
35 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
24 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
21 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
20 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
38 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
0answers
98 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
63 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
50 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
23 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 ...
1
vote
1answer
51 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
103 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
23 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
21 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
72 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
25 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
0answers
53 views

Web3J credentials with public key and mnemonics

How can I create web3J credentials with public key and mnemonics. I am not asking for android, but for simple desktop java application. Thank you.
0
votes
1answer
95 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
27 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
144 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
51 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
106 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
130 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
153 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
34 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
75 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
12 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
143 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
25 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 ...
0
votes
1answer
142 views

how to know smart contract gas price and gas limit when deploying the contract using web3j

I am new to smart contracts and ethereum I am using web3j to deploy contracts on the private network Following this as a guide https://github.com/web3j/web3j In the below section of code, it asks ...
0
votes
1answer
81 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
16 views

Implement Blockchain in money movement system for keeping Transparency into the system

I have current system, which act as a hub and spoke matching platform between – 1) issuers and dealers, and 2) advisors and accredited investors. But still lack of transparency is one of the pain ...
0
votes
0answers
22 views

Storing generated accounts. Security

I originally built a system that had a front end where users simply entered some details and a password which then generated them a wallet and emailed it to them. My aim was that the user could then ...
0
votes
1answer
175 views

Getting “insufficient funds for gas * price + value” with geth on Ropsten no matter what

I'm having geth 1.7.3 (tried 1.8.x too) running in docker container: --verbosity 4 -rpc --nousb --ipcdisable --rpcaddr "0.0.0.0" --rpccorsdomain "*" --syncmode "fast" --rpcapi="db,personal,eth,net,...
0
votes
0answers
115 views

Error when deploying contract in Ganache using web3j

I'm trying to deploy a smart contract using web3j in Ganache network as follows: public void deployCST(String pw, String walletFile, String sLotNumber, int iWeight) throws CipherException, ...
0
votes
1answer
45 views

Web3j directly gets string from contract by eth_call

I just have a simple solidity contract: pragma solidity ^0.4.19; contract SampleContract { string value; function SampleContract() public { value = "hello world"; } ...
0
votes
1answer
101 views

can not send ERC20 tokens because user have no ethereum

I have 1 wallet server but have many account address for each user, so when user want to transfer erc-20 token say OMG to another address(user) in the same wallet server, the system said can not ...
1
vote
1answer
302 views

how to get the status of a transaction which is not mined and pending

I used the following code to send a transaction and get transaction status.However, sometimes the transaction is not minded at all. But the transactionReceipt get the same value "NULL" for both of the ...
0
votes
0answers
307 views

web3j Android, “E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!” When try to get balance

My app tries to get the balance of an ethereum address, but when testing, it crashes. I get the error "E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!" in logcat. Using web3 and android studio. Web3j ...
0
votes
0answers
52 views

Smart contracts work when deployed with Remix, but not Web3j

I have a web3j call to a smart contract ecrecover() function and I need to pass the V value. However I'm unsure as to how to convert the V value to a BigInteger. Web3j: aVerifier.verify("Kieran", "...
0
votes
0answers
134 views

How to automatically transfer ETH from my address to another

I want to format or configure my ETH wallet in a way that if any ETH comes into the address, it will automatically be sent to another address. I have the feeling that my private key is being ...
0
votes
0answers
51 views

When exactly do events fire

I have a web3J application that is supposed to deploy a contract (by calling a function on another contract) then listen for the contractCreatedEvent that is fired by the factoryContract and then call ...
0
votes
0answers
126 views

web3.js-1.0.0 General Availability (GA) Date ?

When will web3js 1.0.0 be General Available? i.e., web3 GA date